The Netsukuku Project
0.0.9
An Alternative routing method
|
Go to the source code of this file.
Data Structures | |
struct | snsd_node |
struct | snsd_prio |
struct | snsd_service |
struct | snsd_node_llist_hdr |
struct | snsd_prio_llist_hdr |
struct | snsd_service_llist_hdr |
Macros | |
#define | SNSD_MAX_RECORDS |
#define | SNSD_MAX_QUEUE_RECORDS |
#define | SNSD_MAX_REC_SERV 16 /* Maximum records per service */ |
#define | SNSD_ALL_SERVICE |
#define | SNSD_DEFAULT_SERVICE 0 |
#define | SNSD_DEFAULT_PROTO 1 /* tcp */ |
#define | SNSD_DEFAULT_PRIO 16 |
#define | SNSD_DEFAULT_WEIGHT 1 |
#define | SNSD_WEIGHT(x) |
#define | MAX_SNSD_LINE_SZ (ANDNA_MAX_HNAME_LEN*4) |
#define | MAX_SNSD_FIELDS 6 |
#define | MIN_SNSD_FIELDS 5 |
#define | SNSD_NODE_HNAME |
#define | SNSD_NODE_IP |
#define | SNSD_NODE_MAIN_IP |
#define | SNSD_NODE_PACK_SZ (MAX_IP_SZ+sizeof(char)*2) |
#define | SNSD_PRIO_PACK_SZ (sizeof(char)) |
#define | SNSD_SERVICE_PACK_SZ (sizeof(u_short)+sizeof(u_char)) |
#define | SNSD_NODE_LLIST_PACK_SZ(head) |
#define | SNSD_PRIO_LLIST_PACK_SZ(head) |
#define | SNSD_SERVICE_LLIST_PACK_SZ(head) |
#define | SNSD_SERVICE_SINGLE_PACK_SZ(head) |
#define | SNSD_SERVICE_MAX_PACK_SZ |
#define | SNSD_SERVICE_MAX_LLIST_PACK_SZ |
Typedefs | |
typedef struct snsd_node | snsd_node |
typedef struct snsd_prio | snsd_prio |
typedef struct snsd_service | snsd_service |
Functions | |
void | snsd_cache_init (int family) |
u_char | str_to_snsd_proto (char *proto_name) |
const char * | snsd_proto_to_str (u_char proto) |
int | str_to_snsd_service (char *str, int *service, u_char *proto) |
struct servent * | snsd_service_to_str (int service, u_char proto, char **service_str, char **proto_str) |
snsd_service * | snsd_find_service (snsd_service *sns, u_short service, u_char proto) |
snsd_service * | snsd_add_service (snsd_service **head, u_short service, u_char proto) |
snsd_prio * | snsd_find_prio (snsd_prio *snp, u_char prio) |
snsd_prio * | snsd_add_prio (snsd_prio **head, u_char prio) |
snsd_node * | snsd_find_node_by_record (snsd_node *snd, u_int record[4]) |
snsd_node * | snsd_add_node (snsd_node **head, u_short *counter, u_short max_records, u_int record[4]) |
snsd_node * | snsd_add_mainip (snsd_service **head, u_short *counter, u_short max_records, u_int record[4]) |
void | snsd_service_llist_del (snsd_service **head) |
void | snsd_record_del_selected (snsd_service **head, u_short *snd_counter, snsd_service *selected) |
int | snsd_pack_service (char *pack, size_t free_sz, snsd_service *service) |
snsd_service * | snsd_unpack_service (char *pack, size_t pack_sz, size_t *unpacked_sz, u_short *nodes_counter) |
int | snsd_pack_all_services (char *pack, size_t pack_sz, snsd_service *head) |
snsd_service * | snsd_unpack_all_service (char *pack, size_t pack_sz, size_t *unpacked_sz, u_short *nodes_counter) |
snsd_node * | snsd_choose_wrand (snsd_node *head) |
snsd_prio * | snsd_highest_prio (snsd_prio *head) |
snsd_node * | snsd_find_mainip (snsd_service *sns) |
void | snsd_unset_all_flags (snsd_service *sns, u_char flag) |
snsd_service * | snsd_service_llist_copy (snsd_service *sns, int service, u_char proto) |
void | snsd_merge_node (snsd_node **head, u_short *snsd_counter, snsd_node *new) |
void | snsd_node_llist_merge (snsd_node **dst, u_short *snsd_counter, snsd_node *src) |
void | snsd_merge_prio (snsd_prio **head, u_short *snsd_counter, snsd_prio *new) |
void | snsd_prio_llist_merge (snsd_prio **dst, u_short *snsd_counter, snsd_prio *src) |
void | snsd_merge_service (snsd_service **head, u_short *snsd_counter, snsd_service *new) |
void | snsd_service_llist_merge (snsd_service **dst, u_short *snsd_counter, snsd_service *src) |
int | snsd_count_nodes (snsd_node *head) |
int | snsd_count_prio_nodes (snsd_prio *head) |
int | snsd_count_service_nodes (snsd_service *head) |
Variables | |
struct snsd_node_llist_hdr | _PACKED_ |
static const int_info | snsd_node_llist_hdr_iinfo = { 1, { (1<<1) }, { 0 }, { 1 } } |
static const int_info | snsd_prio_llist_hdr_iinfo = { 1, { (1<<1) }, { 0 }, { 1 } } |
static const int_info | snsd_service_llist_hdr_iinfo = { 1, { (1<<1) }, { 0 }, { 1 } } |
static const char | proto_str [][5] |
#define MAX_SNSD_FIELDS 6 |
#define MAX_SNSD_LINE_SZ (ANDNA_MAX_HNAME_LEN*4) |
#define MIN_SNSD_FIELDS 5 |
#define SNSD_ALL_SERVICE |
#define SNSD_DEFAULT_PRIO 16 |
#define SNSD_DEFAULT_PROTO 1 /* tcp */ |
#define SNSD_DEFAULT_SERVICE 0 |
#define SNSD_DEFAULT_WEIGHT 1 |
#define SNSD_MAX_QUEUE_RECORDS |
#define SNSD_MAX_REC_SERV 16 /* Maximum records per service */ |
#define SNSD_MAX_RECORDS |
#define SNSD_NODE_HNAME |
#define SNSD_NODE_IP |
#define SNSD_NODE_LLIST_PACK_SZ | ( | head | ) |
#define SNSD_NODE_MAIN_IP |
#define SNSD_NODE_PACK_SZ (MAX_IP_SZ+sizeof(char)*2) |
#define SNSD_PRIO_LLIST_PACK_SZ | ( | head | ) |
#define SNSD_PRIO_PACK_SZ (sizeof(char)) |
#define SNSD_SERVICE_LLIST_PACK_SZ | ( | head | ) |
#define SNSD_SERVICE_MAX_LLIST_PACK_SZ |
#define SNSD_SERVICE_MAX_PACK_SZ |
#define SNSD_SERVICE_PACK_SZ (sizeof(u_short)+sizeof(u_char)) |
#define SNSD_SERVICE_SINGLE_PACK_SZ | ( | head | ) |
#define SNSD_WEIGHT | ( | x | ) |
typedef struct snsd_service snsd_service |
snsd_node* snsd_add_mainip | ( | snsd_service ** | head, |
u_short * | counter, | ||
u_short | max_records, | ||
u_int | record[4] | ||
) |
snsd_node* snsd_add_node | ( | snsd_node ** | head, |
u_short * | counter, | ||
u_short | max_records, | ||
u_int | record[4] | ||
) |
snsd_service* snsd_add_service | ( | snsd_service ** | head, |
u_short | service, | ||
u_char | proto | ||
) |
void snsd_cache_init | ( | int | family | ) |
int snsd_count_nodes | ( | snsd_node * | head | ) |
int snsd_count_prio_nodes | ( | snsd_prio * | head | ) |
int snsd_count_service_nodes | ( | snsd_service * | head | ) |
snsd_node* snsd_find_mainip | ( | snsd_service * | sns | ) |
snsd_service* snsd_find_service | ( | snsd_service * | sns, |
u_short | service, | ||
u_char | proto | ||
) |
void snsd_merge_service | ( | snsd_service ** | head, |
u_short * | snsd_counter, | ||
snsd_service * | new | ||
) |
int snsd_pack_all_services | ( | char * | pack, |
size_t | pack_sz, | ||
snsd_service * | head | ||
) |
int snsd_pack_service | ( | char * | pack, |
size_t | free_sz, | ||
snsd_service * | service | ||
) |
const char* snsd_proto_to_str | ( | u_char | proto | ) |
void snsd_record_del_selected | ( | snsd_service ** | head, |
u_short * | snd_counter, | ||
snsd_service * | selected | ||
) |
snsd_service* snsd_service_llist_copy | ( | snsd_service * | sns, |
int | service, | ||
u_char | proto | ||
) |
void snsd_service_llist_del | ( | snsd_service ** | head | ) |
void snsd_service_llist_merge | ( | snsd_service ** | dst, |
u_short * | snsd_counter, | ||
snsd_service * | src | ||
) |
struct servent* snsd_service_to_str | ( | int | service, |
u_char | proto, | ||
char ** | service_str, | ||
char ** | proto_str | ||
) |
snsd_service* snsd_unpack_all_service | ( | char * | pack, |
size_t | pack_sz, | ||
size_t * | unpacked_sz, | ||
u_short * | nodes_counter | ||
) |
snsd_service* snsd_unpack_service | ( | char * | pack, |
size_t | pack_sz, | ||
size_t * | unpacked_sz, | ||
u_short * | nodes_counter | ||
) |
void snsd_unset_all_flags | ( | snsd_service * | sns, |
u_char | flag | ||
) |
u_char str_to_snsd_proto | ( | char * | proto_name | ) |
int str_to_snsd_service | ( | char * | str, |
int * | service, | ||
u_char * | proto | ||
) |
struct snsd_service_llist_hdr _PACKED_ |
|
static |
|
static |
|
static |
|
static |