#include <errno.h>
#include <netdb.h>
#include <strings.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include "andns_lib.h"
Go to the source code of this file.
#define AMISILENT (GOP.silent) |
Value:GQT->qstlength=len;
GQT->qstdata=(
char*) \
if (!
GQT->qstdata){
say(
"Fatal malloc!\n"); \
exit(1);}
#define say
Definition: ntkresolv.h:237
void * xmalloc(size_t size)
Definition: xmalloc.c:44
#define GQT
Definition: ntkresolv.h:235
Value:
GQT->qstlength=strlen(s);
#define GQT
Definition: ntkresolv.h:235
#define G_ALIGN(len)
Definition: ntkresolv.h:245
Value:({ \
char *__f; \
switch((ap)->ipv) { \
__f="IPv4"; \
break; \
__f="IPv6"; \
break; \
default: \
__f="UNKNOW"; \
break; \
} \
__f;})
#define ANDNS_IPV6
Definition: andns_lib.h:114
#define ANDNS_IPV4
Definition: andns_lib.h:113
#define LOCALHOST "localhost" |
#define MAX_HOSTNAME_LEN 512 |
#define min |
( |
|
x, |
|
|
|
y |
|
) |
| (x)<(y)?(x):(y) |
Value:({ \
char *__d; \
switch((ap)->nk) { \
__d="DNS"; \
break; \
__d="Ntk"; \
break; \
__d="Inet"; \
break; \
default: \
__d="UNKNOW"; \
break; \
} \
__d;})
#define NK_DNS
Definition: ntkresolv.h:53
#define NK_NTK
Definition: ntkresolv.h:54
#define NK_INET
Definition: ntkresolv.h:55
#define NTK_RESOLV_HASH_STR |
( |
|
s, |
|
|
|
d |
|
) |
| |
Value:({ \
int __i; \
sprintf(d+2*__i,"%02x",((unsigned char*)(s))[__i]); \
#define ANDNS_HASH_H
Definition: andns_lib.h:40
#define NTK_RESOLV_HNAME_SYMBOL "-" |
#define NTK_RESOLV_IP_SYMBOL "~" |
#define NTK_RESOLV_MAIL_BUGS "https://github.com/Netsukuku/netsukuku/issues" |
#define NTK_RESOLV_STR_HASH |
( |
|
s, |
|
|
|
d |
|
) |
| |
Value:({ \
int __i,__t; \
sscanf(s+2*__i,"%02x",&__t); \
d[__i]=(unsigned char)(__t);}})
#define ANDNS_HASH_H
Definition: andns_lib.h:40
#define NTK_RESOLV_SYMBOL |
( |
|
apd | ) |
|
Value:
#define APD_IP
Definition: andns_lib.h:60
#define NTK_RESOLV_HNAME_SYMBOL
Definition: ntkresolv.h:267
#define NTK_RESOLV_IP_SYMBOL
Definition: ntkresolv.h:266
#define NTK_RESOLV_TIMEOUT 15 |
#define NTKRESOLV_MAX_OBJ_LEN 512 |
#define NTKRESOLV_PORT 53 |
#define NTKRESOLV_PORT_STR "53" |
Value:({ \
char *__h; \
switch((ap)->qtype) { \
__h="*"; \
break; \
__h="None"; \
break; \
if (!ap->service) \
__h="None"; \
else \
break; \
default: \
__h="UNKNOW"; \
break; \
} \
__h;})
#define AT_G
Definition: andns_lib.h:101
#define SNSD_PROTO_UDP_STR
Definition: ntkresolv.h:47
#define SNSD_PROTO_TCP
Definition: ntkresolv.h:44
#define AT_PTR
Definition: andns_lib.h:100
#define AT_A
Definition: andns_lib.h:99
#define SNSD_PROTO_TCP_STR
Definition: ntkresolv.h:46
#define PROTOFROMPREF |
( |
|
s | ) |
|
Value:({ \
uint8_t __res=-1; \
__res; })
#define SNSD_PROTO_UDP_STR
Definition: ntkresolv.h:47
#define SNSD_PROTO_TCP
Definition: ntkresolv.h:44
#define SNSD_PROTO_UDP
Definition: ntkresolv.h:45
#define SNSD_PROTO_TCP_STR
Definition: ntkresolv.h:46
#define QR_STR |
( |
|
ap | ) |
((ap)->qr==0)?"QUERY":"ANSWER" |
Value:({ \
int __n,__res=-1; \
for (__n=0;__n<
QT_LEN;__n++) \
{__res=__n;break;} \
__res; })
char * QTYPE_STR_LIST[]
Definition: ntkresolv.h:62
int QT_LEN
Definition: ntkresolv.h:63
#define QTYPE_A_STR "snsd" |
#define QTYPE_G_STR "global" |
#define QTYPE_MX_STR "mx" |
#define QTYPE_PTR_STR "ptr" |
Value:({ \
char *__c; \
switch((ap)->qtype) { \
__c="Host2Ip"; \
break; \
__c="Ip2Host"; \
break; \
__c=" Global"; \
break; \
default: \
__c="Unknow"; \
break; \
} \
__c;})
#define AT_G
Definition: andns_lib.h:101
#define AT_PTR
Definition: andns_lib.h:100
#define AT_A
Definition: andns_lib.h:99
Value:({ \
char *__e; \
switch((ap)->rcode) { \
__e="NoError"; \
break; \
__e="InError"; \
break; \
__e="SrvFail"; \
break; \
__e="NoXHost"; \
break; \
__e="NotImpl"; \
break; \
__e="Refused"; \
break; \
default: \
__e="UNKNOW"; \
break; \
} \
__e;})
#define ANDNS_RCODE_ENIMPL
Definition: andns_lib.h:107
#define ANDNS_RCODE_NOERR
Definition: andns_lib.h:103
#define ANDNS_RCODE_ENSDMN
Definition: andns_lib.h:106
#define ANDNS_RCODE_ESRVFAIL
Definition: andns_lib.h:105
#define ANDNS_RCODE_EINTRPRT
Definition: andns_lib.h:104
#define ANDNS_RCODE_ERFSD
Definition: andns_lib.h:108
#define REALM_INT_STR "inet" |
#define REALM_NTK_STR "ntk" |
#define REALMFROMPREF |
( |
|
s | ) |
|
Value:({ \
uint8_t __res=0; \
__res; })
#define REALM_NTK_STR
Definition: ntkresolv.h:32
#define REALM_INT
Definition: ntkresolv.h:31
#define REALM_INT_STR
Definition: ntkresolv.h:33
#define REALM_NTK
Definition: ntkresolv.h:30
#define SERVICE_STR |
( |
|
ap | ) |
|
Value:({ \
char *__g; \
switch((ap)->qtype) { \
__g="*"; \
break; \
__g="None"; \
break; \
ap->service); \
__g=__t; \
break; \
default: \
__g="UNKNOW"; \
break; \
} \
__g;})
#define AT_G
Definition: andns_lib.h:101
#define MAX_INT_STR
Definition: ntkresolv.h:183
#define AT_PTR
Definition: andns_lib.h:100
#define AT_A
Definition: andns_lib.h:99
#define SNSD_PROTO_TCP_STR "tcp" |
#define SNSD_PROTO_UDP_STR "udp" |
#define SNSD_SERVICE_DEFAULT 0 |
Value:
say(
"Query time: %f seconds.\n" \
#define AMISILENT
Definition: ntkresolv.h:234
#define say
Definition: ntkresolv.h:237
static struct timeval time_start time_stop
Definition: ntkresolv.c:12
#define COMPUTE_TIME
Definition: ntkresolv.h:240
#define TIME_SCALE 1000000.0 |
double diff_time |
( |
struct timeval |
a, |
|
|
struct timeval |
b |
|
) |
| |
void ip_bin_to_str |
( |
void * |
data, |
|
|
char * |
dst |
|
) |
| |
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
void ntkresolv_exit |
( |
int |
i | ) |
|
void ntkresolv_safe_exit |
( |
int |
i | ) |
|
void opts_finish |
( |
char * |
arg | ) |
|
void opts_set_compute_hash |
( |
void |
| ) |
|
void opts_set_hash |
( |
void |
| ) |
|
void opts_set_ns |
( |
char * |
arg | ) |
|
void opts_set_parsable_output |
( |
void |
| ) |
|
void opts_set_port |
( |
char * |
arg | ) |
|
void opts_set_proto |
( |
char * |
arg | ) |
|
void opts_set_qt |
( |
char * |
arg | ) |
|
void opts_set_question |
( |
char * |
arg | ) |
|
void opts_set_realm |
( |
char * |
arg | ) |
|
void opts_set_recursion |
( |
void |
| ) |
|
void opts_set_service_and_proto |
( |
char * |
arg | ) |
|
void opts_set_silent |
( |
void |
| ) |
|
void print_parsable_answers |
( |
void |
| ) |
|
void print_results |
( |
void |
| ) |
|
void proto_usage |
( |
char * |
arg | ) |
|
void qt_usage |
( |
char * |
arg | ) |
|
void realm_usage |
( |
char * |
arg | ) |
|
void service_and_proto_usage |
( |
char * |
arg | ) |
|
char* QTYPE_STR_LIST[] ={ "snsd" , "ptr" , "global" , "mx" } |