| OLD | NEW |
| 1 #ifndef _RESOLV_H | 1 #ifndef _RESOLV_H |
| 2 #define _RESOLV_H | 2 #define _RESOLV_H |
| 3 | 3 |
| 4 #include <stdint.h> | 4 #include <stdint.h> |
| 5 #include <arpa/nameser.h> | 5 #include <arpa/nameser.h> |
| 6 #include <netinet/in.h> | 6 #include <netinet/in.h> |
| 7 | 7 |
| 8 #ifdef __cplusplus | 8 #ifdef __cplusplus |
| 9 extern "C" { | 9 extern "C" { |
| 10 #endif | 10 #endif |
| 11 | 11 |
| 12 #define MAXNS» » » 3 | 12 #define MAXNS 3 |
| 13 #define MAXDFLSRCH» » 3 | 13 #define MAXDFLSRCH 3 |
| 14 #define MAXDNSRCH» » 6 | 14 #define MAXDNSRCH 6 |
| 15 #define LOCALDOMAINPARTS» 2 | 15 #define LOCALDOMAINPARTS 2 |
| 16 | 16 |
| 17 #define RES_TIMEOUT» » 5 | 17 #define RES_TIMEOUT 5 |
| 18 #define MAXRESOLVSORT» » 10 | 18 #define MAXRESOLVSORT 10 |
| 19 #define RES_MAXNDOTS» » 15 | 19 #define RES_MAXNDOTS 15 |
| 20 #define RES_MAXRETRANS» » 30 | 20 #define RES_MAXRETRANS 30 |
| 21 #define RES_MAXRETRY» » 5 | 21 #define RES_MAXRETRY 5 |
| 22 #define RES_DFLRETRY» » 2 | 22 #define RES_DFLRETRY 2 |
| 23 #define RES_MAXTIME» » 65535 | 23 #define RES_MAXTIME 65535 |
| 24 | 24 |
| 25 /* unused; purely for broken apps */ | 25 /* unused; purely for broken apps */ |
| 26 typedef struct __res_state { | 26 typedef struct __res_state { |
| 27 » int retrans; | 27 int retrans; |
| 28 » int retry; | 28 int retry; |
| 29 » unsigned long options; | 29 unsigned long options; |
| 30 » int nscount; | 30 int nscount; |
| 31 » struct sockaddr_in nsaddr_list[MAXNS]; | 31 struct sockaddr_in nsaddr_list[MAXNS]; |
| 32 # define nsaddr»nsaddr_list[0] | 32 #define nsaddr nsaddr_list[0] |
| 33 » unsigned short id; | 33 unsigned short id; |
| 34 » char *dnsrch[MAXDNSRCH+1]; | 34 char* dnsrch[MAXDNSRCH + 1]; |
| 35 » char defdname[256]; | 35 char defdname[256]; |
| 36 » unsigned long pfcode; | 36 unsigned long pfcode; |
| 37 » unsigned ndots:4; | 37 unsigned ndots : 4; |
| 38 » unsigned nsort:4; | 38 unsigned nsort : 4; |
| 39 » unsigned ipv6_unavail:1; | 39 unsigned ipv6_unavail : 1; |
| 40 » unsigned unused:23; | 40 unsigned unused : 23; |
| 41 » struct { | 41 struct { |
| 42 » » struct in_addr addr; | 42 struct in_addr addr; |
| 43 » » uint32_t mask; | 43 uint32_t mask; |
| 44 » } sort_list[MAXRESOLVSORT]; | 44 } sort_list[MAXRESOLVSORT]; |
| 45 » void *qhook; | 45 void* qhook; |
| 46 » void *rhook; | 46 void* rhook; |
| 47 » int res_h_errno; | 47 int res_h_errno; |
| 48 » int _vcsock; | 48 int _vcsock; |
| 49 » unsigned _flags; | 49 unsigned _flags; |
| 50 » union { | 50 union { |
| 51 » » char pad[52]; | 51 char pad[52]; |
| 52 » » struct { | 52 struct { |
| 53 » » » uint16_t» » nscount; | 53 uint16_t nscount; |
| 54 » » » uint16_t» » nsmap[MAXNS]; | 54 uint16_t nsmap[MAXNS]; |
| 55 » » » int» » » nssocks[MAXNS]; | 55 int nssocks[MAXNS]; |
| 56 » » » uint16_t» » nscount6; | 56 uint16_t nscount6; |
| 57 » » » uint16_t» » nsinit; | 57 uint16_t nsinit; |
| 58 » » » struct sockaddr_in6» *nsaddrs[MAXNS]; | 58 struct sockaddr_in6* nsaddrs[MAXNS]; |
| 59 » » » unsigned int» » _initstamp[2]; | 59 unsigned int _initstamp[2]; |
| 60 » » } _ext; | 60 } _ext; |
| 61 » } _u; | 61 } _u; |
| 62 } *res_state; | 62 } * res_state; |
| 63 | 63 |
| 64 #define»__RES» 19991006 | 64 #define __RES 19991006 |
| 65 | 65 |
| 66 #ifndef _PATH_RESCONF | 66 #ifndef _PATH_RESCONF |
| 67 #define _PATH_RESCONF "/etc/resolv.conf" | 67 #define _PATH_RESCONF "/etc/resolv.conf" |
| 68 #endif | 68 #endif |
| 69 | 69 |
| 70 struct res_sym { | 70 struct res_sym { |
| 71 » int number; | 71 int number; |
| 72 » char *name; | 72 char* name; |
| 73 » char *humanname; | 73 char* humanname; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 #define»RES_F_VC» 0x00000001 | 76 #define RES_F_VC 0x00000001 |
| 77 #define»RES_F_CONN» 0x00000002 | 77 #define RES_F_CONN 0x00000002 |
| 78 #define RES_F_EDNS0ERR» 0x00000004 | 78 #define RES_F_EDNS0ERR 0x00000004 |
| 79 | 79 |
| 80 #define»RES_EXHAUSTIVE» 0x00000001 | 80 #define RES_EXHAUSTIVE 0x00000001 |
| 81 | 81 |
| 82 #define RES_INIT» 0x00000001 | 82 #define RES_INIT 0x00000001 |
| 83 #define RES_DEBUG» 0x00000002 | 83 #define RES_DEBUG 0x00000002 |
| 84 #define RES_AAONLY» 0x00000004 | 84 #define RES_AAONLY 0x00000004 |
| 85 #define RES_USEVC» 0x00000008 | 85 #define RES_USEVC 0x00000008 |
| 86 #define RES_PRIMARY» 0x00000010 | 86 #define RES_PRIMARY 0x00000010 |
| 87 #define RES_IGNTC» 0x00000020 | 87 #define RES_IGNTC 0x00000020 |
| 88 #define RES_RECURSE» 0x00000040 | 88 #define RES_RECURSE 0x00000040 |
| 89 #define RES_DEFNAMES» 0x00000080 | 89 #define RES_DEFNAMES 0x00000080 |
| 90 #define RES_STAYOPEN» 0x00000100 | 90 #define RES_STAYOPEN 0x00000100 |
| 91 #define RES_DNSRCH» 0x00000200 | 91 #define RES_DNSRCH 0x00000200 |
| 92 #define»RES_INSECURE1» 0x00000400 | 92 #define RES_INSECURE1 0x00000400 |
| 93 #define»RES_INSECURE2» 0x00000800 | 93 #define RES_INSECURE2 0x00000800 |
| 94 #define»RES_NOALIASES» 0x00001000 | 94 #define RES_NOALIASES 0x00001000 |
| 95 #define»RES_USE_INET6» 0x00002000 | 95 #define RES_USE_INET6 0x00002000 |
| 96 #define RES_ROTATE» 0x00004000 | 96 #define RES_ROTATE 0x00004000 |
| 97 #define»RES_NOCHECKNAME»0x00008000 | 97 #define RES_NOCHECKNAME 0x00008000 |
| 98 #define»RES_KEEPTSIG» 0x00010000 | 98 #define RES_KEEPTSIG 0x00010000 |
| 99 #define»RES_BLAST» 0x00020000 | 99 #define RES_BLAST 0x00020000 |
| 100 #define RES_USEBSTRING» 0x00040000 | 100 #define RES_USEBSTRING 0x00040000 |
| 101 #define RES_NOIP6DOTINT»0x00080000 | 101 #define RES_NOIP6DOTINT 0x00080000 |
| 102 #define RES_USE_EDNS0» 0x00100000 | 102 #define RES_USE_EDNS0 0x00100000 |
| 103 #define RES_SNGLKUP» 0x00200000 | 103 #define RES_SNGLKUP 0x00200000 |
| 104 #define RES_SNGLKUPREOP»0x00400000 | 104 #define RES_SNGLKUPREOP 0x00400000 |
| 105 #define RES_USE_DNSSEC» 0x00800000 | 105 #define RES_USE_DNSSEC 0x00800000 |
| 106 | 106 |
| 107 #define RES_DEFAULT» (RES_RECURSE|RES_DEFNAMES|RES_DNSRCH|RES_NOIP6DOTINT) | 107 #define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH | RES_NOIP6DOTINT) |
| 108 | 108 |
| 109 #define RES_PRF_STATS» 0x00000001 | 109 #define RES_PRF_STATS 0x00000001 |
| 110 #define RES_PRF_UPDATE» 0x00000002 | 110 #define RES_PRF_UPDATE 0x00000002 |
| 111 #define RES_PRF_CLASS 0x00000004 | 111 #define RES_PRF_CLASS 0x00000004 |
| 112 #define RES_PRF_CMD» 0x00000008 | 112 #define RES_PRF_CMD 0x00000008 |
| 113 #define RES_PRF_QUES» 0x00000010 | 113 #define RES_PRF_QUES 0x00000010 |
| 114 #define RES_PRF_ANS» 0x00000020 | 114 #define RES_PRF_ANS 0x00000020 |
| 115 #define RES_PRF_AUTH» 0x00000040 | 115 #define RES_PRF_AUTH 0x00000040 |
| 116 #define RES_PRF_ADD» 0x00000080 | 116 #define RES_PRF_ADD 0x00000080 |
| 117 #define RES_PRF_HEAD1» 0x00000100 | 117 #define RES_PRF_HEAD1 0x00000100 |
| 118 #define RES_PRF_HEAD2» 0x00000200 | 118 #define RES_PRF_HEAD2 0x00000200 |
| 119 #define RES_PRF_TTLID» 0x00000400 | 119 #define RES_PRF_TTLID 0x00000400 |
| 120 #define RES_PRF_HEADX» 0x00000800 | 120 #define RES_PRF_HEADX 0x00000800 |
| 121 #define RES_PRF_QUERY» 0x00001000 | 121 #define RES_PRF_QUERY 0x00001000 |
| 122 #define RES_PRF_REPLY» 0x00002000 | 122 #define RES_PRF_REPLY 0x00002000 |
| 123 #define RES_PRF_INIT» 0x00004000 | 123 #define RES_PRF_INIT 0x00004000 |
| 124 | 124 |
| 125 struct __res_state *__res_state(void); | 125 struct __res_state* __res_state(void); |
| 126 #define _res (*__res_state()) | 126 #define _res (*__res_state()) |
| 127 | 127 |
| 128 int res_init(void); | 128 int res_init(void); |
| 129 int res_query(const char *, int, int, unsigned char *, int); | 129 int res_query(const char*, int, int, unsigned char*, int); |
| 130 int res_querydomain(const char *, 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); | 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 u
nsigned char*, unsigned char *, int); | 132 int res_mkquery(int, |
| 133 int res_send(const unsigned char *, int, unsigned char *, int); | 133 const char*, |
| 134 int dn_comp(const char *, unsigned char *, int, unsigned char **, unsigned char
**); | 134 int, |
| 135 int dn_expand(const unsigned char *, const unsigned char *, const unsigned char
*, char *, int); | 135 int, |
| 136 int dn_skipname(const unsigned char *, const unsigned char *); | 136 const unsigned char*, |
| 137 int, |
| 138 const unsigned char*, |
| 139 unsigned char*, |
| 140 int); |
| 141 int res_send(const unsigned char*, int, unsigned char*, int); |
| 142 int dn_comp(const char*, unsigned char*, int, unsigned char**, unsigned char**); |
| 143 int dn_expand(const unsigned char*, |
| 144 const unsigned char*, |
| 145 const unsigned char*, |
| 146 char*, |
| 147 int); |
| 148 int dn_skipname(const unsigned char*, const unsigned char*); |
| 137 | 149 |
| 138 #ifdef __cplusplus | 150 #ifdef __cplusplus |
| 139 } | 151 } |
| 140 #endif | 152 #endif |
| 141 | 153 |
| 142 #endif | 154 #endif |
| OLD | NEW |