From 4bf362f86336a147ba07d063d93e9706f0e6930b Mon Sep 17 00:00:00 2001 From: Lars Roland Date: Fri, 28 Jan 2005 13:53:14 +0000 Subject: A new patch for mate from Luis Ontanon: - move mate_packet into packet-mate.c and remove it frome mate.h - supressed some warnings svn path=/trunk/; revision=13190 --- plugins/mate/mate.h | 3 ++- plugins/mate/mate_runtime.c | 12 ++++-------- plugins/mate/packet-mate.c | 17 +++++++++++++---- 3 files changed, 19 insertions(+), 13 deletions(-) (limited to 'plugins') diff --git a/plugins/mate/mate.h b/plugins/mate/mate.h index 62f75976c6..56e660540e 100644 --- a/plugins/mate/mate.h +++ b/plugins/mate/mate.h @@ -307,6 +307,7 @@ struct _mate_item { /* } pdu; */ /* struct _gop { */ + /* membership* gogs; */ mate_gog* gog; /* the gog of a gop */ mate_pdu* pdus; /* pdus that belong to a gop (NULL in gog) */ gboolean released; /* has this gop been released? */ @@ -319,6 +320,7 @@ struct _mate_item { /* } gop; */ /* struct _gog { */ + /* membership* gops; */ mate_gop* gops; /* gops that belong to a gog (NULL in gop) */ int num_of_gops; /* how many gops a gog has? */ int num_of_released_gops; /* how many of them have already been released */ @@ -333,7 +335,6 @@ struct _mate_item { extern void initialize_mate_runtime(void); extern mate_pdu* mate_get_pdus(guint32 framenum); extern void mate_analyze_frame(packet_info *pinfo, proto_tree* tree); -extern int mate_packet(void*, packet_info*, epan_dissect_t*,const void*); /* from mate_setup.c */ extern mate_config* mate_make_config(guint8* filename); diff --git a/plugins/mate/mate_runtime.c b/plugins/mate/mate_runtime.c index cdd0db22d9..298540251e 100644 --- a/plugins/mate/mate_runtime.c +++ b/plugins/mate/mate_runtime.c @@ -732,8 +732,8 @@ static mate_pdu* new_pdu(mate_cfg_pdu* cfg, guint32 framenum, field_info* proto, dbg_print(dbg_pdu,3,dbg_facility,"new_pdu: transport(%i) range %i-%i\n",hfid,range->start,range->end); } else { - /* what to do if we miss a range? */ - g_warning("mate: missed a range"); + /* we missed a range */ + dbg_print(dbg_pdu,6,dbg_facility,"new_pdu: transport(%i) missed\n",hfid); } } @@ -746,10 +746,6 @@ static mate_pdu* new_pdu(mate_cfg_pdu* cfg, guint32 framenum, field_info* proto, return pdu; } -extern int mate_packet(void *prs _U_, packet_info* tree _U_, epan_dissect_t *edt _U_, const void *dummy _U_) { - /* nothing to do yet */ - return 0; -} static void delete_mate_pdu(mate_pdu* pdu) { if (pdu->avpl) delete_avpl(pdu->avpl,TRUE); @@ -774,7 +770,7 @@ extern void mate_analyze_frame(packet_info *pinfo, proto_tree* tree) { cfg = g_ptr_array_index(mc->pducfglist,i); - dbg_print (dbg_pdu,4,dbg_facility,"mate_packet: tryning to extract: %s\n",cfg->name); + dbg_print (dbg_pdu,4,dbg_facility,"mate_analyze_frame: tryning to extract: %s\n",cfg->name); protos = (GPtrArray*) g_hash_table_lookup(tree->tree_data->interesting_hfids,(gpointer) cfg->hfid_proto); if (protos) { @@ -782,7 +778,7 @@ extern void mate_analyze_frame(packet_info *pinfo, proto_tree* tree) { for (j = 0; j < protos->len; j++) { - dbg_print (dbg_pdu,3,dbg_facility,"mate_packet: found matching proto, extracting: %s\n",cfg->name); + dbg_print (dbg_pdu,3,dbg_facility,"mate_analyze_frame: found matching proto, extracting: %s\n",cfg->name); proto = (field_info*) g_ptr_array_index(protos,j); pdu = new_pdu(cfg, pinfo->fd->num, proto, tree->tree_data->interesting_hfids); diff --git a/plugins/mate/packet-mate.c b/plugins/mate/packet-mate.c index 902ad43f28..73dfcf588d 100644 --- a/plugins/mate/packet-mate.c +++ b/plugins/mate/packet-mate.c @@ -52,7 +52,7 @@ void attrs_tree(proto_tree* tree, tvbuff_t *tvb,mate_item* item) { avpl_t = proto_item_add_subtree(avpl_i, item->cfg->ett_attr); for ( c = item->avpl->null.next; c->avp; c = c->next) { - hfi_p = g_hash_table_lookup(item->cfg->my_hfids,c->avp->n); + hfi_p = g_hash_table_lookup(item->cfg->my_hfids,(char*)c->avp->n); if (hfi_p) { proto_tree_add_string(avpl_t,*hfi_p,tvb,0,0,c->avp->v); @@ -121,6 +121,7 @@ void mate_gop_tree(proto_tree* tree, tvbuff_t *tvb, mate_gop* gop) { mate_pdu* gop_pdus; float rel_time; float gop_time; + float pdu_rel_time; gchar* pdu_str; gchar* type_str; guint32 pdu_item; @@ -170,10 +171,12 @@ void mate_gop_tree(proto_tree* tree, tvbuff_t *tvb, mate_gop* gop) { pdu_str = ""; } + pdu_rel_time = gop_pdus->time_in_gop != 0.0 ? gop_pdus->time_in_gop - rel_time : (float) 0.0; + proto_tree_add_uint_format(gop_pdu_tree,gop->cfg->hfid_gop_pdu,tvb,0,0,pdu_item, "%sPDU: %s %i (%f : %f)",pdu_str, type_str, pdu_item, gop_pdus->time_in_gop, - gop_pdus->time_in_gop - rel_time); + pdu_rel_time); rel_time = gop_pdus->time_in_gop; @@ -235,11 +238,16 @@ extern void mate_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { } } +static int mate_packet(void *prs _U_, packet_info* tree _U_, epan_dissect_t *edt _U_, const void *dummy _U_) { + /* nothing to do yet */ + return 0; +} + static void init_mate(void) { GString* tap_error = NULL; tap_error = register_tap_listener("frame", &mate_tap_data, - mc->tap_filter, + (char*) mc->tap_filter, (tap_reset_cb) NULL, mate_packet, (tap_draw_cb) NULL); @@ -269,9 +277,10 @@ proto_reg_handoff_mate(void) } if (!mc) { - mc = mate_make_config(pref_mate_config_filename); + mc = mate_make_config((char*)pref_mate_config_filename); current_mate_config_filename = pref_mate_config_filename; if (mc) { + /* XXX: alignment warnings, what do they mean? */ 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); -- cgit v1.2.3