Changed the GopTree in GogDef and GogExtra from a boolean to a string
authorlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 20 Feb 2005 02:21:04 +0000 (02:21 +0000)
committerlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 20 Feb 2005 02:21:04 +0000 (02:21 +0000)
  GopTree={BasicTree|NoTree|FullTree}
    NoTree: just an item for each gop
    BasicTree: (default) some essential information regarding the gop
    FullTree: the Gop's full tree

added Id and eol-style to examples

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13435 f5534014-38df-0310-8fa8-9805f1628bb7

plugins/mate/examples/call.mate
plugins/mate/examples/mms.mate
plugins/mate/examples/pasv_ftp.mate
plugins/mate/examples/tcp.mate
plugins/mate/examples/web.mate
plugins/mate/mate.h
plugins/mate/mate_setup.c
plugins/mate/packet-mate.c

index 48afa5e939477164f1a6d19f9bcea6eb5c85edc3..8d66610785dd702d579d8a7b5b1dddb4a3c021e8 100644 (file)
@@ -1,5 +1,5 @@
 # call.mate
-# $Id$
+# $Id$
 
 Action=Settings; DiscardPduData=TRUE; ShowGopTimes=FALSE; ShowPduTree=FALSE;
 
index 369be35109f021ae1c018546e713a4d20b74f8a8..05bc110c8b7f243e65461b056a27bda5050c729e 100644 (file)
@@ -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;
index 3a776f7210743948f51bcc90392c6df9c4adff3d..05bec4c1fd4385ccdbda4e3918f43fc55b86df97 100644 (file)
@@ -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; 
index 3af4e355832e109dffac2eca7be2c1069ae003ff..c7fd7e2da3685b30d80e7aa705ab01daf41c0ff9 100644 (file)
@@ -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;
index d6a843123e9ac772cc835de58b1b756e56b6e6cf..87f7ab41f4cc712134633d9a54bcd38051d8c8ca 100644 (file)
@@ -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;
index 3da59f059488478157cebe96f562f80591c3589d..0a759addbd6e842559dd117f9a06ef1d19453e61 100644 (file)
 #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;    
index 4852776ae6f5b7d70ca26cc36178bba6d58b74a9..5732928fd456730d964efc330ff75d81068f5e57 100644 (file)
@@ -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) ) {
index 471ccb78b9b54746c5b87208c5ae31908647447c..15afb0601225392fc1ba527601d56214d9014f6e 100644 (file)
@@ -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);
                }
        }
 }