replace *a lot* of file related calls by their GLib counterparts. This is necessary...
[obnox/wireshark/wip.git] / tap-protocolinfo.c
index 3e07d6839ea0443492f1f35f223a44f3b22d7b65..909ac8c240d6c9d9a3f6a73fc91487e9eb3acb93 100644 (file)
@@ -39,6 +39,7 @@
 #include "epan/column-utils.h"
 #include "epan/proto.h"
 #include <epan/tap.h>
 #include "epan/column-utils.h"
 #include "epan/proto.h"
 #include <epan/tap.h>
+#include <epan/stat_cmd_args.h>
 #include "register.h"
 
 typedef struct _pci_t {
 #include "register.h"
 
 typedef struct _pci_t {
@@ -78,7 +79,6 @@ protocolinfo_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const vo
                str=proto_construct_dfilter_string(gp->pdata[i], NULL);
                if(str){
                        col_append_fstr(pinfo->cinfo, COL_INFO, "  %s",str);
                str=proto_construct_dfilter_string(gp->pdata[i], NULL);
                if(str){
                        col_append_fstr(pinfo->cinfo, COL_INFO, "  %s",str);
-                       g_free(str);
                }
        }
        return 0;
                }
        }
        return 0;
@@ -87,11 +87,11 @@ protocolinfo_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const vo
 
 
 static void
 
 
 static void
-protocolinfo_init(char *optarg)
+protocolinfo_init(const char *optarg)
 {
        pci_t *rs;
 {
        pci_t *rs;
-       char *field=NULL;
-       char *filter=NULL;
+       const char *field=NULL;
+       const char *filter=NULL;
        header_field_info *hfi;
        GString *error_string;
 
        header_field_info *hfi;
        GString *error_string;
 
@@ -142,6 +142,6 @@ protocolinfo_init(char *optarg)
 void
 register_tap_listener_protocolinfo(void)
 {
 void
 register_tap_listener_protocolinfo(void)
 {
-       register_ethereal_tap("proto,colinfo,", protocolinfo_init);
+       register_stat_cmd_arg("proto,colinfo,", protocolinfo_init);
 }
 
 }