route.c File Reference

#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)

Define Documentation

#define LEAFSET_SIZE   8
 

#define MAX_COL   power(2,BASE_B)
 

#define MAX_ROW   KEY_SIZE/BASE_B
 


Function Documentation

void chimera_update_upcall ChimeraState state,
Key k,
ChimeraHost h,
int  joined
 

void gethostinfo ChimeraHost CHost  ) 
 

int hexalpha_to_int int  c  ) 
 

void leafset_delete ChimeraState state,
ChimeraHost host,
int  right_or_left,
ChimeraHost **  deleted
 

void leafset_insert ChimeraState state,
ChimeraHost host,
int  right_or_left,
ChimeraHost **  deleted,
ChimeraHost **  added
 

void leafset_print ChimeraState state  ) 
 

int leafset_size ChimeraHost **  arr  ) 
 

void leafset_update ChimeraState state,
ChimeraHost host,
int  joined,
ChimeraHost **  deleted,
ChimeraHost **  added
 

int power int  base,
int  n
 

void printTable ChimeraState state  ) 
 

prints routing table,

ChimeraHost** route_get_table ChimeraState state  ) 
 

route_get_table: returns all the entries in the routing table in an array of ChimeraHost.

void* route_init ChimeraHost me  ) 
 

route_init: Ininitiates routing table and leafsets

void route_keyupdate void *  routeglob,
ChimeraHost me
 

ChimeraHost** route_lookup ChimeraState state,
Key  key,
int  count,
int  is_safe
 

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.

ChimeraHost** route_neighbors ChimeraState state,
int  count
 

route_neighbors: returns an array of count# neighbor nodes with priority to closer nodes

ChimeraHost** route_row_lookup ChimeraState state,
Key  key
 

route_row_lookup:key return the row in the routing table that matches the longest prefix with key#

void route_update ChimeraState state,
ChimeraHost host,
int  joined
 

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

void sort_hosts void *  logs,
ChimeraHost **  hosts,
Key  key,
int  size
 


Generated on Sat Nov 12 16:43:15 2005 for Chimera by  doxygen 1.4.5