The Netsukuku Project  0.0.9
An Alternative routing method
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
gmap.c File Reference
#include "includes.h"
#include "inet.h"
#include "endianness.h"
#include "map.h"
#include "gmap.h"
#include "bmap.h"
#include "common.h"
Include dependency graph for gmap.c:

Functions

int get_groups (int max_levels, int lvl)
 
int is_group_invalid (int *gids, int gid, int lvl, int family)
 
int pos_from_gnode (map_gnode *gnode, map_gnode *map)
 
map_gnodegnode_from_pos (int pos, map_gnode *map)
 
void rnodetoip (u_int mapstart, u_int maprnode, inet_prefix ipstart, inet_prefix *ret)
 
const char * rnode_to_ipstr (u_int mapstart, u_int maprnode, inet_prefix ipstart)
 
int iptogid (inet_prefix *ip, int level)
 
void iptogids (inet_prefix *ip, int *gid, int levels)
 
void gidtoipstart (int *gid, u_char total_levels, u_char levels, int family, inet_prefix *ip)
 
void iptoquadg (inet_prefix ip, map_gnode **ext_map, quadro_group *qg, char flags)
 
void quadg_setflags (quadro_group *qg, char flags)
 
void quadg_free (quadro_group *qg)
 
void quadg_destroy (quadro_group *qg)
 
void gnode_inc_seeds (quadro_group *qg, int level)
 
void gnode_dec_seeds (quadro_group *qg, int level)
 
void pack_quadro_group (quadro_group *qg, char *pack)
 
void unpack_quadro_group (quadro_group *qg, char *pack)
 
int is_map_void_flag_set (map_node *node)
 
int is_gmap_full_flag_set (map_gnode *gnode)
 
int is_gmap_void_flag_set (map_gnode *gnode)
 
int isnot_gmap_void_flag_set (map_gnode *gnode)
 
int increment_gids (quadro_group *qg, int level, map_gnode **ext_map, map_node *int_map, int(*is_gnode_flag_set)(map_gnode *gnode), int(*is_node_flag_set)(map_node *node))
 
int free_gids (quadro_group *qg, int level, map_gnode **ext_map, map_node *int_map)
 
int void_gids (quadro_group *qg, int level, map_gnode **ext_map, map_node *int_map)
 
int random_ip (inet_prefix *ipstart, int final_level, int final_gid, int total_levels, map_gnode **ext_map, int only_free_gnode, inet_prefix *new_ip, int my_family)
 
void gnodetoip (quadro_group *quadg, int gnodeid, u_char level, inet_prefix *ip)
 
int gids_cmp (int *gids_a, int *gids_b, int lvl, int max_lvl)
 
int quadg_gids_cmp (quadro_group a, quadro_group b, int lvl)
 
int ip_gids_cmp (inet_prefix a, inet_prefix b, int lvl)
 
ext_rnode_cachee_rnode_init (u_int *counter)
 
void e_rnode_free (ext_rnode_cache **erc, u_int *counter)
 
void e_rnode_add (ext_rnode_cache **erc, ext_rnode *e_rnode, int rnode_pos, u_int *counter)
 
void e_rnode_del (ext_rnode_cache **erc_head, u_int *counter, ext_rnode_cache *erc)
 
void erc_update_rnodepos (ext_rnode_cache *erc, map_node *root_node, int old_rnode_pos)
 
void erc_reorder_rnodepos (ext_rnode_cache **erc, u_int *erc_counter, map_node *root_node)
 
ext_rnode_cacheerc_find (ext_rnode_cache *erc, ext_rnode *e_rnode)
 
ext_rnode_cachee_rnode_find (ext_rnode_cache *erc, quadro_group *qg, int level)
 
ext_rnode_cacheerc_find_gnode (ext_rnode_cache *erc, map_gnode *gnode, u_char level)
 
map_gnodeinit_gmap (int groups)
 
void reset_gmap (map_gnode *gmap, int groups)
 
map_gnode ** init_extmap (u_char levels, int groups)
 
void free_extmap (map_gnode **ext_map, u_char levels, int groups)
 
void reset_extmap (map_gnode **ext_map, u_char levels, int groups)
 
int g_rnode_find (map_gnode *gnode, map_gnode *n)
 
int extmap_find_level (map_gnode **ext_map, map_gnode *gnode, u_char max_level)
 
void gmap_node_del (map_gnode *gnode)
 
int merge_lvl_ext_maps (map_gnode *base, map_gnode *new, quadro_group base_root, quadro_group new_root, int level)
 
int merge_ext_maps (map_gnode **base, map_gnode **new, quadro_group base_root, quadro_group new_root)
 
map_rnodegmap_get_rblock (map_gnode *map, int maxgroupnode, int *count)
 
int gmap_store_rblock (map_gnode *gmap, int maxgroupnode, map_rnode *rblock)
 
map_rnode ** extmap_get_rblock (map_gnode **ext_map, u_char levels, int maxgroupnodes, int **ret_count)
 
int extmap_store_rblock (map_gnode **ext_map, u_char levels, int maxgroupnode, map_rnode *rblock, size_t *rblock_sz)
 
int verify_ext_map_hdr (struct ext_map_hdr *emap_hdr, quadro_group *quadg)
 
void free_extmap_rblock (map_rnode **rblock, u_char levels)
 
void pack_map_gnode (map_gnode *gnode, char *pack)
 
void unpack_map_gnode (map_gnode *gnode, char *pack)
 
char * pack_extmap (map_gnode **ext_map, int maxgroupnode, quadro_group *quadg, size_t *pack_sz)
 
map_gnode ** unpack_extmap (char *package, quadro_group *quadg)
 
int save_extmap (map_gnode **ext_map, int maxgroupnode, quadro_group *quadg, char *file)
 
map_gnode ** load_extmap (char *file, quadro_group *quadg)
 

Function Documentation

void e_rnode_add ( ext_rnode_cache **  erc,
ext_rnode e_rnode,
int  rnode_pos,
u_int *  counter 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void e_rnode_del ( ext_rnode_cache **  erc_head,
u_int *  counter,
ext_rnode_cache erc 
)

Here is the caller graph for this function:

ext_rnode_cache* e_rnode_find ( ext_rnode_cache erc,
quadro_group qg,
int  level 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void e_rnode_free ( ext_rnode_cache **  erc,
u_int *  counter 
)

Here is the caller graph for this function:

ext_rnode_cache* e_rnode_init ( u_int *  counter)

Here is the caller graph for this function:

ext_rnode_cache* erc_find ( ext_rnode_cache erc,
ext_rnode e_rnode 
)

Here is the caller graph for this function:

ext_rnode_cache* erc_find_gnode ( ext_rnode_cache erc,
map_gnode gnode,
u_char  level 
)

Here is the caller graph for this function:

void erc_reorder_rnodepos ( ext_rnode_cache **  erc,
u_int *  erc_counter,
map_node root_node 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void erc_update_rnodepos ( ext_rnode_cache erc,
map_node root_node,
int  old_rnode_pos 
)

Here is the caller graph for this function:

int extmap_find_level ( map_gnode **  ext_map,
map_gnode gnode,
u_char  max_level 
)

Here is the caller graph for this function:

map_rnode** extmap_get_rblock ( map_gnode **  ext_map,
u_char  levels,
int  maxgroupnodes,
int **  ret_count 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int extmap_store_rblock ( map_gnode **  ext_map,
u_char  levels,
int  maxgroupnode,
map_rnode rblock,
size_t *  rblock_sz 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void free_extmap ( map_gnode **  ext_map,
u_char  levels,
int  groups 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void free_extmap_rblock ( map_rnode **  rblock,
u_char  levels 
)

Here is the caller graph for this function:

int free_gids ( quadro_group qg,
int  level,
map_gnode **  ext_map,
map_node int_map 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int g_rnode_find ( map_gnode gnode,
map_gnode n 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int get_groups ( int  max_levels,
int  lvl 
)
inline

Here is the caller graph for this function:

int gids_cmp ( int *  gids_a,
int *  gids_b,
int  lvl,
int  max_lvl 
)

Here is the caller graph for this function:

void gidtoipstart ( int *  gid,
u_char  total_levels,
u_char  levels,
int  family,
inet_prefix ip 
)

Here is the caller graph for this function:

map_rnode* gmap_get_rblock ( map_gnode map,
int  maxgroupnode,
int *  count 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void gmap_node_del ( map_gnode gnode)

Here is the call graph for this function:

Here is the caller graph for this function:

int gmap_store_rblock ( map_gnode gmap,
int  maxgroupnode,
map_rnode rblock 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void gnode_dec_seeds ( quadro_group qg,
int  level 
)

Here is the caller graph for this function:

map_gnode* gnode_from_pos ( int  pos,
map_gnode map 
)

Here is the caller graph for this function:

void gnode_inc_seeds ( quadro_group qg,
int  level 
)

Here is the caller graph for this function:

void gnodetoip ( quadro_group quadg,
int  gnodeid,
u_char  level,
inet_prefix ip 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int increment_gids ( quadro_group qg,
int  level,
map_gnode **  ext_map,
map_node int_map,
int(*)(map_gnode *gnode)  is_gnode_flag_set,
int(*)(map_node *node)  is_node_flag_set 
)

Here is the call graph for this function:

Here is the caller graph for this function:

map_gnode** init_extmap ( u_char  levels,
int  groups 
)

Here is the call graph for this function:

Here is the caller graph for this function:

map_gnode* init_gmap ( int  groups)

Here is the call graph for this function:

Here is the caller graph for this function:

int ip_gids_cmp ( inet_prefix  a,
inet_prefix  b,
int  lvl 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int iptogid ( inet_prefix ip,
int  level 
)

Here is the caller graph for this function:

void iptogids ( inet_prefix ip,
int *  gid,
int  levels 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void iptoquadg ( inet_prefix  ip,
map_gnode **  ext_map,
quadro_group qg,
char  flags 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int is_gmap_full_flag_set ( map_gnode gnode)

Here is the caller graph for this function:

int is_gmap_void_flag_set ( map_gnode gnode)

Here is the caller graph for this function:

int is_group_invalid ( int *  gids,
int  gid,
int  lvl,
int  family 
)

Here is the caller graph for this function:

int is_map_void_flag_set ( map_node node)

Here is the caller graph for this function:

int isnot_gmap_void_flag_set ( map_gnode gnode)

Here is the call graph for this function:

Here is the caller graph for this function:

map_gnode** load_extmap ( char *  file,
quadro_group quadg 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int merge_ext_maps ( map_gnode **  base,
map_gnode **  new,
quadro_group  base_root,
quadro_group  new_root 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int merge_lvl_ext_maps ( map_gnode base,
map_gnode new,
quadro_group  base_root,
quadro_group  new_root,
int  level 
)

Here is the call graph for this function:

Here is the caller graph for this function:

char* pack_extmap ( map_gnode **  ext_map,
int  maxgroupnode,
quadro_group quadg,
size_t *  pack_sz 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void pack_map_gnode ( map_gnode gnode,
char *  pack 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void pack_quadro_group ( quadro_group qg,
char *  pack 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int pos_from_gnode ( map_gnode gnode,
map_gnode map 
)

Here is the caller graph for this function:

void quadg_destroy ( quadro_group qg)

Here is the call graph for this function:

void quadg_free ( quadro_group qg)

Here is the caller graph for this function:

int quadg_gids_cmp ( quadro_group  a,
quadro_group  b,
int  lvl 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void quadg_setflags ( quadro_group qg,
char  flags 
)

Here is the caller graph for this function:

int random_ip ( inet_prefix ipstart,
int  final_level,
int  final_gid,
int  total_levels,
map_gnode **  ext_map,
int  only_free_gnode,
inet_prefix new_ip,
int  my_family 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void reset_extmap ( map_gnode **  ext_map,
u_char  levels,
int  groups 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void reset_gmap ( map_gnode gmap,
int  groups 
)

Here is the call graph for this function:

Here is the caller graph for this function:

const char* rnode_to_ipstr ( u_int  mapstart,
u_int  maprnode,
inet_prefix  ipstart 
)

Here is the call graph for this function:

void rnodetoip ( u_int  mapstart,
u_int  maprnode,
inet_prefix  ipstart,
inet_prefix ret 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int save_extmap ( map_gnode **  ext_map,
int  maxgroupnode,
quadro_group quadg,
char *  file 
)

Here is the call graph for this function:

Here is the caller graph for this function:

map_gnode** unpack_extmap ( char *  package,
quadro_group quadg 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void unpack_map_gnode ( map_gnode gnode,
char *  pack 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void unpack_quadro_group ( quadro_group qg,
char *  pack 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int verify_ext_map_hdr ( struct ext_map_hdr emap_hdr,
quadro_group quadg 
)

Here is the caller graph for this function:

int void_gids ( quadro_group qg,
int  level,
map_gnode **  ext_map,
map_node int_map 
)

Here is the call graph for this function:

Here is the caller graph for this function: