The Netsukuku Project
0.0.9
An Alternative routing method
|
#include "inet.h"
#include "crypto.h"
#include "endianness.h"
#include "llist.c"
#include "snsd_cache.h"
Go to the source code of this file.
Data Structures | |
struct | andna_cache_queue |
struct | andna_cache |
struct | counter_c_hashes |
struct | counter_c |
struct | lcl_cache_keyring |
struct | lcl_cache |
struct | resolved_hnames_cache |
struct | lcl_keyring_pkt_hdr |
struct | lcl_cache_pkt_hdr |
struct | andna_cache_pkt_hdr |
struct | counter_c_pkt_hdr |
struct | rh_cache_pkt_hdr |
Macros | |
#define | ANDNA_MAX_BACKUP_GNODES 2 |
#define | ANDNA_MAX_QUEUE 5 |
#define | ANDNA_MAX_HNAME_LEN 512 /* (null terminator included) */ |
#define | ANDNA_MAX_HOSTNAMES 256 /* Max number of hnames per node */ |
#define | ANDNA_MAX_RHC_HNAMES |
#define | ANDNA_EXPIRATION_TIME 259200 /* 3 days (in seconds)*/ |
#define | ANDNA_MIN_UPDATE_TIME |
#define | ANDNA_PRIVKEY_BITS 1024 |
#define | ANDNA_SKEY_MAX_LEN 900 |
#define | ANDNA_PKEY_LEN 140 |
#define | ANDNA_HASH_SZ (MAX_IP_SZ) |
#define | ANDNA_SIGNATURE_LEN 128 |
#define | ANDNA_BACKUP_NODES(seeds) |
#define | ANDNA_BACKUP 1 /* We are a backup_node */ |
#define | ANDNA_COUNTER (1<<1) /* We are a counter_node */ |
#define | ANDNA_ROUNDED (1<<2) /* We are a rounded_hash_node */ |
#define | ANDNA_FULL (1<<3) /* Queue full */ |
#define | ANDNA_UPDATING |
#define | LCL_KEYRING_HDR_PACK_SZ(khdr) |
#define | LCL_CACHE_HDR_PACK_SZ (sizeof(struct lcl_cache_pkt_hdr)) |
#define | LCL_CACHE_BODY_PACK_SZ(hname_len) |
#define | ACQ_BODY_PACK_SZ |
#define | ACQ_PACK_SZ(snsd_pack_sz) (ACQ_BODY_PACK_SZ + (snsd_pack_sz)) |
#define | ACACHE_BODY_PACK_SZ |
#define | ACACHE_PACK_SZ(acq_pack_sz) ((acq_pack_sz) + ACACHE_BODY_PACK_SZ) |
#define | ACACHE_PACK_FILE 1 |
#define | ACACHE_PACK_PKT 2 |
#define | COUNTER_CACHE_HASHES_PACK_SZ |
#define | COUNTER_CACHE_BODY_PACK_SZ |
#define | COUNTER_CACHE_PACK_SZ(hashes) |
#define | RH_CACHE_BODY_PACK_SZ(snsd_pack_sz) |
Typedefs | |
typedef struct andna_cache_queue | andna_cache_queue |
typedef struct andna_cache | andna_cache |
typedef struct counter_c_hashes | counter_c_hashes |
typedef struct counter_c | counter_c |
typedef struct lcl_cache | lcl_cache |
typedef struct resolved_hnames_cache | rh_cache |
Variables | |
static const int_info | counter_c_hashes_body_iinfo |
static const int_info | counter_c_body_iinfo |
andna_cache * | andna_c |
int | andna_c_counter |
counter_c * | andna_counter_c |
int | cc_counter |
lcl_cache_keyring | lcl_keyring |
lcl_cache * | andna_lcl |
int | lcl_counter |
rh_cache * | andna_rhc |
int | rhc_counter |
struct lcl_keyring_pkt_hdr | _PACKED_ |
static const int_info | lcl_keyring_pkt_hdr_iinfo |
static const int_info | lcl_cache_pkt_hdr_iinfo = { 1, { (1<<1) }, { 0 }, { 1 } } |
static const int_info | lcl_cache_pkt_body_iinfo |
static const int_info | acq_body_iinfo |
static const int_info | andna_cache_pkt_hdr_iinfo = { 1, { (1<<1) }, { 0 }, { 1 } } |
static const int_info | andna_cache_body_iinfo |
static const int_info | counter_c_pkt_hdr_iinfo = { 1, { (1<<1) }, { 0 }, { 1 } } |
static const int_info | rh_cache_pkt_hdr_iinfo = { 1, { (1<<1) }, { 0 }, { 1 } } |
static const int_info | rh_cache_pkt_body_iinfo |
#define ACACHE_BODY_PACK_SZ |
#define ACACHE_PACK_FILE 1 |
#define ACACHE_PACK_PKT 2 |
#define ACACHE_PACK_SZ | ( | acq_pack_sz | ) | ((acq_pack_sz) + ACACHE_BODY_PACK_SZ) |
#define ACQ_BODY_PACK_SZ |
#define ACQ_PACK_SZ | ( | snsd_pack_sz | ) | (ACQ_BODY_PACK_SZ + (snsd_pack_sz)) |
#define ANDNA_BACKUP 1 /* We are a backup_node */ |
#define ANDNA_BACKUP_NODES | ( | seeds | ) |
#define ANDNA_COUNTER (1<<1) /* We are a counter_node */ |
#define ANDNA_EXPIRATION_TIME 259200 /* 3 days (in seconds)*/ |
#define ANDNA_FULL (1<<3) /* Queue full */ |
#define ANDNA_HASH_SZ (MAX_IP_SZ) |
#define ANDNA_MAX_BACKUP_GNODES 2 |
#define ANDNA_MAX_HNAME_LEN 512 /* (null terminator included) */ |
#define ANDNA_MAX_HOSTNAMES 256 /* Max number of hnames per node */ |
#define ANDNA_MAX_QUEUE 5 |
#define ANDNA_MAX_RHC_HNAMES |
#define ANDNA_MIN_UPDATE_TIME |
#define ANDNA_PKEY_LEN 140 |
#define ANDNA_PRIVKEY_BITS 1024 |
#define ANDNA_ROUNDED (1<<2) /* We are a rounded_hash_node */ |
#define ANDNA_SIGNATURE_LEN 128 |
#define ANDNA_SKEY_MAX_LEN 900 |
#define ANDNA_UPDATING |
#define COUNTER_CACHE_BODY_PACK_SZ |
#define COUNTER_CACHE_HASHES_PACK_SZ |
#define COUNTER_CACHE_PACK_SZ | ( | hashes | ) |
#define LCL_CACHE_BODY_PACK_SZ | ( | hname_len | ) |
#define LCL_CACHE_HDR_PACK_SZ (sizeof(struct lcl_cache_pkt_hdr)) |
#define LCL_KEYRING_HDR_PACK_SZ | ( | khdr | ) |
#define RH_CACHE_BODY_PACK_SZ | ( | snsd_pack_sz | ) |
typedef struct andna_cache andna_cache |
typedef struct andna_cache_queue andna_cache_queue |
typedef struct counter_c_hashes counter_c_hashes |
typedef struct resolved_hnames_cache rh_cache |
andna_cache_queue* ac_queue_add | ( | andna_cache * | ac, |
char * | pubkey | ||
) |
void ac_queue_del | ( | andna_cache * | ac, |
andna_cache_queue * | acq | ||
) |
void ac_queue_del_expired | ( | andna_cache * | ac | ) |
void ac_queue_destroy | ( | andna_cache * | ac | ) |
andna_cache_queue* ac_queue_findpubk | ( | andna_cache * | ac, |
char * | pubk | ||
) |
int add_resolv_conf | ( | char * | hname, |
char * | file | ||
) |
andna_cache* andna_cache_addhash | ( | int | hash[4] | ) |
void andna_cache_del_expired | ( | void | ) |
int andna_cache_del_ifexpired | ( | andna_cache * | ac | ) |
void andna_cache_destroy | ( | void | ) |
andna_cache* andna_cache_findhash | ( | int | hash[4] | ) |
andna_cache* andna_cache_gethash | ( | int | hash[4] | ) |
void andna_caches_init | ( | int | family | ) |
counter_c_hashes* cc_findhash | ( | counter_c * | cc, |
int | hash[4] | ||
) |
counter_c_hashes* cc_hashes_add | ( | counter_c * | cc, |
int | hash[4] | ||
) |
void cc_hashes_del | ( | counter_c * | cc, |
counter_c_hashes * | cch | ||
) |
void cc_hashes_del_expired | ( | counter_c * | cc | ) |
void cc_hashes_destroy | ( | counter_c * | cc | ) |
counter_c* counter_c_add | ( | inet_prefix * | rip, |
char * | pubkey | ||
) |
void counter_c_del_expired | ( | void | ) |
int counter_c_del_ifexpired | ( | counter_c * | cc | ) |
void counter_c_destroy | ( | void | ) |
counter_c* counter_c_findpubk | ( | char * | pubk | ) |
int del_resolv_conf | ( | char * | hname, |
char * | file | ||
) |
void lcl_cache_destroy | ( | lcl_cache * | head, |
int * | counter | ||
) |
void lcl_cache_free | ( | lcl_cache * | alcl | ) |
lcl_cache* lcl_cache_new | ( | char * | hname | ) |
void lcl_destroy_keyring | ( | lcl_cache_keyring * | keyring | ) |
void lcl_new_keyring | ( | lcl_cache_keyring * | keyring | ) |
andna_cache* load_andna_cache | ( | char * | file, |
int * | counter | ||
) |
counter_c* load_counter_c | ( | char * | file, |
int * | counter | ||
) |
int load_hostnames | ( | char * | file, |
lcl_cache ** | old_alcl_head, | ||
int * | old_alcl_counter | ||
) |
lcl_cache* load_lcl_cache | ( | char * | file, |
int * | counter | ||
) |
int load_lcl_keyring | ( | lcl_cache_keyring * | keyring, |
char * | file | ||
) |
rh_cache* load_rh_cache | ( | char * | file, |
int * | counter | ||
) |
int load_snsd | ( | char * | file, |
lcl_cache * | alcl_head | ||
) |
char* pack_andna_cache | ( | andna_cache * | acache, |
size_t * | pack_sz, | ||
int | pack_type | ||
) |
char* pack_counter_cache | ( | counter_c * | countercache, |
size_t * | pack_sz | ||
) |
char* pack_lcl_cache | ( | lcl_cache * | local_cache, |
size_t * | pack_sz | ||
) |
char* pack_lcl_keyring | ( | lcl_cache_keyring * | keyring, |
size_t * | pack_sz | ||
) |
char* pack_rh_cache | ( | rh_cache * | rhcache, |
size_t * | pack_sz | ||
) |
rh_cache* rh_cache_add | ( | char * | hname, |
time_t | timestamp | ||
) |
rh_cache* rh_cache_add_hash | ( | u_int | hash, |
time_t | timestamp | ||
) |
void rh_cache_del | ( | rh_cache * | rhc | ) |
void rh_cache_del_expired | ( | void | ) |
rh_cache* rh_cache_find_hash | ( | u_int | hash | ) |
rh_cache* rh_cache_find_hname | ( | char * | hname | ) |
void rh_cache_flush | ( | void | ) |
rh_cache* rh_cache_new | ( | char * | hname, |
time_t | timestamp | ||
) |
int save_andna_cache | ( | andna_cache * | acache, |
char * | file | ||
) |
int save_counter_c | ( | counter_c * | countercache, |
char * | file | ||
) |
int save_lcl_cache | ( | lcl_cache * | lcl, |
char * | file | ||
) |
int save_lcl_keyring | ( | lcl_cache_keyring * | keyring, |
char * | file | ||
) |
int save_rh_cache | ( | rh_cache * | rh, |
char * | file | ||
) |
andna_cache* unpack_andna_cache | ( | char * | pack, |
size_t | pack_sz, | ||
int * | counter, | ||
int | pack_type | ||
) |
counter_c* unpack_counter_cache | ( | char * | pack, |
size_t | pack_sz, | ||
int * | counter | ||
) |
lcl_cache* unpack_lcl_cache | ( | char * | pack, |
size_t | pack_sz, | ||
int * | counter | ||
) |
int unpack_lcl_keyring | ( | lcl_cache_keyring * | keyring, |
char * | pack, | ||
size_t | pack_sz | ||
) |
rh_cache* unpack_rh_cache | ( | char * | pack, |
size_t | pack_sz, | ||
int * | counter | ||
) |
struct rh_cache_pkt_hdr _PACKED_ |
|
static |
andna_cache* andna_c |
int andna_c_counter |
|
static |
|
static |
counter_c* andna_counter_c |
lcl_cache* andna_lcl |
rh_cache* andna_rhc |
int cc_counter |
|
static |
|
static |
|
static |
|
static |
|
static |
int lcl_counter |
lcl_cache_keyring lcl_keyring |
|
static |
|
static |
|
static |
int rhc_counter |