/* 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
#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>
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));
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);
void
register_tap_listener_sctpstat(void)
{
- register_tap_listener_cmd_arg("sctp,stat", sctpstat_init);
+ register_stat_cmd_arg("sctp,stat", sctpstat_init,NULL);
}