add "mate" as a protocol to its tree
authorlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 10 Feb 2005 16:55:08 +0000 (16:55 +0000)
committerlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 10 Feb 2005 16:55:08 +0000 (16:55 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13380 f5534014-38df-0310-8fa8-9805f1628bb7

plugins/mate/mate.h
plugins/mate/mate_setup.c
plugins/mate/packet-mate.c

index ea898313b2a8c51ff289efa1fe1ccc96e8a42089..27bf3478ab11f10aee600a6fd58556911148c74a 100644 (file)
@@ -226,7 +226,8 @@ typedef struct _mate_config {
        avpl_match_mode match_mode;
        avpl_replace_mode replace_mode;
        gboolean gop_as_subtree;
-
+       int hfid_mate;
+       
        float gop_expiration;
        float gop_idle_timeout;
        float gop_lifetime;
@@ -338,7 +339,7 @@ extern mate_pdu* mate_get_pdus(guint32 framenum);
 extern void mate_analyze_frame(packet_info *pinfo, proto_tree* tree);
 
 /* from mate_setup.c */
-extern mate_config* mate_make_config(guint8* filename);
+extern mate_config* mate_make_config(guint8* filename, int mate_hfid);
 extern mate_config* mate_cfg(void);
 
 #endif
index 72bde2b53203ff0a1ff808b95eb9c9feaf963865..055b12fd730c9c78292988c54a86577f00160f80 100644 (file)
@@ -1594,7 +1594,7 @@ extern mate_config* mate_cfg() {
        return matecfg;
 }
 
-extern mate_config* mate_make_config(guint8* filename) {
+extern mate_config* mate_make_config(guint8* filename, int mate_hfid) {
        gint* ett;
 
        avp_init();
@@ -1630,7 +1630,8 @@ extern mate_config* mate_make_config(guint8* filename) {
        matecfg->hfrs = g_array_new(FALSE,TRUE,sizeof(hf_register_info));
        matecfg->ett = g_array_new(FALSE,TRUE,sizeof(gint*));
        matecfg->ett_root = -1;
-
+       matecfg->hfid_mate = mate_hfid;
+       
        ett = &matecfg->ett_root;
        g_array_append_val(matecfg->ett,ett);
 
index 70fd15e0da65193001392c16a81325ee14c296e9..7344869867f5dae9d3c5014d3ea92e8855f99744 100644 (file)
@@ -231,7 +231,7 @@ extern void mate_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
 
        if (( pdus = mate_get_pdus(pinfo->fd->num) )) {
                for ( ; pdus; pdus = pdus->next_in_frame) {
-                       mate_i = proto_tree_add_text(tree,tvb,0,0,"MATE");
+                       mate_i = proto_tree_add_protocol_format(tree,mc->hfid_mate,tvb,0,0,"MATE");
                        mate_t = proto_item_add_subtree(mate_i, mc->ett_root);                  
                        mate_pdu_tree(pdus,tvb,mate_t);
                }
@@ -277,7 +277,7 @@ proto_reg_handoff_mate(void)
                } 
                
                if (!mc) { 
-                       mc = mate_make_config((char*)pref_mate_config_filename);
+                       mc = mate_make_config((char*)pref_mate_config_filename,proto_mate);
                        current_mate_config_filename = pref_mate_config_filename;
                        if (mc) {
                                /* XXX: alignment warnings, what do they mean? */