MAJOR: dns: Refactor the DNS code

This is a huge patch with many changes, all about the DNS. Initially, the idea
was to update the DNS part to ease the threads support integration. But quickly,
I started to refactor some parts. And after several iterations, it was
impossible for me to commit the different parts atomically. So, instead of
adding tens of patches, often reworking the same parts, it was easier to merge
all my changes in a uniq patch. Here are all changes made on the DNS.

First, the DNS initialization has been refactored. The DNS configuration parsing
remains untouched, in cfgparse.c. But all checks have been moved in a post-check
callback. In the function dns_finalize_config, for each resolvers, the
nameservers configuration is tested and the task used to manage DNS resolutions
is created. The links between the backend's servers and the resolvers are also
created at this step. Here no connection are kept alive. So there is no needs
anymore to reopen them after HAProxy fork. Connections used to send DNS queries
will be opened on demand.

Then, the way DNS requesters are linked to a DNS resolution has been
reworked. The resolution used by a requester is now referenced into the
dns_requester structure and the resolution pointers in server and dns_srvrq
structures have been removed. wait and curr list of requesters, for a DNS
resolution, have been replaced by a uniq list. And Finally, the way a requester
is removed from a DNS resolution has been simplified. Now everything is done in
dns_unlink_resolution.

srv_set_fqdn function has been simplified. Now, there is only 1 way to set the
server's FQDN, independently it is done by the CLI or when a SRV record is
resolved.

The static DNS resolutions pool has been replaced by a dynamoc pool. The part
has been modified by Baptiste Assmann.

The way the DNS resolutions are triggered by the task or by a health-check has
been totally refactored. Now, all timeouts are respected. Especially
hold.valid. The default frequency to wake up a resolvers is now configurable
using "timeout resolve" parameter.

Now, as documented, as long as invalid repsonses are received, we really wait
all name servers responses before retrying.

As far as possible, resources allocated during DNS configuration parsing are
releases when HAProxy is shutdown.

Beside all these changes, the code has been cleaned to ease code review and the
doc has been updated.
diff --git a/include/types/dns.h b/include/types/dns.h
index 06e014c..1c68551 100644
--- a/include/types/dns.h
+++ b/include/types/dns.h
@@ -22,21 +22,32 @@
 #ifndef _TYPES_DNS_H
 #define _TYPES_DNS_H
 
+#include <eb32tree.h>
+
+#include <common/mini-clist.h>
+
+#include <types/connection.h>
+#include <types/obj_type.h>
+#include <types/proto_udp.h>
+#include <types/proxy.h>
+#include <types/server.h>
+#include <types/task.h>
+
 /*DNS maximum values */
 /*
  * Maximum issued from RFC:
  *  RFC 1035: https://www.ietf.org/rfc/rfc1035.txt chapter 2.3.4
  *  RFC 2671: http://tools.ietf.org/html/rfc2671
  */
-#define DNS_MAX_LABEL_SIZE	63
-#define DNS_MAX_NAME_SIZE	255
-#define DNS_MAX_UDP_MESSAGE	8192
+#define DNS_MAX_LABEL_SIZE   63
+#define DNS_MAX_NAME_SIZE    255
+#define DNS_MAX_UDP_MESSAGE  8192
 
 /* DNS minimun record size: 1 char + 1 NULL + type + class */
-#define DNS_MIN_RECORD_SIZE	( 1 + 1 + 2 + 2 )
+#define DNS_MIN_RECORD_SIZE  (1 + 1 + 2 + 2)
 
 /* DNS smallest fqdn 'a.gl' size */
-# define DNS_SMALLEST_FQDN_SIZE	4
+# define DNS_SMALLEST_FQDN_SIZE 4
 
 /* maximum number of query records in a DNS response
  * For now, we allow only one */
@@ -52,29 +63,29 @@
 #define DNS_ANALYZE_BUFFER_SIZE DNS_MAX_UDP_MESSAGE + DNS_MAX_NAME_SIZE
 
 /* DNS error messages */
-#define DNS_TOO_LONG_FQDN	"hostname too long"
-#define DNS_LABEL_TOO_LONG	"one label too long"
-#define DNS_INVALID_CHARACTER	"found an invalid character"
+#define DNS_TOO_LONG_FQDN       "hostname too long"
+#define DNS_LABEL_TOO_LONG      "one label too long"
+#define DNS_INVALID_CHARACTER   "found an invalid character"
 
 /* dns query class */
-#define DNS_RCLASS_IN		1	/* internet class */
+#define DNS_RCLASS_IN           1      /* internet class */
 
 /* dns record types (non exhaustive list) */
-#define DNS_RTYPE_A		1	/* IPv4 address */
-#define DNS_RTYPE_CNAME		5	/* canonical name */
-#define DNS_RTYPE_AAAA		28	/* IPv6 address */
-#define DNS_RTYPE_SRV		33	/* SRV record */
-#define DNS_RTYPE_OPT		41	/* OPT */
-#define DNS_RTYPE_ANY		255	/* all records */
+#define DNS_RTYPE_A             1       /* IPv4 address */
+#define DNS_RTYPE_CNAME         5       /* canonical name */
+#define DNS_RTYPE_AAAA          28      /* IPv6 address */
+#define DNS_RTYPE_SRV           33      /* SRV record */
+#define DNS_RTYPE_OPT           41      /* OPT */
+#define DNS_RTYPE_ANY           255     /* all records */
 
 /* dns rcode values */
-#define DNS_RCODE_NO_ERROR	0	/* no error */
-#define DNS_RCODE_NX_DOMAIN	3	/* non existent domain */
-#define DNS_RCODE_REFUSED	5	/* query refused */
+#define DNS_RCODE_NO_ERROR      0       /* no error */
+#define DNS_RCODE_NX_DOMAIN     3       /* non existent domain */
+#define DNS_RCODE_REFUSED       5       /* query refused */
 
 /* dns flags masks */
-#define DNS_FLAG_TRUNCATED	0x0200	/* mask for truncated flag */
-#define DNS_FLAG_REPLYCODE	0x000F	/* mask for reply code */
+#define DNS_FLAG_TRUNCATED      0x0200  /* mask for truncated flag */
+#define DNS_FLAG_REPLYCODE      0x000F  /* mask for reply code */
 
 /* max number of network preference entries are avalaible from the
  * configuration file.
@@ -82,10 +93,7 @@
 #define SRV_MAX_PREF_NET 5
 
 /* DNS header size */
-#define DNS_HEADER_SIZE		((int)sizeof(struct dns_header))
-
-/* DNS resolution pool size, per resolvers section */
-#define DNS_DEFAULT_RESOLUTION_POOL_SIZE	64
+#define DNS_HEADER_SIZE  ((int)sizeof(struct dns_header))
 
 /* DNS request or response header structure */
 struct dns_header {
@@ -100,254 +108,244 @@
 /* short structure to describe a DNS question */
 /* NOTE: big endian structure */
 struct dns_question {
-	unsigned short	qtype;		/* question type */
-	unsigned short	qclass;		/* query class */
+	unsigned short qtype;   /* question type */
+	unsigned short qclass;  /* query class */
 };
 
 /* NOTE: big endian structure */
 struct dns_query_item {
-	struct list list;
-	char name[DNS_MAX_NAME_SIZE];		/* query name */
-	unsigned short type;			/* question type */
-	unsigned short class;			/* query class */
+	char           name[DNS_MAX_NAME_SIZE]; /* query name */
+	unsigned short type;                    /* question type */
+	unsigned short class;                   /* query class */
+	struct list    list;
 };
 
 /* NOTE: big endian structure */
 struct dns_additional_record {
-	uint8_t name;                           /* domain name, must be 0 (RFC 6891) */
-	uint16_t type;			/* record type DNS_RTYPE_OPT (41) */
-	uint16_t udp_payload_size;	/* maximum size accepted for the response */
-	uint32_t extension;				/* extended rcode and flags, not used for now */
-	uint16_t data_length;		/* data length */
-/* as of today, we don't support yet edns options, that said I already put a placeholder here
- * for this purpose. We may need to define a dns_option_record structure which itself should
- * point to different type of data, based on the extension set (client subnet, tcp keepalive,
- * etc...)*/
-//	struct list options;			/* list of option records */
+	uint8_t  name;             /* domain name, must be 0 (RFC 6891) */
+	uint16_t type;             /* record type DNS_RTYPE_OPT (41) */
+	uint16_t udp_payload_size; /* maximum size accepted for the response */
+	uint32_t extension;        /* extended rcode and flags, not used for now */
+	uint16_t data_length;      /* data length */
+/* as of today, we don't support yet edns options, that said I already put a
+ * placeholder here for this purpose. We may need to define a dns_option_record
+ * structure which itself should point to different type of data, based on the
+ * extension set (client subnet, tcp keepalive, etc...)*/
+//	struct list options;       /* list of option records */
 } __attribute__ ((packed));
 
 /* NOTE: big endian structure */
 struct dns_answer_item {
-	struct list list;
-	char name[DNS_MAX_NAME_SIZE];		/* answer name
-						 * For SRV type, name also includes service
-						 * and protocol value */
-	int16_t type;				/* question type */
-	int16_t class;				/* query class */
-	int32_t ttl;				/* response TTL */
-	int16_t priority;			/* SRV type priority */
-	int16_t weight;				/* SRV type weight */
-	int16_t port;				/* SRV type port */
-	int16_t data_len;			/* number of bytes in target below */
-	struct sockaddr address;		/* IPv4 or IPv6, network format */
-	char target[DNS_MAX_NAME_SIZE];		/* Response data: SRV or CNAME type target */
-	time_t last_seen;			/* When was the answer was last seen */
+	/*For SRV type, name also includes service and protocol value */
+	char            name[DNS_MAX_NAME_SIZE];   /* answer name */
+	int16_t         type;                      /* question type */
+	int16_t         class;                     /* query class */
+	int32_t         ttl;                       /* response TTL */
+	int16_t         priority;                  /* SRV type priority */
+	int16_t         weight;                    /* SRV type weight */
+	int16_t         port;                      /* SRV type port */
+	int16_t         data_len;                  /* number of bytes in target below */
+	struct sockaddr address;                   /* IPv4 or IPv6, network format */
+	char            target[DNS_MAX_NAME_SIZE]; /* Response data: SRV or CNAME type target */
+	time_t          last_seen;                 /* When was the answer was last seen */
+	struct list     list;
 };
 
 struct dns_response_packet {
 	struct dns_header header;
-	struct list query_list;
-	struct list answer_list;
+	struct list       query_list;
+	struct list       answer_list;
 	/* authority and additional_information ignored for now */
 };
 
-/*
- * resolvers section and parameters. It is linked to the name servers
+/* Resolvers section and parameters. It is linked to the name servers
  * servers points to it.
  * current resolution are stored in a FIFO list.
  */
 struct dns_resolvers {
-	struct list list;		/* resolvers list */
-	char *id;			/* resolvers unique identifier */
+	char      *id;                      /* resolvers unique identifier */
 	struct {
-		const char *file;	/* file where the section appears */
-		int line;		/* line where the section appears */
-	} conf;				/* config information */
-	struct list nameserver_list;	/* dns server list */
-	unsigned int accepted_payload_size;	/* maximum payload size we accept for responses */
-	int count_nameservers;			/* total number of nameservers in a resolvers section */
-	int resolve_retries;		/* number of retries before giving up */
-	struct {			/* time to: */
-		int retry;		/*   wait for a response before retrying */
+		const char *file;           /* file where the section appears */
+		int         line;           /* line where the section appears */
+	} conf;                             /* config information */
+	struct list  nameservers;           /* dns server list */
+	unsigned int accepted_payload_size; /* maximum payload size we accept for responses */
+	int          nb_nameservers;        /* total number of active nameservers in a resolvers section */
+	int          resolve_retries;       /* number of retries before giving up */
+	struct {                            /* time to: */
+		int resolve;                /*     wait between 2 queries for the same resolution */
+		int retry;                  /*     wait for a response before retrying */
 	} timeout;
-	struct {			/* time to hold current data when */
-		int valid;		/*   a response is valid */
-		int nx;                 /*   a response doesn't exist */
-		int timeout;            /*   no answer was delivered */
-		int refused;            /*   dns server refused to answer */
-		int other;              /*   other dns response errors */
-		int obsolete;		/*   an answer hasn't been seen */
+	struct {                            /* time to hold current data when */
+		int valid;                  /*     a response is valid */
+		int nx;                     /*     a response doesn't exist */
+		int timeout;                /*     no answer was delivered */
+		int refused;                /*     dns server refused to answer */
+		int other;                  /*     other dns response errors */
+		int obsolete;               /*     an answer hasn't been seen */
 	} hold;
-	struct task *t;			/* timeout management */
-	int resolution_pool_size;	/* size of the resolution pool associated to this resolvers section */
+	struct task *t;                     /* timeout management */
 	struct {
-		struct list pool;	/* resolution pool dedicated to this resolvers section */
-		struct list wait;	/* resolutions managed to this resolvers section */
-		struct list curr;	/* current running resolutions */
-	} resolution;
-	struct eb_root query_ids;	/* tree to quickly lookup/retrieve query ids currently in use */
-					/* used by each nameserver, but stored in resolvers since there must */
-					/* be a unique relation between an eb_root and an eb_node (resolution) */
+		struct list wait;           /* resolutions managed to this resolvers section */
+		struct list curr;           /* current running resolutions */
+	} resolutions;
+	struct eb_root query_ids;           /* tree to quickly lookup/retrieve query ids currently in use
+                                             * used by each nameserver, but stored in resolvers since there must
+                                             * be a unique relation between an eb_root and an eb_node (resolution) */
+	struct list list;                   /* resolvers list */
 };
 
-/*
- * structure describing a name server used during name resolution.
+/* Structure describing a name server used during name resolution.
  * A name server belongs to a resolvers section.
  */
 struct dns_nameserver {
-	struct list list;		/* nameserver chained list */
-	char *id;			/* nameserver unique identifier */
+	char *id;                       /* nameserver unique identifier */
 	struct {
-		const char *file;	/* file where the section appears */
-		int line;		/* line where the section appears */
-	} conf;				/* config information */
-	struct dns_resolvers *resolvers;
-	struct dgram_conn *dgram;		/* transport layer */
-	struct sockaddr_storage addr;	/* IP address */
-	struct {			/* numbers relted to this name server: */
-		long int sent;		/* - queries sent */
-		long int valid;		/* - valid response */
-		long int update;	/* - valid response used to update server's IP */
-		long int cname;		/* - CNAME response requiring new resolution */
-		long int cname_error;	/* - error when resolving CNAMEs */
-		long int any_err;	/* - void response (usually because ANY qtype) */
-		long int nx;		/* - NX response */
-		long int timeout;	/* - queries which reached timeout */
-		long int refused;	/* - queries refused */
-		long int other;		/* - other type of response */
-		long int invalid;	/* - malformed DNS response */
-		long int too_big;	/* - too big response */
-		long int outdated;	/* - outdated response (server slower than the other ones) */
-		long int truncated;	/* - truncated response */
+		const char *file;       /* file where the section appears */
+		int         line;       /* line where the section appears */
+	} conf;                         /* config information */
+
+	struct dns_resolvers   *resolvers;
+	struct dgram_conn      *dgram;  /* transport layer */
+	struct sockaddr_storage addr;   /* IP address */
+
+	struct {                        /* numbers relted to this name server: */
+		long long sent;         /* - queries sent */
+		long long snd_error;    /* - sending errors */
+		long long valid;        /* - valid response */
+		long long update;       /* - valid response used to update server's IP */
+		long long cname;        /* - CNAME response requiring new resolution */
+		long long cname_error;  /* - error when resolving CNAMEs */
+		long long any_err;      /* - void response (usually because ANY qtype) */
+		long long nx;           /* - NX response */
+		long long timeout;      /* - queries which reached timeout */
+		long long refused;      /* - queries refused */
+		long long other;        /* - other type of response */
+		long long invalid;      /* - malformed DNS response */
+		long long too_big;      /* - too big response */
+		long long outdated;     /* - outdated response (server slower than the other ones) */
+		long long truncated;    /* - truncated response */
 	} counters;
+	struct list list;               /* nameserver chained list */
 };
 
 struct dns_options {
-	int family_prio;	/* which IP family should the resolver use when both are returned */
+	int family_prio; /* which IP family should the resolver use when both are returned */
 	struct {
 		int family;
 		union {
-			struct in_addr in4;
+			struct in_addr  in4;
 			struct in6_addr in6;
 		} addr;
 		union {
-			struct in_addr in4;
+			struct in_addr  in4;
 			struct in6_addr in6;
 		} mask;
 	} pref_net[SRV_MAX_PREF_NET];
-	int pref_net_nb;               /* The number of registered prefered networks. */
+	int pref_net_nb; /* The number of registered prefered networks. */
 };
 
-/*
- * resolution structure associated to single server and used to manage name resolution for
- * this server.
- * The only link between the resolution and a nameserver is through the query_id.
+/* Resolution structure associated to single server and used to manage name
+ * resolution for this server.
+ * The only link between the resolution and a nameserver is through the
+ * query_id.
  */
 struct dns_resolution {
-	struct list list;		/* resolution list */
-	struct {
-		struct list wait;	/* list of standby requesters for this resolution */
-		struct list curr;	/* list of requesters currently active on this resolution */
-	} requester;
-	int (*requester_cb)(struct dns_resolution *, struct dns_nameserver *);
-					/* requester callback for valid response */
-	int (*requester_error_cb)(struct dns_resolution *, int);
-					/* requester callback, for error management */
-	int uuid;			/* unique id (used for debugging purpose) */
-	char *hostname_dn;		/* server hostname in domain name label format */
-	int hostname_dn_len;		/* server domain name label len */
-	unsigned int last_resolution;	/* time of the lastest valid resolution */
-	unsigned int last_sent_packet;	/* time of the latest DNS packet sent */
-	unsigned int last_status_change;	/* time of the latest DNS resolution status change */
-	int query_id;			/* DNS query ID dedicated for this resolution */
-	struct eb32_node qid;		/* ebtree query id */
-	int query_type;
-		/* query type to send. By default DNS_RTYPE_A or DNS_RTYPE_AAAA depending on resolver_family_priority */
-	int status;			/* status of the resolution being processed RSLV_STATUS_* */
-	int step;			/* */
-	int try;			/* current resolution try */
-	int try_cname;			/* number of CNAME requests sent */
-	int nb_responses;		/* count number of responses received */
-	unsigned long long revision;    /* updated for each update */
-	struct dns_response_packet response;	/* structure hosting the DNS response */
-	struct dns_query_item response_query_records[DNS_MAX_QUERY_RECORDS];		/* <response> query records */
+	struct dns_resolvers *resolvers;           /* pointer to the resolvers structure owning the resolution */
+	struct list           requesters;          /* list of requesters using this resolution */
+	int                   uuid;                /* unique id (used for debugging purpose) */
+	char                 *hostname_dn;         /* server hostname in domain name label format */
+	int                   hostname_dn_len;     /* server domain name label len */
+	unsigned int          last_resolution;     /* time of the last resolution */
+	unsigned int          last_query;          /* time of the last query sent */
+	unsigned int          last_valid;          /* time of the last valid response */
+	int                   query_id;            /* DNS query ID dedicated for this resolution */
+	struct eb32_node      qid;                 /* ebtree query id */
+	int                   prefered_query_type; /* prefered query type */
+	int                   query_type;          /* current query type  */
+	int                   status;              /* status of the resolution being processed RSLV_STATUS_* */
+	int                   step;                /* RSLV_STEP_* */
+	int                   try;                 /* current resolution try */
+	int                   nb_queries;          /* count number of queries sent */
+	int                   nb_responses;        /* count number of responses received */
+
+	struct dns_response_packet response; /* structure hosting the DNS response */
+	struct dns_query_item response_query_records[DNS_MAX_QUERY_RECORDS]; /* <response> query records */
+
+	struct list list; /* resolution list */
 };
 
-/*
- * structure used to describe the owner of a DNS resolution.
- */
+/* Structure used to describe the owner of a DNS resolution. */
 struct dns_requester {
-	struct list list;		/* requester list */
-	enum obj_type *requester;	/* pointer to the requester */
-	int prefered_query_type;	/* prefered query type */
-	int (*requester_cb)(struct dns_requester *, struct dns_nameserver *);
-					/* requester callback for valid response */
-	int (*requester_error_cb)(struct dns_requester *, int);
-					/* requester callback, for error management */
+	enum obj_type         *owner;       /* pointer to the owner (server or dns_srvrq) */
+	struct dns_resolution *resolution;  /* pointer to the owned DNS resolution */
+
+	int (*requester_cb)(struct dns_requester *, struct dns_nameserver *); /* requester callback for valid response */
+	int (*requester_error_cb)(struct dns_requester *, int);               /* requester callback, for error management */
+
+	struct list list; /* requester list */
 };
 
-/* last resolution status code */
+/* Last resolution status code */
 enum {
-	RSLV_STATUS_NONE	= 0,	/* no resolution occured yet */
-	RSLV_STATUS_VALID,		/* no error */
-	RSLV_STATUS_INVALID,		/* invalid responses */
-	RSLV_STATUS_ERROR,		/* error */
-	RSLV_STATUS_NX,			/* NXDOMAIN */
-	RSLV_STATUS_REFUSED,		/* server refused our query */
-	RSLV_STATUS_TIMEOUT,		/* no response from DNS servers */
-	RSLV_STATUS_OTHER,		/* other errors */
+	RSLV_STATUS_NONE = 0,  /* no resolution occured yet */
+	RSLV_STATUS_VALID,     /* no error */
+	RSLV_STATUS_INVALID,   /* invalid responses */
+	RSLV_STATUS_ERROR,     /* error */
+	RSLV_STATUS_NX,        /* NXDOMAIN */
+	RSLV_STATUS_REFUSED,   /* server refused our query */
+	RSLV_STATUS_TIMEOUT,   /* no response from DNS servers */
+	RSLV_STATUS_OTHER,     /* other errors */
 };
 
-/* current resolution step */
+/* Current resolution step */
 enum {
-	RSLV_STEP_NONE		= 0,	/* nothing happening currently */
-	RSLV_STEP_RUNNING,		/* resolution is running */
+	RSLV_STEP_NONE = 0,    /* nothing happening currently */
+	RSLV_STEP_RUNNING,     /* resolution is running */
 };
 
-/* return codes after analyzing a DNS response */
+/* Return codes after analyzing a DNS response */
 enum {
-	DNS_RESP_VALID		= 0,	/* valid response */
-	DNS_RESP_INVALID,		/* invalid response (various type of errors can trigger it) */
-	DNS_RESP_ERROR,			/* DNS error code */
-	DNS_RESP_NX_DOMAIN,		/* resolution unsuccessful */
-	DNS_RESP_REFUSED,		/* DNS server refused to answer */
-	DNS_RESP_ANCOUNT_ZERO,		/* no answers in the response */
-	DNS_RESP_WRONG_NAME,		/* response does not match query name */
-	DNS_RESP_CNAME_ERROR,		/* error when resolving a CNAME in an atomic response */
-	DNS_RESP_TIMEOUT,		/* DNS server has not answered in time */
-	DNS_RESP_TRUNCATED,		/* DNS response is truncated */
-	DNS_RESP_NO_EXPECTED_RECORD,	/* No expected records were found in the response */
-	DNS_RESP_QUERY_COUNT_ERROR,	/* we did not get the expected number of queries in the response */
-	DNS_RESP_INTERNAL,		/* internal resolver error */
+	DNS_RESP_VALID = 0,          /* valid response */
+	DNS_RESP_INVALID,            /* invalid response (various type of errors can trigger it) */
+	DNS_RESP_ERROR,              /* DNS error code */
+	DNS_RESP_NX_DOMAIN,          /* resolution unsuccessful */
+	DNS_RESP_REFUSED,            /* DNS server refused to answer */
+	DNS_RESP_ANCOUNT_ZERO,       /* no answers in the response */
+	DNS_RESP_WRONG_NAME,         /* response does not match query name */
+	DNS_RESP_CNAME_ERROR,        /* error when resolving a CNAME in an atomic response */
+	DNS_RESP_TIMEOUT,            /* DNS server has not answered in time */
+	DNS_RESP_TRUNCATED,          /* DNS response is truncated */
+	DNS_RESP_NO_EXPECTED_RECORD, /* No expected records were found in the response */
+        DNS_RESP_QUERY_COUNT_ERROR,  /* we did not get the expected number of queries in the response */
+        DNS_RESP_INTERNAL,           /* internal resolver error */
 };
 
-/* return codes after searching an IP in a DNS response buffer, using a family preference */
+/* Return codes after searching an IP in a DNS response buffer, using a family
+ * preference
+ */
 enum {
-	DNS_UPD_NO 		= 1,	/* provided IP was found and preference is matched
-					 * OR provided IP found and preference is not matched, but no IP
-					 *    matching preference was found */
-	DNS_UPD_SRVIP_NOT_FOUND,	/* provided IP not found
-					 * OR provided IP found and preference is not match and an IP
-					 *    matching preference was found */
-	DNS_UPD_CNAME,			/* CNAME without any IP provided in the response */
-	DNS_UPD_NAME_ERROR,		/* name in the response did not match the query */
-	DNS_UPD_NO_IP_FOUND,		/* no IP could be found in the response */
-	DNS_UPD_OBSOLETE_IP,		/* The server IP was obsolete, and no other IP was found */
+	DNS_UPD_NO = 1,           /* provided IP was found and preference is matched
+                                   * OR provided IP found and preference is not matched, but no IP
+                                   * matching preference was found */
+	DNS_UPD_SRVIP_NOT_FOUND,  /* provided IP not found
+                                   * OR provided IP found and preference is not match and an IP
+                                   * matching preference was found */
+	DNS_UPD_CNAME,            /* CNAME without any IP provided in the response */
+	DNS_UPD_NAME_ERROR,       /* name in the response did not match the query */
+	DNS_UPD_NO_IP_FOUND,      /* no IP could be found in the response */
+	DNS_UPD_OBSOLETE_IP,      /* The server IP was obsolete, and no other IP was found */
 };
 
 struct dns_srvrq {
-	enum obj_type obj_type;			/* object type == OBJ_TYPE_SRVRQ */
-	struct dns_resolvers *resolvers;	/* pointer to the resolvers structure used for this server template */
-
-	struct dns_resolution *resolution;	/* server name resolution */
-
-	struct proxy *proxy;			/* associated proxy */
-	char *name;
-	char *hostname_dn;			/* server hostname in Domain Name format */
-	int hostname_dn_len;			/* string length of the server hostname in Domain Name format */
-	struct dns_requester *dns_requester;	/* used to link to its DNS resolution */
-	int inter;				/* time in ms */
-	struct list list;			/* Next SRV RQ for the same proxy */
+	enum obj_type         obj_type;         /* object type == OBJ_TYPE_SRVRQ */
+	struct dns_resolvers *resolvers;        /* pointer to the resolvers structure used for this server template */
+	struct proxy         *proxy;            /* associated proxy */
+	char                 *name;
+	char                 *hostname_dn;      /* server hostname in Domain Name format */
+	int                   hostname_dn_len;  /* string length of the server hostname in Domain Name format */
+	struct dns_requester *dns_requester;    /* used to link to its DNS resolution */
+	struct list list;                       /* Next SRV RQ for the same proxy */
 };
 
 #endif /* _TYPES_DNS_H */