aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mate/packet-mate.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-04-16 18:18:11 -0700
committerGuy Harris <guy@alum.mit.edu>2017-04-17 01:18:43 +0000
commitdae108837fc1d9c48eefbcc7feeff607c26e0a4e (patch)
treeaa2901323887c6e2b6ffaa1700ea72447527a832 /plugins/mate/packet-mate.c
parent3f912df8754972a6db06eda36564a300d5a5e350 (diff)
Make the current MATE config pointer static only to packet-mate.c.
Pass it as an argument to everything else, so only packet-mate.c has the notion of there being *a* configuration, and everything else takes the configuration as an argument. Change-Id: Ia92c1539586d3e71580fd822cf07bd3d79a6f093 Reviewed-on: https://code.wireshark.org/review/21151 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'plugins/mate/packet-mate.c')
-rw-r--r--plugins/mate/packet-mate.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/mate/packet-mate.c b/plugins/mate/packet-mate.c
index 5dddc58580..d14dbdd45c 100644
--- a/plugins/mate/packet-mate.c
+++ b/plugins/mate/packet-mate.c
@@ -311,7 +311,7 @@ mate_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
if ( tree == NULL)
return tvb_captured_length(tvb);
- mate_analyze_frame(pinfo,tree);
+ mate_analyze_frame(mc, pinfo,tree);
if (( pdus = mate_get_pdus(pinfo->num) )) {
for ( ; pdus; pdus = pdus->next_in_frame) {
@@ -330,6 +330,12 @@ mate_packet(void *prs _U_, packet_info* tree _U_, epan_dissect_t *edt _U_, cons
return 0;
}
+static void
+initialize_mate(void)
+{
+ initialize_mate_runtime(mc);
+}
+
extern
void
proto_reg_handoff_mate(void)
@@ -351,7 +357,7 @@ proto_reg_handoff_mate(void)
/* XXX: alignment warnings, what do they mean? */
proto_register_field_array(proto_mate, (hf_register_info*)(void *)mc->hfrs->data, mc->hfrs->len );
proto_register_subtree_array((gint**)(void*)mc->ett->data, mc->ett->len);
- register_init_routine(initialize_mate_runtime);
+ register_init_routine(initialize_mate);
/*
* Set the list of fields we want.
@@ -373,7 +379,7 @@ proto_reg_handoff_mate(void)
return;
}
- initialize_mate_runtime();
+ initialize_mate_runtime(mc);
}
current_mate_config_filename = pref_mate_config_filename;