#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <stdlib.h>
#include "route.h"
#include "host.h"
#include "key.h"
#include "jrb.h"
#include "jval.h"
#include "log.h"
Classes | |
struct | RouteGlobal |
Defines | |
#define | LEAFSET_SIZE 8 |
#define | MAX_ROW KEY_SIZE/BASE_B |
#define | MAX_COL power(2,BASE_B) |
Functions | |
void | leafset_update (ChimeraState *state, ChimeraHost *host, int joined, ChimeraHost **deleted, ChimeraHost **added) |
int | leafset_size (ChimeraHost **arr) |
void | leafset_insert (ChimeraState *state, ChimeraHost *host, int right_or_left, ChimeraHost **deleted, ChimeraHost **added) |
void | leafset_delete (ChimeraState *state, ChimeraHost *host, int right_or_left, ChimeraHost **deleted) |
void | leafset_print (ChimeraState *state) |
void | sort_hosts (void *logs, ChimeraHost **hosts, Key key, int size) |
int | power (int base, int n) |
int | hexalpha_to_int (int c) |
void | route_keyupdate (void *routeglob, ChimeraHost *me) |
void * | route_init (ChimeraHost *me) |
ChimeraHost ** | route_get_table (ChimeraState *state) |
ChimeraHost ** | route_row_lookup (ChimeraState *state, Key key) |
ChimeraHost ** | route_lookup (ChimeraState *state, Key key, int count, int is_safe) |
void | chimera_update_upcall (ChimeraState *state, Key *k, ChimeraHost *h, int joined) |
ChimeraHost ** | route_neighbors (ChimeraState *state, int count) |
void | route_update (ChimeraState *state, ChimeraHost *host, int joined) |
void | gethostinfo (ChimeraHost *CHost) |
void | printTable (ChimeraState *state) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
prints routing table, |
|
route_get_table: returns all the entries in the routing table in an array of ChimeraHost. |
|
route_init: Ininitiates routing table and leafsets |
|
|
|
route_lookup: returns an array of count# nodes that are acceptable next hops for a message being routed to key#. is_save# is ignored for now. |
|
route_neighbors: returns an array of count# neighbor nodes with priority to closer nodes |
|
route_row_lookup:key return the row in the routing table that matches the longest prefix with key# |
|
route_update: updated the routing table in regard to host#. If the host is joining the network (and joined# == 1), then it is added to the routing table if it is appropriate. If it is leaving the network (and joined# == 0), then it is removed from the routing tables |
|
|