diff options
author | Lars Roland <Lars.Roland@gmx.net> | 2005-01-10 02:37:19 +0000 |
---|---|---|
committer | Lars Roland <Lars.Roland@gmx.net> | 2005-01-10 02:37:19 +0000 |
commit | 2b88200a3a4179d22db98185557df7f42f6ce96f (patch) | |
tree | e96b9e1470fa509ddf289bed0770e7fb6927d4e3 /plugins/mate/packet-mate.c | |
parent | 2f5e81ccccc8abdefbdee7ec5c03467106d72412 (diff) | |
download | wireshark-2b88200a3a4179d22db98185557df7f42f6ce96f.tar.gz |
One more patch for mate:
- renamed analyze_frame() into mate_analyze_frame().
- prepare mate to be statically linked
- use report_open_failure() , report_read_failure() and
report_failure() in case there's an error while loading the config
- some cleanup in mate_util.c
- some fixes and cleanup in examples and matelib
svn path=/trunk/; revision=13001
Diffstat (limited to 'plugins/mate/packet-mate.c')
-rw-r--r-- | plugins/mate/packet-mate.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/plugins/mate/packet-mate.c b/plugins/mate/packet-mate.c index 8c7a86e7d3..4c965078a4 100644 --- a/plugins/mate/packet-mate.c +++ b/plugins/mate/packet-mate.c @@ -38,6 +38,7 @@ static mate_config* mc = NULL; static int proto_mate = -1; static char* pref_mate_config_filename = ""; +static char* current_mate_config_filename = NULL; static proto_item *mate_i = NULL; @@ -223,7 +224,7 @@ extern void mate_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if ( ! mc || ! tree ) return; - analyze_frame(pinfo,tree); + mate_analyze_frame(pinfo,tree); if (( pdus = mate_get_pdus(pinfo->fd->num) )) { for ( ; pdus; pdus = pdus->next_in_frame) { @@ -261,12 +262,20 @@ proto_reg_handoff_mate(void) { if ( *pref_mate_config_filename != '\0' ) { - mc = mate_make_config(pref_mate_config_filename); + if (current_mate_config_filename) { + report_failure("Mate cannot reconfigure itself.\n" + "for changes to be applied you have to save the preferences and restart ethereal\n"); + return; + } - if (mc) { - proto_register_field_array(proto_mate, (hf_register_info*) mc->hfrs->data, mc->hfrs->len ); - proto_register_subtree_array((gint**) mc->ett->data, mc->ett->len); - register_init_routine(init_mate); + if (!mc) { + mc = mate_make_config(pref_mate_config_filename); + current_mate_config_filename = pref_mate_config_filename; + if (mc) { + proto_register_field_array(proto_mate, (hf_register_info*) mc->hfrs->data, mc->hfrs->len ); + proto_register_subtree_array((gint**) mc->ett->data, mc->ett->len); + register_init_routine(init_mate); + } } } } |