/* tap_sipstat.c
- * sip message counter for ethereal
+ * sip message counter for wireshark
*
* $Id$
* Copied from gtk/sip_stat.c and tap-httpstat.c
*
- * 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 <string.h>
#include "epan/packet_info.h"
-#include "tap.h"
+#include <epan/tap.h>
+#include <epan/stat_cmd_args.h>
#include "epan/value_string.h"
#include "register.h"
#include <epan/dissectors/packet-sip.h>
typedef struct _sip_response_code_t {
guint32 packets; /* 3 */
guint response_code; /* 404 */
- gchar *name; /* Not Found */
+ const gchar *name; /* Not Found */
sipstat_t *sp;
} sip_response_code_t;
{ 407, "Proxy Authentication Required"},
{ 408, "Request Timeout"},
{ 410, "Gone"},
+ { 412, "Conditional Request Failed"},
{ 413, "Request Entity Too Large"},
{ 414, "Request-URI Too Long"},
{ 415, "Unsupported Media Type"},
{ 420, "Bad Extension"},
{ 421, "Extension Required"},
{ 423, "Interval Too Brief"},
+ { 429, "Provide Referrer Identity"},
{ 480, "Temporarily Unavailable"},
{ 481, "Call/Transaction Does Not Exist"},
{ 482, "Loop Detected"},
{ 489, "Bad Event"},
{ 491, "Request Pending"},
{ 493, "Undecipherable"},
+ { 494, "Security Agreement Required"},
{ 499, "Client Error - Others"},
{ 500, "Server Internal Error"},
/* Main entry point to SIP tap */
static int
-sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, void *pri)
+sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri)
{
- sip_info_value_t *value=pri;
+ const sip_info_value_t *value=pri;
sipstat_t *sp = (sipstat_t *)psp;
/* Total number of packets, including continuation packets */
}
static void
-sipstat_init(char *optarg)
+sipstat_init(const char *optarg, void* userdata _U_)
{
sipstat_t *sp;
- char *filter=NULL;
+ const char *filter=NULL;
GString *error_string;
if (strncmp (optarg, "sip,stat,", 9) == 0){
/* error, we failed to attach to the tap. clean up */
g_free(sp->filter);
g_free(sp);
- fprintf (stderr, "tethereal: Coulnd't register sip,stat tap: %s\n",
+ fprintf (stderr, "tshark: Couldn't register sip,stat tap: %s\n",
error_string->str);
g_string_free(error_string, TRUE);
exit(1);
void
register_tap_listener_sipstat(void)
{
- register_ethereal_tap("sip,stat", sipstat_init);
+ register_stat_cmd_arg("sip,stat", sipstat_init,NULL);
}