Skip to content

Commit

Permalink
Updated print-bootp.c with corrected options for TZ and added option …
Browse files Browse the repository at this point in the history
…for MUDURL.

Updated print-dhcpv6.c to process TZ options as well as MUDURL.
  • Loading branch information
Eliot Lear committed Dec 8, 2016
1 parent 4abe278 commit 3caf684
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
11 changes: 7 additions & 4 deletions print-bootp.c
Expand Up @@ -212,15 +212,17 @@ 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)
#define TAG_URL ((uint8_t) 114)
#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
Expand Down Expand Up @@ -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 */
Expand Down
14 changes: 14 additions & 0 deletions print-dhcp6.c
Expand Up @@ -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" },
Expand Down Expand Up @@ -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 }
};

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3caf684

Please sign in to comment.