The Netsukuku Project  0.0.9
An Alternative routing method
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
andns_lib.h File Reference
#include <string.h>
#include <stdint.h>
#include <sys/types.h>
Include dependency graph for andns_lib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  andns_pkt_data
 
struct  andns_pkt
 

Macros

#define ANDNS_MAX_QUESTION_LEN   263 /* TODO */
 
#define ANDNS_MAX_ANSWER_LEN   516
 
#define ANDNS_MAX_ANSWERS_NUM   256
 
#define ANDNS_MAX_PK_LEN
 
#define ANDNS_MAX_DATA_LEN   512
 
#define ANDNS_MAX_QST_LEN   512
 
#define ANNDS_DNS_MAZ_QST_LEN   255
 
#define ANDNS_MAX_ANSW_IP_LEN   20
 
#define ANDNS_MAX_ANSW_H_LEN   516
 
#define ANDNS_HASH_H   16
 
#define ANDNS_COMPR_LEVEL   Z_BEST_COMPRESSION
 
#define ANDNS_COMPR_THRESHOLD   1000
 
#define ANDNS_PKT_DATA_SZ   sizeof(andns_pkt_data)
 
#define APD_ALIGN(apd)
 
#define APD_MAIN_IP   1<<0
 
#define APD_IP   1<<1
 
#define APD_TCP   1<<2
 
#define APD_UDP   1<<3
 
#define ANDNS_PKT_SZ   sizeof(andns_pkt)
 
#define AP_ALIGN(ap)   (ap)->qstdata=(char*)xmalloc((ap)->qstlength)
 
#define ANDNS_HDR_SZ   4
 
#define ANDNS_HDR_Z   4
 
#define ANDNS_MAX_SZ   ANDNS_HDR_SZ+ANDNS_MAX_QST_LEN+ANDNS_MAX_QST_LEN+4
 
#define ANDNS_SET_RCODE(s, c)   *((s)+3)=(((*((s)+3))&0xf0)|c)
 
#define ANDNS_SET_QR(s)   (*((s)+2))|=0x80
 
#define ANDNS_SET_ANCOUNT(s, n)   *(s+2)|=((n)>>1);*(s+3)|=((n)<<7);
 
#define ANDNS_SET_Z(s)   *(s+3)|=0x20;
 
#define ANDNS_UNSET_Z(s)   *(s+3)&=0xdf;
 
#define ANDNS_PROTO_TCP   0
 
#define ANDNS_PROTO_UDP   1
 
#define AT_A   0 /* h->ip */
 
#define AT_PTR   1 /* ip->h */
 
#define AT_G   2 /* global */
 
#define ANDNS_RCODE_NOERR   0 /* No error */
 
#define ANDNS_RCODE_EINTRPRT   1 /* Intepret error */
 
#define ANDNS_RCODE_ESRVFAIL   2 /* Server failure */
 
#define ANDNS_RCODE_ENSDMN   3 /* No such domain */
 
#define ANDNS_RCODE_ENIMPL   4 /* Not implemented */
 
#define ANDNS_RCODE_ERFSD   5 /* Refused */
 
#define NTK_REALM   1
 
#define INET_REALM   2
 
#define ANDNS_IPV4   0
 
#define ANDNS_IPV6   1
 

Typedefs

typedef struct andns_pkt_data andns_pkt_data
 
typedef struct andns_pkt andns_pkt
 

Functions

int andns_compress (char *src, int srclen)
 
char * andns_uncompress (char *src, int srclen, int *dstlen)
 
int a_hdr_u (char *buf, andns_pkt *ap)
 
int a_qst_u (char *buf, andns_pkt *ap, int limitlen)
 
int a_answ_u (char *buf, andns_pkt *ap, int limitlen)
 
int a_answs_u (char *buf, andns_pkt *ap, int limitlen)
 
int a_u (char *buf, int pktlen, andns_pkt **app)
 
int a_hdr_p (andns_pkt *ap, char *buf)
 
int a_qst_p (andns_pkt *ap, char *buf, int limitlen)
 
int a_answ_p (andns_pkt *ap, andns_pkt_data *apd, char *buf, int limitlen)
 
int a_answs_p (andns_pkt *ap, char *buf, int limitlen)
 
int a_p (andns_pkt *ap, char *buf)
 
andns_pktcreate_andns_pkt (void)
 
andns_pkt_datacreate_andns_pkt_data (void)
 
andns_pkt_dataandns_add_answ (andns_pkt *ap)
 
void destroy_andns_pkt_data (andns_pkt_data *apd)
 
void andns_del_answ (andns_pkt *ap)
 
void destroy_andns_pkt_datas (andns_pkt *ap)
 
void destroy_andns_pkt (andns_pkt *ap)
 

Macro Definition Documentation

#define ANDNS_COMPR_LEVEL   Z_BEST_COMPRESSION
#define ANDNS_COMPR_THRESHOLD   1000
#define ANDNS_HASH_H   16
#define ANDNS_HDR_SZ   4
#define ANDNS_HDR_Z   4
#define ANDNS_IPV4   0
#define ANDNS_IPV6   1
#define ANDNS_MAX_ANSW_H_LEN   516
#define ANDNS_MAX_ANSW_IP_LEN   20
#define ANDNS_MAX_ANSWER_LEN   516
#define ANDNS_MAX_ANSWERS_NUM   256
#define ANDNS_MAX_DATA_LEN   512
#define ANDNS_MAX_PK_LEN
Value:
#define ANDNS_MAX_QUESTION_LEN
Definition: andns_lib.h:28
#define ANDNS_MAX_ANSWER_LEN
Definition: andns_lib.h:29
#define ANDNS_MAX_ANSWERS_NUM
Definition: andns_lib.h:30
#define ANDNS_MAX_QST_LEN   512
#define ANDNS_MAX_QUESTION_LEN   263 /* TODO */
#define ANDNS_MAX_SZ   ANDNS_HDR_SZ+ANDNS_MAX_QST_LEN+ANDNS_MAX_QST_LEN+4
#define ANDNS_PKT_DATA_SZ   sizeof(andns_pkt_data)
#define ANDNS_PKT_SZ   sizeof(andns_pkt)
#define ANDNS_PROTO_TCP   0
#define ANDNS_PROTO_UDP   1
#define ANDNS_RCODE_EINTRPRT   1 /* Intepret error */
#define ANDNS_RCODE_ENIMPL   4 /* Not implemented */
#define ANDNS_RCODE_ENSDMN   3 /* No such domain */
#define ANDNS_RCODE_ERFSD   5 /* Refused */
#define ANDNS_RCODE_ESRVFAIL   2 /* Server failure */
#define ANDNS_RCODE_NOERR   0 /* No error */
#define ANDNS_SET_ANCOUNT (   s,
 
)    *(s+2)|=((n)>>1);*(s+3)|=((n)<<7);
#define ANDNS_SET_QR (   s)    (*((s)+2))|=0x80
#define ANDNS_SET_RCODE (   s,
 
)    *((s)+3)=(((*((s)+3))&0xf0)|c)
#define ANDNS_SET_Z (   s)    *(s+3)|=0x20;
#define ANDNS_UNSET_Z (   s)    *(s+3)&=0xdf;
#define ANNDS_DNS_MAZ_QST_LEN   255
#define AP_ALIGN (   ap)    (ap)->qstdata=(char*)xmalloc((ap)->qstlength)
#define APD_ALIGN (   apd)
Value:
(apd)->rdata=(char*)xmalloc((apd)->rdlength+1); \
memset((apd)->rdata,0,(apd)->rdlength+1)
void * xmalloc(size_t size)
Definition: xmalloc.c:44
#define APD_IP   1<<1
#define APD_MAIN_IP   1<<0
#define APD_TCP   1<<2
#define APD_UDP   1<<3
#define AT_A   0 /* h->ip */
#define AT_G   2 /* global */
#define AT_PTR   1 /* ip->h */
#define INET_REALM   2
#define NTK_REALM   1

Typedef Documentation

typedef struct andns_pkt andns_pkt

Function Documentation

int a_answ_p ( andns_pkt ap,
andns_pkt_data apd,
char *  buf,
int  limitlen 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int a_answ_u ( char *  buf,
andns_pkt ap,
int  limitlen 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int a_answs_p ( andns_pkt ap,
char *  buf,
int  limitlen 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int a_answs_u ( char *  buf,
andns_pkt ap,
int  limitlen 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int a_hdr_p ( andns_pkt ap,
char *  buf 
)

Here is the caller graph for this function:

int a_hdr_u ( char *  buf,
andns_pkt ap 
)

Here is the caller graph for this function:

int a_p ( andns_pkt ap,
char *  buf 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int a_qst_p ( andns_pkt ap,
char *  buf,
int  limitlen 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int a_qst_u ( char *  buf,
andns_pkt ap,
int  limitlen 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int a_u ( char *  buf,
int  pktlen,
andns_pkt **  app 
)

Here is the call graph for this function:

Here is the caller graph for this function:

andns_pkt_data* andns_add_answ ( andns_pkt ap)

Here is the call graph for this function:

Here is the caller graph for this function:

int andns_compress ( char *  src,
int  srclen 
)

Here is the caller graph for this function:

void andns_del_answ ( andns_pkt ap)

Here is the call graph for this function:

Here is the caller graph for this function:

char* andns_uncompress ( char *  src,
int  srclen,
int *  dstlen 
)

Here is the call graph for this function:

Here is the caller graph for this function:

andns_pkt* create_andns_pkt ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

andns_pkt_data* create_andns_pkt_data ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void destroy_andns_pkt ( andns_pkt ap)

Here is the call graph for this function:

Here is the caller graph for this function:

void destroy_andns_pkt_data ( andns_pkt_data apd)

Here is the caller graph for this function:

void destroy_andns_pkt_datas ( andns_pkt ap)

Here is the call graph for this function:

Here is the caller graph for this function: