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

- Main Page
- Classes
- Files
- Directories

- File List
- File Members

# route.h File Reference

`#include "chimera.h"`
`#include "semaphore.h"`
`#include "key.h"`

Go to the source code of this file.

## Classes
struct | RouteGlobal
## Defines
#define | MAX_ROW KEY_SIZE/BASE_B
#define | MAX_COL power(2,BASE_B)
#define | MAX_ENTRY 3
#define | LEAFSET_SIZE 8
## Functions
void * | route_init (ChimeraHost *me)
ChimeraHost ** | route_lookup (ChimeraState *state, Key key, int count, int is_safe)
ChimeraHost ** | route_neighbors (ChimeraState *state, int count)
void | route_update (ChimeraState *state, ChimeraHost *host, int joined)
ChimeraHost ** | route_row_lookup (ChimeraState *state, Key key)
ChimeraHost ** | route_get_table (ChimeraState *state)
void | printTable (ChimeraState *state)

## Define Documentation

#define LEAFSET_SIZE 8

#define MAX_COL power(2,BASE_B)

#define MAX_ENTRY 3

#define MAX_ROW KEY_SIZE/BASE_B

## Function Documentation

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

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