Add another DL CRC error - Duplicate NonZero RV.
[obnox/wireshark/wip.git] / gtk / hostlist_wlan.c
index 65e0fe338bcee5e1a99b8ecf793fff4d3ed13325..cbf1d20557b5ce98b93388a72e34d3a8599e51cc 100644 (file)
@@ -1,10 +1,10 @@
-/* hostlist_wlan.c   2004 Giles Scott 
+/* hostlist_wlan.c   2004 Giles Scott
  * modified from endpoint_talkers_eth.c   2003 Ronnie Sahlberg
  *
  * $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
 #ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
+#include <string.h>
 
 #include <gtk/gtk.h>
-#include <string.h>
+
 #include "epan/packet.h"
-#include "tap_menu.h"
+#include <epan/stat_cmd_args.h>
 #include <epan/tap.h>
-#include "../register.h"
-#include "hostlist_table.h"
 #include <epan/dissectors/packet-ieee80211.h>
 
+#include "../stat_menu.h"
+
+#include "gtk/gui_stat_menu.h"
+#include "gtk/hostlist_table.h"
 
 static int
 wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
@@ -49,14 +52,14 @@ wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con
         /* Take two "add" passes per packet, adding for each direction, ensures that all
         packets are counted properly (even if address is sending to itself)
         XXX - this could probably be done more efficiently inside hostlist_table */
-        add_hostlist_table_data(hosts, &whdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, SAT_ETHER, PT_NONE);
-        add_hostlist_table_data(hosts, &whdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, SAT_ETHER, PT_NONE);
+        add_hostlist_table_data(hosts, &whdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, SAT_WLAN, PT_NONE);
+        add_hostlist_table_data(hosts, &whdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, SAT_WLAN, PT_NONE);
 
         return 1;
 }
 
 static void
-gtk_wlan_hostlist_init(const char *optarg)
+gtk_wlan_hostlist_init(const char *optarg, void* userdata _U_)
 {
         const char *filter=NULL;
 
@@ -66,25 +69,33 @@ gtk_wlan_hostlist_init(const char *optarg)
                 filter=NULL;
         }
 
-        init_hostlist_table(TRUE, "WLAN Hosts", "wlan", filter, wlan_hostlist_packet);
+        init_hostlist_table(TRUE, "WLAN", "wlan", filter, wlan_hostlist_packet);
 
 }
 
-
+#ifdef MAIN_MENU_USE_UIMANAGER
+void
+gtk_wlan_hostlist_cb(GtkAction *action _U_, gpointer user_data _U_)
+{
+        gtk_wlan_hostlist_init("hosts,wlan",NULL);
+}
+#else
 static void
 gtk_wlan_hostlist_cb(GtkWidget *w _U_, gpointer d _U_)
 {
-        gtk_wlan_hostlist_init("hosts,wlan");
+        gtk_wlan_hostlist_init("hosts,wlan",NULL);
 }
-
+#endif
 
 void
 register_tap_listener_wlan_hostlist(void)
 {
-        register_tap_listener_cmd_arg("hosts,wlan", gtk_wlan_hostlist_init);
+        register_stat_cmd_arg("hosts,wlan", gtk_wlan_hostlist_init,NULL);
 
-        register_tap_menu_item("WLAN", REGISTER_TAP_GROUP_ENDPOINT_LIST,
+#ifdef MAIN_MENU_USE_UIMANAGER
+#else
+        register_stat_menu_item("WLAN", REGISTER_STAT_GROUP_ENDPOINT_LIST,
             gtk_wlan_hostlist_cb, NULL, NULL, NULL);
-
+#endif
         register_hostlist_table(TRUE, "WLAN", "wlan", NULL /*filter*/, wlan_hostlist_packet);
 }