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

Go to the source code of this file.

Macros

#define ANDNS_TIMEOUT   15
 
#define MAXNSSERVERS   3
 
#define DNS_REPLY_TIMEOUT   10 /* seconds */
 
#define DNS_PORT   53
 
#define DNS_PORT_STR   "53"
 
#define INET_REALM_PREFIX   ".INT"
 
#define NTK_REALM_PREFIX   ".NTK"
 
#define PTR_INET_REALM_PREFIX   "INT."
 
#define PTR_NTK_REALM_PREFIX   "NTK."
 
#define REALM_PREFIX_LEN   4
 
#define DNS_PROTO   0
 
#define ANDNS_PROTO   1
 
#define NK_DNS   0
 
#define NK_NTK   1
 
#define NK_INET   2
 
#define GET_NK_BIT(msg)   (*((msg+3))>>4)&0x03
 
#define RCODE_NOERR   0
 
#define RCODE_EINTRPRT   1
 
#define RCODE_ESRVFAIL   2
 
#define RCODE_ENSDMN   3
 
#define RCODE_ENIMPL   4
 
#define RCODE_ERFSD   5
 

Functions

int store_ns (char *ns)
 
int collect_resolv_conf (char *resolve_conf)
 
void reset_andns_ns (void)
 
int andns_init (int restricted, char *resolv_conf, int family)
 
void andns_close (void)
 
int ns_general_send (char *msg, int msglen, char *answer, int anslen)
 
void dpktacpy (dns_pkt *dst, dns_pkt *src, const char *prefix)
 
dns_pktdpktcpy (dns_pkt *src, const char *prefix)
 
char * rm_realm_prefix (char *from, char *dst, int type)
 
dns_pktdpktcpy_rm_pref (dns_pkt *src)
 
int andns_gethostbyname (char *hname, inet_prefix *ip)
 
int andns_realm (dns_pkt_qst *dpq, int *prefixed)
 
int is_prefixed (dns_pkt *dp)
 
int dns_forward (dns_pkt *dp, char *msg, int msglen, char *answer)
 
int inet_rslv (dns_pkt *dp, char *msg, int msglen, char *answer)
 
int nk_rslv (andns_pkt *ap, char *msg, int msglen, char *answer)
 
int qtype_a_to_d (andns_pkt *ap)
 
int apqsttodpqst (andns_pkt *ap, dns_pkt **dpsrc)
 
int dpanswtoapansw (dns_pkt *dp, andns_pkt *ap)
 
int nk_forward (andns_pkt *ap, char *msg, int msglen, char *answer)
 
char * andns_rslv (char *msg, int msglen, char *answer, int *answ_len)
 

Macro Definition Documentation

#define ANDNS_PROTO   1
#define ANDNS_TIMEOUT   15
#define DNS_PORT   53
#define DNS_PORT_STR   "53"
#define DNS_PROTO   0
#define DNS_REPLY_TIMEOUT   10 /* seconds */
#define GET_NK_BIT (   msg)    (*((msg+3))>>4)&0x03
#define INET_REALM_PREFIX   ".INT"
#define MAXNSSERVERS   3
#define NK_DNS   0
#define NK_INET   2
#define NK_NTK   1
#define NTK_REALM_PREFIX   ".NTK"
#define PTR_INET_REALM_PREFIX   "INT."
#define PTR_NTK_REALM_PREFIX   "NTK."
#define RCODE_EINTRPRT   1
#define RCODE_ENIMPL   4
#define RCODE_ENSDMN   3
#define RCODE_ERFSD   5
#define RCODE_ESRVFAIL   2
#define RCODE_NOERR   0
#define REALM_PREFIX_LEN   4

Function Documentation

void andns_close ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

int andns_gethostbyname ( char *  hname,
inet_prefix ip 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int andns_init ( int  restricted,
char *  resolv_conf,
int  family 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int andns_realm ( dns_pkt_qst dpq,
int *  prefixed 
)

Here is the caller graph for this function:

char* andns_rslv ( char *  msg,
int  msglen,
char *  answer,
int *  answ_len 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int apqsttodpqst ( andns_pkt ap,
dns_pkt **  dpsrc 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int collect_resolv_conf ( char *  resolve_conf)

Here is the call graph for this function:

Here is the caller graph for this function:

int dns_forward ( dns_pkt dp,
char *  msg,
int  msglen,
char *  answer 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int dpanswtoapansw ( dns_pkt dp,
andns_pkt ap 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void dpktacpy ( dns_pkt dst,
dns_pkt src,
const char *  prefix 
)

Here is the caller graph for this function:

dns_pkt* dpktcpy ( dns_pkt src,
const char *  prefix 
)

Here is the call graph for this function:

Here is the caller graph for this function:

dns_pkt* dpktcpy_rm_pref ( dns_pkt src)

Here is the call graph for this function:

Here is the caller graph for this function:

int inet_rslv ( dns_pkt dp,
char *  msg,
int  msglen,
char *  answer 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int is_prefixed ( dns_pkt dp)

Here is the call graph for this function:

Here is the caller graph for this function:

int nk_forward ( andns_pkt ap,
char *  msg,
int  msglen,
char *  answer 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int nk_rslv ( andns_pkt ap,
char *  msg,
int  msglen,
char *  answer 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int ns_general_send ( char *  msg,
int  msglen,
char *  answer,
int  anslen 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int qtype_a_to_d ( andns_pkt ap)

Here is the caller graph for this function:

void reset_andns_ns ( void  )

Here is the caller graph for this function:

char* rm_realm_prefix ( char *  from,
char *  dst,
int  type 
)

Here is the caller graph for this function:

int store_ns ( char *  ns)

Here is the call graph for this function:

Here is the caller graph for this function: