Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 1 | /* |
| 2 | * include/types/dns.h |
| 3 | * This file provides structures and types for DNS. |
| 4 | * |
| 5 | * Copyright (C) 2014 Baptiste Assmann <bedis9@gmail.com> |
| 6 | * |
| 7 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Lesser General Public |
| 9 | * License as published by the Free Software Foundation, version 2.1 |
| 10 | * exclusively. |
| 11 | * |
| 12 | * This library is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * Lesser General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Lesser General Public |
| 18 | * License along with this library; if not, write to the Free Software |
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | */ |
| 21 | |
| 22 | #ifndef _TYPES_DNS_H |
| 23 | #define _TYPES_DNS_H |
| 24 | |
| 25 | /*DNS maximum values */ |
| 26 | /* |
| 27 | * Maximum issued from RFC: |
| 28 | * RFC 1035: https://www.ietf.org/rfc/rfc1035.txt chapter 2.3.4 |
| 29 | * RFC 2671: http://tools.ietf.org/html/rfc2671 |
| 30 | */ |
| 31 | #define DNS_MAX_LABEL_SIZE 63 |
| 32 | #define DNS_MAX_NAME_SIZE 255 |
Baptiste Assmann | d20bbaf | 2016-03-26 15:09:48 +0100 | [diff] [blame] | 33 | #define DNS_MAX_UDP_MESSAGE 512 |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 34 | |
Baptiste Assmann | 4ec076f | 2015-12-09 14:02:01 +0100 | [diff] [blame] | 35 | /* DNS minimun record size: 1 char + 1 NULL + type + class */ |
| 36 | #define DNS_MIN_RECORD_SIZE ( 1 + 1 + 2 + 2 ) |
| 37 | |
Baptiste Assmann | d0aa6d2 | 2017-04-03 14:40:20 +0200 | [diff] [blame] | 38 | /* DNS smallest fqdn 'a.gl' size */ |
| 39 | # define DNS_SMALLEST_FQDN_SIZE 4 |
| 40 | |
Baptiste Assmann | 4ec076f | 2015-12-09 14:02:01 +0100 | [diff] [blame] | 41 | /* maximum number of query records in a DNS response |
| 42 | * For now, we allow only one */ |
| 43 | #define DNS_MAX_QUERY_RECORDS 1 |
| 44 | |
| 45 | /* maximum number of answer record in a DNS response */ |
| 46 | #define DNS_MAX_ANSWER_RECORDS ((DNS_MAX_UDP_MESSAGE - DNS_HEADER_SIZE) / DNS_MIN_RECORD_SIZE) |
| 47 | |
Baptiste Assmann | c1ce5f3 | 2016-05-14 11:26:22 +0200 | [diff] [blame] | 48 | /* size of dns_buffer used to store responses from the buffer |
| 49 | * dns_buffer is used to store data collected from records found in a response. |
| 50 | * Before using it, caller will always check that there is at least DNS_MAX_NAME_SIZE bytes |
| 51 | * available */ |
| 52 | #define DNS_ANALYZE_BUFFER_SIZE DNS_MAX_UDP_MESSAGE + DNS_MAX_NAME_SIZE |
| 53 | |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 54 | /* DNS error messages */ |
| 55 | #define DNS_TOO_LONG_FQDN "hostname too long" |
| 56 | #define DNS_LABEL_TOO_LONG "one label too long" |
| 57 | #define DNS_INVALID_CHARACTER "found an invalid character" |
| 58 | |
| 59 | /* dns query class */ |
| 60 | #define DNS_RCLASS_IN 1 /* internet class */ |
| 61 | |
| 62 | /* dns record types (non exhaustive list) */ |
| 63 | #define DNS_RTYPE_A 1 /* IPv4 address */ |
| 64 | #define DNS_RTYPE_CNAME 5 /* canonical name */ |
| 65 | #define DNS_RTYPE_AAAA 28 /* IPv6 address */ |
Olivier Houchard | 8da5f98 | 2017-08-04 18:35:36 +0200 | [diff] [blame] | 66 | #define DNS_RTYPE_SRV 33 /* SRV record */ |
Baptiste Assmann | 572ab8b | 2017-08-14 00:04:58 +0200 | [diff] [blame] | 67 | #define DNS_RTYPE_OPT 41 /* OPT */ |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 68 | #define DNS_RTYPE_ANY 255 /* all records */ |
| 69 | |
| 70 | /* dns rcode values */ |
| 71 | #define DNS_RCODE_NO_ERROR 0 /* no error */ |
| 72 | #define DNS_RCODE_NX_DOMAIN 3 /* non existent domain */ |
| 73 | #define DNS_RCODE_REFUSED 5 /* query refused */ |
| 74 | |
Baptiste Assmann | 042d0a1 | 2015-09-02 21:52:37 +0200 | [diff] [blame] | 75 | /* dns flags masks */ |
| 76 | #define DNS_FLAG_TRUNCATED 0x0200 /* mask for truncated flag */ |
| 77 | #define DNS_FLAG_REPLYCODE 0x000F /* mask for reply code */ |
| 78 | |
Thierry Fournier | ac88cfe | 2016-02-17 22:05:30 +0100 | [diff] [blame] | 79 | /* max number of network preference entries are avalaible from the |
| 80 | * configuration file. |
| 81 | */ |
| 82 | #define SRV_MAX_PREF_NET 5 |
| 83 | |
Baptiste Assmann | ed97c95 | 2015-07-21 15:34:51 +0200 | [diff] [blame] | 84 | /* DNS header size */ |
| 85 | #define DNS_HEADER_SIZE sizeof(struct dns_header) |
| 86 | |
Baptiste Assmann | 201c07f | 2017-05-22 15:17:15 +0200 | [diff] [blame] | 87 | /* DNS resolution pool size, per resolvers section */ |
| 88 | #define DNS_DEFAULT_RESOLUTION_POOL_SIZE 64 |
| 89 | |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 90 | /* DNS request or response header structure */ |
| 91 | struct dns_header { |
Nenad Merdanovic | 8ab7942 | 2016-07-13 14:03:43 +0200 | [diff] [blame] | 92 | uint16_t id; |
| 93 | uint16_t flags; |
| 94 | uint16_t qdcount; |
| 95 | uint16_t ancount; |
| 96 | uint16_t nscount; |
| 97 | uint16_t arcount; |
| 98 | } __attribute__ ((packed)); |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 99 | |
| 100 | /* short structure to describe a DNS question */ |
Baptiste Assmann | 83b0a17 | 2016-09-05 19:09:49 +0200 | [diff] [blame] | 101 | /* NOTE: big endian structure */ |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 102 | struct dns_question { |
| 103 | unsigned short qtype; /* question type */ |
| 104 | unsigned short qclass; /* query class */ |
| 105 | }; |
| 106 | |
Baptiste Assmann | 83b0a17 | 2016-09-05 19:09:49 +0200 | [diff] [blame] | 107 | /* NOTE: big endian structure */ |
Baptiste Assmann | 5748f73 | 2015-07-21 15:36:24 +0200 | [diff] [blame] | 108 | struct dns_query_item { |
| 109 | struct list list; |
| 110 | char name[DNS_MAX_NAME_SIZE]; /* query name */ |
| 111 | unsigned short type; /* question type */ |
| 112 | unsigned short class; /* query class */ |
| 113 | }; |
| 114 | |
Baptiste Assmann | 83b0a17 | 2016-09-05 19:09:49 +0200 | [diff] [blame] | 115 | /* NOTE: big endian structure */ |
Baptiste Assmann | 2af08fe | 2017-08-14 00:13:01 +0200 | [diff] [blame] | 116 | struct dns_additional_record { |
| 117 | uint8_t name; /* domain name, must be 0 (RFC 6891) */ |
| 118 | uint16_t type; /* record type DNS_RTYPE_OPT (41) */ |
| 119 | uint16_t udp_payload_size; /* maximum size accepted for the response */ |
| 120 | uint32_t extension; /* extended rcode and flags, not used for now */ |
| 121 | uint16_t data_length; /* data length */ |
| 122 | /* as of today, we don't support yet edns options, that said I already put a placeholder here |
| 123 | * for this purpose. We may need to define a dns_option_record structure which itself should |
| 124 | * point to different type of data, based on the extension set (client subnet, tcp keepalive, |
| 125 | * etc...)*/ |
| 126 | // struct list options; /* list of option records */ |
| 127 | } __attribute__ ((packed)); |
| 128 | |
| 129 | /* NOTE: big endian structure */ |
Baptiste Assmann | 5748f73 | 2015-07-21 15:36:24 +0200 | [diff] [blame] | 130 | struct dns_answer_item { |
| 131 | struct list list; |
Olivier Houchard | a8c6db8 | 2017-07-06 18:46:47 +0200 | [diff] [blame] | 132 | char name[DNS_MAX_NAME_SIZE]; /* answer name |
Baptiste Assmann | 5748f73 | 2015-07-21 15:36:24 +0200 | [diff] [blame] | 133 | * For SRV type, name also includes service |
| 134 | * and protocol value */ |
| 135 | int16_t type; /* question type */ |
| 136 | int16_t class; /* query class */ |
| 137 | int32_t ttl; /* response TTL */ |
| 138 | int16_t priority; /* SRV type priority */ |
| 139 | int16_t weight; /* SRV type weight */ |
| 140 | int16_t port; /* SRV type port */ |
| 141 | int16_t data_len; /* number of bytes in target below */ |
| 142 | struct sockaddr address; /* IPv4 or IPv6, network format */ |
Olivier Houchard | a8c6db8 | 2017-07-06 18:46:47 +0200 | [diff] [blame] | 143 | char target[DNS_MAX_NAME_SIZE]; /* Response data: SRV or CNAME type target */ |
| 144 | time_t last_seen; /* When was the answer was last seen */ |
Baptiste Assmann | 5748f73 | 2015-07-21 15:36:24 +0200 | [diff] [blame] | 145 | }; |
| 146 | |
| 147 | struct dns_response_packet { |
| 148 | struct dns_header header; |
| 149 | struct list query_list; |
| 150 | struct list answer_list; |
| 151 | /* authority and additional_information ignored for now */ |
| 152 | }; |
| 153 | |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 154 | /* |
| 155 | * resolvers section and parameters. It is linked to the name servers |
| 156 | * servers points to it. |
| 157 | * current resolution are stored in a FIFO list. |
| 158 | */ |
| 159 | struct dns_resolvers { |
| 160 | struct list list; /* resolvers list */ |
| 161 | char *id; /* resolvers unique identifier */ |
| 162 | struct { |
| 163 | const char *file; /* file where the section appears */ |
| 164 | int line; /* line where the section appears */ |
| 165 | } conf; /* config information */ |
| 166 | struct list nameserver_list; /* dns server list */ |
Baptiste Assmann | 2af08fe | 2017-08-14 00:13:01 +0200 | [diff] [blame] | 167 | unsigned int accepted_payload_size; /* maximum payload size we accept for responses */ |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 168 | int count_nameservers; /* total number of nameservers in a resolvers section */ |
| 169 | int resolve_retries; /* number of retries before giving up */ |
| 170 | struct { /* time to: */ |
| 171 | int retry; /* wait for a response before retrying */ |
| 172 | } timeout; |
| 173 | struct { /* time to hold current data when */ |
| 174 | int valid; /* a response is valid */ |
Baptiste Assmann | 987e16d | 2016-11-02 22:23:31 +0100 | [diff] [blame] | 175 | int nx; /* a response doesn't exist */ |
| 176 | int timeout; /* no answer was delivered */ |
| 177 | int refused; /* dns server refused to answer */ |
| 178 | int other; /* other dns response errors */ |
Olivier Houchard | a8c6db8 | 2017-07-06 18:46:47 +0200 | [diff] [blame] | 179 | int obsolete; /* an answer hasn't been seen */ |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 180 | } hold; |
| 181 | struct task *t; /* timeout management */ |
Baptiste Assmann | 201c07f | 2017-05-22 15:17:15 +0200 | [diff] [blame] | 182 | int resolution_pool_size; /* size of the resolution pool associated to this resolvers section */ |
| 183 | struct { |
| 184 | struct list pool; /* resolution pool dedicated to this resolvers section */ |
| 185 | struct list wait; /* resolutions managed to this resolvers section */ |
| 186 | struct list curr; /* current running resolutions */ |
| 187 | } resolution; |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 188 | struct eb_root query_ids; /* tree to quickly lookup/retrieve query ids currently in use */ |
| 189 | /* used by each nameserver, but stored in resolvers since there must */ |
| 190 | /* be a unique relation between an eb_root and an eb_node (resolution) */ |
| 191 | }; |
| 192 | |
| 193 | /* |
| 194 | * structure describing a name server used during name resolution. |
| 195 | * A name server belongs to a resolvers section. |
| 196 | */ |
| 197 | struct dns_nameserver { |
| 198 | struct list list; /* nameserver chained list */ |
| 199 | char *id; /* nameserver unique identifier */ |
| 200 | struct { |
| 201 | const char *file; /* file where the section appears */ |
| 202 | int line; /* line where the section appears */ |
| 203 | } conf; /* config information */ |
| 204 | struct dns_resolvers *resolvers; |
| 205 | struct dgram_conn *dgram; /* transport layer */ |
| 206 | struct sockaddr_storage addr; /* IP address */ |
| 207 | struct { /* numbers relted to this name server: */ |
| 208 | long int sent; /* - queries sent */ |
| 209 | long int valid; /* - valid response */ |
| 210 | long int update; /* - valid response used to update server's IP */ |
| 211 | long int cname; /* - CNAME response requiring new resolution */ |
| 212 | long int cname_error; /* - error when resolving CNAMEs */ |
| 213 | long int any_err; /* - void response (usually because ANY qtype) */ |
| 214 | long int nx; /* - NX response */ |
| 215 | long int timeout; /* - queries which reached timeout */ |
| 216 | long int refused; /* - queries refused */ |
| 217 | long int other; /* - other type of response */ |
| 218 | long int invalid; /* - malformed DNS response */ |
| 219 | long int too_big; /* - too big response */ |
| 220 | long int outdated; /* - outdated response (server slower than the other ones) */ |
Baptiste Assmann | 6cdea93 | 2015-09-02 21:56:05 +0200 | [diff] [blame] | 221 | long int truncated; /* - truncated response */ |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 222 | } counters; |
| 223 | }; |
| 224 | |
Thierry Fournier | ada3484 | 2016-02-17 21:25:09 +0100 | [diff] [blame] | 225 | struct dns_options { |
| 226 | int family_prio; /* which IP family should the resolver use when both are returned */ |
Thierry Fournier | ac88cfe | 2016-02-17 22:05:30 +0100 | [diff] [blame] | 227 | struct { |
| 228 | int family; |
| 229 | union { |
| 230 | struct in_addr in4; |
| 231 | struct in6_addr in6; |
| 232 | } addr; |
| 233 | union { |
| 234 | struct in_addr in4; |
| 235 | struct in6_addr in6; |
| 236 | } mask; |
| 237 | } pref_net[SRV_MAX_PREF_NET]; |
| 238 | int pref_net_nb; /* The number of registered prefered networks. */ |
Thierry Fournier | ada3484 | 2016-02-17 21:25:09 +0100 | [diff] [blame] | 239 | }; |
| 240 | |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 241 | /* |
| 242 | * resolution structure associated to single server and used to manage name resolution for |
| 243 | * this server. |
| 244 | * The only link between the resolution and a nameserver is through the query_id. |
| 245 | */ |
| 246 | struct dns_resolution { |
| 247 | struct list list; /* resolution list */ |
Baptiste Assmann | 201c07f | 2017-05-22 15:17:15 +0200 | [diff] [blame] | 248 | struct { |
| 249 | struct list wait; /* list of standby requesters for this resolution */ |
| 250 | struct list curr; /* list of requesters currently active on this resolution */ |
| 251 | } requester; |
Baptiste Assmann | 729c901 | 2017-05-22 15:13:10 +0200 | [diff] [blame] | 252 | int (*requester_cb)(struct dns_resolution *, struct dns_nameserver *); |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 253 | /* requester callback for valid response */ |
| 254 | int (*requester_error_cb)(struct dns_resolution *, int); |
| 255 | /* requester callback, for error management */ |
Baptiste Assmann | 201c07f | 2017-05-22 15:17:15 +0200 | [diff] [blame] | 256 | int uuid; /* unique id (used for debugging purpose) */ |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 257 | char *hostname_dn; /* server hostname in domain name label format */ |
| 258 | int hostname_dn_len; /* server domain name label len */ |
Baptiste Assmann | 189363e | 2015-09-03 10:55:20 +0200 | [diff] [blame] | 259 | unsigned int last_resolution; /* time of the lastest valid resolution */ |
| 260 | unsigned int last_sent_packet; /* time of the latest DNS packet sent */ |
| 261 | unsigned int last_status_change; /* time of the latest DNS resolution status change */ |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 262 | int query_id; /* DNS query ID dedicated for this resolution */ |
| 263 | struct eb32_node qid; /* ebtree query id */ |
Andrew Hayworth | e6a4a32 | 2015-10-19 22:29:51 +0000 | [diff] [blame] | 264 | int query_type; |
| 265 | /* query type to send. By default DNS_RTYPE_A or DNS_RTYPE_AAAA depending on resolver_family_priority */ |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 266 | int status; /* status of the resolution being processed RSLV_STATUS_* */ |
| 267 | int step; /* */ |
| 268 | int try; /* current resolution try */ |
| 269 | int try_cname; /* number of CNAME requests sent */ |
| 270 | int nb_responses; /* count number of responses received */ |
Baptiste Assmann | fa4a663 | 2017-05-04 09:05:00 +0200 | [diff] [blame] | 271 | unsigned long long revision; /* updated for each update */ |
Baptiste Assmann | 729c901 | 2017-05-22 15:13:10 +0200 | [diff] [blame] | 272 | struct dns_response_packet response; /* structure hosting the DNS response */ |
| 273 | struct dns_query_item response_query_records[DNS_MAX_QUERY_RECORDS]; /* <response> query records */ |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 274 | }; |
| 275 | |
Baptiste Assmann | 201c07f | 2017-05-22 15:17:15 +0200 | [diff] [blame] | 276 | /* |
| 277 | * structure used to describe the owner of a DNS resolution. |
| 278 | */ |
| 279 | struct dns_requester { |
| 280 | struct list list; /* requester list */ |
| 281 | enum obj_type *requester; /* pointer to the requester */ |
| 282 | int prefered_query_type; /* prefered query type */ |
| 283 | int (*requester_cb)(struct dns_requester *, struct dns_nameserver *); |
| 284 | /* requester callback for valid response */ |
| 285 | int (*requester_error_cb)(struct dns_requester *, int); |
| 286 | /* requester callback, for error management */ |
| 287 | }; |
| 288 | |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 289 | /* last resolution status code */ |
| 290 | enum { |
| 291 | RSLV_STATUS_NONE = 0, /* no resolution occured yet */ |
| 292 | RSLV_STATUS_VALID, /* no error */ |
| 293 | RSLV_STATUS_INVALID, /* invalid responses */ |
| 294 | RSLV_STATUS_ERROR, /* error */ |
| 295 | RSLV_STATUS_NX, /* NXDOMAIN */ |
| 296 | RSLV_STATUS_REFUSED, /* server refused our query */ |
| 297 | RSLV_STATUS_TIMEOUT, /* no response from DNS servers */ |
| 298 | RSLV_STATUS_OTHER, /* other errors */ |
| 299 | }; |
| 300 | |
| 301 | /* current resolution step */ |
| 302 | enum { |
| 303 | RSLV_STEP_NONE = 0, /* nothing happening currently */ |
| 304 | RSLV_STEP_RUNNING, /* resolution is running */ |
| 305 | }; |
| 306 | |
| 307 | /* return codes after analyzing a DNS response */ |
| 308 | enum { |
| 309 | DNS_RESP_VALID = 0, /* valid response */ |
| 310 | DNS_RESP_INVALID, /* invalid response (various type of errors can trigger it) */ |
| 311 | DNS_RESP_ERROR, /* DNS error code */ |
| 312 | DNS_RESP_NX_DOMAIN, /* resolution unsuccessful */ |
| 313 | DNS_RESP_REFUSED, /* DNS server refused to answer */ |
| 314 | DNS_RESP_ANCOUNT_ZERO, /* no answers in the response */ |
| 315 | DNS_RESP_WRONG_NAME, /* response does not match query name */ |
| 316 | DNS_RESP_CNAME_ERROR, /* error when resolving a CNAME in an atomic response */ |
| 317 | DNS_RESP_TIMEOUT, /* DNS server has not answered in time */ |
Baptiste Assmann | 0df5d96 | 2015-09-02 21:58:32 +0200 | [diff] [blame] | 318 | DNS_RESP_TRUNCATED, /* DNS response is truncated */ |
Baptiste Assmann | 96972bc | 2015-09-09 00:46:58 +0200 | [diff] [blame] | 319 | DNS_RESP_NO_EXPECTED_RECORD, /* No expected records were found in the response */ |
Baptiste Assmann | c1ce5f3 | 2016-05-14 11:26:22 +0200 | [diff] [blame] | 320 | DNS_RESP_QUERY_COUNT_ERROR, /* we did not get the expected number of queries in the response */ |
Baptiste Assmann | 4274637 | 2017-05-03 12:12:02 +0200 | [diff] [blame] | 321 | DNS_RESP_INTERNAL, /* internal resolver error */ |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 322 | }; |
| 323 | |
| 324 | /* return codes after searching an IP in a DNS response buffer, using a family preference */ |
| 325 | enum { |
| 326 | DNS_UPD_NO = 1, /* provided IP was found and preference is matched |
| 327 | * OR provided IP found and preference is not matched, but no IP |
| 328 | * matching preference was found */ |
| 329 | DNS_UPD_SRVIP_NOT_FOUND, /* provided IP not found |
| 330 | * OR provided IP found and preference is not match and an IP |
| 331 | * matching preference was found */ |
| 332 | DNS_UPD_CNAME, /* CNAME without any IP provided in the response */ |
| 333 | DNS_UPD_NAME_ERROR, /* name in the response did not match the query */ |
Baptiste Assmann | 0453a1d | 2015-09-09 00:51:08 +0200 | [diff] [blame] | 334 | DNS_UPD_NO_IP_FOUND, /* no IP could be found in the response */ |
Olivier Houchard | a8c6db8 | 2017-07-06 18:46:47 +0200 | [diff] [blame] | 335 | DNS_UPD_OBSOLETE_IP, /* The server IP was obsolete, and no other IP was found */ |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 336 | }; |
| 337 | |
Olivier Houchard | 8da5f98 | 2017-08-04 18:35:36 +0200 | [diff] [blame] | 338 | struct dns_srvrq { |
| 339 | enum obj_type obj_type; /* object type == OBJ_TYPE_SRVRQ */ |
| 340 | struct dns_resolvers *resolvers; /* pointer to the resolvers structure used for this server template */ |
| 341 | |
| 342 | struct dns_resolution *resolution; /* server name resolution */ |
| 343 | |
| 344 | struct proxy *proxy; /* associated proxy */ |
| 345 | char *name; |
| 346 | char *hostname_dn; /* server hostname in Domain Name format */ |
| 347 | int hostname_dn_len; /* string length of the server hostname in Domain Name format */ |
| 348 | struct dns_requester *dns_requester; /* used to link to its DNS resolution */ |
| 349 | int inter; /* time in ms */ |
| 350 | struct list list; /* Next SRV RQ for the same proxy */ |
| 351 | }; |
| 352 | |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 353 | #endif /* _TYPES_DNS_H */ |