diff options
author | jmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-02-01 14:53:00 +0000 |
---|---|---|
committer | jmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-02-01 14:53:00 +0000 |
commit | 23f4b31393ebd3a66dba71621922013b91ad710e (patch) | |
tree | b72118721b4b2a11ba91aebda8a8dfe19840ee46 /epan/dissectors/packet-dhcpv6.c | |
parent | 4ab14aad987b8ce080beccb1a50d6c6e960a8773 (diff) |
Bugfix: Hilight the correct range of bytes when dissecting embeeded
dhvpv6 payload.
New feature: Allow minimalistic filtering on dhcpv6 options:
type, length and value (value as hex dump)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31753 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-dhcpv6.c')
-rw-r--r-- | epan/dissectors/packet-dhcpv6.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c index 5de533939c..6b728e65ff 100644 --- a/epan/dissectors/packet-dhcpv6.c +++ b/epan/dissectors/packet-dhcpv6.c @@ -59,6 +59,9 @@ static int hf_fqdn_1 = -1; static int hf_fqdn_2 = -1; static int hf_fqdn_3 = -1; static int hf_fqdn_4 = -1; +static int hf_option_type = -1; +static int hf_option_length = -1; +static int hf_option_value = -1; static gint ett_dhcpv6 = -1; static gint ett_dhcpv6_option = -1; @@ -469,11 +472,13 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, "%s", val_to_str(opttype, opttype_vals, "DHCP option %u")); subtree = proto_item_add_subtree(ti, ett_dhcpv6_option); - proto_tree_add_text(subtree, tvb, off, 2, "option type: %d", opttype); - proto_tree_add_text(subtree, tvb, off + 2, 2, "option length: %d", - optlen); - + proto_tree_add_item(subtree, hf_option_type, tvb, off, 2, FALSE); + proto_tree_add_item(subtree, hf_option_length, tvb, off + 2, 2, FALSE); off += 4; + /* Right now, none of the options can be filtered at, so provide a hex + array for minimalistic filtering */ + proto_tree_add_item(subtree, hf_option_value, tvb, off, optlen, FALSE); + switch (opttype) { case OPTION_CLIENTID: case OPTION_SERVERID: @@ -1194,7 +1199,7 @@ dissect_dhcpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, msgtype = tvb_get_guint8(tvb, off); if (tree) { - ti = proto_tree_add_item(tree, proto_dhcpv6, tvb, 0, -1, FALSE); + ti = proto_tree_add_item(tree, proto_dhcpv6, tvb, off, eoff - off, FALSE); bp_tree = proto_item_add_subtree(ti, ett_dhcpv6); } @@ -1288,7 +1293,13 @@ proto_register_dhcpv6(void) { &hf_fqdn_3, { "O", "dhcpv6.msgtype.o", FT_BOOLEAN, 8, TFS(&fqdn_o), 0x2, NULL, HFILL}}, { &hf_fqdn_4, - { "S", "dhcpv6.msgtype.s", FT_BOOLEAN, 8, TFS(&fqdn_s), 0x1, NULL, HFILL}} + { "S", "dhcpv6.msgtype.s", FT_BOOLEAN, 8, TFS(&fqdn_s), 0x1, NULL, HFILL}}, + { &hf_option_type, + { "Option", "dhcpv6.option.type", FT_UINT16, BASE_DEC, VALS(opttype_vals), 0x0, NULL, HFILL}}, + { &hf_option_length, + { "Length", "dhcpv6.option.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}}, + { &hf_option_value, + { "Value", "dhcpv6.option.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}} }; static gint *ett[] = { |