The Netsukuku Project
0.0.9
An Alternative routing method
|
#include "inet.h"
Go to the source code of this file.
Data Structures | |
struct | map_rnode |
struct | map_node |
struct | int_map_hdr |
Macros | |
#define | MAXGROUPNODE_BITS 8 /* 2^MAXGROUPNODE_BITS == MAXGROUPNODE */ |
#define | MAXGROUPNODE (1<<MAXGROUPNODE_BITS) |
#define | MAXROUTES 20 |
#define | MAXLINKS MAXROUTES |
#define | MAP_ME 1 /*The root_node, in other words, me ;)*/ |
#define | MAP_VOID (1<<1) /*It indicates a non existent node*/ |
#define | MAP_HNODE |
#define | MAP_BNODE |
#define | MAP_ERNODE (1<<4) /*It is an External Rnode*/ |
#define | MAP_GNODE (1<<5) /*It is a gnode*/ |
#define | MAP_RNODE (1<<6) /*If a node has this set, it is one of the rnodes*/ |
#define | MAP_UPDATE |
#define | QSPN_CLOSED |
#define | QSPN_OPENED (1<<9) /*It puts a link in a QSPN_OPEN state*/ |
#define | QSPN_OLD |
#define | QSPN_STARTER |
#define | QSPN_OPENER |
#define | MAP_IGW (1<<13) /*This node is an Internet gateway*/ |
#define | MAP_RNODE_PACK_SZ (sizeof(int *)+sizeof(u_int)) |
#define | MAP_NODE_PACK_SZ (sizeof(u_short)*2 + sizeof(u_int)) |
#define | MAXRNODEBLOCK (MAXLINKS * MAXGROUPNODE * sizeof(map_rnode)) |
#define | MAXRNODEBLOCK_PACK_SZ (MAXLINKS * MAXGROUPNODE * MAP_RNODE_PACK_SZ) |
#define | INTMAP_END(mapstart) ((sizeof(map_node)*MAXGROUPNODE)+(mapstart)) |
#define | INT_MAP_BLOCK_SZ(int_map_sz, rblock_sz) (sizeof(struct int_map_hdr)+(int_map_sz)+(rblock_sz)) |
Functions | |
int | pos_from_node (map_node *node, map_node *map) |
map_node * | node_from_pos (int pos, map_node *map) |
void | postoip (u_int map_pos, inet_prefix ipstart, inet_prefix *ret) |
void | maptoip (u_int mapstart, u_int mapoff, inet_prefix ipstart, inet_prefix *ret) |
int | iptomap (u_int mapstart, inet_prefix ip, inet_prefix ipstart, map_node **ret) |
map_node * | init_map (size_t len) |
void | free_map (map_node *map, size_t count) |
void | map_node_del (map_node *node) |
void | reset_int_map (map_node *map, int maxgroupnode) |
map_rnode * | rnode_insert (map_rnode *buf, size_t pos, map_rnode *new) |
map_rnode * | map_rnode_insert (map_node *node, size_t pos, map_rnode *new) |
map_rnode * | rnode_add (map_node *node, map_rnode *new) |
void | rnode_swap (map_rnode *one, map_rnode *two) |
void | rnode_del (map_node *node, size_t pos) |
void | rnode_destroy (map_node *node) |
int | rnode_find (map_node *node, void *n) |
int | rnode_trtt_compar (const void *a, const void *b) |
void | rnode_trtt_order (map_node *node) |
void | map_routes_order (map_node *map) |
u_int | get_route_trtt (map_node *node, u_short route) |
void | rnode_set_trtt (map_node *node) |
void | rnode_recurse_trtt (map_rnode *rnode, int route, struct timeval *trtt) |
void | node_recurse_trtt (map_node *node) |
void | map_set_trtt (map_node *map) |
map_node * | get_gw_node (map_node *node, u_short route) |
int | merge_maps (map_node *base, map_node *new, map_node *base_root, map_node *new_root) |
int | mod_rnode_addr (map_rnode *node, int *map_start, int *new_start) |
int | get_rnode_block (int *map, map_node *node, map_rnode *rblock, int rstart) |
map_rnode * | map_get_rblock (map_node *map, int *addr_map, int maxgroupnode, int *count) |
int | store_rnode_block (int *map, map_node *node, map_rnode *rblock, int rstart) |
int | map_store_rblock (map_node *map, int *addr_map, int maxgroupnode, map_rnode *rblock) |
int | verify_int_map_hdr (struct int_map_hdr *imap_hdr, int maxgroupnode, int maxrnodeblock) |
void | pack_map_node (map_node *node, char *pack) |
void | unpack_map_node (map_node *node, char *pack) |
char * | pack_map (map_node *map, int *addr_map, int maxgroupnode, map_node *root_node, size_t *pack_sz) |
map_node * | unpack_map (char *pack, int *addr_map, map_node **new_root, int maxgroupnode, int maxrnodeblock) |
int | save_map (map_node *map, map_node *root_node, char *file) |
map_node * | load_map (char *file, map_node **new_root) |
Variables | |
static const int_info | map_rnode_iinfo |
static const int_info | map_node_iinfo |
struct int_map_hdr | _PACKED_ |
static const int_info | int_map_hdr_iinfo |
#define INT_MAP_BLOCK_SZ | ( | int_map_sz, | |
rblock_sz | |||
) | (sizeof(struct int_map_hdr)+(int_map_sz)+(rblock_sz)) |
#define INTMAP_END | ( | mapstart | ) | ((sizeof(map_node)*MAXGROUPNODE)+(mapstart)) |
#define MAP_BNODE |
#define MAP_ERNODE (1<<4) /*It is an External Rnode*/ |
#define MAP_GNODE (1<<5) /*It is a gnode*/ |
#define MAP_HNODE |
#define MAP_IGW (1<<13) /*This node is an Internet gateway*/ |
#define MAP_ME 1 /*The root_node, in other words, me ;)*/ |
#define MAP_NODE_PACK_SZ (sizeof(u_short)*2 + sizeof(u_int)) |
#define MAP_RNODE (1<<6) /*If a node has this set, it is one of the rnodes*/ |
#define MAP_RNODE_PACK_SZ (sizeof(int *)+sizeof(u_int)) |
#define MAP_UPDATE |
#define MAP_VOID (1<<1) /*It indicates a non existent node*/ |
#define MAXGROUPNODE (1<<MAXGROUPNODE_BITS) |
#define MAXGROUPNODE_BITS 8 /* 2^MAXGROUPNODE_BITS == MAXGROUPNODE */ |
#define MAXLINKS MAXROUTES |
#define MAXRNODEBLOCK (MAXLINKS * MAXGROUPNODE * sizeof(map_rnode)) |
#define MAXRNODEBLOCK_PACK_SZ (MAXLINKS * MAXGROUPNODE * MAP_RNODE_PACK_SZ) |
#define MAXROUTES 20 |
#define QSPN_CLOSED |
#define QSPN_OLD |
#define QSPN_OPENED (1<<9) /*It puts a link in a QSPN_OPEN state*/ |
#define QSPN_OPENER |
#define QSPN_STARTER |
void free_map | ( | map_node * | map, |
size_t | count | ||
) |
u_int get_route_trtt | ( | map_node * | node, |
u_short | route | ||
) |
map_node* init_map | ( | size_t | len | ) |
int iptomap | ( | u_int | mapstart, |
inet_prefix | ip, | ||
inet_prefix | ipstart, | ||
map_node ** | ret | ||
) |
void map_node_del | ( | map_node * | node | ) |
void map_routes_order | ( | map_node * | map | ) |
void map_set_trtt | ( | map_node * | map | ) |
void maptoip | ( | u_int | mapstart, |
u_int | mapoff, | ||
inet_prefix | ipstart, | ||
inet_prefix * | ret | ||
) |
int mod_rnode_addr | ( | map_rnode * | node, |
int * | map_start, | ||
int * | new_start | ||
) |
void node_recurse_trtt | ( | map_node * | node | ) |
char* pack_map | ( | map_node * | map, |
int * | addr_map, | ||
int | maxgroupnode, | ||
map_node * | root_node, | ||
size_t * | pack_sz | ||
) |
void pack_map_node | ( | map_node * | node, |
char * | pack | ||
) |
void postoip | ( | u_int | map_pos, |
inet_prefix | ipstart, | ||
inet_prefix * | ret | ||
) |
void reset_int_map | ( | map_node * | map, |
int | maxgroupnode | ||
) |
void rnode_del | ( | map_node * | node, |
size_t | pos | ||
) |
void rnode_destroy | ( | map_node * | node | ) |
int rnode_find | ( | map_node * | node, |
void * | n | ||
) |
void rnode_recurse_trtt | ( | map_rnode * | rnode, |
int | route, | ||
struct timeval * | trtt | ||
) |
void rnode_set_trtt | ( | map_node * | node | ) |
int rnode_trtt_compar | ( | const void * | a, |
const void * | b | ||
) |
void rnode_trtt_order | ( | map_node * | node | ) |
map_node* unpack_map | ( | char * | pack, |
int * | addr_map, | ||
map_node ** | new_root, | ||
int | maxgroupnode, | ||
int | maxrnodeblock | ||
) |
void unpack_map_node | ( | map_node * | node, |
char * | pack | ||
) |
int verify_int_map_hdr | ( | struct int_map_hdr * | imap_hdr, |
int | maxgroupnode, | ||
int | maxrnodeblock | ||
) |
struct int_map_hdr _PACKED_ |
|
static |
|
static |
|
static |