The Netsukuku Project
0.0.9
An Alternative routing method
|
#include "includes.h"
#include "inet.h"
#include "endianness.h"
#include "map.h"
#include "gmap.h"
#include "bmap.h"
#include "common.h"
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_gnode * | gnode_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_cache * | e_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_cache * | erc_find (ext_rnode_cache *erc, ext_rnode *e_rnode) |
ext_rnode_cache * | e_rnode_find (ext_rnode_cache *erc, quadro_group *qg, int level) |
ext_rnode_cache * | erc_find_gnode (ext_rnode_cache *erc, map_gnode *gnode, u_char level) |
map_gnode * | init_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_rnode * | gmap_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) |
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 | ||
) |
ext_rnode_cache* e_rnode_find | ( | ext_rnode_cache * | erc, |
quadro_group * | qg, | ||
int | level | ||
) |
void e_rnode_free | ( | ext_rnode_cache ** | erc, |
u_int * | counter | ||
) |
ext_rnode_cache* e_rnode_init | ( | u_int * | counter | ) |
ext_rnode_cache* erc_find | ( | ext_rnode_cache * | erc, |
ext_rnode * | e_rnode | ||
) |
ext_rnode_cache* erc_find_gnode | ( | ext_rnode_cache * | erc, |
map_gnode * | gnode, | ||
u_char | level | ||
) |
void erc_reorder_rnodepos | ( | ext_rnode_cache ** | erc, |
u_int * | erc_counter, | ||
map_node * | root_node | ||
) |
void erc_update_rnodepos | ( | ext_rnode_cache * | erc, |
map_node * | root_node, | ||
int | old_rnode_pos | ||
) |
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 | ||
) |
void free_extmap | ( | map_gnode ** | ext_map, |
u_char | levels, | ||
int | groups | ||
) |
void free_extmap_rblock | ( | map_rnode ** | rblock, |
u_char | levels | ||
) |
int free_gids | ( | quadro_group * | qg, |
int | level, | ||
map_gnode ** | ext_map, | ||
map_node * | int_map | ||
) |
|
inline |
int gids_cmp | ( | int * | gids_a, |
int * | gids_b, | ||
int | lvl, | ||
int | max_lvl | ||
) |
void gidtoipstart | ( | int * | gid, |
u_char | total_levels, | ||
u_char | levels, | ||
int | family, | ||
inet_prefix * | ip | ||
) |
void gmap_node_del | ( | map_gnode * | gnode | ) |
void gnode_dec_seeds | ( | quadro_group * | qg, |
int | level | ||
) |
void gnode_inc_seeds | ( | quadro_group * | qg, |
int | level | ||
) |
void gnodetoip | ( | quadro_group * | quadg, |
int | gnodeid, | ||
u_char | level, | ||
inet_prefix * | ip | ||
) |
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 | ||
) |
map_gnode** init_extmap | ( | u_char | levels, |
int | groups | ||
) |
map_gnode* init_gmap | ( | int | groups | ) |
int ip_gids_cmp | ( | inet_prefix | a, |
inet_prefix | b, | ||
int | lvl | ||
) |
int iptogid | ( | inet_prefix * | ip, |
int | level | ||
) |
void iptogids | ( | inet_prefix * | ip, |
int * | gid, | ||
int | levels | ||
) |
void iptoquadg | ( | inet_prefix | ip, |
map_gnode ** | ext_map, | ||
quadro_group * | qg, | ||
char | flags | ||
) |
int is_gmap_full_flag_set | ( | map_gnode * | gnode | ) |
int is_gmap_void_flag_set | ( | map_gnode * | gnode | ) |
int is_group_invalid | ( | int * | gids, |
int | gid, | ||
int | lvl, | ||
int | family | ||
) |
int is_map_void_flag_set | ( | map_node * | node | ) |
int isnot_gmap_void_flag_set | ( | map_gnode * | gnode | ) |
map_gnode** load_extmap | ( | char * | file, |
quadro_group * | quadg | ||
) |
int merge_ext_maps | ( | map_gnode ** | base, |
map_gnode ** | new, | ||
quadro_group | base_root, | ||
quadro_group | new_root | ||
) |
int merge_lvl_ext_maps | ( | map_gnode * | base, |
map_gnode * | new, | ||
quadro_group | base_root, | ||
quadro_group | new_root, | ||
int | level | ||
) |
char* pack_extmap | ( | map_gnode ** | ext_map, |
int | maxgroupnode, | ||
quadro_group * | quadg, | ||
size_t * | pack_sz | ||
) |
void pack_map_gnode | ( | map_gnode * | gnode, |
char * | pack | ||
) |
void pack_quadro_group | ( | quadro_group * | qg, |
char * | pack | ||
) |
void quadg_destroy | ( | quadro_group * | qg | ) |
void quadg_free | ( | quadro_group * | qg | ) |
int quadg_gids_cmp | ( | quadro_group | a, |
quadro_group | b, | ||
int | lvl | ||
) |
void quadg_setflags | ( | quadro_group * | qg, |
char | flags | ||
) |
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 reset_extmap | ( | map_gnode ** | ext_map, |
u_char | levels, | ||
int | groups | ||
) |
void reset_gmap | ( | map_gnode * | gmap, |
int | groups | ||
) |
const char* rnode_to_ipstr | ( | u_int | mapstart, |
u_int | maprnode, | ||
inet_prefix | ipstart | ||
) |
void rnodetoip | ( | u_int | mapstart, |
u_int | maprnode, | ||
inet_prefix | ipstart, | ||
inet_prefix * | ret | ||
) |
int save_extmap | ( | map_gnode ** | ext_map, |
int | maxgroupnode, | ||
quadro_group * | quadg, | ||
char * | file | ||
) |
map_gnode** unpack_extmap | ( | char * | package, |
quadro_group * | quadg | ||
) |
void unpack_map_gnode | ( | map_gnode * | gnode, |
char * | pack | ||
) |
void unpack_quadro_group | ( | quadro_group * | qg, |
char * | pack | ||
) |
int verify_ext_map_hdr | ( | struct ext_map_hdr * | emap_hdr, |
quadro_group * | quadg | ||
) |
int void_gids | ( | quadro_group * | qg, |
int | level, | ||
map_gnode ** | ext_map, | ||
map_node * | int_map | ||
) |