The Netsukuku Project  0.0.9
An Alternative routing method
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
igs.h File Reference
#include "route.h"
Include dependency graph for igs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  internet_gateway
 
struct  inet_gw_pack_hdr
 
struct  default_inet_gw_nexthop
 

Macros

#define MIN_CONN_BANDWIDTH   3 /* 16 Kb/s */
 
#define MAX_INTERNET_HNAMES   10
 
#define MAX_INTERNET_HNAME_SZ   64
 
#define INET_HOST_PING_TIMEOUT   3
 
#define IGW_HOST_PING_TIMEOUT   10
 
#define INET_NEXT_PING_WAIT   10
 
#define IGW_BW_DELTA
 
#define MAXIGWS
 
#define RTTABLE_IGW   221 /* Routing tables from 221 to 244 */
 
#define RTTABLE_ALISHIELD
 
#define FWMARK_ALISHIELD   25
 
#define IGW_TUNNELED   1
 
#define IGW_ACTIVE
 
#define IGW_RTRULE
 
#define INET_GW_PACK_SZ   (sizeof(u_char)*2 + MAX_IP_SZ)
 
#define IGWS_PACK_SZ(hdr)
 
#define MAX_IGWS_PACK_SZ(levels)
 
#define MAX_IGW_PER_QSPN_CHUNK
 

Typedefs

typedef struct internet_gateway inet_gw
 
typedef struct
default_inet_gw_nexthop 
igw_nexthop
 

Functions

u_char bandwidth_in_8bit (u_int x)
 
int str_to_inet_gw (char *str, inet_prefix *gw, char **dev)
 
char ** parse_internet_hosts (char *str, int *hosts)
 
void free_internet_hosts (char **hnames, int hosts)
 
void init_my_igw (void)
 
void init_igws (inet_gw ***igws, int **igws_counter, int levels)
 
void reset_igws (inet_gw **igws, int *igws_counter, int levels)
 
void free_igws (inet_gw **igws, int *igws_counter, int levels)
 
void init_my_igws (inet_gw **igws, int *igws_counter, inet_gw ***my_new_igws, u_char my_bandwidth, map_node *cur_node, quadro_group *qg)
 
void free_my_igws (inet_gw ***my_igs)
 
void init_internet_gateway_search (void)
 
void close_internet_gateway_search (void)
 
inet_gwigw_add_node (inet_gw **igws, int *igws_counter, int level, int gid, map_node *node, int ip[4], u_char bandwidth)
 
int igw_del (inet_gw **igws, int *igws_counter, inet_gw *igw, int level)
 
inet_gwigw_find_node (inet_gw **igws, int level, map_node *node)
 
inet_gwigw_find_ip (inet_gw **igws, int level, u_int ip[4])
 
int igw_del_node (inet_gw **, int *, int, map_node *)
 
void igw_update_gnode_bw (int *, inet_gw **, inet_gw *, int, int, int)
 
void igw_order (inet_gw **igws, int *igws_counter, inet_gw **my_igws, int level)
 
int igw_check_inet_conn (void)
 
void * igw_check_inet_conn_t (void *null)
 
void * igw_monitor_igws_t (void *null)
 
int igw_exec_masquerade_sh (char *script, int stop)
 
int igw_exec_tcshaper_sh (char *script, int stop, char *dev, int upload_bw, int dnload_bw)
 
void reset_igw_nexthop (igw_nexthop *igwn)
 
void reset_igw_rules (void)
 
int igw_replace_def_igws (inet_gw **igws, int *igws_counter, inet_gw **my_igws, int max_levels, int family)
 
char * igw_build_bentry (u_char level, size_t *pack_sz, int *new_bblocks)
 
int igw_store_bblock (bnode_hdr *bblock_hdr, bnode_chunk *bchunk, u_char level)
 
char * pack_igws (inet_gw **igws, int *igws_counter, int levels, int *pack_sz)
 
int unpack_igws (char *pack, size_t pack_sz, map_node *int_map, map_gnode **ext_map, int levels, inet_gw ***new_igws, int **new_igws_counter)
 

Variables

struct inet_gw_pack_hdr _PACKED_
 
static const int_info inet_gw_pack_hdr_iinfo = { 1, { (1<<1) }, { 0 }, { (14+ ( 1 + 1 ) ) } }
 
int active_gws
 
igw_nexthop multigw_nh [24]
 

Macro Definition Documentation

#define FWMARK_ALISHIELD   25
#define IGW_ACTIVE
Value:
(1<<1) /* This gw is being used in the
routing table */
#define IGW_BW_DELTA
Value:
1 /* If the difference between the old and the new
igw->bandwidth is >= IGW_BW_DELTA, then
me.igws is reordered and the routing table
updated */
#define IGW_HOST_PING_TIMEOUT   10
#define IGW_RTRULE
Value:
(1<<2) /* The relative routing rule is already
present */
#define IGW_TUNNELED   1
#define IGWS_PACK_SZ (   hdr)
Value:
({ \
size_t _sz; int _pi; \
_sz=sizeof(struct inet_gw_pack_hdr); \
for(_pi=0; _pi<(hdr)->levels; _pi++) \
_sz+=INET_GW_PACK_SZ*((hdr)->gws[_pi]); \
_sz; \
})
#define INET_GW_PACK_SZ
Definition: igs.h:101
Definition: igs.h:103
u_char levels
Definition: igs.h:107
#define INET_GW_PACK_SZ   (sizeof(u_char)*2 + MAX_IP_SZ)
#define INET_HOST_PING_TIMEOUT   3
#define INET_NEXT_PING_WAIT   10
#define MAX_IGW_PER_QSPN_CHUNK
Value:
16 /* Maximum number of IGWs
contained in a single
QSPN chunk */
#define MAX_IGWS_PACK_SZ (   levels)
Value:
(sizeof(struct inet_gw_pack_hdr) + \
#define MAXIGWS
Definition: igs.h:58
#define INET_GW_PACK_SZ
Definition: igs.h:101
Definition: igs.h:103
u_char levels
Definition: igs.h:107
#define MAX_INTERNET_HNAME_SZ   64
#define MAX_INTERNET_HNAMES   10
#define MAXIGWS
Value:
MAXGROUPNODE /* max number of internet
gateways in each level */
#define MAXGROUPNODE
Definition: map.h:26
#define MIN_CONN_BANDWIDTH   3 /* 16 Kb/s */
#define RTTABLE_ALISHIELD
Value:
245 /* Anti Loop multi-Igw Shield
(what a damn long name, read the Ntk_IGS
RFC) */
#define RTTABLE_IGW   221 /* Routing tables from 221 to 244 */

Typedef Documentation

typedef struct internet_gateway inet_gw

Function Documentation

u_char bandwidth_in_8bit ( u_int  x)

Here is the caller graph for this function:

void close_internet_gateway_search ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void free_igws ( inet_gw **  igws,
int *  igws_counter,
int  levels 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void free_internet_hosts ( char **  hnames,
int  hosts 
)

Here is the caller graph for this function:

void free_my_igws ( inet_gw ***  my_igs)

Here is the caller graph for this function:

inet_gw* igw_add_node ( inet_gw **  igws,
int *  igws_counter,
int  level,
int  gid,
map_node node,
int  ip[4],
u_char  bandwidth 
)

Here is the call graph for this function:

Here is the caller graph for this function:

char* igw_build_bentry ( u_char  level,
size_t *  pack_sz,
int *  new_bblocks 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int igw_check_inet_conn ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void* igw_check_inet_conn_t ( void *  null)

Here is the call graph for this function:

Here is the caller graph for this function:

int igw_del ( inet_gw **  igws,
int *  igws_counter,
inet_gw igw,
int  level 
)

Here is the caller graph for this function:

int igw_del_node ( inet_gw **  ,
int *  ,
int  ,
map_node  
)

Here is the call graph for this function:

int igw_exec_masquerade_sh ( char *  script,
int  stop 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int igw_exec_tcshaper_sh ( char *  script,
int  stop,
char *  dev,
int  upload_bw,
int  dnload_bw 
)

Here is the call graph for this function:

Here is the caller graph for this function:

inet_gw* igw_find_ip ( inet_gw **  igws,
int  level,
u_int  ip[4] 
)

Here is the caller graph for this function:

inet_gw* igw_find_node ( inet_gw **  igws,
int  level,
map_node node 
)

Here is the caller graph for this function:

void* igw_monitor_igws_t ( void *  null)

Here is the call graph for this function:

Here is the caller graph for this function:

void igw_order ( inet_gw **  igws,
int *  igws_counter,
inet_gw **  my_igws,
int  level 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int igw_replace_def_igws ( inet_gw **  igws,
int *  igws_counter,
inet_gw **  my_igws,
int  max_levels,
int  family 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int igw_store_bblock ( bnode_hdr *  bblock_hdr,
bnode_chunk *  bchunk,
u_char  level 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void igw_update_gnode_bw ( int *  ,
inet_gw **  ,
inet_gw ,
int  ,
int  ,
int   
)

Here is the caller graph for this function:

void init_igws ( inet_gw ***  igws,
int **  igws_counter,
int  levels 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void init_internet_gateway_search ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void init_my_igw ( void  )
void init_my_igws ( inet_gw **  igws,
int *  igws_counter,
inet_gw ***  my_new_igws,
u_char  my_bandwidth,
map_node cur_node,
quadro_group qg 
)

Here is the call graph for this function:

Here is the caller graph for this function:

char* pack_igws ( inet_gw **  igws,
int *  igws_counter,
int  levels,
int *  pack_sz 
)

Here is the call graph for this function:

Here is the caller graph for this function:

char** parse_internet_hosts ( char *  str,
int *  hosts 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void reset_igw_nexthop ( igw_nexthop igwn)

Here is the caller graph for this function:

void reset_igw_rules ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void reset_igws ( inet_gw **  igws,
int *  igws_counter,
int  levels 
)

Here is the caller graph for this function:

int str_to_inet_gw ( char *  str,
inet_prefix gw,
char **  dev 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int unpack_igws ( char *  pack,
size_t  pack_sz,
map_node int_map,
map_gnode **  ext_map,
int  levels,
inet_gw ***  new_igws,
int **  new_igws_counter 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

int active_gws
const int_info inet_gw_pack_hdr_iinfo = { 1, { (1<<1) }, { 0 }, { (14+ ( 1 + 1 ) ) } }
static
igw_nexthop multigw_nh[24]