diff options
author | Michael Mann <mmann78@netscape.net> | 2014-11-01 16:55:25 -0400 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-11-02 15:42:28 +0000 |
commit | ba008bf746843b11b98a18b957637431249d5132 (patch) | |
tree | 8f1fb2dbbf2d3b89f1a1eee33de3e9bd92ca72dd /epan/dissectors/packet-ldp.c | |
parent | f19c70c952e40bb2ec15b2cfa1e1df90919d02a0 (diff) |
Eliminate proto_tree_add_text from several dissectors.
Change-Id: I6d3125f15d268edd47ef74dd655eb86cb25ee52d
Reviewed-on: https://code.wireshark.org/review/5047
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: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-ldp.c')
-rw-r--r-- | epan/dissectors/packet-ldp.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/epan/dissectors/packet-ldp.c b/epan/dissectors/packet-ldp.c index b0f213d8e2..52d8c0fbf8 100644 --- a/epan/dissectors/packet-ldp.c +++ b/epan/dissectors/packet-ldp.c @@ -307,6 +307,11 @@ static int hf_ldp_tlv_must_be_zero = -1; static int hf_ldp_tlv_tunnel_id = -1; static int hf_ldp_tlv_ext_tunnel_id = -1; static int hf_ldp_tlv_inv_length = -1; +static int hf_ldp_returned_pdu_data = -1; +static int hf_ldp_returned_message_parameters = -1; +static int hf_ldp_data = -1; +static int hf_ldp_unknown_data = -1; + static int ett_ldp = -1; static int ett_ldp_header = -1; @@ -1536,7 +1541,7 @@ dissect_tlv_returned_pdu(tvbuff_t *tvb, packet_info *pinfo, guint offset, proto_ if ( rem > 0 ) { /*XXX - dissect returned pdu data*/ - proto_tree_add_text(val_tree, tvb, offset, rem, "Returned PDU Data"); + proto_tree_add_item(val_tree, hf_ldp_returned_pdu_data, tvb, offset, rem, ENC_NA); } } @@ -1584,7 +1589,7 @@ dissect_tlv_returned_message(tvbuff_t *tvb, packet_info *pinfo, guint offset, pr if ( rem > 0 ) { /*XXX - dissect returned msg parameters*/ - proto_tree_add_text(val_tree, tvb, offset, rem, "Returned Message Parameters"); + proto_tree_add_item(val_tree, hf_ldp_returned_message_parameters, tvb, offset, rem, ENC_NA); } } @@ -2584,7 +2589,7 @@ dissect_tlv(tvbuff_t *tvb, packet_info *pinfo, guint offset, proto_tree *tree, i else { proto_tree_add_item(tlv_tree, hf_ldp_tlv_vendor_id, tvb,offset + 4, 4, ENC_BIG_ENDIAN); if( length > 4 ) /*have data*/ - proto_tree_add_text(tlv_tree, tvb, offset + 8, length-4,"Data"); + proto_tree_add_item(tlv_tree, hf_ldp_data, tvb, offset + 8, length-4, ENC_NA); } break; @@ -2596,7 +2601,7 @@ dissect_tlv(tvbuff_t *tvb, packet_info *pinfo, guint offset, proto_tree *tree, i else { proto_tree_add_item(tlv_tree, hf_ldp_tlv_experiment_id, tvb,offset + 4, 4, ENC_BIG_ENDIAN); if( length > 4 ) /*have data*/ - proto_tree_add_text(tlv_tree, tvb, offset + 8, length-4,"Data"); + proto_tree_add_item(tlv_tree, hf_ldp_data, tvb, offset + 8, length-4, ENC_NA); } break; @@ -3065,7 +3070,7 @@ dissect_subtlv_interface_parameters(tvbuff_t *tvb, guint offset, proto_tree *tre break; default: /* unknown */ proto_item_append_text(ti," unknown"); - proto_tree_add_text(vcintparam_tree,tvb, offset+2, (intparam_len -2), "Unknown data"); + proto_tree_add_item(vcintparam_tree, hf_ldp_unknown_data, tvb, offset+2, (intparam_len -2), ENC_NA); break; } @@ -4223,6 +4228,22 @@ proto_register_ldp(void) { &hf_ldp_tlv_inv_length, { "Invalid length", "ldp.msg.tlv.invalid.length", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + + { &hf_ldp_returned_pdu_data, + { "Returned PDU Data", "ldp.returned_pdu_data", FT_BYTES, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + + { &hf_ldp_returned_message_parameters, + { "Returned Message Parameters", "ldp.returned_message_parameters", FT_BYTES, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + + { &hf_ldp_data, + { "Data", "ldp.data", FT_BYTES, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + + { &hf_ldp_unknown_data, + { "Unknown Data", "ldp.unknown_data", FT_BYTES, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { |