12 #define TV_LESS(A,B) (((A)->tv_sec < (B)->tv_sec) || ((A)->tv_sec == (B)->tv_sec && (A)->tv_usec < (B)->tv_usec)) 51 #define DNS_T_HINFO 13 65 #define DNS_T_AXFR 252 70 #define DNS_RANDOM_SEED (32*4) 72 #define DNS_MAX_IPS 16 74 #define DNS_NAME4_DOMAIN (4*4+14) 76 #define DNS_NAME6_DOMAIN (32*2+10) 155 extern void dns_rotate(
unsigned char*,
unsigned int n,
unsigned int shift);
159 extern void dns_sort_mx(
struct dns_mx* mxs,
int count);
170 extern unsigned int dns_packet_copy(
const char *,
unsigned int,
unsigned int,
unsigned char *,
unsigned int);
171 extern unsigned int dns_packet_getname(
const char *,
unsigned int,
unsigned int,
char **);
174 int (*sizefn)(
const char* buf,
unsigned int len,
unsigned int pos, uint16 datalen),
175 int (*copy)(
struct dns_result* out,
unsigned int index,
unsigned int offset,
176 const char* buf,
unsigned int len,
unsigned int pos, uint16 datalen));
216 #define DNS_R_FN_WRAP(NAME,TYPE) \ 217 int dns_##NAME(struct dns_result* out,TYPE in) \ 219 struct dns_transmit tx = {0}; \ 220 int r = dns_##NAME##_r(&tx,out,in); \ 221 dns_transmit_free(&tx); \ #define DNS_RANDOM_SEED
Definition: dns.h:70
int s1
Definition: dns.h:91
unsigned fmt_dns_domain(char *, const char *)
Definition: dns_fmt.c:4
int dns_mx_packet(struct dns_result *, const char *, unsigned int)
Definition: dns_mx.c:34
uint16 distance
Definition: dns.h:122
int dns_transmit_get(struct dns_transmit *, const iopoll_fd *, const struct timeval *)
Definition: dns_transmit.c:257
unsigned int udploop
Definition: dns.h:103
int dns_resolvconfip(ipv4addr [DNS_MAX_IPS])
Definition: dns_resolvconfip.c:84
unsigned int dns_random(unsigned int)
Definition: dns_random.c:28
int dns_txt_r(struct dns_transmit *, struct dns_result *, const char *)
Definition: dns_txt.c:50
int dns_qualify(struct dns_result *, str *, const char *, int(*)(struct dns_transmit *, struct dns_result *, const char *))
Definition: dns_qualify.c:99
int dns_name4(struct dns_result *, const ipv4addr *)
int dns_txt_packet(struct dns_result *, const char *, unsigned int)
Definition: dns_txt.c:44
#define DNS_NAME4_DOMAIN
Definition: dns.h:74
unsigned int querylen
Definition: dns.h:83
int dns_ip4_packet(struct dns_result *, const char *, unsigned int)
Definition: dns_ip4.c:18
int dns_ip6(struct dns_result *, const char *)
int dns_txt(struct dns_result *, const char *)
int dns_transmit_start(struct dns_transmit *, const ipv4addr [DNS_MAX_IPS], int, const char *, uint16, const ipv4addr *)
Definition: dns_transmit.c:204
int dns_mx(struct dns_result *, const char *)
void dns_rotate(unsigned char *, unsigned int n, unsigned int shift)
Definition: dns_rotate.c:11
int count
Definition: dns.h:140
int dns_domain_fromdot(char **, const char *, unsigned int)
Definition: dns_domain_fromdot.c:8
ipv4addr localip
Definition: dns.h:113
int tcpstate
Definition: dns.h:101
struct timeval deadline
Definition: dns.h:107
unsigned int curserver
Definition: dns.h:105
char * packet
Definition: dns.h:85
void * __buffer
Definition: dns.h:146
int dns_name6_r(struct dns_transmit *, struct dns_result *, const ipv6addr *)
Definition: dns_name6.c:4
int dns_result_alloc(struct dns_result *d, int type, int count, int size)
Definition: dns_result.c:21
int dns_ip4_r(struct dns_transmit *, struct dns_result *, const char *)
Definition: dns_ip4.c:27
int dns_domain_todot_cat(str *, const char *)
Definition: dns_domain_todot.c:4
int dns_qualify_rules(struct dns_result *, str *, const char *, const str *, int(*)(struct dns_transmit *, struct dns_result *, const char *))
Definition: dns_qualify.c:50
unsigned int packetlen
Definition: dns.h:87
const ipv4addr * servers
Definition: dns.h:111
void dns_name4_domain(char [DNS_NAME4_DOMAIN], const ipv4addr *)
Definition: dns_name4_domain.c:7
unsigned int dns_packet_copy(const char *, unsigned int, unsigned int, unsigned char *, unsigned int)
Definition: dns_packet.c:12
#define DNS_NAME6_DOMAIN
Definition: dns.h:76
unsigned int dns_packet_getname(const char *, unsigned int, unsigned int, char **)
Definition: dns_packet.c:41
int dns_packet_extract(struct dns_result *out, const char *buf, unsigned int len, uint16 rrtype, uint16 rrclass, int(*sizefn)(const char *buf, unsigned int len, unsigned int pos, uint16 datalen), int(*copy)(struct dns_result *out, unsigned int index, unsigned int offset, const char *buf, unsigned int len, unsigned int pos, uint16 datalen))
Definition: dns_packet.c:96
#define DNS_MAX_IPS
Definition: dns.h:72
void dns_result_free(struct dns_result *d)
Definition: dns_result.c:8
int dns_resolvconfrewrite(str *)
Definition: dns_resolvconfrewrite.c:128
char * query
Definition: dns.h:81
unsigned int dns_domain_length(const char *)
Definition: dns_domain.c:8
int dns_domain_suffix(const char *, const char *)
Definition: dns_domain.c:56
void dns_domain_free(char **)
Definition: dns_domain.c:20
int dns_read_resolvconf(str *out)
Definition: dns_resolvconfip.c:15
unsigned int dns_domain_suffixpos(const char *, const char *)
Definition: dns_domain.c:69
unsigned int dns_packet_skipname(const char *, unsigned int, unsigned int)
Definition: dns_packet.c:23
int dns_name_packet(struct dns_result *, const char *, unsigned int)
Definition: dns_name_packet.c:31
int dns_name6(struct dns_result *, const ipv6addr *)
void dns_transmit_free(struct dns_transmit *)
Definition: dns_transmit.c:79
int dns_name4_r(struct dns_transmit *, struct dns_result *, const ipv4addr *)
Definition: dns_name4.c:6
void dns_rotateipv4(ipv4addr *, unsigned int)
Definition: dns_rotate.c:27
int dns_domain_equal(const char *, const char *)
Definition: dns_domain.c:44
void dns_rotateipv6(ipv6addr *, unsigned int)
Definition: dns_rotate.c:33
int dns_ip6_r(struct dns_transmit *, struct dns_result *, const char *)
Definition: dns_ip6.c:27
uint16 qtype
Definition: dns.h:115
int dns_mx_r(struct dns_transmit *, struct dns_result *, const char *)
Definition: dns_mx.c:40
int dns_resolve(struct dns_transmit *, const char *, uint16)
Definition: dns_resolve.c:33
char * name
Definition: dns.h:124
unsigned int pos
Definition: dns.h:109
int dns_ip6_packet(struct dns_result *, const char *, unsigned int)
Definition: dns_ip6.c:18
void dns_name6_domain(char [DNS_NAME6_DOMAIN], const ipv6addr *)
Definition: dns_name6_domain.c:7
int dns_ip4(struct dns_result *, const char *)
void dns_transmit_io(const struct dns_transmit *, iopoll_fd *, struct timeval *)
Definition: dns_transmit.c:236
int dns_domain_copy(char **, const char *)
Definition: dns_domain.c:29
int type
Definition: dns.h:142