*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.87 2007-08-21 21:59:12 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.89 2008-04-22 09:45:08 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "ether.h"
#include "bootp.h"
+static const char tstr[] = " [|bootp]";
+
static void rfc1048_print(const u_char *);
static void cmu_print(const u_char *);
static char *client_fqdn_flags(u_int flags);
-static char tstr[] = " [|bootp]";
-
static const struct tok bootp_flag_values[] = {
{ 0x8000, "Broadcast" },
{ 0, NULL}
* B - on/off (8 bits)
* $ - special (explicit code to handle)
*/
-static struct tok tag2str[] = {
+static const struct tok tag2str[] = {
/* RFC1048 tags */
{ TAG_PAD, " PAD" },
{ TAG_SUBNET_MASK, "iSubnet-Mask" }, /* subnet mask (RFC950) */
{ 0, NULL }
};
/* 2-byte extended tags */
-static struct tok xtag2str[] = {
+static const struct tok xtag2str[] = {
{ 0, NULL }
};
/* DHCP "options overload" types */
-static struct tok oo2str[] = {
+static const struct tok oo2str[] = {
{ 1, "file" },
{ 2, "sname" },
{ 3, "file+sname" },
};
/* NETBIOS over TCP/IP node type options */
-static struct tok nbo2str[] = {
+static const struct tok nbo2str[] = {
{ 0x1, "b-node" },
{ 0x2, "p-node" },
{ 0x4, "m-node" },
};
/* ARP Hardware types, for Client-ID option */
-static struct tok arp2str[] = {
+static const struct tok arp2str[] = {
{ 0x1, "ether" },
{ 0x6, "ieee802" },
{ 0x7, "arcnet" },
{ 0, NULL }
};
-static struct tok dhcp_msg_values[] = {
+static const struct tok dhcp_msg_values[] = {
{ DHCPDISCOVER, "Discover" },
{ DHCPOFFER, "Offer" },
{ DHCPREQUEST, "Request" },
{ 0, NULL }
};
-#define AGENT_SUBOPTION_CIRCUIT_ID 1
-static struct tok agent_suboption_values[] = {
+#define AGENT_SUBOPTION_CIRCUIT_ID 1 /* RFC 3046 */
+#define AGENT_SUBOPTION_REMOTE_ID 2 /* RFC 3046 */
+#define AGENT_SUBOPTION_SUBSCRIBER_ID 6 /* RFC 3993 */
+static const struct tok agent_suboption_values[] = {
{ AGENT_SUBOPTION_CIRCUIT_ID, "Circuit-ID" },
+ { AGENT_SUBOPTION_REMOTE_ID, "Remote-ID" },
+ { AGENT_SUBOPTION_SUBSCRIBER_ID, "Subscriber-ID" },
{ 0, NULL }
};
if (len < 1) {
printf("ERROR: option %u len %u < 1 bytes",
TAG_NETBIOS_NODE, len);
- bp += len;
- len = 0;
break;
}
tag = *bp++;
if (len < 1) {
printf("ERROR: option %u len %u < 1 bytes",
TAG_OPT_OVERLOAD, len);
- bp += len;
- len = 0;
break;
}
tag = *bp++;
if (len < 1) {
printf("ERROR: option %u len %u < 1 bytes",
TAG_CLIENT_ID, len);
- bp += len;
- len = 0;
break;
}
type = *bp++;
suboptlen);
switch (subopt) {
- case AGENT_SUBOPTION_CIRCUIT_ID:
- fn_printn(bp, suboptlen, NULL);
- break;
+ case AGENT_SUBOPTION_CIRCUIT_ID: /* fall through */
+ case AGENT_SUBOPTION_REMOTE_ID:
+ case AGENT_SUBOPTION_SUBSCRIBER_ID:
+ fn_printn(bp, suboptlen, NULL);
+ break;
default:
- print_unknown_data(bp, "\n\t\t", suboptlen);
+ print_unknown_data(gndo,bp, "\n\t\t", suboptlen);
}
len -= suboptlen;
case TAG_CLASSLESS_STATIC_RT:
case TAG_CLASSLESS_STA_RT_MS:
- {
+ {
u_int mask_width, significant_octets, i;
/* this option should be at least 5 bytes long */