chiark / gitweb /
8666614456e5cd0d8db594f4864a7c20e26dee9e
[adns.git] / src / adns-internal.h
1 /**/
2
3 #ifndef ADNS_INTERNAL_H_INCLUDED
4 #define ADNS_INTERNAL_H_INCLUDED
5
6 #include <sys/time.h>
7
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;
19   struct adns_answer *answer;
20   int flags, udpretries, server;
21   struct timeval timeout;
22   void *context;
23   char owner[1];
24 };
25
26 struct adns__state {
27   adns_initflags iflags;
28   struct { adns_query head, tail; } input, timew, childw, output;
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;
37     struct { adns_query head, tail; } connw;
38   } servers[MAXSERVERS];
39 };
40
41 #endif