]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: dns: new bitmasks to use against DNS flags
authorBaptiste Assmann <bedis9@gmail.com>
Wed, 2 Sep 2015 19:52:37 +0000 (21:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 8 Sep 2015 10:14:03 +0000 (12:14 +0200)
Current DNS client code implementation doesn't take care of response
flags setup by the server.
This patch introduces a couple of bitmasks one can use to retrieve the
truncated flag and the reply code available in the 2-bytes flag field.

include/types/dns.h

index d0a835d9b34cd1cdd0614bea0646e3ae487ec10d..589bb5dfd9661ef8c2862a65a5f56d895869f1a1 100644 (file)
 #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 */
+
 /* DNS request or response header structure */
 struct dns_header {
        unsigned short  id:16;          /* identifier */