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-lge_monitor.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-lge_monitor.c')
-rw-r--r-- | epan/dissectors/packet-lge_monitor.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/epan/dissectors/packet-lge_monitor.c b/epan/dissectors/packet-lge_monitor.c index 67f40aae3a..418a7a9356 100644 --- a/epan/dissectors/packet-lge_monitor.c +++ b/epan/dissectors/packet-lge_monitor.c @@ -39,10 +39,11 @@ static int proto_lge_monitor = -1; static int hf_lge_monitor_dir = -1; static int hf_lge_monitor_prot = -1; static int hf_lge_monitor_length = -1; +static int hf_lge_monitor_data = -1; /* Initialize the subtree pointers */ static int ett_lge_monitor = -1; - +static int ett_lge_header = -1; static guint LGEMonitorUDPPort = 0; static dissector_handle_t mtp3_handle, m3ua_handle, sccp_handle, sctp_handle; @@ -70,6 +71,7 @@ dissect_lge_monitor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) int offset = 0; guint32 lge_monitor_proto_id; tvbuff_t* next_tvb = NULL; + proto_tree* header_tree; /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; @@ -81,14 +83,14 @@ dissect_lge_monitor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ti = proto_tree_add_item(tree, proto_lge_monitor, tvb, 0, LGEMON_PROTO_HEADER_LENGTH, ENC_NA); lge_monitor_tree = proto_item_add_subtree(ti, ett_lge_monitor); - proto_tree_add_text(lge_monitor_tree, tvb, offset, LGEMON_PROTO_HEADER_LENGTH, "LGE Monitor PDU"); - proto_tree_add_item(lge_monitor_tree, hf_lge_monitor_dir, tvb, offset, 4, ENC_BIG_ENDIAN); - offset = offset +4; + header_tree = proto_tree_add_subtree(lge_monitor_tree, tvb, offset, LGEMON_PROTO_HEADER_LENGTH, ett_lge_header, NULL, "LGE Monitor PDU"); + proto_tree_add_item(header_tree, hf_lge_monitor_dir, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; lge_monitor_proto_id = tvb_get_ntohl(tvb,offset); - proto_tree_add_item(lge_monitor_tree, hf_lge_monitor_prot, tvb, offset, 4, ENC_BIG_ENDIAN); - offset = offset +4; - proto_tree_add_item(lge_monitor_tree, hf_lge_monitor_length, tvb, offset, 4, ENC_BIG_ENDIAN); - offset = offset +4; + proto_tree_add_item(header_tree, hf_lge_monitor_prot, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + proto_tree_add_item(header_tree, hf_lge_monitor_length, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; next_tvb = tvb_new_subset_remaining(tvb, offset); @@ -106,7 +108,7 @@ dissect_lge_monitor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) call_dissector(m3ua_handle, next_tvb, pinfo, tree); return; default: - proto_tree_add_text(lge_monitor_tree, tvb, offset, -1, "LGE Monitor data"); + proto_tree_add_item(lge_monitor_tree, hf_lge_monitor_data, tvb, offset, -1, ENC_NA); break; } return; @@ -164,11 +166,17 @@ proto_register_lge_monitor(void) FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_lge_monitor_data, + { "LGE Monitor data", "lge_monitor.monitor_data", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_lge_monitor, + &ett_lge_header }; /* Register the protocol name and description */ |