The Netsukuku Project  0.0.9
An Alternative routing method
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
request.c File Reference
#include "includes.h"
#include "request.h"
#include "xmalloc.h"
#include "log.h"
Include dependency graph for request.c:

Macros

#define ECHO_ME_WAIT   5 /*(in seconds)*/
 
#define ECHO_REPLY_WAIT   5
 
#define GET_FREE_NODES_WAIT   10
 
#define GET_QSPN_ROUND_WAIT   10
 
#define GET_INTERNET_GWS_WAIT   5
 
#define SET_FOREIGN_ROUTE_WAIT   5
 
#define DEL_FOREIGN_ROUTE_WAIT   5
 
#define NEW_BACKROUTE_WAIT   10
 
#define DELAYED_BROADCAST_WAIT   5
 
#define SPLIT_ROUTE_WAIT   20
 
#define SET_NO_IDENTITY_WAIT   20
 
#define QSPN_CLOSE_WAIT   0
 
#define QSPN_OPEN_WAIT   0
 
#define QSPN_RFR_WAIT   5
 
#define GET_DNODEBLOCK_WAIT   20
 
#define GET_DNODEIP_WAIT   5
 
#define TRACER_PKT_WAIT   10
 
#define TRACER_PKT_CONNECT_WAIT   10
 
#define DEL_SNODE_WAIT   10
 
#define DEL_GNODE_WAIT   10
 
#define GET_INT_MAP_WAIT   10
 
#define GET_EXT_MAP_WAIT   10
 
#define GET_BNODE_MAP_WAIT   10
 
#define ANDNA_REGISTER_HNAME_WAIT   5
 
#define ANDNA_CHECK_COUNTER_WAIT   5
 
#define ANDNA_RESOLVE_HNAME_WAIT   2
 
#define ANDNA_RESOLVE_IP_WAIT   5
 
#define ANDNA_RESOLVE_MX_WAIT   5
 
#define ANDNA_GET_ANDNA_CACHE_WAIT   10
 
#define ANDNA_GET_SINGLE_ACACHE_WAIT   10
 
#define ANDNA_SPREAD_SACACHE_WAIT   10
 
#define ANDNA_GET_COUNT_CACHE_WAIT   10
 
#define ECHO_ME_MAXRQ   0 /*NO LIMITS*/
 
#define ECHO_REPLY_MAXRQ   20
 
#define GET_FREE_NODES_MAXRQ   5
 
#define GET_QSPN_ROUND_MAXRQ   5
 
#define GET_INTERNET_GWS_MAXRQ   5
 
#define SET_FOREIGN_ROUTE_MAXRQ   30
 
#define DEL_FOREIGN_ROUTE_MAXRQ   30
 
#define NEW_BACKROUTE_MAXRQ   10
 
#define DELAYED_BROADCAST_MAXRQ   5
 
#define SPLIT_ROUTE_MAXRQ   1
 
#define SET_NO_IDENTITY_MAXRQ   1
 
#define QSPN_CLOSE_MAXRQ   0 /*NO LIMITS*/
 
#define QSPN_OPEN_MAXRQ   0 /*NO LIMITS*/
 
#define QSPN_RFR_MAXRQ   10
 
#define GET_DNODEBLOCK_MAXRQ   1
 
#define GET_DNODEIP_MAXRQ   10
 
#define TRACER_PKT_MAXRQ   20
 
#define TRACER_PKT_CONNECT_MAXRQ   10
 
#define DEL_SNODE_MAXRQ   20
 
#define DEL_GNODE_MAXRQ   5
 
#define GET_INT_MAP_MAXRQ   2
 
#define GET_EXT_MAP_MAXRQ   2
 
#define GET_BNODE_MAP_MAXRQ   2
 
#define ANDNA_REGISTER_HNAME_MAXRQ   30
 
#define ANDNA_CHECK_COUNTER_MAXRQ   0 /*NO LIMITS*/
 
#define ANDNA_RESOLVE_HNAME_MAXRQ   80
 
#define ANDNA_RESOLVE_IP_MAXRQ   40
 
#define ANDNA_RESOLVE_MX_MAXRQ   40
 
#define ANDNA_GET_ANDNA_CACHE_MAXRQ   5
 
#define ANDNA_GET_SINGLE_ACACHE_MAXRQ   10
 
#define ANDNA_SPREAD_SACACHE_MAXRQ   10
 
#define ANDNA_GET_COUNT_CACHE_MAXRQ   5
 
#define RQ_WAIT   0
 
#define RQ_MAXRQ   1
 

Functions

void rq_wait_idx_init (int *rq_wait_idx)
 
int op_verify (u_char op)
 
int rq_verify (u_char rq)
 
int re_verify (u_char re)
 
int err_verify (u_char err)
 
const u_char * rq_strerror (int err)
 
const u_char * rq_to_str (u_char rq)
 
const u_char * re_to_str (u_char re)
 
void update_rq_tbl (rq_tbl *tbl)
 
int is_rq_full (u_char rq, rq_tbl *tbl)
 
int find_free_rq_wait (u_char rq, rq_tbl *tbl)
 
int add_rq (u_char rq, rq_tbl *tbl)
 
void op_filter_reset_re (int bit)
 
void op_filter_reset_rq (int bit)
 

Variables

static const u_char request_str [][30]
 
static const char unknown_reply [] ="Unknow reply"
 
static const u_char reply_str [][30]
 
static const u_char unknown_error [] ="Unknow error"
 
static const u_char error_str [][40]
 
static const u_char unknown_request [] ="Unknow request"
 
static const u_char request_array [][2]
 

Macro Definition Documentation

#define ANDNA_CHECK_COUNTER_MAXRQ   0 /*NO LIMITS*/
#define ANDNA_CHECK_COUNTER_WAIT   5
#define ANDNA_GET_ANDNA_CACHE_MAXRQ   5
#define ANDNA_GET_ANDNA_CACHE_WAIT   10
#define ANDNA_GET_COUNT_CACHE_MAXRQ   5
#define ANDNA_GET_COUNT_CACHE_WAIT   10
#define ANDNA_GET_SINGLE_ACACHE_MAXRQ   10
#define ANDNA_GET_SINGLE_ACACHE_WAIT   10
#define ANDNA_REGISTER_HNAME_MAXRQ   30
#define ANDNA_REGISTER_HNAME_WAIT   5
#define ANDNA_RESOLVE_HNAME_MAXRQ   80
#define ANDNA_RESOLVE_HNAME_WAIT   2
#define ANDNA_RESOLVE_IP_MAXRQ   40
#define ANDNA_RESOLVE_IP_WAIT   5
#define ANDNA_RESOLVE_MX_MAXRQ   40
#define ANDNA_RESOLVE_MX_WAIT   5
#define ANDNA_SPREAD_SACACHE_MAXRQ   10
#define ANDNA_SPREAD_SACACHE_WAIT   10
#define DEL_FOREIGN_ROUTE_MAXRQ   30
#define DEL_FOREIGN_ROUTE_WAIT   5
#define DEL_GNODE_MAXRQ   5
#define DEL_GNODE_WAIT   10
#define DEL_SNODE_MAXRQ   20
#define DEL_SNODE_WAIT   10
#define DELAYED_BROADCAST_MAXRQ   5
#define DELAYED_BROADCAST_WAIT   5
#define ECHO_ME_MAXRQ   0 /*NO LIMITS*/
#define ECHO_ME_WAIT   5 /*(in seconds)*/
#define ECHO_REPLY_MAXRQ   20
#define ECHO_REPLY_WAIT   5
#define GET_BNODE_MAP_MAXRQ   2
#define GET_BNODE_MAP_WAIT   10
#define GET_DNODEBLOCK_MAXRQ   1
#define GET_DNODEBLOCK_WAIT   20
#define GET_DNODEIP_MAXRQ   10
#define GET_DNODEIP_WAIT   5
#define GET_EXT_MAP_MAXRQ   2
#define GET_EXT_MAP_WAIT   10
#define GET_FREE_NODES_MAXRQ   5
#define GET_FREE_NODES_WAIT   10
#define GET_INT_MAP_MAXRQ   2
#define GET_INT_MAP_WAIT   10
#define GET_INTERNET_GWS_MAXRQ   5
#define GET_INTERNET_GWS_WAIT   5
#define GET_QSPN_ROUND_MAXRQ   5
#define GET_QSPN_ROUND_WAIT   10
#define NEW_BACKROUTE_MAXRQ   10
#define NEW_BACKROUTE_WAIT   10
#define QSPN_CLOSE_MAXRQ   0 /*NO LIMITS*/
#define QSPN_CLOSE_WAIT   0
#define QSPN_OPEN_MAXRQ   0 /*NO LIMITS*/
#define QSPN_OPEN_WAIT   0
#define QSPN_RFR_MAXRQ   10
#define QSPN_RFR_WAIT   5
#define RQ_MAXRQ   1
#define RQ_WAIT   0
#define SET_FOREIGN_ROUTE_MAXRQ   30
#define SET_FOREIGN_ROUTE_WAIT   5
#define SET_NO_IDENTITY_MAXRQ   1
#define SET_NO_IDENTITY_WAIT   20
#define SPLIT_ROUTE_MAXRQ   1
#define SPLIT_ROUTE_WAIT   20
#define TRACER_PKT_CONNECT_MAXRQ   10
#define TRACER_PKT_CONNECT_WAIT   10
#define TRACER_PKT_MAXRQ   20
#define TRACER_PKT_WAIT   10

Function Documentation

int add_rq ( u_char  rq,
rq_tbl tbl 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int err_verify ( u_char  err)

Here is the caller graph for this function:

int find_free_rq_wait ( u_char  rq,
rq_tbl tbl 
)

Here is the caller graph for this function:

int is_rq_full ( u_char  rq,
rq_tbl tbl 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void op_filter_reset_re ( int  bit)

Here is the caller graph for this function:

void op_filter_reset_rq ( int  bit)
int op_verify ( u_char  op)

Here is the caller graph for this function:

const u_char* re_to_str ( u_char  re)

Here is the call graph for this function:

Here is the caller graph for this function:

int re_verify ( u_char  re)

Here is the call graph for this function:

Here is the caller graph for this function:

const u_char* rq_strerror ( int  err)

Here is the call graph for this function:

Here is the caller graph for this function:

const u_char* rq_to_str ( u_char  rq)

Here is the call graph for this function:

Here is the caller graph for this function:

int rq_verify ( u_char  rq)

Here is the caller graph for this function:

void rq_wait_idx_init ( int *  rq_wait_idx)

Here is the caller graph for this function:

void update_rq_tbl ( rq_tbl tbl)

Here is the caller graph for this function:

Variable Documentation

const u_char error_str[][40]
static
Initial value:
=
{
{ "Invalid request" },
{ "Accept table full" },
{ "Request table full" },
{ "Quadro Group full" },
{ "Netsukuku is full" },
{ "Invalid signature" },
{ "Cannot forward the pkt" },
{ "Invalid hash_gnode" },
{ "ANDNA cache queue full" },
{ "Hostname update too early" },
{ "Too many hostname registered" },
{ "Hname updates counter mismatch" },
{ "Inexistent host name" },
{ "Counter check failed" },
{ "Too many connection" },
}
const u_char reply_str[][30]
static
Initial value:
=
{
{ "PUT_FREE_NODES" },
{ "PUT_QSPN_ROUND" },
{ "PUT_INTERNET_GWS" },
{ "PUT_DNODEIP" },
{ "EMPTY_REPLY_SLOT" },
{ "EMPTY_REPLY_SLOT1" },
{ "PUT_INT_MAP" },
{ "PUT_EXT_MAP" },
{ "PUT_BNODE_MAP" },
{ "ANDNA_RESOLVE_REPLY" },
{ "ANDNA_REV_RESOLVE_REPLY" },
{ "ANDNA_MX_RESOLVE_REPLY" },
{ "ANDNA_PUT_COUNT_CACHE" },
{ "ANDNA_PUT_ANDNA_CACHE" },
{ "ACK_AFFERMATIVE"},
{ "ACK_NEGATIVE" }
}
const u_char request_array[][2]
static
const u_char request_str[][30]
static
const u_char unknown_error[] ="Unknow error"
static
const char unknown_reply[] ="Unknow reply"
static
const u_char unknown_request[] ="Unknow request"
static