diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-04-16 18:18:11 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-04-17 01:18:43 +0000 |
commit | dae108837fc1d9c48eefbcc7feeff607c26e0a4e (patch) | |
tree | aa2901323887c6e2b6ffaa1700ea72447527a832 /plugins/mate/mate_runtime.c | |
parent | 3f912df8754972a6db06eda36564a300d5a5e350 (diff) | |
download | wireshark-dae108837fc1d9c48eefbcc7feeff607c26e0a4e.tar.gz |
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/mate_runtime.c')
-rw-r--r-- | plugins/mate/mate_runtime.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/plugins/mate/mate_runtime.c b/plugins/mate/mate_runtime.c index 1e4232c3c9..82c7af26ea 100644 --- a/plugins/mate/mate_runtime.c +++ b/plugins/mate/mate_runtime.c @@ -46,7 +46,6 @@ typedef struct _gogkey { static mate_runtime_data* rd = NULL; -static mate_config* mc = NULL; static int zero = 5; @@ -131,11 +130,11 @@ static void destroy_gogs_in_cfg(gpointer k _U_, gpointer v, gpointer p _U_) { c->last_id = 0; } -void initialize_mate_runtime(void) { +void initialize_mate_runtime(mate_config* mc) { dbg_print (dbg,5,dbg_facility,"initialize_mate: entering"); - if (( mc = mate_cfg() )) { + if (mc) { if (rd == NULL ) { rd = (mate_runtime_data *)g_malloc(sizeof(mate_runtime_data)); } else { @@ -301,7 +300,7 @@ static void gog_remove_keys (mate_gog* gog) { } -static void reanalyze_gop(mate_gop* gop) { +static void reanalyze_gop(mate_config* mc, mate_gop* gop) { LoAL* gog_keys = NULL; AVPL* curr_gogkey = NULL; mate_cfg_gop* gop_cfg = NULL; @@ -372,7 +371,7 @@ static void reanalyze_gop(mate_gop* gop) { } } -static void analyze_gop(mate_gop* gop) { +static void analyze_gop(mate_config* mc, mate_gop* gop) { mate_cfg_gog* cfg = NULL; LoAL* gog_keys = NULL; AVPL* curr_gogkey = NULL; @@ -453,13 +452,13 @@ static void analyze_gop(mate_gop* gop) { if (gogkey_match) delete_avpl(gogkey_match,TRUE); - reanalyze_gop(gop); + reanalyze_gop(mc, gop); } } -static void analyze_pdu(mate_pdu* pdu) { +static void analyze_pdu(mate_config* mc, mate_pdu* pdu) { /* TODO: return a g_boolean to tell we've destroyed the pdu when the pdu is unnassigned destroy the unassigned pdu @@ -643,9 +642,9 @@ static void analyze_pdu(mate_pdu* pdu) { gop->last_n = gop->avpl->len; if (gop->gog) { - reanalyze_gop(gop); + reanalyze_gop(mc, gop); } else { - analyze_gop(gop); + analyze_gop(mc, gop); } } else { @@ -833,7 +832,7 @@ static mate_pdu* new_pdu(mate_cfg_pdu* cfg, guint32 framenum, field_info* proto, } -extern void mate_analyze_frame(packet_info *pinfo, proto_tree* tree) { +extern void mate_analyze_frame(mate_config *mc, packet_info *pinfo, proto_tree* tree) { mate_cfg_pdu* cfg; GPtrArray* protos; field_info* proto; @@ -882,7 +881,7 @@ extern void mate_analyze_frame(packet_info *pinfo, proto_tree* tree) { } } - analyze_pdu(pdu); + analyze_pdu(mc, pdu); if ( ! pdu->gop && cfg->drop_unassigned) { delete_avpl(pdu->avpl,TRUE); |