From Jeff Foster: add support for Cisco HDLC captures.
[obnox/wireshark/wip.git] / tap-sctpchunkstat.c
index 83b8985a149447627f4382fd0478f43db35abb50..de060d53fd30ca388e198a8a9975032390a8c1f1 100644 (file)
@@ -1,11 +1,11 @@
 /* tap_sctpchunkstat.c
- * SCTP chunk counter for ethereal
+ * SCTP chunk counter for wireshark
  * Copyright 2005 Oleg Terletsky <oleg.terletsky@comverse.com>
  *
- * $Id:$
+ * $Id$
  *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
  * Copyright 1998 Gerald Combs
  *
  * This program is free software; you can redistribute it and/or
@@ -37,6 +37,7 @@
 #include "epan/packet_info.h"
 #include "epan/addr_resolv.h"
 #include <epan/tap.h>
+#include <epan/stat_cmd_args.h>
 #include "epan/value_string.h"
 #include "register.h"
 #include <epan/dissectors/packet-sctp.h>
@@ -219,17 +220,16 @@ sctpstat_draw(void *phs)
 
 
 static void
-sctpstat_init(char *optarg)
+sctpstat_init(const char *optarg, void* userdata _U_)
 {
        sctpstat_t *hs;
-       char *filter=NULL;
+       const char *filter=NULL;
        GString *error_string;
 
        if(!strncmp(optarg,"sctp,stat,",11)){
                filter=optarg+11;
        } else {
-               filter=g_malloc(1);
-               *filter='\0';
+               filter="";
        }
 
        hs = g_malloc(sizeof(sctpstat_t));
@@ -246,7 +246,7 @@ sctpstat_init(char *optarg)
                g_free(hs->filter);
                g_free(hs);
 
-               fprintf(stderr, "tethereal: Couldn't register sctp,stat tap: %s\n",
+               fprintf(stderr, "tshark: Couldn't register sctp,stat tap: %s\n",
                    error_string->str);
                g_string_free(error_string, TRUE);
                exit(1);
@@ -257,5 +257,5 @@ sctpstat_init(char *optarg)
 void
 register_tap_listener_sctpstat(void)
 {
-       register_tap_listener_cmd_arg("sctp,stat", sctpstat_init);
+       register_stat_cmd_arg("sctp,stat", sctpstat_init,NULL);
 }