]> The Tcpdump Group git mirrors - tcpdump/commitdiff
DHCPv6 decoder update 308/head
authorfxlb <[email protected]>
Mon, 29 Apr 2013 12:32:10 +0000 (14:32 +0200)
committerfxlb <[email protected]>
Mon, 29 Apr 2013 12:33:18 +0000 (14:33 +0200)
- In dhcp6opt_print() constify tp
- Add decoder for option 21 (SIP_SERVER_D - RFC3319)

print-dhcp6.c
tests/TESTLIST
tests/dhcpv6-sip-server-d.out [new file with mode: 0644]
tests/dhcpv6-sip-server-d.pcap [new file with mode: 0644]

index 9bfe6e7028bfa31c893d224ec4c16941f99db0fe..b317eb4eb94ecda9bba03f334030fa46aaa585d5 100644 (file)
@@ -336,7 +336,7 @@ static void
 dhcp6opt_print(const u_char *cp, const u_char *ep)
 {
        struct dhcp6opt *dh6o;
-       u_char *tp;
+       const u_char *tp;
        size_t i;
        u_int16_t opttype;
        size_t optlen;
@@ -605,6 +605,14 @@ dhcp6opt_print(const u_char *cp, const u_char *ep)
                                printf(" %s", ip6addr_string(&tp[i]));
                        printf(")");
                        break;
+               case DH6OPT_SIP_SERVER_D:
+                       tp = (u_char *)(dh6o + 1);
+                       while (tp < ep) {
+                               putchar(' ');
+                               if((tp = ns_nprint(tp, ep)) == NULL)
+                                       goto trunc;
+                       }
+                       break;
                case DH6OPT_STATUS_CODE:
                        if (optlen < 2) {
                                printf(" ?)");
index 5c3034f560f67cdce7bbe1ed231b0f578f6e4fa7..2be2223b576b51cf727403f3373c173209459676 100644 (file)
@@ -89,6 +89,7 @@ dhcpv6-ia-na  dhcpv6-ia-na.pcap       dhcpv6-ia-na.out        -t -v
 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
 
 # ZeroMQ/PGM tests
 # ZMTP/1.0 over TCP
diff --git a/tests/dhcpv6-sip-server-d.out b/tests/dhcpv6-sip-server-d.out
new file mode 100644 (file)
index 0000000..62f8992
--- /dev/null
@@ -0,0 +1 @@
+IP6 (hlim 64, next-header UDP (17) payload length: 114) fe80::20c:29ff:fe9b:a15d.547 > fe80::20c:29ff:fe38:f368.546: [udp sum ok] dhcp6 reply (xid=6890d8 (client-ID hwaddr/time type 1 time 418384703 000c2938f368) (server-ID hwaddr/time type 1 time 418354459 000c299ba153) (SIP-servers-domain sip1.my-domain.net. sip2.example.com. sip3.sub.my-domain.org.)
diff --git a/tests/dhcpv6-sip-server-d.pcap b/tests/dhcpv6-sip-server-d.pcap
new file mode 100644 (file)
index 0000000..7cb2103
Binary files /dev/null and b/tests/dhcpv6-sip-server-d.pcap differ