Chimera: chimera_0-9/include/route.h Source File

- Main Page
- Classes
- Files
- Directories

- File List
- File Members

# route.h

Go to the documentation of this file.

    00001
    00002
    00003 #ifndef _CHIMERA_ROUTE_H_
    00004 #define _CHIMERA_ROUTE_H_
    00005
    00006 #include "chimera.h"
    00007 #include "semaphore.h"
    00008 #include "key.h"
    00009
    00010 #define MAX_ROW KEY_SIZE/BASE_B
    00011 #define MAX_COL power(2,BASE_B)
    00012 #define MAX_ENTRY 3
    00013 #define LEAFSET_SIZE 8   /* (must be even) excluding node itself */
    00014
    00015
    00016 typedef struct {
    00017   ChimeraHost *me;
    00018   char *keystr;
    00019   ChimeraHost ****table;
    00020   ChimeraHost **leftleafset;
    00021   ChimeraHost **rightleafset;
    00022   Key Rrange;
    00023   Key Lrange;
    00024   pthread_mutex_t lock;
    00025   Sema threshold;          /* for future security enhancement */
    00026   Sema thresholdInterval;  /* for future security enhancement */
    00027 } RouteGlobal;
    00028
    00033 void * route_init(ChimeraHost *me);
    00034
    00040 ChimeraHost **route_lookup(ChimeraState *state,Key key, int count, int is_safe);
    00041
    00042
    00047 ChimeraHost **route_neighbors(ChimeraState *state,int count);
    00048
    00049
    00057 void route_update(ChimeraState *state,ChimeraHost *host, int joined);
    00058
    00059
    00064 ChimeraHost **route_row_lookup(ChimeraState *state, Key key);
    00065
    00066
    00071 ChimeraHost **route_get_table(ChimeraState *state);
    00072
    00075 void printTable(ChimeraState *state);
    00076
    00077 #endif /* _CHIMERA_ROUTE_H_ */