]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Updated print-bootp.c with corrected options for TZ and added option for MUDURL.
authorEliot Lear <[email protected]>
Thu, 8 Dec 2016 13:18:24 +0000 (14:18 +0100)
committerEliot Lear <[email protected]>
Thu, 8 Dec 2016 13:18:24 +0000 (14:18 +0100)
Updated print-dhcpv6.c to process TZ options as well as MUDURL.

print-bootp.c
print-dhcp6.c

index d16bd9db854d96bf378b6df9c85aff3d3a469738..d6be1d5b631a509f6067adce944713850d076b4e 100644 (file)
@@ -212,8 +212,9 @@ struct bootp {
 #define        TAG_CLIENT_GUID         ((uint8_t)  97)
 #define        TAG_LDAP_URL            ((uint8_t)  95)
 #define        TAG_6OVER4              ((uint8_t)  96)
-#define        TAG_PRINTER_NAME        ((uint8_t) 100)
-#define        TAG_MDHCP_SERVER        ((uint8_t) 101)
+/* RFC 4833, TZ codes */
+#define        TAG_TZ_PCODE            ((uint8_t) 100)
+#define        TAG_TZ_TCODE            ((uint8_t) 101)
 #define        TAG_IPX_COMPAT          ((uint8_t) 110)
 #define        TAG_NETINFO_PARENT      ((uint8_t) 112)
 #define        TAG_NETINFO_PARENT_TAG  ((uint8_t) 113)
@@ -221,6 +222,7 @@ struct bootp {
 #define        TAG_FAILOVER            ((uint8_t) 115)
 #define        TAG_EXTENDED_REQUEST    ((uint8_t) 126)
 #define        TAG_EXTENDED_OPTION     ((uint8_t) 127)
+#define TAG_MUDURL              ((uint8_t) 161)
 
 /* DHCP Message types (values for TAG_DHCP_MESSAGE option) */
 #define DHCPDISCOVER   1
@@ -519,13 +521,14 @@ static const struct tok tag2str[] = {
        { TAG_CLIENT_GUID,      "bGUID" },      /* XXX 'b' */
        { TAG_LDAP_URL,         "aLDAP" },
        { TAG_6OVER4,           "i6o4" },
-       { TAG_PRINTER_NAME,     "aPRTR" },
-       { TAG_MDHCP_SERVER,     "bMDHCP" },     /* XXX 'b' */
+       { TAG_TZ_PCODE,         "aPOSIX-TZ" },
+       { TAG_TZ_TCODE,         "aTZ-Name" },
        { TAG_IPX_COMPAT,       "bIPX" },       /* XXX 'b' */
        { TAG_NETINFO_PARENT,   "iNI" },
        { TAG_NETINFO_PARENT_TAG, "aNITAG" },
        { TAG_URL,              "aURL" },
        { TAG_FAILOVER,         "bFAIL" },      /* XXX 'b' */
+       { TAG_MUDURL,           "aMUD-URL" },
        { 0, NULL }
 };
 /* 2-byte extended tags */
index 05ca6c4fde00c580b1661a1a0aa9360e2b142ffb..e4a9f759604a7813d8e5a8229d9933cc535dd7e9 100644 (file)
@@ -194,6 +194,7 @@ struct dhcp6_relay {
 #  define DH6OPT_NTP_SUBOPTION_MC_ADDR 2
 #  define DH6OPT_NTP_SUBOPTION_SRV_FQDN 3
 #define DH6OPT_AFTR_NAME 64
+#define DH6OPT_MUDURL 112
 
 static const struct tok dh6opt_str[] = {
        { DH6OPT_CLIENTID,           "client-ID"            },
@@ -244,6 +245,7 @@ static const struct tok dh6opt_str[] = {
        { DH6OPT_LQ_CLIENT_LINK,     "LQ-client-link"       },
        { DH6OPT_NTP_SERVER,         "NTP-server"           },
        { DH6OPT_AFTR_NAME,          "AFTR-Name"            },
+       { DH6OPT_MUDURL,             "MUD-URL"              },
        { 0, NULL }
 };
 
@@ -740,6 +742,18 @@ dhcp6opt_print(netdissect_options *ndo,
                        }
                        ND_PRINT((ndo, ")"));
                        break;
+               case DH6OPT_NEW_POSIX_TIMEZONE: /* all three of these options */
+               case DH6OPT_NEW_TZDB_TIMEZONE:  /* are encoded similarly */
+               case DH6OPT_MUDURL:             /* although GMT might not work */
+                       if ( optlen < 5 ) {
+                         ND_PRINT((ndo," ?)"));
+                         break;
+                       }
+                       tp=(u_char *) (dh6o + 1);
+                       ND_PRINT((ndo,"=%.*s)",(int) optlen,tp));
+                       break;
+                   
+
                default:
                        ND_PRINT((ndo, ")"));
                        break;