]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Add support for decoding DNS URI RR (typecode 256, RFC7553) 732/head
authorWang Jian <[email protected]>
Sat, 9 Feb 2019 08:05:17 +0000 (16:05 +0800)
committerWang Jian <[email protected]>
Sat, 13 Apr 2019 08:08:03 +0000 (16:08 +0800)
nameser.h
print-domain.c
tests/TESTLIST
tests/dns-uri.out [new file with mode: 0644]
tests/dns-uri.pcap [new file with mode: 0644]

index d8dbd4db2c9e9f3a0a5e8ed71682f654926dc99b..820458c2ecf0c73861bc9ee12eb4799a196cc3a7 100644 (file)
--- a/nameser.h
+++ b/nameser.h
 #define T_MAILB                253             /* transfer mailbox records */
 #define T_MAILA                254             /* transfer mail agent records */
 #define T_ANY          255             /* wildcard match */
+#define T_URI          256             /* uri records [RFC7553] */
 
 /*
  * Values for class field
index 63c541a81a7de7f08b065a15942f5e0e87d3d962..b8355a905f56db083d009f8bc5eed66323c3e322 100644 (file)
@@ -332,6 +332,7 @@ const struct tok ns_type2str[] = {
        { T_MAILB,      "MAILB" },              /* RFC 1035 */
        { T_MAILA,      "MAILA" },              /* RFC 1035 */
        { T_ANY,        "ANY" },
+       { T_URI,        "URI" },                /* RFC 7553 */
        { 0,            NULL }
 };
 
@@ -552,6 +553,14 @@ ns_rprint(netdissect_options *ndo,
                break;
            }
 
+       case T_URI:
+               if (!ND_TTEST_LEN(cp, len))
+                       return(NULL);
+               ND_PRINT(" %u %u ", GET_BE_U_2(cp), GET_BE_U_2(cp + 2));
+               if (nd_printn(ndo, cp + 4, len - 4, ndo->ndo_snapend))
+                       return(NULL);
+               break;
+
        case T_OPT:
                ND_PRINT(" UDPsize=%u", class);
                if (opt_flags & 0x8000)
index 35786eec8ee1bac95eccbda3d3ff8c449ac49c76..55e3f38e56e6cfe9037c95a14180433a0cc9f09f 100644 (file)
@@ -669,3 +669,6 @@ dns-badvers dns-badvers.pcap        dns-badvers.out
 
 # LLDP
 lldp-app-priority      lldp-app-priority.pcap  lldp-app-priority.out   -v
+
+# DNS URI RR support tests
+dns-uri                dns-uri.pcap    dns-uri.out
diff --git a/tests/dns-uri.out b/tests/dns-uri.out
new file mode 100644 (file)
index 0000000..232846e
--- /dev/null
@@ -0,0 +1,4 @@
+    1  18:31:55.600983 IP 127.0.0.1.59347 > 127.0.0.1.53: 44845+ [1au] URI? _http.dns.test. (55)
+    2  18:31:55.601140 IP 127.0.0.1.53 > 127.0.0.1.59347: 44845* 1/0/1 URI 10 5 http://www.dns.test:8000 (83)
+    3  18:31:57.245707 IP 127.0.0.1.37251 > 127.0.0.1.53: 25957+ [1au] URI? _ftp.dns.test. (54)
+    4  18:31:57.245858 IP 127.0.0.1.53 > 127.0.0.1.37251: 25957 NXDomain* 0/1/1 (101)
diff --git a/tests/dns-uri.pcap b/tests/dns-uri.pcap
new file mode 100644 (file)
index 0000000..70e8024
Binary files /dev/null and b/tests/dns-uri.pcap differ