aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mate/mate.h12
-rw-r--r--plugins/mate/mate_runtime.c65
-rw-r--r--plugins/mate/mate_setup.c20
-rw-r--r--plugins/mate/mate_util.c147
-rw-r--r--plugins/mate/mate_util.h22
-rw-r--r--plugins/mate/matelib/isup.mate34
-rw-r--r--plugins/mate/matelib/radius.mate8
-rw-r--r--plugins/mate/moduleinfo.h2
-rw-r--r--plugins/mate/packet-mate.c36
9 files changed, 210 insertions, 136 deletions
diff --git a/plugins/mate/mate.h b/plugins/mate/mate.h
index a6a2d9d3d7..0a4a3665a2 100644
--- a/plugins/mate/mate.h
+++ b/plugins/mate/mate.h
@@ -168,6 +168,7 @@ typedef struct _mate_cfg_item {
avpl_match_mode criterium_match_mode;
AVPL* criterium; /* must match to be created */
int hfid_pdu_rel_time;
+ int hfid_pdu_time_in_gop;
/* gop */
AVPL* start; /* start candidate avpl */
@@ -252,11 +253,7 @@ struct _mate_item {
mate_cfg_item* cfg; /* the type of this item */
AVPL* avpl; /* the attributes of the pdu/gop/gog */
-
- /* these two have different uses in pdu and gop/gog */
- gint start; /* start of the pdu in the tvb / framenum of the start of a gop */
- gint end; /* end of the pdu in the tvb / framenum of the stop of a gop */
-
+
mate_item* next; /* in pdu: next in gop; in gop: next in gog; in gog this doesn't make any sense yet */
/* union _payload { */
@@ -267,14 +264,14 @@ struct _mate_item {
gboolean is_start; /* this is the start pdu for this gop */
gboolean is_stop; /* this is the stop pdu for this gop */
gboolean after_release; /* this pdu comes after the stop */
- float rel_time; /* time since gop start if in gop or start of capture if unassigned */
+ float rel_time; /* time since start of capture */
+ float time_in_gop; /* time since gop start */
mate_pdu* next_in_frame; /* points to the next pdu in this frame */
/* } pdu; */
/* struct _gop { */
mate_gog* gog; /* the gog of a gop */
mate_pdu* pdus; /* pdus that belong to a gop (NULL in gog) */
- float expiration; /* when will it expire once released? */
gboolean released; /* has this gop been released? */
int num_of_pdus; /* how many gops a gog has? */
int num_of_after_release_pdus; /* how many pdus have arrived since it's been released */
@@ -287,6 +284,7 @@ struct _mate_item {
/* struct _gog { */
mate_gop* gops; /* gops that belong to a gog (NULL in gop) */
+ float expiration; /* when will it expire once released? */
int num_of_gops; /* how many gops a gog has? */
int num_of_released_gops; /* how many of them have already been released */
guint last_n; /* the number of attributes the avpl had the last time we checked */
diff --git a/plugins/mate/mate_runtime.c b/plugins/mate/mate_runtime.c
index cbe70c1c2d..10a6dd2f6f 100644
--- a/plugins/mate/mate_runtime.c
+++ b/plugins/mate/mate_runtime.c
@@ -67,13 +67,14 @@ static gboolean destroy_mate_items(gpointer k _U_, gpointer v, gpointer p _U_) {
if (mi->gop_key) g_free(mi->gop_key);
if (mi->gog_keys) g_ptr_array_free (mi->gog_keys,TRUE);
- delete_avpl(mi->avpl,TRUE);
-
+ if (mi->avpl) delete_avpl(mi->avpl,TRUE);
return TRUE;
}
static gboolean destroy_items_in_cfg(gpointer k _U_, gpointer v, gpointer p _U_) {
g_hash_table_foreach_remove(((mate_cfg_item*)v)->items,destroy_mate_items,NULL);
+ ((mate_cfg_item*)v)->last_id = 0;
+ return TRUE;
}
static void delete_mate_runtime_data(mate_runtime_data* rdat) {
@@ -113,11 +114,10 @@ extern void initialize_mate_runtime(void) {
/* this will be called when the mate's dissector is initialized */
dbg_print (dbg,5,dbg_facility,"initialize_mate: entering");
-
dbg_pdu = &(mc->dbg_pdu_lvl);
dbg_gop = &(mc->dbg_gop_lvl);
dbg_gog = &(mc->dbg_gog_lvl);
-
+
} else {
rd = NULL;
}
@@ -131,8 +131,6 @@ static mate_item* new_mate_item(mate_cfg_item* cfg) {
it->id = cfg->last_id;
it->avpl = NULL ;
- it->start = 0 ;
- it->end = 0 ;
it->frame = 0 ;
it->next = NULL ;
it->released = FALSE ;
@@ -150,22 +148,22 @@ static mate_gop* new_gop(mate_cfg_gop* cfg, mate_pdu* pdu, guint8* key) {
dbg_print (dbg_gop,1,dbg_facility,"new_gop: %s: ``%s:%d''",gop->cfg->name,gop->id,key);
- gop->avpl = new_avpl("attributes");
+ gop->avpl = new_avpl(cfg->name);
gop->gog = NULL;
gop->pdus = pdu;
gop->last_pdu = pdu;
gop->gop_key = key;
gop->next = NULL;
- gop->start_time = pdu->rel_time;
+ gop->start_time = rd->now;
gop->release_time = 0.0;
gop->last_time = 0.0;
pdu->gop = gop;
pdu->next = NULL;
pdu->is_start = TRUE;
- pdu->rel_time = 0.0;
-
+ pdu->time_in_gop = 0.0;
+
return gop;
}
@@ -394,14 +392,11 @@ static void analize_pdu(mate_pdu* pdu) {
if (!cfg) return;
-
-
candidate_gop_key_match = cfg->key;
if (! candidate_gop_key_match) return;
- avpl_str = avpl_to_str(candidate_gop_key_match);
- dbg_print (dbg_gop,1,dbg_facility,"analize_pdu: got candidate key: %s\n",avpl_str);
- g_free(avpl_str);
+
+ dbg_print (dbg_gop,3,dbg_facility,"analize_pdu: got candidate key\n");
gopkey_match = new_avpl_exact_match("",pdu->avpl,candidate_gop_key_match, TRUE);
@@ -411,16 +406,12 @@ static void analize_pdu(mate_pdu* pdu) {
candidate_start = cfg->start;
if (candidate_start) {
- avpl_str = avpl_to_str(candidate_start);
- dbg_print (dbg_gop,1,dbg_facility,"analize_pdu: got candidate start: %s\n",avpl_str);
- g_free(avpl_str);
+ dbg_print (dbg_gop,2,dbg_facility,"analize_pdu: got candidate start\n");
is_start = new_avpl_exact_match("",pdu->avpl, candidate_start, FALSE);
}
if (is_start) {
- avpl_str = avpl_to_str(is_start);
- dbg_print (dbg_gop,1,dbg_facility,"analize_pdu: got start match: %s\n",avpl_str);
- g_free(avpl_str);
+ dbg_print (dbg_gop,2,dbg_facility,"analize_pdu: got start match\n");
delete_avpl(is_start,FALSE);
}
@@ -431,13 +422,10 @@ static void analize_pdu(mate_pdu* pdu) {
gop_key = orig_gop_key;
- dbg_print (dbg_gop,1,dbg_facility,"analize_pdu: got gop: %s\n",gop_key);
+ dbg_print (dbg_gop,2,dbg_facility,"analize_pdu: got gop: %s\n",gop_key);
if (is_start) {
if ( gop->released ) {
-
- dbg_print (dbg_gop,1,dbg_facility,"analize_pdu: new gop on released key before key expiration\n");
-
g_hash_table_remove(rd->gops,gop_key);
gop = new_gop(cfg,pdu,gop_key);
g_hash_table_insert(rd->gops,gop_key,gop);
@@ -452,7 +440,8 @@ static void analize_pdu(mate_pdu* pdu) {
if (gop->last_pdu) gop->last_pdu->next = pdu;
gop->last_pdu = pdu;
pdu->next = NULL;
- pdu->rel_time -= gop->start_time;
+ pdu->time_in_gop = rd->now - gop->start_time;
+
if (gop->released) pdu->after_release = TRUE;
} else {
@@ -599,7 +588,6 @@ static mate_pdu* new_pdu(mate_cfg_pdu* cfg, guint32 framenum, field_info* proto,
dbg_print (dbg_pdu,2,dbg_facility,"new_pdu: type=%s framenum=%i\n",cfg->name,framenum);
pdu->avpl = new_avpl(cfg->name);
- pdu->cfg = cfg;
pdu->gop = NULL;
pdu->next_in_frame = NULL;
pdu->next = NULL;
@@ -607,10 +595,9 @@ static mate_pdu* new_pdu(mate_cfg_pdu* cfg, guint32 framenum, field_info* proto,
pdu->is_start = FALSE;
pdu->is_stop = FALSE;
pdu->after_release = FALSE;
- pdu->start = proto->start;
- pdu->end = pdu->start + proto->length;
pdu->frame = framenum;
pdu->rel_time = rd->now;
+ pdu->time_in_gop = -1.0;
data.ranges = g_ptr_array_new();
data.pdu = pdu;
@@ -618,8 +605,8 @@ static mate_pdu* new_pdu(mate_cfg_pdu* cfg, guint32 framenum, field_info* proto,
/* first we create the proto range */
proto_range = g_malloc(sizeof(mate_range));
- proto_range->start = pdu->start;
- proto_range->end = pdu->end;
+ proto_range->start = proto->start;
+ proto_range->end = proto->start + proto->length;
g_ptr_array_add(data.ranges,proto_range);
dbg_print(dbg_pdu,3,dbg_facility,"new_pdu: proto range %u-%u\n",proto_range->start,proto_range->end);
@@ -651,8 +638,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 do I do if I miss a range? */
+ /* what to do if we miss a range? */
+ g_warning("mate: missed a range");
}
}
@@ -667,6 +654,12 @@ static mate_pdu* new_pdu(mate_cfg_pdu* cfg, guint32 framenum, field_info* proto,
extern int mate_packet(void *prs _U_, proto_tree* tree _U_, epan_dissect_t *edt _U_, void *dummy _U_) {
/* nothing to do yet */
+ return 1;
+}
+
+static void delete_mate_pdu(mate_pdu* pdu) {
+ if (pdu->avpl) delete_avpl(pdu->avpl,TRUE);
+ g_mem_chunk_free(rd->mate_items,pdu);
}
extern void analyze_frame(packet_info *pinfo, proto_tree* tree) {
@@ -706,9 +699,9 @@ extern void analyze_frame(packet_info *pinfo, proto_tree* tree) {
delete_avpl(criterium_match,FALSE);
}
- if ( (criterium_match && cfg->criterium->name == mc->reject ) || ( ! criterium_match && cfg->criterium->name == mc->accept )) {
- delete_avpl(pdu->avpl,TRUE);
- g_mem_chunk_free(rd->mate_items,pdu);
+ if ( (criterium_match && cfg->criterium->name == mc->reject )
+ || ( ! criterium_match && cfg->criterium->name == mc->accept )) {
+ delete_mate_pdu(pdu);
pdu = NULL;
continue;
}
diff --git a/plugins/mate/mate_setup.c b/plugins/mate/mate_setup.c
index 004dbecac6..accbfe8708 100644
--- a/plugins/mate/mate_setup.c
+++ b/plugins/mate/mate_setup.c
@@ -126,6 +126,7 @@ static mate_cfg_item* new_mate_cfg_item(guint8* name) {
new->hfid = -1;
new->hfid_pdu_rel_time = -1;
+ new->hfid_pdu_time_in_gop = -1;
new->my_hfids = g_hash_table_new(g_str_hash,g_str_equal);
new->items = g_hash_table_new(g_direct_hash,g_direct_equal);
@@ -1188,16 +1189,25 @@ static void analyze_pdu_config(mate_cfg_pdu* cfg) {
hfri.hfinfo.display = BASE_DEC;
g_array_append_val(matecfg->hfrs,hfri);
-
+
hfri.p_id = &(cfg->hfid_pdu_rel_time);
hfri.hfinfo.name = g_strdup_printf("%s time",cfg->name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.RelativeTime",cfg->name);
hfri.hfinfo.type = FT_FLOAT;
hfri.hfinfo.display = BASE_DEC;
- hfri.hfinfo.blurb = "Seconds passed since the start of the GOP or capture if the PDU is unnassigned";
-
+ hfri.hfinfo.blurb = "Seconds passed since the start of capture";
+
g_array_append_val(matecfg->hfrs,hfri);
-
+
+ hfri.p_id = &(cfg->hfid_pdu_time_in_gop);
+ hfri.hfinfo.name = g_strdup_printf("%s time since begining of Gop",cfg->name);
+ hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.TimeInGop",cfg->name);
+ hfri.hfinfo.type = FT_FLOAT;
+ hfri.hfinfo.display = BASE_DEC;
+ hfri.hfinfo.blurb = "Seconds passed since the start of the GOP";
+
+ g_array_append_val(matecfg->hfrs,hfri);
+
g_hash_table_foreach(cfg->hfids_attr,analyze_pdu_hfids,cfg);
ett = &cfg->ett;
@@ -1242,7 +1252,7 @@ static void analyze_gop_config(gpointer k _U_, gpointer v, gpointer p _U_) {
g_array_append_val(matecfg->hfrs,hfri);
hfri.p_id = &(cfg->hfid_gop_last_time);
- hfri.hfinfo.name = g_strdup_printf("%s current time",cfg->name);
+ hfri.hfinfo.name = g_strdup_printf("%s duration",cfg->name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.Duration",cfg->name);
hfri.hfinfo.blurb = g_strdup_printf("Time passed between the start of this %s and the last pdu assigned to it",cfg->name);
diff --git a/plugins/mate/mate_util.c b/plugins/mate/mate_util.c
index a508b593e6..14c3658f8c 100644
--- a/plugins/mate/mate_util.c
+++ b/plugins/mate/mate_util.c
@@ -95,15 +95,51 @@ void dbg_print(const guint* which, guint how, FILE* where, guint8* fmt, ... ) {
*
* Initializes the scs hash.
**/
+
+/* Don't call variables "small" or "huge". They are keywords for the MSVC compiler. Rename them to "mate_small" and "mate_huge"*/
+struct _scs_collection {
+ GHashTable* hash; /* key: a string value: guint number of subscribers */
+ GMemChunk* ctrs;
+ GMemChunk* mate_small;
+ GMemChunk* medium;
+ GMemChunk* large;
+ GMemChunk* mate_huge;
+ guint8* buf;
+};
+
+extern void destroy_scs_collection(SCS_collection* c) {
+ if ( c->ctrs ) g_mem_chunk_destroy(c->ctrs);
+ if ( c->mate_small ) g_mem_chunk_destroy(c->mate_small);
+ if ( c->medium ) g_mem_chunk_destroy(c->medium);
+ if ( c->large ) g_mem_chunk_destroy(c->large);
+ if ( c->mate_huge ) g_mem_chunk_destroy(c->mate_huge);
+
+ if (c->hash) g_hash_table_destroy(c->hash);
+}
-void scs_init(GHashTable** hash) {
- /* key: a string
- value: guint number of subscribers */
-
- if (*hash) g_hash_table_destroy(*hash);
-
- *hash = g_hash_table_new_full(g_str_hash,g_str_equal,g_free,g_free);
+extern SCS_collection* scs_init(void) {
+ SCS_collection* c = g_malloc(sizeof(SCS_collection));
+ c->hash = g_hash_table_new(g_str_hash,g_str_equal);
+
+ c->ctrs = g_mem_chunk_new("ints_scs_chunk", sizeof(guint),
+ sizeof(guint) * SCS_SMALL_CHUNK_SIZE, G_ALLOC_AND_FREE);
+
+ c->mate_small = g_mem_chunk_new("small_scs_chunk", SCS_SMALL_SIZE,
+ SCS_SMALL_SIZE * SCS_SMALL_CHUNK_SIZE, G_ALLOC_AND_FREE);
+
+ c->medium = g_mem_chunk_new("medium_scs_chunk", SCS_MEDIUM_SIZE,
+ SCS_MEDIUM_SIZE * SCS_MEDIUM_CHUNK_SIZE, G_ALLOC_AND_FREE);
+
+ c->large = g_mem_chunk_new("large_scs_chunk", SCS_LARGE_SIZE,
+ SCS_LARGE_SIZE * SCS_LARGE_CHUNK_SIZE, G_ALLOC_AND_FREE);
+
+ c->mate_huge = g_mem_chunk_new("huge_scs_chunk", SCS_HUGE_SIZE,
+ SCS_HUGE_SIZE * SCS_HUGE_CHUNK_SIZE, G_ALLOC_AND_FREE);
+
+ c->buf = g_mem_chunk_alloc0(c->mate_huge);
+
+ return c;
}
@@ -119,23 +155,45 @@ void scs_init(GHashTable** hash) {
*
* Return value: a pointer to the subscribed string.
**/
-guint8* scs_subscribe(GHashTable* collection, guint8* s) {
- guint8* ok = NULL;
+guint8* scs_subscribe(SCS_collection* c, guint8* s) {
+ guint8* orig = NULL;
guint* ip = NULL;
-
- g_hash_table_lookup_extended(collection,s,(gpointer*)&ok,(gpointer*)&ip);
+ size_t len = 0;
+ guint8* new = NULL;
+ GMemChunk* chunk = NULL;
+
+ g_hash_table_lookup_extended(c->hash,s,(gpointer*)&orig,(gpointer*)&ip);
if (ip) {
(*ip)++;
- s = ok;
+ new = orig;
} else {
- ip = g_malloc(sizeof(int));
+ ip = g_mem_chunk_alloc(c->ctrs);
*ip = 0;
- s = g_strdup(s);
- g_hash_table_insert(collection,s,ip);
+
+ len = strlen(s) + 1;
+ if (len <= SCS_SMALL_SIZE) {
+ chunk = c->mate_small;
+ } else if (len <= SCS_MEDIUM_SIZE) {
+ chunk = c->medium;
+ } else if (len <= SCS_LARGE_SIZE) {
+ chunk = c->large;
+ } else if (len < SCS_HUGE_SIZE) {
+ chunk = c->mate_huge;
+ } else {
+ chunk = c->mate_huge;
+ len = SCS_HUGE_SIZE;
+ g_warning("mate SCS: string truncated to huge size");
+ }
+
+ --len;
+ new = g_mem_chunk_alloc(chunk);
+ strncpy(new,s,len);
+
+ g_hash_table_insert(c->hash,new,ip);
}
- return s;
+ return new;
}
/**
@@ -146,14 +204,33 @@ guint8* scs_subscribe(GHashTable* collection, guint8* s) {
* decreases the count of subscribers, if zero frees the internal copy of
* the string.
**/
-void scs_unsubscribe(GHashTable* collection, guint8* s) {
- guint8* ok = NULL;
+void scs_unsubscribe(SCS_collection* c, guint8* s) {
+ guint8* orig = NULL;
guint* ip = NULL;
-
- g_hash_table_lookup_extended(collection,s,(gpointer*)&ok,(gpointer*)&ip);
+ size_t len = 0xffff;
+ GMemChunk* chunk = NULL;
+
+ g_hash_table_lookup_extended(c->hash,s,(gpointer*)&orig,(gpointer*)&ip);
if (ip) {
- if (*ip == 0) g_hash_table_remove(collection,ok);
+ if (*ip == 0) {
+ g_hash_table_remove(c->hash,orig);
+
+ len = strlen(orig);
+
+ if (len < SCS_SMALL_SIZE) {
+ chunk = c->mate_small;
+ } else if (len < SCS_MEDIUM_SIZE) {
+ chunk = c->medium;
+ } else if (len < SCS_LARGE_SIZE) {
+ chunk = c->large;
+ } else {
+ chunk = c->mate_huge;
+ }
+
+ g_mem_chunk_free(chunk,orig);
+ g_mem_chunk_free(c->ctrs,ip);
+ }
else (*ip)--;
} else {
g_warning("unsusbcribe: already deleted: '%s'?",s);
@@ -169,29 +246,14 @@ void scs_unsubscribe(GHashTable* collection, guint8* s) {
* Return value: the stored copy of the formated string.
*
**/
-extern guint8* scs_subscribe_printf(GHashTable* collection, guint8* fmt, ...) {
+extern guint8* scs_subscribe_printf(SCS_collection* c, guint8* fmt, ...) {
va_list list;
- guint8* ok = NULL;
- guint8* s = NULL;
- guint* ip = NULL;
va_start( list, fmt );
- s = g_strdup_vprintf(fmt, list);
+ g_vsnprintf(c->buf, SCS_HUGE_SIZE-1 ,fmt, list);
va_end( list );
- g_hash_table_lookup_extended(collection,s,(gpointer*)&ok,(gpointer*)&ip);
-
- if (ip) {
- (*ip)++;
- g_free(s);
- s = ok;
- } else {
- ip = g_malloc0(sizeof(int));
- *ip = 0;
- g_hash_table_insert(collection,s,ip);
- }
-
- return s;
+ return scs_subscribe(c,c->buf);
}
@@ -217,7 +279,7 @@ typedef union _any_avp_type {
static GMemChunk* avp_chunk = NULL;
-static GHashTable* avp_strings = NULL;
+static SCS_collection* avp_strings = NULL;
#ifdef _AVP_DEBUGGING
static FILE* dbg_fp = NULL;
@@ -269,7 +331,7 @@ extern void setup_avp_debug(FILE* fp, int* general, int* avp, int* avp_op, int*
**/
extern void avp_init(void) {
- scs_init(&avp_strings);
+ avp_strings = scs_init();
if ( avp_chunk ) {
@@ -893,6 +955,7 @@ extern AVPL* new_avpl_from_avpl(guint8* name, AVPL* avpl, gboolean copy_avps) {
/* BROKEN, makes no sense right now */
/* FIXME: Use subscribe/unsubscribe */
+#if 0
static AVP* avp_transform(AVP* src, AVP* op) {
unsigned int i;
guint8 c;
@@ -985,7 +1048,7 @@ static AVP* avp_transform(AVP* src, AVP* op) {
return src;
}
-
+#endif
/**
* match_avp:
diff --git a/plugins/mate/mate_util.h b/plugins/mate/mate_util.h
index 454b6620eb..3c9ee9c253 100644
--- a/plugins/mate/mate_util.h
+++ b/plugins/mate/mate_util.h
@@ -42,11 +42,23 @@ extern void dbg_print(const guint* which, guint how, FILE* where, guint8* fmt, .
/******* single copy strings *********/
-
-extern void scs_init(GHashTable** hash);
-extern guint8* scs_subscribe(GHashTable* collection, guint8* s);
-extern void scs_unsubscribe(GHashTable* collection, guint8* s);
-extern guint8* scs_subscribe_printf(GHashTable* collection, guint8* fmt, ...);
+typedef struct _scs_collection SCS_collection;
+
+#define SCS_SMALL_SIZE 16
+#define SCS_MEDIUM_SIZE 256
+#define SCS_LARGE_SIZE 4096
+#define SCS_HUGE_SIZE 65536
+
+#define SCS_SMALL_CHUNK_SIZE 4096
+#define SCS_MEDIUM_CHUNK_SIZE 1024
+#define SCS_LARGE_CHUNK_SIZE 256
+#define SCS_HUGE_CHUNK_SIZE 128
+
+extern void destroy_scs_collection(SCS_collection* c);
+extern SCS_collection* scs_init(void);
+extern guint8* scs_subscribe(SCS_collection* collection, guint8* s);
+extern void scs_unsubscribe(SCS_collection* collection, guint8* s);
+extern guint8* scs_subscribe_printf(SCS_collection* collection, guint8* fmt, ...);
/******* AVPs & Co. *********/
#define AVP_CHUNK_SIZE 4096
diff --git a/plugins/mate/matelib/isup.mate b/plugins/mate/matelib/isup.mate
index d7bafa497b..7b3d400809 100644
--- a/plugins/mate/matelib/isup.mate
+++ b/plugins/mate/matelib/isup.mate
@@ -1,25 +1,23 @@
# isup.mate
# $Id$
-
-Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=1; .isup_IAM=;
-Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=2; .isup_SAM=;
-Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=3; .isup_INR=;
-Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=4; .isup_INF=;
-Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=5; .isup_COT=;
-Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=6; .isup_ACM=;
-Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=7; .isup_CON=;
-Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=8; .isup_FOT=;
-Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=9; .isup_ANM=;
-Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=12; .isup_REL=;
-Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=13; .isup_SUS=;
-Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=14; .isup_RES=;
-Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=16; .isup_RLC=;
+#Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=1; .isup_IAM=;
+#Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=2; .isup_SAM=;
+#Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=3; .isup_INR=;
+#Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=4; .isup_INF=;
+#Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=5; .isup_COT=;
+#Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=6; .isup_ACM=;
+#Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=7; .isup_CON=;
+#Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=8; .isup_FOT=;
+#Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=9; .isup_ANM=;
+#Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=12; .isup_REL=;
+#Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=13; .isup_SUS=;
+#Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=14; .isup_RES=;
+#Action=Transform; Name=isup_msg_type; Mode=Insert; Match=Strict; isup_msg=16; .isup_RLC=;
Action=PduDef; Name=isup_pdu; Proto=isup; Transport=mtp3; mtp3pc=mtp3.dpc; mtp3pc=mtp3.opc; cic=isup.cic; isup_msg=isup.message_type;
-Action=PduTransform; For=isup_pdu; Name=isup_msg_type;
+#Action=PduTransform; For=isup_pdu; Name=isup_msg_type;
Action=GopDef; Name=isup_leg; On=isup_pdu; ShowPduTree=TRUE; mtp3pc; mtp3pc; cic;
-Action=GopStart; For=isup_leg; isup_IAM;
-Action=GopStop; For=isup_leg; isup_RLC;
-
+Action=GopStart; For=isup_leg; isup_msg=1;
+Action=GopStop; For=isup_leg; isup_msg=16;
diff --git a/plugins/mate/matelib/radius.mate b/plugins/mate/matelib/radius.mate
index 851717557d..3f69b56ed5 100644
--- a/plugins/mate/matelib/radius.mate
+++ b/plugins/mate/matelib/radius.mate
@@ -1,7 +1,13 @@
# radius.mate
# $Id$
+Action=Transform; Name=radius_same_port; Mode=Insert; Match=Strict; radius_port; radius_port;
+Action=Transform; Name=radius_same_port; Mode=Insert; Match=Every; radius_port; .radius_port=0;
+
Action=PduDef; Name=radius_pdu; Proto=radius; Transport=udp/ip; radius_addr=ip.addr; radius_port=udp.port; radius_id=radius.id; radius_code=radius.code;
-Action=GopDef; Name=radius_req; On=radius_pdu; radius_id; radius_addr; radius_addr;
+Action=PduTransform; For=radius_pdu; Name=radius_same_port;
+
+Action=GopDef; Name=radius_req; On=radius_pdu; radius_id; radius_addr; radius_addr; radius_port; radius_port;
Action=GopStart; For=radius_req; radius_code|1|4|7;
Action=GopStop; For=radius_req; radius_code|2|3|5|8|9;
+
diff --git a/plugins/mate/moduleinfo.h b/plugins/mate/moduleinfo.h
index 569556f83d..2e233de7cd 100644
--- a/plugins/mate/moduleinfo.h
+++ b/plugins/mate/moduleinfo.h
@@ -12,5 +12,5 @@
#endif
/* Version number of package */
-#define VERSION "0.0.3"
+#define VERSION "0.0.3.1"
diff --git a/plugins/mate/packet-mate.c b/plugins/mate/packet-mate.c
index 2d28f53888..ce070730c6 100644
--- a/plugins/mate/packet-mate.c
+++ b/plugins/mate/packet-mate.c
@@ -122,12 +122,10 @@ void mate_gop_tree(proto_tree* tree, tvbuff_t *tvb, mate_gop* gop) {
proto_tree_add_float(gop_time_tree, gop->cfg->hfid_gop_start_time, tvb, 0, 0, gop->start_time);
if (gop->released) {
- proto_tree_add_float(gop_time_tree, gop->cfg->hfid_gop_stop_time, tvb, 0, 0, gop->release_time);
- if (gop->release_time != gop->last_time) {
- proto_tree_add_float(gop_time_tree, gop->cfg->hfid_gop_last_time, tvb, 0, 0, gop->last_time);
- }
+ proto_tree_add_float(gop_time_tree, gop->cfg->hfid_gop_stop_time, tvb, 0, 0, gop->release_time - gop->start_time);
+ proto_tree_add_float(gop_time_tree, gop->cfg->hfid_gop_last_time, tvb, 0, 0, gop->last_time - gop->start_time);
} else {
- proto_tree_add_float(gop_time_tree, gop->cfg->hfid_gop_last_time, tvb, 0, 0, gop->last_time);
+ proto_tree_add_float(gop_time_tree, gop->cfg->hfid_gop_last_time, tvb, 0, 0, gop->last_time - gop->start_time);
}
}
@@ -148,26 +146,26 @@ void mate_gop_tree(proto_tree* tree, tvbuff_t *tvb, mate_gop* gop) {
tvb,0,0,gop_pdus->frame,
"Stop PDU: in frame %i (%f : %f)",
gop_pdus->frame,
- gop_pdus->rel_time,
- gop_pdus->rel_time-rel_time);
+ gop_pdus->time_in_gop,
+ gop_pdus->time_in_gop-rel_time);
} else if (gop_pdus->after_release) {
proto_tree_add_uint_format(gop_pdu_tree,gop->cfg->hfid_gop_pdu,
tvb,0,0,gop_pdus->frame,
"After stop PDU: in frame %i (%f : %f)",
gop_pdus->frame,
- gop_pdus->rel_time,
- gop_pdus->rel_time-rel_time);
+ gop_pdus->time_in_gop,
+ gop_pdus->time_in_gop-rel_time);
} else {
proto_tree_add_uint_format(gop_pdu_tree,gop->cfg->hfid_gop_pdu,
tvb,0,0,gop_pdus->frame,
"PDU: in frame %i (%f : %f)",
gop_pdus->frame,
- gop_pdus->rel_time,
- gop_pdus->rel_time-rel_time);
+ gop_pdus->time_in_gop,
+ gop_pdus->time_in_gop-rel_time);
}
- rel_time = gop_pdus->rel_time;
+ rel_time = gop_pdus->time_in_gop;
}
}
@@ -177,7 +175,6 @@ void mate_gop_tree(proto_tree* tree, tvbuff_t *tvb, mate_gop* gop) {
void mate_pdu_tree(mate_pdu *pdu, tvbuff_t *tvb, proto_tree* tree) {
proto_item *pdu_item;
proto_tree *pdu_tree;
- guint32 len;
if ( ! pdu ) return;
@@ -194,12 +191,12 @@ void mate_pdu_tree(mate_pdu *pdu, tvbuff_t *tvb, proto_tree* tree) {
proto_item_append_text(mate_i," %s:%d",pdu->cfg->name,pdu->id);
}
- len = pdu->end - pdu->start;
- pdu_item = proto_tree_add_uint(tree,pdu->cfg->hfid,tvb,pdu->start,len,pdu->id);
+ pdu_item = proto_tree_add_uint(tree,pdu->cfg->hfid,tvb,0,0,pdu->id);
pdu_tree = proto_item_add_subtree(pdu_item, pdu->cfg->ett);
proto_tree_add_float(pdu_tree,pdu->cfg->hfid_pdu_rel_time, tvb, 0, 0, pdu->rel_time);
if (pdu->gop) {
+ proto_tree_add_float(pdu_tree,pdu->cfg->hfid_pdu_time_in_gop, tvb, 0, 0, pdu->time_in_gop);
mate_gop_tree(pdu_tree,tvb,pdu->gop);
if (pdu->gop->gog)
@@ -220,13 +217,10 @@ extern void mate_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
analyze_frame(pinfo,tree);
if (( pdus = mate_get_pdus(pinfo->fd->num) )) {
-
- mate_i = proto_tree_add_text(tree,tvb,0,0,"mate");
-
- mate_t = proto_item_add_subtree(mate_i, mc->ett_root);
-
for ( ; pdus; pdus = pdus->next_in_frame) {
- mate_pdu_tree(pdus,tvb,mate_t);
+ mate_i = proto_tree_add_text(tree,tvb,0,0,"mate");
+ mate_t = proto_item_add_subtree(mate_i, mc->ett_root);
+ mate_pdu_tree(pdus,tvb,mate_t);
}
}
}