diff options
author | Michael Mann <mmann78@netscape.net> | 2014-07-31 12:39:40 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-08-03 16:29:16 +0000 |
commit | 3fa5625ea074908d5617111a7edfcf6d95e6108a (patch) | |
tree | 05c5b6f0995c239b28a05ae3f61f3fdf9ff40583 /epan/dissectors/packet-atm.c | |
parent | 7a7a72e15508d5927ced7189e50d17a16a016dad (diff) |
Eliminate proto_tree_add_text from some dissectors.
Change-Id: Ib6024307e85d6c23decf40e9759f549c19ffe136
Reviewed-on: https://code.wireshark.org/review/3318
Petri-Dish: Michael Mann <mmann78@netscape.net>
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-atm.c')
-rw-r--r-- | epan/dissectors/packet-atm.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c index e4ca478f70..96e4b8674b 100644 --- a/epan/dissectors/packet-atm.c +++ b/epan/dissectors/packet-atm.c @@ -43,6 +43,7 @@ void proto_reg_handoff_atm(void); static int proto_atm = -1; static int hf_atm_aal = -1; +static int hf_atm_gfc = -1; static int hf_atm_vpi = -1; static int hf_atm_vci = -1; static int hf_atm_cid = -1; @@ -116,6 +117,7 @@ static int hf_atm_aal_oamcell_type_ad = -1; static int hf_atm_aal_oamcell_type_ft = -1; static int hf_atm_aal_oamcell_func_spec = -1; static int hf_atm_aal_oamcell_crc = -1; +static int hf_atm_padding = -1; static gint ett_atm = -1; static gint ett_atm_lane = -1; @@ -1079,8 +1081,7 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *ti; if (pad_length > 0) { - proto_tree_add_text(atm_tree, tvb, aal5_length, pad_length, - "Padding"); + proto_tree_add_item(atm_tree, hf_atm_padding, tvb, aal5_length, pad_length, ENC_NA); } proto_tree_add_item(atm_tree, hf_atm_aal5_uu, tvb, length - 8, 1, ENC_BIG_ENDIAN); @@ -1167,7 +1168,7 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, else if (pntoh16(octet) == 0x00) { /* assume vc muxed bridged ethernet */ - proto_tree_add_text(tree, tvb, 0, 2, "Pad: 0x0000"); + proto_tree_add_item(tree, hf_atm_padding, tvb, 0, 2, ENC_NA); next_tvb = tvb_new_subset_remaining(tvb, 2); call_dissector(eth_handle, next_tvb, pinfo, tree); } @@ -1622,7 +1623,7 @@ dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * +-+-+-+-+-+-+-+-+ */ octet = tvb_get_guint8(tvb, 0); - proto_tree_add_text(atm_tree, tvb, 0, 1, "GFC: 0x%x", octet >> 4); + proto_tree_add_item(atm_tree, hf_atm_gfc, tvb, 0, 1, ENC_NA); vpi = (octet & 0xF) << 4; octet = tvb_get_guint8(tvb, 1); vpi |= octet >> 4; @@ -1934,7 +1935,9 @@ proto_register_atm(void) { &hf_atm_aal, { "AAL", "atm.aal", FT_UINT8, BASE_DEC, VALS(aal_vals), 0x0, NULL, HFILL }}, - + { &hf_atm_gfc, + { "GFC", "atm.GFC", FT_UINT8, BASE_DEC, NULL, 0xF0, + NULL, HFILL }}, { &hf_atm_vpi, { "VPI", "atm.vpi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, @@ -2139,6 +2142,10 @@ proto_register_atm(void) { &hf_atm_aal_oamcell_crc, { "CRC-10", "atm.aal_oamcell.crc", FT_UINT16, BASE_HEX, NULL, 0x3FF, NULL, HFILL }}, + { &hf_atm_padding, + { "Padding", "atm.padding", FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + }; static gint *ett[] = { |