aboutsummaryrefslogtreecommitdiffstats
path: root/packet-bootp.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2000-05-19 02:16:17 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2000-05-19 02:16:17 +0000
commit82de27099dad3d14ff2a7f1a0ac12f874e94cbff (patch)
tree272977ddf89996f16c8c14a88a840654588424e3 /packet-bootp.c
parent568af9a05d52d2de8f1bfcab7ef37acceb246d58 (diff)
Mark DHCP packets as DHCP, and add boot.dhcp flag.
From Paul Ionescu <ipaul@romsys.ro> svn path=/trunk/; revision=1977
Diffstat (limited to 'packet-bootp.c')
-rw-r--r--packet-bootp.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/packet-bootp.c b/packet-bootp.c
index bb0c6da5b5..43f9f01322 100644
--- a/packet-bootp.c
+++ b/packet-bootp.c
@@ -2,7 +2,7 @@
* Routines for BOOTP/DHCP packet disassembly
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-bootp.c,v 1.31 2000/05/11 08:15:00 gram Exp $
+ * $Id: packet-bootp.c,v 1.32 2000/05/19 02:16:17 gram Exp $
*
* The information used comes from:
* RFC 2132: DHCP Options and BOOTP Vendor Extensions
@@ -57,10 +57,13 @@ static int hf_bootp_hw_addr = -1;
static int hf_bootp_server = -1;
static int hf_bootp_file = -1;
static int hf_bootp_cookie = -1;
+static int hf_bootp_dhcp = -1;
static guint ett_bootp = -1;
static guint ett_bootp_option = -1;
+static char * is_dhcp ;
+
#define UDP_PORT_BOOTPS 67
enum field_type { none, ipv4, string, toggle, yes_no, special, opaque,
@@ -299,6 +302,7 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
}
proto_tree_add_text(bp_tree, NullTVB, voff, 3, "Option %d: %s = DHCP %s",
code, text, opt53_text[i]);
+ is_dhcp = (char *) opt53_text[i];
break;
/* Parameter Request List */
@@ -562,6 +566,8 @@ dissect_bootp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
int voff, eoff; /* vender offset, end offset */
guint32 ip_addr;
+ is_dhcp = NULL;
+
if (check_col(fd, COL_PROTOCOL))
col_add_str(fd, COL_PROTOCOL, "BOOTP");
@@ -670,6 +676,13 @@ dissect_bootp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
while (voff < eoff) {
voff += bootp_option(pd, bp_tree, voff, eoff);
}
+ if (is_dhcp != NULL ) {
+ if (check_col(fd, COL_PROTOCOL))
+ col_add_str(fd, COL_PROTOCOL, "DHCP");
+ if (check_col(fd, COL_INFO))
+ col_add_fstr(fd, COL_INFO, "DHCP %-8s - Trans. ID 0x%x", is_dhcp, pntohl(&pd[offset+4]) );
+ proto_tree_add_item_hidden(bp_tree, hf_bootp_dhcp, NullTVB, 0, 0, 1);
+ }
}
}
@@ -677,6 +690,10 @@ void
proto_register_bootp(void)
{
static hf_register_info hf[] = {
+ { &hf_bootp_dhcp,
+ { "Frame is DHCP", "bootp.dhcp", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
+ "" }},
+
{ &hf_bootp_type,
{ "Message type", "bootp.type", FT_UINT8, BASE_NONE, NULL, 0x0,
"" }},