diff options
author | Michael Mann <mmann78@netscape.net> | 2014-08-13 08:56:22 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-08-14 04:21:05 +0000 |
commit | d68d0e88b4924a610b5cd2fd3a748b00c9bbab1a (patch) | |
tree | f46c04238502faa689c173f1b8420c8d19d3c51e /epan/dissectors/packet-msdp.c | |
parent | f64421df3f230e89e0d83e327926f4c46fbd70dc (diff) |
Eliminate proto_tree_add_text from some dissectors.
Other minor cleanup while in the neighborhood.
Change-Id: If73a029f564219782c313d4154c24c7ce7458b52
Reviewed-on: https://code.wireshark.org/review/3574
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-msdp.c')
-rw-r--r-- | epan/dissectors/packet-msdp.c | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/epan/dissectors/packet-msdp.c b/epan/dissectors/packet-msdp.c index 13726929e5..8c842bcd8f 100644 --- a/epan/dissectors/packet-msdp.c +++ b/epan/dissectors/packet-msdp.c @@ -156,6 +156,10 @@ static int hf_msdp_not_res = -1; static int hf_msdp_not_entry_count = -1; static int hf_msdp_not_sprefix_len = -1; +static int hf_msdp_tlv_contents = -1; +static int hf_msdp_trailing_junk = -1; +static int hf_msdp_unknown_encap = -1; +static int hf_msdp_unknown_data = -1; static gint ett_msdp = -1; static gint ett_msdp_sa_entry = -1; @@ -219,15 +223,14 @@ dissect_msdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; default: if (length > 0) - proto_tree_add_text(msdp_tree, tvb, offset, length, "TLV contents"); + proto_tree_add_item(msdp_tree, hf_msdp_tlv_contents, tvb, offset, length, ENC_NA); offset += length; break; } } if (tvb_length_remaining(tvb, offset) > 0) - proto_tree_add_text(msdp_tree, tvb, offset, - -1, "Trailing junk"); + proto_tree_add_item(msdp_tree, hf_msdp_trailing_junk, tvb, offset, -1, ENC_NA); return; } @@ -409,15 +412,11 @@ static void dissect_msdp_notification(tvbuff_t *tvb, packet_info *pinfo, proto_t } else if (error_sub == 6) { /* No break, causes fall through to next label */ } else if (error_sub == 7) { - proto_tree_add_text(tree, tvb, *offset, tlv_len - 5, - "Packet with unknown encapsulation: %u bytes", - tlv_len - 5); + proto_tree_add_item(tree, hf_msdp_unknown_encap, tvb, *offset, tlv_len - 5, ENC_NA); *offset += tlv_len - 5; break; } else { - proto_tree_add_text(tree, tvb, *offset, tlv_len - 5, - "<Unknown data>: %u bytes", - tlv_len -5); + proto_tree_add_item(tree, hf_msdp_unknown_data, tvb, *offset, tlv_len - 5, ENC_NA); *offset += tlv_len - 5; break; } @@ -439,9 +438,7 @@ static void dissect_msdp_notification(tvbuff_t *tvb, packet_info *pinfo, proto_t break; default: if (tlv_len - 5 > 0) - proto_tree_add_text(tree, tvb, *offset, tlv_len - 5, - "<Unknown data>: %u bytes", - tlv_len -5); + proto_tree_add_item(tree, hf_msdp_unknown_data, tvb, *offset, tlv_len - 5, ENC_NA); *offset += tlv_len - 5; break; } @@ -548,6 +545,26 @@ proto_register_msdp(void) FT_UINT8, BASE_DEC, NULL, 0, "Source prefix length in Notification messages", HFILL } }, + { &hf_msdp_tlv_contents, + { "TLV contents", "msdp.tlv_contents", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_msdp_trailing_junk, + { "Trailing junk", "msdp.trailing_junk", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_msdp_unknown_encap, + { "Packet with unknown encapsulation", "msdp.unknown_encap", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_msdp_unknown_data, + { "Unknown data", "msdp.unknown_data", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL } + }, }; static gint *ett[] = { |