5 #include <arpa/nameser.h>
6 #include <netinet/in.h>
15 #define LOCALDOMAINPARTS 2
18 #define MAXRESOLVSORT 10
19 #define RES_MAXNDOTS 15
20 #define RES_MAXRETRANS 30
21 #define RES_MAXRETRY 5
22 #define RES_DFLRETRY 2
23 #define RES_MAXTIME 65535
25 /* unused; purely for broken apps */
26 typedef struct __res_state
{
29 unsigned long options
;
31 struct sockaddr_in nsaddr_list
[MAXNS
];
32 # define nsaddr nsaddr_list[0]
34 char *dnsrch
[MAXDNSRCH
+1];
39 unsigned ipv6_unavail
:1;
44 } sort_list
[MAXRESOLVSORT
];
54 uint16_t nsmap
[MAXNS
];
58 struct sockaddr_in6
*nsaddrs
[MAXNS
];
59 unsigned int _initstamp
[2];
64 #define __RES 19960801
67 #define _PATH_RESCONF "/etc/resolv.conf"
76 #define RES_F_VC 0x00000001
77 #define RES_F_CONN 0x00000002
78 #define RES_F_EDNS0ERR 0x00000004
80 #define RES_EXHAUSTIVE 0x00000001
82 #define RES_INIT 0x00000001
83 #define RES_DEBUG 0x00000002
84 #define RES_AAONLY 0x00000004
85 #define RES_USEVC 0x00000008
86 #define RES_PRIMARY 0x00000010
87 #define RES_IGNTC 0x00000020
88 #define RES_RECURSE 0x00000040
89 #define RES_DEFNAMES 0x00000080
90 #define RES_STAYOPEN 0x00000100
91 #define RES_DNSRCH 0x00000200
92 #define RES_INSECURE1 0x00000400
93 #define RES_INSECURE2 0x00000800
94 #define RES_NOALIASES 0x00001000
95 #define RES_USE_INET6 0x00002000
96 #define RES_ROTATE 0x00004000
97 #define RES_NOCHECKNAME 0x00008000
98 #define RES_KEEPTSIG 0x00010000
99 #define RES_BLAST 0x00020000
100 #define RES_USEBSTRING 0x00040000
101 #define RES_NOIP6DOTINT 0x00080000
102 #define RES_USE_EDNS0 0x00100000
103 #define RES_SNGLKUP 0x00200000
104 #define RES_SNGLKUPREOP 0x00400000
105 #define RES_USE_DNSSEC 0x00800000
107 #define RES_DEFAULT (RES_RECURSE|RES_DEFNAMES|RES_DNSRCH|RES_NOIP6DOTINT)
109 #define RES_PRF_STATS 0x00000001
110 #define RES_PRF_UPDATE 0x00000002
111 #define RES_PRF_CLASS 0x00000004
112 #define RES_PRF_CMD 0x00000008
113 #define RES_PRF_QUES 0x00000010
114 #define RES_PRF_ANS 0x00000020
115 #define RES_PRF_AUTH 0x00000040
116 #define RES_PRF_ADD 0x00000080
117 #define RES_PRF_HEAD1 0x00000100
118 #define RES_PRF_HEAD2 0x00000200
119 #define RES_PRF_TTLID 0x00000400
120 #define RES_PRF_HEADX 0x00000800
121 #define RES_PRF_QUERY 0x00001000
122 #define RES_PRF_REPLY 0x00002000
123 #define RES_PRF_INIT 0x00004000
125 struct __res_state
*__res_state(void);
126 #define _res (*__res_state())
129 int res_query(const char *, int, int, unsigned char *, int);
130 int res_querydomain(const char *, const char *, int, int, unsigned char *, int);
131 int res_search(const char *, int, int, unsigned char *, int);
132 int res_mkquery(int, const char *, int, int, const unsigned char *, int, const unsigned char*, unsigned char *, int);
133 int res_send(const unsigned char *, int, unsigned char *, int);
134 int dn_comp(const char *, unsigned char *, int, unsigned char **, unsigned char **);
135 int dn_expand(const unsigned char *, const unsigned char *, const unsigned char *, char *, int);
136 int dn_skipname(const unsigned char *, const unsigned char *);