5db99a2e |
1 | /**/ |
2 | |
3 | #ifndef ADNS_INTERNAL_H_INCLUDED |
4 | #define ADNS_INTERNAL_H_INCLUDED |
5 | |
e7afa27f |
6 | #include <sys/time.h> |
7 | |
5db99a2e |
8 | #include "adns.h" |
9 | |
10 | #define MAXSERVERS 5 |
11 | #define MAXUDPRETRIES 10 |
12 | #define UDPRETRYMS 2000 |
13 | #define TCPMS 20000 |
14 | |
15 | struct adns__query { |
16 | adns_query next, back; |
17 | adns_query parent, child; |
18 | adns_rrtype type; |
5617a135 |
19 | adns_answer *answer; |
5db99a2e |
20 | int flags, udpretries, server; |
21 | struct timeval timeout; |
22 | void *context; |
23 | char owner[1]; |
24 | }; |
25 | |
26 | struct adns__state { |
e7afa27f |
27 | adns_initflags iflags; |
28 | struct { adns_query head, tail; } input, timew, childw, output; |
5db99a2e |
29 | int udpsocket; |
30 | int qbufavail, tcpbufavail, tcpbufused, tcpbufdone; |
31 | char *qbuf, *tcpbuf; |
32 | int nservers; |
33 | struct { |
34 | struct in_addr addr; |
35 | int tcpsocket; |
36 | struct timeval timeout; |
e7afa27f |
37 | struct { adns_query head, tail; } connw; |
5db99a2e |
38 | } servers[MAXSERVERS]; |
39 | }; |
40 | |
41 | #endif |