summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-04-16 14:50:30 -0700
committerGuy Harris <guy@alum.mit.edu>2017-04-16 21:51:03 +0000
commitd28d537391cab21362a471c514b36158d87ea62a (patch)
tree2472f769debbdd8b4048412a085bff8ef389a3e9 /plugins
parent5d7bd7ca2615bd9c86acf43affdd83fbcfabaa78 (diff)
downloadwireshark-d28d537391cab21362a471c514b36158d87ea62a.tar.gz
No need for this to be a global variable.
Make it local to mate_tree(), and pass it to mate_pdu_tree(). Change-Id: I489683614b4d65aec3ddd94ce2c9077180e769ca Reviewed-on: https://code.wireshark.org/review/21149 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mate/packet-mate.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/plugins/mate/packet-mate.c b/plugins/mate/packet-mate.c
index 65f08209fb..5dddc58580 100644
--- a/plugins/mate/packet-mate.c
+++ b/plugins/mate/packet-mate.c
@@ -51,8 +51,6 @@ static expert_field ei_mate_undefined_attribute = EI_INIT;
static const gchar* pref_mate_config_filename = "";
static const gchar* current_mate_config_filename = NULL;
-static proto_item *mate_i = NULL;
-
static dissector_handle_t mate_handle;
static void
@@ -261,7 +259,7 @@ mate_gop_tree(proto_tree* tree, packet_info *pinfo, tvbuff_t *tvb, mate_gop* gop
static void
-mate_pdu_tree(mate_pdu *pdu, packet_info *pinfo, tvbuff_t *tvb, proto_tree* tree)
+mate_pdu_tree(mate_pdu *pdu, packet_info *pinfo, tvbuff_t *tvb, proto_item *item, proto_tree* tree)
{
proto_item *pdu_item;
proto_tree *pdu_tree;
@@ -269,16 +267,16 @@ mate_pdu_tree(mate_pdu *pdu, packet_info *pinfo, tvbuff_t *tvb, proto_tree* tree
if ( ! pdu ) return;
if (pdu->gop && pdu->gop->gog) {
- proto_item_append_text(mate_i," %s:%d->%s:%d->%s:%d",
+ proto_item_append_text(item," %s:%d->%s:%d->%s:%d",
pdu->cfg->name,pdu->id,
pdu->gop->cfg->name,pdu->gop->id,
pdu->gop->gog->cfg->name,pdu->gop->gog->id);
} else if (pdu->gop) {
- proto_item_append_text(mate_i," %s:%d->%s:%d",
+ proto_item_append_text(item," %s:%d->%s:%d",
pdu->cfg->name,pdu->id,
pdu->gop->cfg->name,pdu->gop->id);
} else {
- proto_item_append_text(mate_i," %s:%d",pdu->cfg->name,pdu->id);
+ proto_item_append_text(item," %s:%d",pdu->cfg->name,pdu->id);
}
pdu_item = proto_tree_add_uint(tree,pdu->cfg->hfid,tvb,0,0,pdu->id);
@@ -302,6 +300,7 @@ static int
mate_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
mate_pdu* pdus;
+ proto_item *mate_i;
proto_tree *mate_t;
/* If there is no MATE configuration, don't claim the packet */
@@ -318,7 +317,7 @@ mate_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
for ( ; pdus; pdus = pdus->next_in_frame) {
mate_i = proto_tree_add_protocol_format(tree,mc->hfid_mate,tvb,0,0,"MATE");
mate_t = proto_item_add_subtree(mate_i, mc->ett_root);
- mate_pdu_tree(pdus,pinfo,tvb,mate_t);
+ mate_pdu_tree(pdus,pinfo,tvb,mate_i,mate_t);
}
}
return tvb_captured_length(tvb);