]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: dns: new DNS structures to store received packets
authorBaptiste Assmann <bedis9@gmail.com>
Tue, 21 Jul 2015 13:36:24 +0000 (15:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 12 Sep 2016 17:54:11 +0000 (19:54 +0200)
struct dns_query_item: describes a DNS query record

struct dns_answer_item: describes a DNS answer record

struct dns_response_packet: describes a DNS response packet

include/types/dns.h

index 994dec3b341c290cd2606b4fb7fd8b00941cbe46..03ffdc1483c16a317fc5673a57760bcb8256f5f9 100644 (file)
@@ -89,6 +89,36 @@ struct dns_question {
        unsigned short  qclass;         /* query class */
 };
 
+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 */
+};
+
+struct dns_answer_item {
+       struct list list;
+       char *name;                             /* 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;                           /* Response data: SRV or CNAME type target */
+};
+
+struct dns_response_packet {
+       struct dns_header header;
+       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
  * servers points to it.