Fix build by #if 0 out unused de_sgsap_tmsi() function.
[obnox/wireshark/wip.git] / tap-protohierstat.c
index 29ef5082188079c07388f1ed8f515f132daff728..b8db44fc394f3a213b43f2974c6cb64649a2adf9 100644 (file)
@@ -40,7 +40,6 @@
 #include "epan/proto.h"
 #include <epan/tap.h>
 #include <epan/stat_cmd_args.h>
-#include "register.h"
 
 typedef struct _phs_t {
        struct _phs_t *sibling;
@@ -76,7 +75,7 @@ protohierstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const v
 {
        phs_t *rs=prs;
        phs_t *tmprs;
-       proto_tree *tree;
+       proto_node *node;
        field_info *fi;
 
        if(!edt){
@@ -89,8 +88,8 @@ protohierstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const v
                return 0;
        }
 
-       for(tree=edt->tree->first_child;tree;tree=tree->next){
-               fi=PITEM_FINFO(tree);
+       for(node=edt->tree->first_child;node;node=node->next){
+               fi=PNODE_FINFO(node);
 
                /* first time we saw a protocol at this leaf */
                if(rs->protocol==-1){
@@ -180,17 +179,11 @@ protohierstat_init(const char *optarg, void* userdata _U_)
        const char *filter=NULL;
        GString *error_string;
 
-       if(!strcmp("io,phs",optarg)){
-               filter="frame";
+       if(strcmp("io,phs",optarg)==0){
+               /* No arguments */
        } else if(sscanf(optarg,"io,phs,%n",&pos)==0){
                if(pos){
                        filter=optarg+pos;
-               } else {
-                       /* We must use a filter to guarantee that edt->tree
-                          will be populated. "frame" matches everything so
-                          that one is used instead of no filter.
-                       */
-                       filter="frame";
                }
        } else {
                fprintf(stderr, "tshark: invalid \"-z io,phs[,<filter>]\" argument\n");
@@ -205,7 +198,7 @@ protohierstat_init(const char *optarg, void* userdata _U_)
                rs->filter=NULL;
        }
 
-       error_string=register_tap_listener("frame", rs, filter, NULL, protohierstat_packet, protohierstat_draw);
+       error_string=register_tap_listener("frame", rs, filter, TL_REQUIRES_PROTO_TREE, NULL, protohierstat_packet, protohierstat_draw);
        if(error_string){
                /* error, we failed to attach to the tap. clean up */
                g_free(rs->filter);