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

Go to the source code of this file.

Data Structures

struct  andna_reg_pkt
 
struct  andna_resolve_rq_pkt
 
struct  andna_resolve_reply_pkt
 
struct  single_acache_hdr
 
struct  spread_acache_pkt
 

Macros

#define MY_NAMESERV   "nameserver 127.0.0.1"
 
#define MY_NAMESERV_IPV6   "nameserver ::1"
 
#define ETC_RESOLV_CONF   "/etc/resolv.conf"
 
#define ETC_RESOLV_CONF_BAK   "/etc/resolv.conf.bak"
 
#define ANDNA_MAX_FLOODS   (ANDNA_MAX_QUEUE*3+1)
 
#define ANDNA_MAX_NEW_GNODES   1024
 
#define ANDNA_HOOK_TIMEOUT   8 /* seconds */
 
#define ANDNA_REV_RESOLVE_RQ_TIMEOUT   60
 
#define ANDNA_PKT_UPDATE   1 /* Update the hostname */
 
#define ANDNA_PKT_FORWARD   (1<<1) /* Forward this pkt, plz */
 
#define ANDNA_PKT_REV_RESOLVE   (1<<2) /* Give me your hostnames */
 
#define ANDNA_PKT_JUST_CHECK
 
#define ANDNA_PKT_SNSD_DEL   (1<<4) /* SNSD delete request */
 
#define ANDNA_REG_PKT_SZ   (sizeof(struct andna_reg_pkt))
 
#define ANDNA_REG_SIGNED_BLOCK_SZ
 
#define ANDNA_RESOLVE_RQ_PKT_SZ   (sizeof(struct andna_resolve_rq_pkt))
 
#define ANDNA_RESOLVE_REPLY_PKT_SZ   (sizeof(struct andna_resolve_reply_pkt))
 
#define SINGLE_ACACHE_PKT_SZ(hgnodes)
 
#define SPREAD_ACACHE_PKT_SZ   (sizeof(struct spread_acache_pkt))
 

Functions

int andna_load_caches (void)
 
int andna_save_caches (void)
 
void andna_init (void)
 
void andna_close (void)
 
void andna_resolvconf_modify (void)
 
void andna_resolvconf_restore (void)
 
int andna_register_hname (lcl_cache *alcl, snsd_service *snsd_delete)
 
int andna_recv_reg_rq (PACKET rpkt)
 
int andna_check_counter (PACKET pkt)
 
int andna_recv_check_counter (PACKET rpkt)
 
snsd_serviceandna_resolve_hash (u_int hname_hash[4], int service, u_char proto, int *records)
 
snsd_serviceandna_resolve_hname (char *hname, int service, u_char proto, int *records)
 
int andna_recv_resolve_rq (PACKET rpkt)
 
lcl_cacheandna_reverse_resolve (inet_prefix ip)
 
int andna_recv_rev_resolve_rq (PACKET rpkt)
 
int spread_single_acache (u_int hash[4])
 
int recv_spread_single_acache (PACKET rpkt)
 
andna_cacheget_single_andna_c (u_int hash[4], u_int hash_gnode[4])
 
int put_single_acache (PACKET rpkt)
 
int put_andna_cache (PACKET rq_pkt)
 
int put_counter_cache (PACKET rq_pkt)
 
void * andna_hook (void *)
 
void andna_update_hnames (int only_new_hname)
 
void * andna_maintain_hnames_active (void *null)
 
void * andna_main (void *)
 

Variables

int last_reg_pkt_id [(5 *3+1)]
 
int last_counter_pkt_id [(5 *3+1)]
 
int last_spread_acache_pkt_id [(5 *3+1)]
 
struct andna_reg_pkt _PACKED_
 
static const int_info andna_reg_pkt_iinfo
 
static const int_info andna_resolve_rq_pkt_iinfo
 
static const int_info andna_resolve_reply_pkt_iinfo
 
static const int_info single_acache_hdr_iinfo
 
static const int_info spread_acache_pkt_info = { 0, { 0 }, { 0 }, { 0 } }
 

Macro Definition Documentation

#define ANDNA_HOOK_TIMEOUT   8 /* seconds */
#define ANDNA_MAX_FLOODS   (ANDNA_MAX_QUEUE*3+1)
#define ANDNA_MAX_NEW_GNODES   1024
#define ANDNA_PKT_FORWARD   (1<<1) /* Forward this pkt, plz */
#define ANDNA_PKT_JUST_CHECK
Value:
(1<<3) /* Check only, don't update
anything */
#define ANDNA_PKT_REV_RESOLVE   (1<<2) /* Give me your hostnames */
#define ANDNA_PKT_SNSD_DEL   (1<<4) /* SNSD delete request */
#define ANDNA_PKT_UPDATE   1 /* Update the hostname */
#define ANDNA_REG_PKT_SZ   (sizeof(struct andna_reg_pkt))
#define ANDNA_REG_SIGNED_BLOCK_SZ
Value:
sizeof(char))
#define ANDNA_SIGNATURE_LEN
Definition: andna_cache.h:47
#define ANDNA_REG_PKT_SZ
Definition: andna.h:118
#define ANDNA_RESOLVE_REPLY_PKT_SZ   (sizeof(struct andna_resolve_reply_pkt))
#define ANDNA_RESOLVE_RQ_PKT_SZ   (sizeof(struct andna_resolve_rq_pkt))
#define ANDNA_REV_RESOLVE_RQ_TIMEOUT   60
#define ETC_RESOLV_CONF   "/etc/resolv.conf"
#define ETC_RESOLV_CONF_BAK   "/etc/resolv.conf.bak"
#define MY_NAMESERV   "nameserver 127.0.0.1"
#define MY_NAMESERV_IPV6   "nameserver ::1"
#define SINGLE_ACACHE_PKT_SZ (   hgnodes)
Value:
(sizeof(struct single_acache_hdr)+\
Definition: andna.h:192
u_short hgnodes
Definition: andna.h:196
#define MAX_IP_SZ
Definition: inet.h:25
#define SPREAD_ACACHE_PKT_SZ   (sizeof(struct spread_acache_pkt))

Function Documentation

int andna_check_counter ( PACKET  pkt)

Here is the call graph for this function:

Here is the caller graph for this function:

void andna_close ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void* andna_hook ( void *  )

Here is the call graph for this function:

Here is the caller graph for this function:

void andna_init ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

int andna_load_caches ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void* andna_main ( void *  )

Here is the call graph for this function:

Here is the caller graph for this function:

void* andna_maintain_hnames_active ( void *  null)

If we don't have rnodes, it's useless to try anything

Here is the call graph for this function:

Here is the caller graph for this function:

int andna_recv_check_counter ( PACKET  rpkt)

Here is the call graph for this function:

Here is the caller graph for this function:

int andna_recv_reg_rq ( PACKET  rpkt)

Check if the counter of number of updates matches with the pkt

Has the registration request been sent too early ?

Set the mainip flag only to the real mainip record, in this way we're sure that there is only one.

Broadcast the request to the entire gnode of level 1 to let the other nodes register the hname.

Here is the call graph for this function:

Here is the caller graph for this function:

int andna_recv_resolve_rq ( PACKET  rpkt)

Here is the call graph for this function:

Here is the caller graph for this function:

int andna_recv_rev_resolve_rq ( PACKET  rpkt)

Here is the call graph for this function:

Here is the caller graph for this function:

int andna_register_hname ( lcl_cache alcl,
snsd_service snsd_delete 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void andna_resolvconf_modify ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void andna_resolvconf_restore ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

snsd_service* andna_resolve_hash ( u_int  hname_hash[4],
int  service,
u_char  proto,
int *  records 
)

Here is the call graph for this function:

Here is the caller graph for this function:

snsd_service* andna_resolve_hname ( char *  hname,
int  service,
u_char  proto,
int *  records 
)

Here is the call graph for this function:

Here is the caller graph for this function:

lcl_cache* andna_reverse_resolve ( inet_prefix  ip)

Here is the call graph for this function:

Here is the caller graph for this function:

int andna_save_caches ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void andna_update_hnames ( int  only_new_hname)

Here is the call graph for this function:

Here is the caller graph for this function:

andna_cache* get_single_andna_c ( u_int  hash[4],
u_int  hash_gnode[4] 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int put_andna_cache ( PACKET  rq_pkt)

Here is the call graph for this function:

Here is the caller graph for this function:

int put_counter_cache ( PACKET  rq_pkt)

Here is the call graph for this function:

Here is the caller graph for this function:

int put_single_acache ( PACKET  rpkt)

Here is the call graph for this function:

Here is the caller graph for this function:

int recv_spread_single_acache ( PACKET  rpkt)

Here is the call graph for this function:

Here is the caller graph for this function:

int spread_single_acache ( u_int  hash[4])

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const int_info andna_reg_pkt_iinfo
static
Initial value:
= { 1,
{ (1<<1) },
{ ( 4 *sizeof(int)) *2 + 140 },
{ 1 },
}
const int_info andna_resolve_reply_pkt_iinfo
static
Initial value:
= { 1,
{ 1 },
{ 0 },
{ 1 }
}
const int_info andna_resolve_rq_pkt_iinfo
static
Initial value:
= { 1,
{ 1 },
{ ( 4 *sizeof(int)) *2+sizeof(char) },
{ 1 },
}
int last_counter_pkt_id[(5 *3+1)]
int last_reg_pkt_id[(5 *3+1)]
int last_spread_acache_pkt_id[(5 *3+1)]
const int_info single_acache_hdr_iinfo
static
Initial value:
= { 1,
{ (1<<1) },
{ ( 4 *sizeof(int)) *2 },
{ 1 },
}
const int_info spread_acache_pkt_info = { 0, { 0 }, { 0 }, { 0 } }
static