diff options
author | Michael Mann <mmann78@netscape.net> | 2014-09-06 08:44:23 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-09-09 01:25:36 +0000 |
commit | 80407a46df538011c1dcea96714c401a4078a697 (patch) | |
tree | f62b063004ba6a8946c552c6a3180cb8f417cd83 /epan/dissectors/packet-sndcp.c | |
parent | 124923b02f3113a1f2aeae205417a18828671850 (diff) |
Eliminate proto_tree_add_text from some of the dissectors.
Other minor cleanups while in the area.
Change-Id: I99096ade9c69a4c148962d45bb6b0bd775040ba1
Reviewed-on: https://code.wireshark.org/review/4020
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-sndcp.c')
-rw-r--r-- | epan/dissectors/packet-sndcp.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/epan/dissectors/packet-sndcp.c b/epan/dissectors/packet-sndcp.c index ac8c9b0b85..bc793de974 100644 --- a/epan/dissectors/packet-sndcp.c +++ b/epan/dissectors/packet-sndcp.c @@ -52,6 +52,7 @@ static int hf_sndcp_pcomp = -1; static int hf_sndcp_segment = -1; static int hf_sndcp_npdu1 = -1; static int hf_sndcp_npdu2 = -1; +static int hf_sndcp_payload = -1; /* These fields are used when reassembling N-PDU fragments */ @@ -350,9 +351,7 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_append_fstr(pinfo->cinfo, COL_INFO, " (N-PDU payload reassembled in packet %u)", fd_npdu->reassembled_in); - if (tree) { - proto_tree_add_text(sndcp_tree, tvb, offset, -1, "Payload"); - } + proto_tree_add_item(sndcp_tree, hf_sndcp_payload, tvb, offset, -1, ENC_NA); } } else { /* Not reassembled yet, or not reassembled at all @@ -362,9 +361,7 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) else col_append_str(pinfo->cinfo, COL_INFO, " (Unreassembled fragment)"); - if (tree) { - proto_tree_add_text(sndcp_tree, tvb, offset, -1, "Payload"); - } + proto_tree_add_item(sndcp_tree, hf_sndcp_payload, tvb, offset, -1, ENC_NA); } /* Now reset fragmentation information in pinfo */ @@ -461,6 +458,13 @@ proto_register_sndcp(void) NULL, HFILL } }, + { &hf_sndcp_payload, + { "Payload", + "sndcp.payload", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL + } + }, /* Fragment fields */ @@ -533,7 +537,7 @@ proto_register_sndcp(void) FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } - } + }, }; /* Setup protocol subtree array */ |