aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mate/examples/call.mate2
-rw-r--r--plugins/mate/examples/mms.mate2
-rw-r--r--plugins/mate/examples/pasv_ftp.mate3
-rw-r--r--plugins/mate/examples/tcp.mate2
-rw-r--r--plugins/mate/examples/web.mate3
-rw-r--r--plugins/mate/mate.h11
-rw-r--r--plugins/mate/mate_setup.c26
-rw-r--r--plugins/mate/packet-mate.c35
8 files changed, 67 insertions, 17 deletions
diff --git a/plugins/mate/examples/call.mate b/plugins/mate/examples/call.mate
index 48afa5e939..8d66610785 100644
--- a/plugins/mate/examples/call.mate
+++ b/plugins/mate/examples/call.mate
@@ -1,5 +1,5 @@
# call.mate
-# $Id: $
+# $Id$
Action=Settings; DiscardPduData=TRUE; ShowGopTimes=FALSE; ShowPduTree=FALSE;
diff --git a/plugins/mate/examples/mms.mate b/plugins/mate/examples/mms.mate
index 369be35109..05bc110c8b 100644
--- a/plugins/mate/examples/mms.mate
+++ b/plugins/mate/examples/mms.mate
@@ -1,5 +1,5 @@
# mms.mate
-# $Id: $
+# $Id$
# MMSE over HTTP
Action=PduDef; Name=mmse_over_http_pdu; Proto=http; Transport=tcp/ip; Payload=mmse; addr=ip.addr; port=tcp.port; http_rq=http.request; content=http.content_type;
diff --git a/plugins/mate/examples/pasv_ftp.mate b/plugins/mate/examples/pasv_ftp.mate
index 3a776f7210..05bec4c1fd 100644
--- a/plugins/mate/examples/pasv_ftp.mate
+++ b/plugins/mate/examples/pasv_ftp.mate
@@ -1,4 +1,5 @@
-
+# pasv_ftp.mate
+# $Id $
Action=PduDef; Name=ftp_pdu; Proto=ftp; Transport=tcp/ip; Stop=TRUE; ftp_addr=ip.addr; ftp_port=tcp.port; ftp_resp=ftp.response.code; ftp_req=ftp.request.command; server_addr=ftp.passive.ip; server_port=ftp.passive.port;
Action=PduDef; Name=ftp_data_pdu; Proto=ftp-data; Transport=tcp/ip; server_addr=ip.src; server_port=tcp.srcport;
diff --git a/plugins/mate/examples/tcp.mate b/plugins/mate/examples/tcp.mate
index 3af4e35583..c7fd7e2da3 100644
--- a/plugins/mate/examples/tcp.mate
+++ b/plugins/mate/examples/tcp.mate
@@ -1,3 +1,5 @@
+# tcp.mate
+# $Id $
Action=PduDef; Name=tcp_pdu; Proto=tcp; Transport=ip; addr=ip.addr; port=tcp.port; tcp_start=tcp.flags.syn; tcp_stop=tcp.flags.fin; tcp_stop=tcp.flags.reset;
Action=GopDef; Name=tcp_session; On=tcp_pdu; addr; addr; port; port;
Action=GopStart; For=tcp_session; tcp_start=1;
diff --git a/plugins/mate/examples/web.mate b/plugins/mate/examples/web.mate
index d6a843123e..87f7ab41f4 100644
--- a/plugins/mate/examples/web.mate
+++ b/plugins/mate/examples/web.mate
@@ -1,4 +1,5 @@
-
+# web.mate
+# $Id $
Action=PduDef; Name=dns_pdu; Proto=dns; Transport=ip; addr=ip.addr; dns_resp=dns.flags.response; host=dns.qry.name; client_addr=ip.src; dns_id=dns.id;
Action=PduDef; Name=http_pdu; Proto=http; Transport=tcp/ip; addr=ip.addr; port=tcp.port; http_rq=http.request.method; http_rs=http.response; host=http.host; client_addr=ip.src;
diff --git a/plugins/mate/mate.h b/plugins/mate/mate.h
index 3da59f0594..0a759addbd 100644
--- a/plugins/mate/mate.h
+++ b/plugins/mate/mate.h
@@ -120,6 +120,8 @@
#define KEYWORD_ACCEPT "Accept"
#define KEYWORD_REJECT "Reject"
#define KEYWORD_NOTREE "NoTree"
+#define KEYWORD_BASICTREE "BasicTree"
+#define KEYWORD_FULLTREE "FullTree"
#define KEYWORD_PDUTREE "PduTree"
#define KEYWORD_FRAMETREE "FrameTree"
#define KEYWORD_GOPEXPIRATION "GopExpiration"
@@ -208,11 +210,12 @@ typedef struct _mate_cfg_item {
GHashTable* gog_index;
/* gog */
- gboolean gop_as_subtree;
+ guint8* gop_as_subtree;
LoAL* keys;
int hfid_gog_num_of_gops;
int hfid_gog_gop;
int hfid_gog_gopstart;
+ int hfid_gog_gopstop;
gint ett_gog_gop;
} mate_cfg_item;
@@ -229,19 +232,21 @@ typedef struct _mate_config {
gboolean last_to_be_created;
avpl_match_mode match_mode;
avpl_replace_mode replace_mode;
- gboolean gop_as_subtree;
+ guint8* gop_as_subtree;
int hfid_mate;
float gop_expiration;
float gop_idle_timeout;
float gop_lifetime;
+ /* text "constants" */
guint8* accept;
guint8* reject;
-
guint8* no_tree;
guint8* frame_tree;
guint8* pdu_tree;
+ guint8* full_tree;
+ guint8* basic_tree;
/* what to dbgprint */
int dbg_lvl;
diff --git a/plugins/mate/mate_setup.c b/plugins/mate/mate_setup.c
index 4852776ae6..5732928fd4 100644
--- a/plugins/mate/mate_setup.c
+++ b/plugins/mate/mate_setup.c
@@ -166,7 +166,7 @@ static mate_cfg_item* new_mate_cfg_item(guint8* name) {
new->gop_index = NULL;
new->gog_index = NULL;
- new->gop_as_subtree = FALSE;
+ new->gop_as_subtree = NULL;
new->keys = NULL;
new->hfid_gog_num_of_gops = -1;
new->hfid_gog_gop = -1;
@@ -879,7 +879,7 @@ static gboolean config_gog(AVPL* avpl) {
cfg = new_gogcfg(name);
cfg->expiration = extract_named_float(avpl, KEYWORD_GOGEXPIRE,matecfg->gog_expiration);
- cfg->gop_as_subtree = extract_named_bool(avpl, KEYWORD_GOPTREE,matecfg->gop_as_subtree);
+ cfg->gop_as_subtree = extract_named_str(avpl, KEYWORD_GOPTREE,matecfg->gop_as_subtree);
return TRUE;
}
@@ -942,7 +942,7 @@ static gboolean config_gogextra(AVPL* avpl) {
}
cfg->expiration = extract_named_float(avpl, KEYWORD_GOGEXPIRE,cfg->expiration);
- cfg->gop_as_subtree = extract_named_bool(avpl, KEYWORD_GOPTREE,cfg->gop_as_subtree);
+ cfg->gop_as_subtree = extract_named_str(avpl, KEYWORD_GOPTREE,cfg->gop_as_subtree);
merge_avpl(cfg->extra,avpl,TRUE);
@@ -1461,6 +1461,15 @@ static void analyze_gog_config(gpointer k _U_, gpointer v, gpointer p _U_) {
g_array_append_val(matecfg->hfrs,hfri);
+ hfri.p_id = &(cfg->hfid_gog_gopstop);
+ hfri.hfinfo.name = "GopStop frame";
+ hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.GopStop",cfg->name);
+ hfri.hfinfo.type = FT_FRAMENUM;
+ hfri.hfinfo.display = BASE_DEC;
+ hfri.hfinfo.blurb = g_strdup("The stop frame of a GOP");
+
+ g_array_append_val(matecfg->hfrs,hfri);
+
hfri.p_id = &(cfg->hfid_start_time);
hfri.hfinfo.name = g_strdup_printf("%s start time",cfg->name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.StartTime",cfg->name);
@@ -1628,6 +1637,14 @@ static void init_actions(void) {
matecfg->pdu_tree = avp->n;
insert_avp(all_keywords,avp);
+ avp = new_avp(KEYWORD_BASICTREE,"",'=');
+ matecfg->basic_tree = avp->n;
+ insert_avp(all_keywords,avp);
+
+ avp = new_avp(KEYWORD_FULLTREE,"",'=');
+ matecfg->full_tree = avp->n;
+ insert_avp(all_keywords,avp);
+
if (actions) {
g_hash_table_destroy(actions);
}
@@ -1703,7 +1720,8 @@ extern mate_config* mate_make_config(guint8* filename, int mate_hfid) {
init_actions();
matecfg->show_pdu_tree = matecfg->frame_tree;
-
+ matecfg->gop_as_subtree = matecfg->basic_tree;
+
config_error = g_string_new("");
if ( mate_load_config(filename) ) {
diff --git a/plugins/mate/packet-mate.c b/plugins/mate/packet-mate.c
index 471ccb78b9..15afb06012 100644
--- a/plugins/mate/packet-mate.c
+++ b/plugins/mate/packet-mate.c
@@ -42,7 +42,7 @@ static char* current_mate_config_filename = NULL;
static proto_item *mate_i = NULL;
-void attrs_tree(proto_tree* tree, tvbuff_t *tvb,mate_item* item) {
+void attrs_tree(proto_tree* tree, tvbuff_t *tvb, mate_item* item) {
AVPN* c;
proto_item *avpl_i;
proto_tree *avpl_t;
@@ -75,7 +75,8 @@ void mate_gog_tree(proto_tree* tree, tvbuff_t *tvb, mate_gog* gog, mate_gop* gop
mate_gop* gog_gops;
proto_item *gog_gop_item;
proto_tree *gog_gop_tree;
-
+ mate_pdu* pdu;
+
#ifdef _MATE_DEBUGGING
proto_item* gog_key_item;
proto_tree* gog_key_tree;
@@ -103,19 +104,41 @@ void mate_gog_tree(proto_tree* tree, tvbuff_t *tvb, mate_gog* gog, mate_gop* gop
for (gog_gops = gog->gops; gog_gops; gog_gops = gog_gops->next) {
if (gop != gog_gops) {
- if (gog->cfg->gop_as_subtree) {
+ if (gog->cfg->gop_as_subtree == mc->full_tree) {
mate_gop_tree(gog_gops_tree, tvb, gog_gops);
} else {
gog_gop_item = proto_tree_add_uint(gog_gops_tree,gog_gops->cfg->hfid,tvb,0,0,gog_gops->id);
- if (gop->pdus && gop->cfg->show_pdu_tree == mc->frame_tree) {
+ if (gog->cfg->gop_as_subtree == mc->basic_tree) {
gog_gop_tree = proto_item_add_subtree(gog_gop_item, gog->cfg->ett_gog_gop);
- proto_tree_add_uint(gog_gop_tree,gog->cfg->hfid_gog_gopstart,tvb,0,0,gog_gops->pdus->frame);
+
+ proto_tree_add_text(gog_gop_tree, tvb,0,0, "Started at: %f", gog_gops->start_time);
+
+
+ proto_tree_add_text(gog_gop_tree, tvb,0,0, "%s Duration: %f",
+ gog_gops->cfg->name, gog_gops->last_time - gog_gops->start_time);
+
+ if (gog_gops->released)
+ proto_tree_add_text(gog_gop_tree, tvb,0,0, "%s has been released, Time: %f",
+ gog_gops->cfg->name, gog_gops->release_time - gog_gops->start_time);
+
+ proto_tree_add_text(gog_gop_tree, tvb,0,0, "Number of Pdus: %u",gog_gops->num_of_pdus);
+
+ if (gop->pdus && gop->cfg->show_pdu_tree == mc->frame_tree) {
+ proto_tree_add_uint(gog_gop_tree,gog->cfg->hfid_gog_gopstart,tvb,0,0,gog_gops->pdus->frame);
+
+ for (pdu = gog_gops->pdus->next ; pdu; pdu = pdu->next) {
+ if (pdu->is_stop) {
+ proto_tree_add_uint(gog_gop_tree,gog->cfg->hfid_gog_gopstop,tvb,0,0,pdu->frame);
+ break;
+ }
+ }
+ }
}
}
} else {
- proto_tree_add_uint_format(gog_gops_tree,gop->cfg->hfid,tvb,0,0,gop->id,"%s of current frame: %d",gop->cfg->name,gop->id);
+ proto_tree_add_uint_format(gog_gops_tree,gop->cfg->hfid,tvb,0,0,gop->id,"current %s Gop: %d",gop->cfg->name,gop->id);
}
}
}