Delete extra_split if we're not using it. This keeps its handle from
[metze/wireshark/wip.git] / ui / gtk / conversations_wlan.c
1 /* conversations_wlan.c 2004 Giles Scott
2  * modified from conversations_eth.c   2003 Ronnie Sahlberg
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24
25 #include "config.h"
26
27 #include <string.h>
28
29 #include <gtk/gtk.h>
30
31 #include <epan/packet.h>
32 #include <epan/stat_cmd_args.h>
33 #include <epan/tap.h>
34 #include <epan/dissectors/packet-ieee80211.h>
35
36 #include "../stat_menu.h"
37
38 #include "ui/gtk/gui_stat_menu.h"
39 #include "ui/gtk/conversations_table.h"
40
41 static int
42 wlan_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
43 {
44         const wlan_hdr *whdr=(wlan_hdr *)vip;
45
46         add_conversation_table_data((conversations_table *)pct, &whdr->src, &whdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, SAT_WLAN, PT_NONE);
47
48         return 1;
49 }
50
51
52
53 static void
54 wlan_conversation_init(const char *opt_arg, void* userdata _U_)
55 {
56         const char *filter=NULL;
57
58         if(!strncmp(opt_arg,"conv,wlan,",10)){
59                 filter=opt_arg+10;
60         } else {
61                 filter=NULL;
62         }
63
64         init_conversation_table(TRUE, "WLAN", "wlan", filter, wlan_conversation_packet);
65
66 }
67
68 void
69 wlan_endpoints_cb(GtkAction *action _U_, gpointer user_data _U_)
70 {
71         wlan_conversation_init("conv,wlan",NULL);
72 }
73
74 void
75 register_tap_listener_wlan_conversation(void)
76 {
77         register_stat_cmd_arg("conv,wlan", wlan_conversation_init,NULL);
78         register_conversation_table(TRUE, "WLAN", "wlan", NULL /*filter*/, wlan_conversation_packet);
79 }