]> The Tcpdump Group git mirrors - tcpdump/commitdiff
DHCPv6 decoder update (RFC3646, DNS options)
authorfxlb <[email protected]>
Mon, 6 May 2013 15:42:33 +0000 (17:42 +0200)
committerGuy Harris <[email protected]>
Mon, 6 May 2013 23:14:55 +0000 (16:14 -0700)
- Add decoder for option 24 (DOMAIN_LIST)
- Rename option 23 as DNS_SERVERS
- Rename option 24 as DOMAIN_LIST
- In dhcp6opt_print() constify dh6o

print-dhcp6.c
tests/TESTLIST
tests/dhcpv6-domain-list.out [new file with mode: 0644]
tests/dhcpv6-domain-list.pcap [new file with mode: 0644]

index b317eb4eb94ecda9bba03f334030fa46aaa585d5..52f823dfa9b4a64437795c3249efefbf6b8826e7 100644 (file)
@@ -147,8 +147,8 @@ struct dhcp6_relay {
 #define DH6OPT_RECONF_ACCEPT 20
 #define DH6OPT_SIP_SERVER_D 21
 #define DH6OPT_SIP_SERVER_A 22
-#define DH6OPT_DNS 23
-#define DH6OPT_DNSNAME 24
+#define DH6OPT_DNS_SERVERS 23
+#define DH6OPT_DOMAIN_LIST 24
 #define DH6OPT_IA_PD 25
 #define DH6OPT_IA_PD_PREFIX 26
 #define DH6OPT_NIS_SERVERS 27
@@ -235,9 +235,9 @@ dhcp6opt_name(int type)
                return "SIP-servers-domain";
        case DH6OPT_SIP_SERVER_A:
                return "SIP-servers-address";
-       case DH6OPT_DNS:
+       case DH6OPT_DNS_SERVERS:
                return "DNS-server";
-       case DH6OPT_DNSNAME:
+       case DH6OPT_DOMAIN_LIST:
                return "DNS-search-list";
        case DH6OPT_IA_PD:
                return "IA_PD";
@@ -335,7 +335,7 @@ dhcp6stcode(int code)
 static void
 dhcp6opt_print(const u_char *cp, const u_char *ep)
 {
-       struct dhcp6opt *dh6o;
+       const struct dhcp6opt *dh6o;
        const u_char *tp;
        size_t i;
        u_int16_t opttype;
@@ -589,7 +589,7 @@ dhcp6opt_print(const u_char *cp, const u_char *ep)
                        printf(")");
                        break;
                case DH6OPT_SIP_SERVER_A:
-               case DH6OPT_DNS:
+               case DH6OPT_DNS_SERVERS:
                case DH6OPT_SNTP_SERVERS:
                case DH6OPT_NIS_SERVERS:
                case DH6OPT_NISP_SERVERS:
@@ -606,6 +606,7 @@ dhcp6opt_print(const u_char *cp, const u_char *ep)
                        printf(")");
                        break;
                case DH6OPT_SIP_SERVER_D:
+               case DH6OPT_DOMAIN_LIST:
                        tp = (u_char *)(dh6o + 1);
                        while (tp < ep) {
                                putchar(' ');
index 2be2223b576b51cf727403f3373c173209459676..35e2c11b43787a4ab5a9b116835c3563ba0500f8 100644 (file)
@@ -90,6 +90,7 @@ dhcpv6-ia-pd  dhcpv6-ia-pd.pcap       dhcpv6-ia-pd.out        -t -v
 dhcpv6-ia-ta   dhcpv6-ia-ta.pcap       dhcpv6-ia-ta.out        -t -v
 dhcpv6-ntp-server      dhcpv6-ntp-server.pcap  dhcpv6-ntp-server.out   -t -v
 dhcpv6-sip-server-d    dhcpv6-sip-server-d.pcap        dhcpv6-sip-server-d.out -t -v
+dhcpv6-domain-list     dhcpv6-domain-list.pcap dhcpv6-domain-list.out  -t -v
 
 # ZeroMQ/PGM tests
 # ZMTP/1.0 over TCP
diff --git a/tests/dhcpv6-domain-list.out b/tests/dhcpv6-domain-list.out
new file mode 100644 (file)
index 0000000..965f091
--- /dev/null
@@ -0,0 +1 @@
+IP6 (hlim 64, next-header UDP (17) payload length: 101) fe80::20c:29ff:fe9b:a15d.547 > fe80::20c:29ff:fe38:f368.546: [udp sum ok] dhcp6 reply (xid=aa56ce (client-ID hwaddr/time type 1 time 418384703 000c2938f368) (server-ID hwaddr/time type 1 time 418354459 000c299ba153) (DNS-search-list example.com. sales.example.com. eng.example.com.)
diff --git a/tests/dhcpv6-domain-list.pcap b/tests/dhcpv6-domain-list.pcap
new file mode 100644 (file)
index 0000000..b0afeff
Binary files /dev/null and b/tests/dhcpv6-domain-list.pcap differ