Make Content-Length and Max-Forwards fields uints
[obnox/wireshark/wip.git] / tap-ansi_astat.c
index 94b498acca148cf508884a5f086a723ec3fbf761..b5a3c425372093f5217280042c0f6b264740b6d6 100644 (file)
@@ -3,10 +3,10 @@
  * Copyright 2003, Michael Lum <mlum [AT] telostech.com>
  * In association with Telos Technology Inc.
  *
- * $Id: tap-ansi_astat.c,v 1.2 2003/12/03 23:46:22 guy Exp $
+ * $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 <string.h>
 #include "epan/packet_info.h"
 #include "epan/value_string.h"
-#include "tap.h"
-#include "packet-bssap.h"
-#include "packet-ansi_a.h"
+#include <epan/tap.h>
+#include <epan/stat_cmd_args.h>
+#include <epan/dissectors/packet-bssap.h>
+#include <epan/dissectors/packet-ansi_a.h>
 #include "register.h"
 
 
@@ -56,16 +57,14 @@ typedef struct _ansi_a_stat_t {
 static int
 ansi_a_stat_packet(
     void                       *tapdata,
-    packet_info                        *pinfo,
+    packet_info                        *pinfo _U_,
     epan_dissect_t             *edt _U_,
-    void                       *data)
+    const void                 *data)
 {
     ansi_a_stat_t              *stat_p = tapdata;
-    ansi_a_tap_rec_t           *tap_p = data;
+    const ansi_a_tap_rec_t     *tap_p = data;
 
 
-    pinfo = pinfo;
-
     switch (tap_p->pdu_type)
     {
     case BSSAP_PDU_TYPE_BSMAP:
@@ -106,7 +105,7 @@ ansi_a_stat_draw(
        if (stat_p->bsmap_message_type[ansi_a_ios401_bsmap_strings[i].value] > 0)
        {
            printf("0x%02x  %-50s%d\n",
-               i,
+               ansi_a_ios401_bsmap_strings[i].value,
                ansi_a_ios401_bsmap_strings[i].strptr,
                stat_p->bsmap_message_type[ansi_a_ios401_bsmap_strings[i].value]);
        }
@@ -123,7 +122,7 @@ ansi_a_stat_draw(
        if (stat_p->dtap_message_type[ansi_a_ios401_dtap_strings[i].value] > 0)
        {
            printf("0x%02x  %-50s%d\n",
-               i,
+               ansi_a_ios401_dtap_strings[i].value,
                ansi_a_ios401_dtap_strings[i].strptr,
                stat_p->dtap_message_type[ansi_a_ios401_dtap_strings[i].value]);
        }
@@ -136,14 +135,11 @@ ansi_a_stat_draw(
 
 
 static void
-ansi_a_stat_init(char *optarg)
+ansi_a_stat_init(const char *optarg _U_, void* userdata _U_)
 {
     ansi_a_stat_t      *stat_p;
     GString            *err_p;
 
-
-    optarg = optarg;
-
     stat_p = g_malloc(sizeof(ansi_a_stat_t));
 
     memset(stat_p, 0, sizeof(ansi_a_stat_t));
@@ -167,5 +163,5 @@ ansi_a_stat_init(char *optarg)
 void
 register_tap_listener_ansi_astat(void)
 {
-    register_ethereal_tap("ansi_a,", ansi_a_stat_init);
+    register_stat_cmd_arg("ansi_a,", ansi_a_stat_init,NULL);
 }