Revert r35132 so that a better fix can be implemented that doesn't break
[obnox/wireshark/wip.git] / tap-smbsids.c
index 4543676d3a36c13435d2dea2cd14f48bf6531043..2955bcfbed1157d04e025437f5c6a947594ab2d9 100644 (file)
@@ -3,8 +3,8 @@
  *
  * $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
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-/* With MSVC and a libethereal.dll this file needs to import some variables 
-   in a special way. Therefore _NEED_VAR_IMPORT_ is defined. */   
-#define _NEED_VAR_IMPORT_
-
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
 #include <string.h>
 #include "epan/packet_info.h"
 #include <epan/dissectors/packet-smb-sidsnooping.h>
-#include "register.h"
-#include "tap.h"
+#include <epan/tap.h>
+#include <epan/stat_cmd_args.h>
 #include "epan/value_string.h"
-#include "smb.h"
+#include <epan/dissectors/packet-smb.h>
 
 
 static int
-smbsids_packet(void *pss _U_, packet_info *pinfo _U_, epan_dissect_t *edt _U_, void *psi _U_)
+smbsids_packet(void *pss _U_, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *psi _U_)
 {
        return 1;
 }
 
-static void 
+static void
 enum_sids(gpointer key _U_, gpointer value, gpointer userdata _U_)
 {
        sid_name *sn=(sid_name *)value;
@@ -72,23 +68,23 @@ smbsids_draw(void *pss _U_)
 
 
 static void
-smbsids_init(char *optarg _U_)
+smbsids_init(const char *optarg _U_, void* userdata _U_)
 {
        GString *error_string;
 
        if(!sid_name_snooping){
                fprintf(stderr,"The -z smb,sids function needs SMB/SID-Snooping to be enabled.\n");
-               fprintf(stderr,"Either enable Edit/Preferences/Protocols/SMB/Snoop SID name mappings  in ethereal\n");
+               fprintf(stderr,"Either enable Edit/Preferences/Protocols/SMB/Snoop SID name mappings  in wireshark\n");
                fprintf(stderr,"or override the preference file by specifying\n");
                fprintf(stderr,"  -o \"smb.sid_name_snooping=TRUE\"\n");
-               fprintf(stderr,"on the tethereal command line.\n");
+               fprintf(stderr,"on the tshark command line.\n");
                exit(1);
        }
 
 
-       error_string=register_tap_listener("smb", NULL, NULL, NULL, smbsids_packet, smbsids_draw);
+       error_string=register_tap_listener("smb", NULL, NULL, 0, NULL, smbsids_packet, smbsids_draw);
        if(error_string){
-               fprintf(stderr, "tethereal: Couldn't register smb,sids tap:%s\n",
+               fprintf(stderr, "tshark: Couldn't register smb,sids tap:%s\n",
                    error_string->str);
                g_string_free(error_string, TRUE);
                exit(1);
@@ -99,6 +95,6 @@ smbsids_init(char *optarg _U_)
 void
 register_tap_listener_smbsids(void)
 {
-       register_ethereal_tap("smb,sids", smbsids_init);
+       register_stat_cmd_arg("smb,sids", smbsids_init,NULL);
 }