25 #define MAXGROUPNODE_BITS 8
26 #define MAXGROUPNODE (1<<MAXGROUPNODE_BITS)
29 #define MAXLINKS MAXROUTES
33 #define MAP_VOID (1<<1)
34 #define MAP_HNODE (1<<2)
36 #define MAP_BNODE (1<<3)
40 #define MAP_ERNODE (1<<4)
41 #define MAP_GNODE (1<<5)
42 #define MAP_RNODE (1<<6)
43 #define MAP_UPDATE (1<<7)
45 #define QSPN_CLOSED (1<<8)
47 #define QSPN_OPENED (1<<9)
48 #define QSPN_OLD (1<<10)
52 #define QSPN_STARTER (1<<11)
54 #define QSPN_OPENER (1<<12)
56 #define MAP_IGW (1<<13)
102 #define MAP_RNODE_PACK_SZ (sizeof(int *)+sizeof(u_int))
138 { 0,
sizeof(short),
sizeof(
short)+
sizeof(int) },
142 #define MAP_NODE_PACK_SZ (sizeof(u_short)*2 + sizeof(u_int))
144 #define MAXRNODEBLOCK (MAXLINKS * MAXGROUPNODE * sizeof(map_rnode))
145 #define MAXRNODEBLOCK_PACK_SZ (MAXLINKS * MAXGROUPNODE * MAP_RNODE_PACK_SZ)
146 #define INTMAP_END(mapstart) ((sizeof(map_node)*MAXGROUPNODE)+(mapstart))
157 {
sizeof(char),
sizeof(
char)+
sizeof(size_t) },
167 #define INT_MAP_BLOCK_SZ(int_map_sz, rblock_sz) (sizeof(struct int_map_hdr)+(int_map_sz)+(rblock_sz))
size_t rblock_sz
Definition: map.h:153
static const int_info map_rnode_iinfo
Definition: map.h:97
map_rnode * rnode_insert(map_rnode *buf, size_t pos, map_rnode *new)
Definition: map.c:139
int pos_from_node(map_node *node, map_node *map)
Definition: map.c:34
void rnode_destroy(map_node *node)
Definition: map.c:197
map_node * unpack_map(char *pack, int *addr_map, map_node **new_root, int maxgroupnode, int maxrnodeblock)
Definition: map.c:661
map_node * node_from_pos(int pos, map_node *map)
Definition: map.c:43
int verify_int_map_hdr(struct int_map_hdr *imap_hdr, int maxgroupnode, int maxrnodeblock)
Definition: map.c:538
map_node * init_map(size_t len)
Definition: map.c:104
int mod_rnode_addr(map_rnode *node, int *map_start, int *new_start)
Definition: map.c:420
void postoip(u_int map_pos, inet_prefix ipstart, inet_prefix *ret)
Definition: map.c:52
struct int_map_hdr _PACKED_
#define INT_TYPE_16BIT
Definition: endianness.h:36
int rnode_trtt_compar(const void *a, const void *b)
Definition: map.c:247
size_t int_map_sz
Definition: map.h:152
void rnode_set_trtt(map_node *node)
void node_recurse_trtt(map_node *node)
int iptomap(u_int mapstart, inet_prefix ip, inet_prefix ipstart, map_node **ret)
Definition: map.c:80
map_rnode * map_rnode_insert(map_node *node, size_t pos, map_rnode *new)
Definition: map.c:147
int get_rnode_block(int *map, map_node *node, map_rnode *rblock, int rstart)
Definition: map.c:435
static const int_info int_map_hdr_iinfo
Definition: map.h:155
void map_set_trtt(map_node *map)
void unpack_map_node(map_node *node, char *pack)
Definition: map.c:578
map_rnode * r_node
Definition: map.h:130
char * pack_map(map_node *map, int *addr_map, int maxgroupnode, map_node *root_node, size_t *pack_sz)
Definition: map.c:605
map_rnode * rnode_add(map_node *node, map_rnode *new)
Definition: map.c:156
void map_node_del(map_node *node)
Definition: map.c:226
static const int_info map_node_iinfo
Definition: map.h:136
void free_map(map_node *map, size_t count)
Definition: map.c:119
int store_rnode_block(int *map, map_node *node, map_rnode *rblock, int rstart)
Definition: map.c:493
void rnode_recurse_trtt(map_rnode *rnode, int route, struct timeval *trtt)
u_int get_route_trtt(map_node *node, u_short route)
Definition: map.c:288
u_int brdcast
Definition: map.h:128
void maptoip(u_int mapstart, u_int mapoff, inet_prefix ipstart, inet_prefix *ret)
Definition: map.c:70
u_short links
Definition: map.h:129
u_short flags
Definition: map.h:127
void rnode_trtt_order(map_node *node)
Definition: map.c:265
u_int trtt
Definition: map.h:78
map_node * get_gw_node(map_node *node, u_short route)
#define INT_INFO
Definition: endianness.h:90
int rnode_find(map_node *node, void *n)
Definition: map.c:212
int merge_maps(map_node *base, map_node *new, map_node *base_root, map_node *new_root)
Definition: map.c:309
int * r_node
Definition: map.h:76
void rnode_del(map_node *node, size_t pos)
Definition: map.c:175
map_rnode * map_get_rblock(map_node *map, int *addr_map, int maxgroupnode, int *count)
Definition: map.c:468
void reset_int_map(map_node *map, int maxgroupnode)
Definition: map.c:233
int save_map(map_node *map, map_node *root_node, char *file)
Definition: map.c:718
#define INT_TYPE_32BIT
Definition: endianness.h:35
void pack_map_node(map_node *node, char *pack)
Definition: map.c:555
void rnode_swap(map_rnode *one, map_rnode *two)
Definition: map.c:166
void map_routes_order(map_node *map)
Definition: map.c:275
u_char root_node
Definition: map.h:151
int map_store_rblock(map_node *map, int *addr_map, int maxgroupnode, map_rnode *rblock)
Definition: map.c:525
map_node * load_map(char *file, map_node **new_root)
Definition: map.c:748