diff options
Diffstat (limited to 'ui/gtk')
-rw-r--r-- | ui/gtk/CMakeLists.txt | 15 | ||||
-rw-r--r-- | ui/gtk/Makefile.common | 15 | ||||
-rw-r--r-- | ui/gtk/conversations_eth.c | 81 | ||||
-rw-r--r-- | ui/gtk/conversations_fc.c | 81 | ||||
-rw-r--r-- | ui/gtk/conversations_fddi.c | 80 | ||||
-rw-r--r-- | ui/gtk/conversations_ip.c | 78 | ||||
-rw-r--r-- | ui/gtk/conversations_ipv6.c | 87 | ||||
-rw-r--r-- | ui/gtk/conversations_ipx.c | 80 | ||||
-rw-r--r-- | ui/gtk/conversations_jxta.c | 89 | ||||
-rw-r--r-- | ui/gtk/conversations_ncp.c | 81 | ||||
-rw-r--r-- | ui/gtk/conversations_rsvp.c | 82 | ||||
-rw-r--r-- | ui/gtk/conversations_sctp.c | 88 | ||||
-rw-r--r-- | ui/gtk/conversations_table.c | 140 | ||||
-rw-r--r-- | ui/gtk/conversations_table.h | 18 | ||||
-rw-r--r-- | ui/gtk/conversations_tcpip.c | 80 | ||||
-rw-r--r-- | ui/gtk/conversations_tr.c | 80 | ||||
-rw-r--r-- | ui/gtk/conversations_udpip.c | 80 | ||||
-rw-r--r-- | ui/gtk/conversations_usb.c | 78 | ||||
-rw-r--r-- | ui/gtk/conversations_wlan.c | 80 | ||||
-rw-r--r-- | ui/gtk/hostlist_ncp.c | 4 | ||||
-rw-r--r-- | ui/gtk/hostlist_table.h | 24 | ||||
-rw-r--r-- | ui/gtk/main.c | 3 | ||||
-rw-r--r-- | ui/gtk/main_menubar.c | 103 |
23 files changed, 178 insertions, 1369 deletions
diff --git a/ui/gtk/CMakeLists.txt b/ui/gtk/CMakeLists.txt index 53e6e093f4..6f1b9f6079 100644 --- a/ui/gtk/CMakeLists.txt +++ b/ui/gtk/CMakeLists.txt @@ -130,21 +130,6 @@ set(WIRESHARK_TAP_SRC camel_counter.c camel_srt.c compare_stat.c - conversations_eth.c - conversations_fc.c - conversations_fddi.c - conversations_ip.c - conversations_ipv6.c - conversations_ipx.c - conversations_jxta.c - conversations_ncp.c - conversations_rsvp.c - conversations_sctp.c - conversations_tcpip.c - conversations_tr.c - conversations_udpip.c - conversations_usb.c - conversations_wlan.c dcerpc_stat.c diameter_stat.c expert_comp_dlg.c diff --git a/ui/gtk/Makefile.common b/ui/gtk/Makefile.common index cd45d6a44c..2d644d9009 100644 --- a/ui/gtk/Makefile.common +++ b/ui/gtk/Makefile.common @@ -154,21 +154,6 @@ WIRESHARK_TAP_SRC = \ camel_counter.c \ camel_srt.c \ compare_stat.c \ - conversations_eth.c \ - conversations_fc.c \ - conversations_fddi.c \ - conversations_ip.c \ - conversations_ipv6.c \ - conversations_ipx.c \ - conversations_jxta.c \ - conversations_ncp.c \ - conversations_rsvp.c \ - conversations_sctp.c \ - conversations_tcpip.c \ - conversations_tr.c \ - conversations_udpip.c \ - conversations_usb.c \ - conversations_wlan.c \ dcerpc_stat.c \ diameter_stat.c \ expert_comp_dlg.c \ diff --git a/ui/gtk/conversations_eth.c b/ui/gtk/conversations_eth.c deleted file mode 100644 index cca55f194b..0000000000 --- a/ui/gtk/conversations_eth.c +++ /dev/null @@ -1,81 +0,0 @@ -/* conversations_eth.c - * conversations_eth 2003 Ronnie Sahlberg - * - * 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 - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <string.h> - -#include <gtk/gtk.h> - -#include <epan/packet.h> -#include <epan/stat_cmd_args.h> -#include <epan/tap.h> -#include <epan/dissectors/packet-eth.h> - -#include <epan/stat_groups.h> - -#include "ui/gtk/gui_stat_menu.h" -#include "ui/gtk/conversations_table.h" - -void register_tap_listener_eth_conversation(void); - -static int -eth_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) -{ - conversations_table *ct = (conversations_table *) pct; - const eth_hdr *ehdr=(const eth_hdr *)vip; - - add_conversation_table_data(&ct->hash, &ehdr->src, &ehdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, CONV_TYPE_ETHERNET, PT_NONE); - - return 1; -} - - - -static void -eth_conversation_init(const char *opt_arg, void* userdata _U_) -{ - const char *filter=NULL; - - if(!strncmp(opt_arg,"conv,eth,",9)){ - filter=opt_arg+9; - } else { - filter=NULL; - } - - init_conversation_table(CONV_TYPE_ETHERNET, filter, eth_conversation_packet); - -} - -void -eth_endpoints_cb(GtkAction *action _U_, gpointer user_data _U_) -{ - eth_conversation_init("conv,eth", NULL); -} - -void -register_tap_listener_eth_conversation(void) -{ - register_stat_cmd_arg("conv,eth", eth_conversation_init,NULL); - register_conversation_table(CONV_TYPE_ETHERNET, NULL /*filter*/, eth_conversation_packet); -} - diff --git a/ui/gtk/conversations_fc.c b/ui/gtk/conversations_fc.c deleted file mode 100644 index c8733e1e3e..0000000000 --- a/ui/gtk/conversations_fc.c +++ /dev/null @@ -1,81 +0,0 @@ -/* conversations_fc.c - * conversations_fc 2003 Ronnie Sahlberg - * - * 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 - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <string.h> - -#include <gtk/gtk.h> - -#include <epan/packet.h> -#include <epan/stat_cmd_args.h> -#include <epan/tap.h> -#include <epan/conversation.h> -#include <epan/dissectors/packet-fc.h> - -#include <epan/stat_groups.h> - -#include "ui/gtk/gui_stat_menu.h" -#include "ui/gtk/conversations_table.h" - -void register_tap_listener_fc_conversation(void); - -static int -fc_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) -{ - conversations_table *ct = (conversations_table *) pct; - const fc_hdr *fchdr=(const fc_hdr *)vip; - - add_conversation_table_data(&ct->hash, &fchdr->s_id, &fchdr->d_id, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, CONV_TYPE_FIBRE_CHANNEL, PT_NONE); - - return 1; -} - - - -static void -fc_conversation_init(const char *opt_arg, void* userdata _U_) -{ - const char *filter=NULL; - - if(!strncmp(opt_arg,"conv,fc,",8)){ - filter=opt_arg+8; - } else { - filter=NULL; - } - - init_conversation_table(CONV_TYPE_FIBRE_CHANNEL, filter, fc_conversation_packet); - -} - -void -fc_endpoints_cb(GtkAction *action _U_, gpointer user_data _U_) -{ - fc_conversation_init("conv,fc",NULL); -} - -void -register_tap_listener_fc_conversation(void) -{ - register_stat_cmd_arg("conv,fc", fc_conversation_init, NULL); - register_conversation_table(CONV_TYPE_FIBRE_CHANNEL, NULL /*filter*/, fc_conversation_packet); -} diff --git a/ui/gtk/conversations_fddi.c b/ui/gtk/conversations_fddi.c deleted file mode 100644 index bef12493f7..0000000000 --- a/ui/gtk/conversations_fddi.c +++ /dev/null @@ -1,80 +0,0 @@ -/* conversations_fddi.c - * conversations_fddi 2003 Ronnie Sahlberg - * - * 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 - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <string.h> - -#include <gtk/gtk.h> - -#include "epan/packet.h" -#include <epan/stat_cmd_args.h> -#include <epan/tap.h> -#include <epan/dissectors/packet-fddi.h> - -#include <epan/stat_groups.h> - -#include "ui/gtk/gui_stat_menu.h" -#include "ui/gtk/conversations_table.h" - -void register_tap_listener_fddi_conversation(void); - -static int -fddi_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) -{ - conversations_table *ct = (conversations_table *) pct; - const fddi_hdr *ehdr=(const fddi_hdr *)vip; - - add_conversation_table_data(&ct->hash, &ehdr->src, &ehdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, CONV_TYPE_FDDI, PT_NONE); - - return 1; -} - - - -static void -fddi_conversation_init(const char *opt_arg, void* userdata _U_ ) -{ - const char *filter=NULL; - - if(!strncmp(opt_arg,"conv,fddi,",10)){ - filter=opt_arg+10; - } else { - filter=NULL; - } - - init_conversation_table(CONV_TYPE_FDDI, filter, fddi_conversation_packet); - -} - -void -fddi_endpoints_cb(GtkAction *action _U_, gpointer user_data _U_) -{ - fddi_conversation_init("conv,fddi",NULL); -} - -void -register_tap_listener_fddi_conversation(void) -{ - register_stat_cmd_arg("conv,fddi", fddi_conversation_init,NULL); - register_conversation_table(CONV_TYPE_FDDI, NULL /*filter*/, fddi_conversation_packet); -} diff --git a/ui/gtk/conversations_ip.c b/ui/gtk/conversations_ip.c deleted file mode 100644 index 280329728a..0000000000 --- a/ui/gtk/conversations_ip.c +++ /dev/null @@ -1,78 +0,0 @@ -/* conversations_ip.c - * conversations_ip 2003 Ronnie Sahlberg - * - * 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 - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <string.h> - -#include <gtk/gtk.h> - -#include <epan/packet.h> -#include <epan/stat_cmd_args.h> -#include <epan/tap.h> -#include <epan/dissectors/packet-ip.h> - -#include <epan/stat_groups.h> - -#include "ui/gtk/gui_stat_menu.h" -#include "ui/gtk/conversations_table.h" - -void register_tap_listener_ip_conversation(void); - -static int -ip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) -{ - conversations_table *ct = (conversations_table *) pct; - const ws_ip *iph=(const ws_ip *)vip; - - add_conversation_table_data(&ct->hash, &iph->ip_src, &iph->ip_dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, CONV_TYPE_IPV4, PT_NONE); - - return 1; -} - -static void -ip_conversation_init(const char *opt_arg, void* userdata _U_) -{ - const char *filter=NULL; - - if(!strncmp(opt_arg,"conv,ip,",8)){ - filter=opt_arg+8; - } else { - filter=NULL; - } - - init_conversation_table(CONV_TYPE_IPV4, filter, ip_conversation_packet); - -} - -void -ip_endpoints_cb(GtkAction *action _U_, gpointer user_data _U_) -{ - ip_conversation_init("conv,ip",NULL); -} - -void -register_tap_listener_ip_conversation(void) -{ - register_stat_cmd_arg("conv,ip", ip_conversation_init,NULL); - register_conversation_table(CONV_TYPE_IPV4, NULL /*filter*/, ip_conversation_packet); -} diff --git a/ui/gtk/conversations_ipv6.c b/ui/gtk/conversations_ipv6.c deleted file mode 100644 index 9634e650e2..0000000000 --- a/ui/gtk/conversations_ipv6.c +++ /dev/null @@ -1,87 +0,0 @@ -/* conversations_ipv6.c 2009 Clif Bratcher - * Modified from conversations_ip 2003 Ronnie Sahlberg - * - * 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 - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <string.h> - -#include <gtk/gtk.h> - -#include <epan/packet.h> -#include <epan/stat_cmd_args.h> -#include <epan/tap.h> -#include <epan/dissectors/packet-ipv6.h> - -#include <epan/stat_groups.h> - -#include "ui/gtk/gui_stat_menu.h" -#include "ui/gtk/conversations_table.h" - -void register_tap_listener_ipv6_conversation(void); - -static int -ipv6_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) -{ - conversations_table *ct = (conversations_table *) pct; - const struct ip6_hdr *ip6h = (const struct ip6_hdr *)vip; - address src; - address dst; - - /* Addresses aren't implemented as 'address' type in struct ip6_hdr */ - src.type = dst.type = AT_IPv6; - src.len = dst.len = sizeof(struct e_in6_addr); - src.data = &ip6h->ip6_src; - dst.data = &ip6h->ip6_dst; - - add_conversation_table_data(&ct->hash, &src, &dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, CONV_TYPE_IPV6, PT_NONE); - - return 1; -} - - -static void -ipv6_conversation_init(const char *opt_arg, void *userdata _U_) -{ - const char *filter=NULL; - - if(!strncmp(opt_arg, "conv,ipv6,", 10)) { - filter = opt_arg + 10; - } - else { - filter = NULL; - } - - init_conversation_table(CONV_TYPE_IPV6, filter, ipv6_conversation_packet); -} - -void -ipv6_endpoints_cb(GtkAction *action _U_, gpointer user_data _U_) -{ - ipv6_conversation_init("conv,ipv6", NULL); -} - -void -register_tap_listener_ipv6_conversation(void) -{ - register_stat_cmd_arg("conv,ipv6", ipv6_conversation_init, NULL); - register_conversation_table(CONV_TYPE_IPV6, NULL /*filter*/, ipv6_conversation_packet); -} diff --git a/ui/gtk/conversations_ipx.c b/ui/gtk/conversations_ipx.c deleted file mode 100644 index d1fa85086e..0000000000 --- a/ui/gtk/conversations_ipx.c +++ /dev/null @@ -1,80 +0,0 @@ -/* conversations_ipx.c - * conversations_ipx 2003 Ronnie Sahlberg - * - * 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 - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <string.h> - -#include <gtk/gtk.h> - -#include <epan/packet.h> -#include <epan/stat_cmd_args.h> -#include <epan/tap.h> -#include <epan/dissectors/packet-ipx.h> - -#include <epan/stat_groups.h> - -#include "ui/gtk/gui_stat_menu.h" -#include "ui/gtk/conversations_table.h" - -void register_tap_listener_ipx_conversation(void); - -static int -ipx_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) -{ - conversations_table *ct = (conversations_table *) pct; - const ipxhdr_t *ipxh=(const ipxhdr_t *)vip; - - add_conversation_table_data(&ct->hash, &ipxh->ipx_src, &ipxh->ipx_dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, CONV_TYPE_IPX, PT_NONE); - - return 1; -} - - - -static void -ipx_conversation_init(const char *opt_arg, void* userdata _U_) -{ - const char *filter=NULL; - - if(!strncmp(opt_arg,"conv,ipx,",9)){ - filter=opt_arg+9; - } else { - filter=NULL; - } - - init_conversation_table(CONV_TYPE_IPX, filter, ipx_conversation_packet); - -} - -void -ipx_endpoints_cb(GtkAction *action _U_, gpointer user_data _U_) -{ - ipx_conversation_init("conv,ipx",NULL); -} - -void -register_tap_listener_ipx_conversation(void) -{ - register_stat_cmd_arg("conv,ipx", ipx_conversation_init,NULL); - register_conversation_table(CONV_TYPE_IPX, NULL /*filter*/, ipx_conversation_packet); -} diff --git a/ui/gtk/conversations_jxta.c b/ui/gtk/conversations_jxta.c deleted file mode 100644 index 472a3207a5..0000000000 --- a/ui/gtk/conversations_jxta.c +++ /dev/null @@ -1,89 +0,0 @@ -/* conversations_jxta.c - * conversations_jxta copyright (c) 2005 Mike Duigou <bondolo@jxta.org> - * copied from conversations_sctp.c - * - * 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 - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <string.h> - -#include <gtk/gtk.h> - -#include <epan/packet.h> -#include <epan/stat_cmd_args.h> -#include <epan/tap.h> -#include <epan/dissectors/packet-jxta.h> - -#include <epan/stat_groups.h> - -#include "ui/gtk/gui_stat_menu.h" -#include "ui/gtk/conversations_table.h" - -void register_tap_listener_jxta_conversation(void); - -static int -jxta_conversation_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *vip) -{ - conversations_table *ct = (conversations_table *) pct; - const jxta_tap_header *jxtahdr = (const jxta_tap_header *) vip; - - add_conversation_table_data(&ct->hash, - &jxtahdr->src_address, - &jxtahdr->dest_address, - 0, - 0, - 1, - jxtahdr->size, - NULL, - CONV_TYPE_JXTA, - PT_NONE); - - - return 1; -} - -static void -jxta_conversation_init(const char *opt_arg, void* userdata _U_) -{ - const char *filter=NULL; - - if(!strncmp(opt_arg,"conv,jxta,",10)){ - filter=opt_arg+10; - } else { - filter=NULL; - } - - init_conversation_table(CONV_TYPE_JXTA, filter, jxta_conversation_packet); - -} - -void -jxta_conversation_cb(GtkAction *action _U_, gpointer user_data _U_) -{ - jxta_conversation_init("conv,jxta",NULL); -} - -void -register_tap_listener_jxta_conversation(void) -{ - register_stat_cmd_arg("conv,jxta", jxta_conversation_init,NULL); - register_conversation_table(CONV_TYPE_JXTA, NULL /*filter*/, jxta_conversation_packet); -} diff --git a/ui/gtk/conversations_ncp.c b/ui/gtk/conversations_ncp.c deleted file mode 100644 index 4ef3e3bb8e..0000000000 --- a/ui/gtk/conversations_ncp.c +++ /dev/null @@ -1,81 +0,0 @@ -/* conversations_ncp.c 2005 Greg Morris - * modified from conversations_eth.c 2003 Ronnie Sahlberg - * - * 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 - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <string.h> - -#include <gtk/gtk.h> - -#include <epan/packet.h> -#include <epan/stat_cmd_args.h> -#include <epan/tap.h> -#include <epan/dissectors/packet-ncp-int.h> - -#include <epan/stat_groups.h> - -#include "ui/gtk/gui_stat_menu.h" -#include "ui/gtk/conversations_table.h" - -void register_tap_listener_ncp_conversation(void); - -static int -ncp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) -{ - conversations_table *ct = (conversations_table *) pct; - const struct ncp_common_header *ncph=(const struct ncp_common_header *)vip; - guint32 connection; - - connection = (ncph->conn_high * 256)+ncph->conn_low; - if (connection < 65535) { - add_conversation_table_data(&ct->hash, &pinfo->src, &pinfo->dst, connection, connection, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, CONV_TYPE_NCP, PT_NCP); - } - - return 1; -} - -static void -ncp_conversation_init(const char *opt_arg, void* userdata _U_) -{ - const char *filter=NULL; - - if(!strncmp(opt_arg,"conv,ncp,",9)){ - filter=opt_arg+9; - } else { - filter=NULL; - } - - init_conversation_table(CONV_TYPE_NCP, filter, ncp_conversation_packet); -} - -void -ncp_endpoints_cb(GtkAction *action _U_, gpointer user_data _U_) -{ - ncp_conversation_init("conv,ncp",NULL); -} - -void -register_tap_listener_ncp_conversation(void) -{ - register_stat_cmd_arg("conv,ncp", ncp_conversation_init,NULL); - register_conversation_table(CONV_TYPE_NCP, NULL /*filter*/, ncp_conversation_packet); -} diff --git a/ui/gtk/conversations_rsvp.c b/ui/gtk/conversations_rsvp.c deleted file mode 100644 index 1393c3db71..0000000000 --- a/ui/gtk/conversations_rsvp.c +++ /dev/null @@ -1,82 +0,0 @@ -/* conversations_rsvp.c - * conversations_rsvp.c August 2005, Manu Pathak <mapathak@cisco.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 - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <string.h> - -#include <gtk/gtk.h> - -#include <epan/packet.h> -#include <epan/stat_cmd_args.h> -#include <epan/tap.h> -#include <epan/dissectors/packet-rsvp.h> - -#include <epan/stat_groups.h> - -#include "ui/gtk/gui_stat_menu.h" -#include "ui/gtk/conversations_table.h" - -void register_tap_listener_rsvp_conversation(void); - -static int -rsvp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) -{ - conversations_table *ct = (conversations_table *) pct; - const rsvp_conversation_info *rsvph = (const rsvp_conversation_info *)vip; - - add_conversation_table_data(&ct->hash, - &rsvph->source, &rsvph->destination, 0, 0, 1, - pinfo->fd->pkt_len, &pinfo->rel_ts, CONV_TYPE_RSVP, PT_NONE); - - return 1; -} - -static void -rsvp_conversation_init(const char *opt_arg, void* userdata _U_) -{ - const char *filter=NULL; - - if(!strncmp(opt_arg,"conv,rsvp,",10)){ - filter=opt_arg+10; - } else { - filter=NULL; - } - - init_conversation_table(CONV_TYPE_RSVP, filter, - rsvp_conversation_packet); - -} - -void -rsvp_endpoints_cb(GtkAction *action _U_, gpointer user_data _U_) -{ - rsvp_conversation_init("conv,rsvp",NULL); -} - -void -register_tap_listener_rsvp_conversation(void) -{ - register_stat_cmd_arg("conv,rsvp", rsvp_conversation_init,NULL); - register_conversation_table(CONV_TYPE_RSVP, NULL /*filter*/, - rsvp_conversation_packet); -} diff --git a/ui/gtk/conversations_sctp.c b/ui/gtk/conversations_sctp.c deleted file mode 100644 index 5b35be16a9..0000000000 --- a/ui/gtk/conversations_sctp.c +++ /dev/null @@ -1,88 +0,0 @@ -/* conversations_sctp.c - * conversations_sctp 2005 Oleg Terletsky <oleg.terletsky@comverse.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 - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <string.h> - -#include <gtk/gtk.h> - -#include <epan/packet.h> -#include <epan/stat_cmd_args.h> -#include <epan/tap.h> -#include <epan/dissectors/packet-sctp.h> - -#include <epan/stat_groups.h> - -#include "ui/gtk/gui_stat_menu.h" -#include "ui/gtk/conversations_table.h" - -void register_tap_listener_sctp_conversation(void); - -static int -sctp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) -{ - conversations_table *ct = (conversations_table *) pct; - const struct _sctp_info *sctphdr=(const struct _sctp_info *)vip; - - add_conversation_table_data(&ct->hash, - &sctphdr->ip_src, - &sctphdr->ip_dst, - sctphdr->sport, - sctphdr->dport, - 1, - pinfo->fd->pkt_len, - &pinfo->rel_ts, - CONV_TYPE_SCTP, - PT_SCTP); - - - return 1; -} - -static void -sctp_conversation_init(const char *opt_arg, void* userdata _U_) -{ - const char *filter=NULL; - - if(!strncmp(opt_arg,"conv,sctp,",10)){ - filter=opt_arg+10; - } else { - filter=NULL; - } - - init_conversation_table(CONV_TYPE_SCTP, filter, sctp_conversation_packet); - -} - -void -sctp_conversation_cb(GtkAction *action _U_, gpointer user_data _U_) -{ - sctp_conversation_init("conv,sctp",NULL); -} - -void -register_tap_listener_sctp_conversation(void) -{ - register_stat_cmd_arg("conv,sctp", sctp_conversation_init,NULL); - register_conversation_table(CONV_TYPE_SCTP, NULL /*filter*/, sctp_conversation_packet); -} diff --git a/ui/gtk/conversations_table.c b/ui/gtk/conversations_table.c index 2ab15ee7b3..efc0daa48d 100644 --- a/ui/gtk/conversations_table.c +++ b/ui/gtk/conversations_table.c @@ -131,7 +131,9 @@ reset_ct_table_data(conversations_table *ct) static void reset_ct_table_data_cb(void *arg) { - reset_ct_table_data((conversations_table *)arg); + conv_hash_t *hash = (conv_hash_t*)arg; + + reset_ct_table_data((conversations_table *)hash->user_data); } static void @@ -139,7 +141,7 @@ ct_win_destroy_cb(GtkWindow *win _U_, gpointer data) { conversations_table *conversations=(conversations_table *)data; - remove_tap_listener(conversations); + remove_tap_listener(&conversations->hash); reset_ct_table_data(conversations); g_free(conversations); @@ -1757,7 +1759,9 @@ draw_ct_table_data(conversations_table *ct) static void draw_ct_table_data_cb(void *arg) { - draw_ct_table_data((conversations_table *)arg); + conv_hash_t *hash = (conv_hash_t*)arg; + + draw_ct_table_data((conversations_table *)hash->user_data); } typedef struct { @@ -2025,8 +2029,9 @@ init_ct_table_page(conversations_table *conversations, GtkWidget *vbox, gboolean gtk_tree_view_set_headers_clickable(conversations->table, TRUE); gtk_tree_view_set_reorderable (conversations->table, TRUE); - conversations->hash.conv_array=NULL; - conversations->hash.hashtable=NULL; + conversations->hash.conv_array = NULL; + conversations->hash.hashtable = NULL; + conversations->hash.user_data = conversations; sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(conversations->table)); gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE); @@ -2035,7 +2040,7 @@ init_ct_table_page(conversations_table *conversations, GtkWidget *vbox, gboolean ct_create_popup_menu(conversations); /* register the tap and rerun the taps on the packet list */ - error_string=register_tap_listener(tap_name, conversations, filter, 0, reset_ct_table_data_cb, packet_func, + error_string=register_tap_listener(tap_name, &conversations->hash, filter, 0, reset_ct_table_data_cb, packet_func, draw_ct_table_data_cb); if(error_string){ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str); @@ -2163,12 +2168,12 @@ follow_stream_cb(GtkWidget *follow_stream_bt, gpointer data _U_) void -init_conversation_table(conversation_type_e conv_type, const char *filter, tap_packet_cb packet_func) +init_conversation_table(struct register_ct* ct, const char *filter) { conversations_table *conversations; char *display_name; char title[256]; - const char *table_name = conversation_title(conv_type); + const char *table_name = proto_get_protocol_short_name(find_protocol_by_id(get_conversation_proto_id(ct))); GtkWidget *vbox; GtkWidget *bbox; GtkWidget *close_bt, *help_bt; @@ -2199,9 +2204,9 @@ init_conversation_table(conversation_type_e conv_type, const char *filter, tap_p gtk_container_set_border_width(GTK_CONTAINER(vbox), DLG_OUTER_MARGIN); ret = init_ct_table_page(conversations, vbox, - conversation_hide_ports(conv_type), - table_name, conversation_tap_name(conv_type), - filter, packet_func); + get_conversation_hide_ports(ct), + table_name, proto_get_protocol_filter_name(get_conversation_proto_id(ct)), + filter, get_conversation_packet_func(ct)); if(ret == FALSE) { g_free(conversations); return; @@ -2341,14 +2346,14 @@ ct_win_destroy_notebook_cb(GtkWindow *win _U_, gpointer data) } static conversations_table * -init_ct_notebook_page_cb(gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter, tap_packet_cb packet_func) +init_ct_notebook_page_cb(register_ct_t *table, const char *filter) { gboolean ret; GtkWidget *page_vbox; conversations_table *conversations; conversations=g_new0(conversations_table,1); - conversations->name=table_name; + conversations->name=proto_get_protocol_short_name(find_protocol_by_id(get_conversation_proto_id(table))); conversations->filter=filter; conversations->resolve_names=TRUE; conversations->use_dfilter=FALSE; @@ -2357,7 +2362,8 @@ init_ct_notebook_page_cb(gboolean hide_ports, const char *table_name, const char conversations->win = page_vbox; gtk_container_set_border_width(GTK_CONTAINER(page_vbox), 6); - ret = init_ct_table_page(conversations, page_vbox, hide_ports, table_name, tap_name, filter, packet_func); + ret = init_ct_table_page(conversations, page_vbox, get_conversation_hide_ports(table), conversations->name, + proto_get_protocol_filter_name(get_conversation_proto_id(table)), filter, get_conversation_packet_func(table)); if(ret == FALSE) { g_free(conversations); return NULL; @@ -2366,35 +2372,6 @@ init_ct_notebook_page_cb(gboolean hide_ports, const char *table_name, const char return conversations; } - -typedef struct { - gboolean hide_ports; /* hide TCP / UDP port columns */ - const char *table_name; /* GUI output name */ - const char *tap_name; /* internal name */ - const char *filter; /* display filter string (unused) */ - tap_packet_cb packet_func; /* function to be called for new incoming packets */ -} register_ct_t; - - -static GSList *registered_ct_tables = NULL; - -void -register_conversation_table(conversation_type_e conv_type, const char *filter, tap_packet_cb packet_func) -{ - register_ct_t *table; - - table = g_new(register_ct_t,1); - - table->hide_ports = conversation_hide_ports(conv_type); - table->table_name = conversation_title(conv_type); - table->tap_name = conversation_tap_name(conv_type); - table->filter = filter; - table->packet_func = packet_func; - - registered_ct_tables = g_slist_append(registered_ct_tables, table); -} - - static void ct_resolve_toggle_dest(GtkWidget *widget, gpointer data) { @@ -2438,11 +2415,37 @@ ct_filter_toggle_dest(GtkWidget *widget, gpointer data) } } +typedef struct _init_ct_page_data { + int page; + void ** pages; + GtkWidget *nb; + GtkWidget *win; +} init_ct_page_data; + +static void +init_ct_page(gpointer data, gpointer user_data) +{ + register_ct_t *table = (register_ct_t*)data; + init_ct_page_data* ct_page_data = (init_ct_page_data*)user_data; + + conversations_table *conversations; + GtkWidget *page_lb; + + conversations = init_ct_notebook_page_cb(table, NULL /*filter*/); + if (conversations) { + + g_object_set_data(G_OBJECT(conversations->win), CONV_PTR_KEY, conversations); + page_lb = gtk_label_new(""); + gtk_notebook_append_page(GTK_NOTEBOOK(ct_page_data->nb), conversations->win, page_lb); + conversations->win = ct_page_data->win; + conversations->page_lb = page_lb; + ct_page_data->pages[++ct_page_data->page] = conversations; + } +} void init_conversation_notebook_cb(GtkWidget *w _U_, gpointer d _U_) { - conversations_table *conversations; char *display_name; char title[256]; GtkWidget *vbox; @@ -2452,19 +2455,16 @@ init_conversation_notebook_cb(GtkWidget *w _U_, gpointer d _U_) GtkWidget *win; GtkWidget *resolv_cb; GtkWidget *filter_cb; - int page; void ** pages; GtkWidget *nb; - GtkWidget *page_lb; - GSList *current_table; - register_ct_t *registered; GtkWidget *copy_bt; GtkWidget *follow_stream_bt; GtkWidget *graph_a_b_bt; GtkWidget *graph_b_a_bt; window_geometry_t tl_geom; + init_ct_page_data ct_page_iter_data; - pages = (void **)g_malloc(sizeof(void *) * (g_slist_length(registered_ct_tables) + 1)); + pages = (void **)g_malloc(sizeof(void *) * (conversation_table_get_num() + 1)); display_name = cf_get_display_name(&cfile); g_snprintf(title, sizeof(title), "Conversations: %s", display_name); @@ -2483,25 +2483,14 @@ init_conversation_notebook_cb(GtkWidget *w _U_, gpointer d _U_) gtk_box_pack_start(GTK_BOX (vbox), nb, TRUE, TRUE, 0); g_object_set_data(G_OBJECT(nb), NB_PAGES_KEY, pages); - page = 0; - - current_table = registered_ct_tables; - while(current_table) { - registered = (register_ct_t *)current_table->data; - conversations = init_ct_notebook_page_cb(registered->hide_ports, registered->table_name, registered->tap_name, - registered->filter, registered->packet_func); - if (conversations) { - g_object_set_data(G_OBJECT(conversations->win), CONV_PTR_KEY, conversations); - page_lb = gtk_label_new(""); - gtk_notebook_append_page(GTK_NOTEBOOK(nb), conversations->win, page_lb); - conversations->win = win; - conversations->page_lb = page_lb; - pages[++page] = conversations; - } - current_table = g_slist_next(current_table); - } + ct_page_iter_data.page = 0; + ct_page_iter_data.pages = pages; + ct_page_iter_data.nb = nb; + ct_page_iter_data.win = win; + + conversation_table_iterate_tables(init_ct_page, &ct_page_iter_data); - pages[0] = GINT_TO_POINTER(page); + pages[0] = GINT_TO_POINTER(ct_page_iter_data.page); hbox = ws_gtk_box_new(GTK_ORIENTATION_HORIZONTAL, DLG_UNRELATED_SPACING, FALSE); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); @@ -2538,13 +2527,13 @@ init_conversation_notebook_cb(GtkWidget *w _U_, gpointer d _U_) copy_bt = (GtkWidget *)g_object_get_data(G_OBJECT(bbox), GTK_STOCK_COPY); gtk_widget_set_tooltip_text(copy_bt, "Copy all statistical values of this page to the clipboard in CSV (Comma Separated Values) format."); g_signal_connect(copy_bt, "clicked", G_CALLBACK(copy_as_csv_cb), NULL); - g_object_set_data(G_OBJECT(copy_bt), CONV_PTR_KEY, pages[page]); + g_object_set_data(G_OBJECT(copy_bt), CONV_PTR_KEY, pages[ct_page_iter_data.page]); /* Graph A->B */ graph_a_b_bt = (GtkWidget *)g_object_get_data(G_OBJECT(bbox), WIRESHARK_STOCK_GRAPH_A_B); gtk_widget_set_tooltip_text(graph_a_b_bt, "Graph traffic from address A to address B."); g_object_set_data(G_OBJECT(graph_a_b_bt), E_DFILTER_TE_KEY, main_display_filter_widget); - g_object_set_data(G_OBJECT(graph_a_b_bt), CONV_PTR_KEY, pages[page]); + g_object_set_data(G_OBJECT(graph_a_b_bt), CONV_PTR_KEY, pages[ct_page_iter_data.page]); g_signal_connect(graph_a_b_bt, "clicked", G_CALLBACK(graph_cb), (gpointer)FALSE); g_object_set_data(G_OBJECT(nb), GRAPH_A_B_BT_KEY, graph_a_b_bt); @@ -2552,7 +2541,7 @@ init_conversation_notebook_cb(GtkWidget *w _U_, gpointer d _U_) graph_b_a_bt = (GtkWidget *)g_object_get_data(G_OBJECT(bbox), WIRESHARK_STOCK_GRAPH_B_A); gtk_widget_set_tooltip_text(graph_b_a_bt, "Graph traffic from address B to address A."); g_object_set_data(G_OBJECT(graph_b_a_bt), E_DFILTER_TE_KEY, main_display_filter_widget); - g_object_set_data(G_OBJECT(graph_b_a_bt), CONV_PTR_KEY, pages[page]); + g_object_set_data(G_OBJECT(graph_b_a_bt), CONV_PTR_KEY, pages[ct_page_iter_data.page]); g_signal_connect(graph_b_a_bt, "clicked", G_CALLBACK(graph_cb), (gpointer)TRUE); g_object_set_data(G_OBJECT(nb), GRAPH_B_A_BT_KEY, graph_b_a_bt); @@ -2560,7 +2549,7 @@ init_conversation_notebook_cb(GtkWidget *w _U_, gpointer d _U_) follow_stream_bt = (GtkWidget *)g_object_get_data(G_OBJECT(bbox), WIRESHARK_STOCK_FOLLOW_STREAM); gtk_widget_set_tooltip_text(follow_stream_bt, "Follow Stream."); g_object_set_data(G_OBJECT(follow_stream_bt), E_DFILTER_TE_KEY, main_display_filter_widget); - g_object_set_data(G_OBJECT(follow_stream_bt), CONV_PTR_KEY, pages[page]); + g_object_set_data(G_OBJECT(follow_stream_bt), CONV_PTR_KEY, pages[ct_page_iter_data.page]); g_signal_connect(follow_stream_bt, "clicked", G_CALLBACK(follow_stream_cb), NULL); g_object_set_data(G_OBJECT(nb), FOLLOW_STREAM_BT_KEY, follow_stream_bt); @@ -2581,6 +2570,15 @@ init_conversation_notebook_cb(GtkWidget *w _U_, gpointer d _U_) gdk_window_raise(gtk_widget_get_window(win)); } +void conversation_endpoint_cb(register_ct_t* table) +{ + char cmd_str[50]; + + g_snprintf(cmd_str, 50, "conv,%s", proto_get_protocol_filter_name(get_conversation_proto_id(table))); + + dissector_conversation_init(cmd_str, table); +} + /* * Editor modelines * diff --git a/ui/gtk/conversations_table.h b/ui/gtk/conversations_table.h index 582af54d3c..e4062b5327 100644 --- a/ui/gtk/conversations_table.h +++ b/ui/gtk/conversations_table.h @@ -25,7 +25,8 @@ #define __CONVERSATIONS_TABLE_H__ #include <epan/conv_id.h> -#include <ui/conversation_hash.h> +#include <epan/conversation_table.h> +#include <ui/conversation_ui.h> /** @file * Conversation definitions. @@ -52,19 +53,12 @@ typedef struct _conversations_table { int reselection_idx; /**< conversation index to reselect */ } conversations_table; -/** Register the conversation table for the multiple conversation window. - * - * @param filter the optional filter name or NULL - * @param packet_func the function to be called for each incoming packet - */ -extern void register_conversation_table(conversation_type_e conv_type, const char *filter, tap_packet_cb packet_func); - /** Init the conversation table for the single conversation window. * * @param filter the optional filter name or NULL * @param packet_func the function to be called for each incoming packet */ -extern void init_conversation_table(conversation_type_e conv_type, const char *filter, tap_packet_cb packet_func); +extern void init_conversation_table(struct register_ct* ct, const char *filter); /** Callback for "Conversations" statistics item. * @@ -73,4 +67,10 @@ extern void init_conversation_table(conversation_type_e conv_type, const char *f */ extern void init_conversation_notebook_cb(GtkWidget *widget, gpointer data); +/** Function called to instantiate the "GTK conversation table display" + * + * @param table conversation table to be created + */ +extern void conversation_endpoint_cb(register_ct_t* table); + #endif /* __CONVERSATIONS_TABLE_H__ */ diff --git a/ui/gtk/conversations_tcpip.c b/ui/gtk/conversations_tcpip.c deleted file mode 100644 index 0491c50fd2..0000000000 --- a/ui/gtk/conversations_tcpip.c +++ /dev/null @@ -1,80 +0,0 @@ -/* conversations_tcpip.c - * conversations_tcpip 2003 Ronnie Sahlberg - * - * 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 - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <string.h> - -#include <gtk/gtk.h> - -#include <epan/packet.h> -#include <epan/stat_cmd_args.h> -#include <epan/tap.h> -#include <epan/dissectors/packet-tcp.h> - -#include <epan/stat_groups.h> - -#include "ui/gtk/gui_stat_menu.h" -#include "ui/gtk/conversations_table.h" - -void register_tap_listener_tcpip_conversation(void); - -static int -tcpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) -{ - conversations_table *ct = (conversations_table *) pct; - const struct tcpheader *tcphdr=(const struct tcpheader *)vip; - - add_conversation_table_data_with_conv_id(&ct->hash, &tcphdr->ip_src, &tcphdr->ip_dst, tcphdr->th_sport, tcphdr->th_dport, (conv_id_t) tcphdr->th_stream, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, CONV_TYPE_TCP, PT_TCP); - - return 1; -} - - - -static void -tcpip_conversation_init(const char *opt_arg, void* userdata _U_) -{ - const char *filter=NULL; - - if(!strncmp(opt_arg,"conv,tcp,",9)){ - filter=opt_arg+9; - } else { - filter=NULL; - } - - init_conversation_table(CONV_TYPE_TCP, filter, tcpip_conversation_packet); - -} - -void -tcpip_conversation_cb(GtkAction *action _U_, gpointer user_data _U_) -{ - tcpip_conversation_init("conv,tcp",NULL); -} - -void -register_tap_listener_tcpip_conversation(void) -{ - register_stat_cmd_arg("conv,tcp", tcpip_conversation_init,NULL); - register_conversation_table(CONV_TYPE_TCP, NULL /*filter*/, tcpip_conversation_packet); -} diff --git a/ui/gtk/conversations_tr.c b/ui/gtk/conversations_tr.c deleted file mode 100644 index 0d0b975591..0000000000 --- a/ui/gtk/conversations_tr.c +++ /dev/null @@ -1,80 +0,0 @@ -/* conversations_tr.c - * conversations_tr 2003 Ronnie Sahlberg - * - * 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 - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <string.h> - -#include <gtk/gtk.h> - -#include <epan/packet.h> -#include <epan/stat_cmd_args.h> -#include <epan/tap.h> -#include <epan/dissectors/packet-tr.h> - -#include <epan/stat_groups.h> - -#include "ui/gtk/gui_stat_menu.h" -#include "ui/gtk/conversations_table.h" - -void register_tap_listener_tr_conversation(void); - -static int -tr_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) -{ - conversations_table *ct = (conversations_table *) pct; - const tr_hdr *trhdr=(const tr_hdr *)vip; - - add_conversation_table_data(&ct->hash, &trhdr->src, &trhdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, CONV_TYPE_TOKEN_RING, PT_NONE); - - return 1; -} - - - -static void -tr_conversation_init(const char *opt_arg, void* userdata _U_) -{ - const char *filter=NULL; - - if(!strncmp(opt_arg,"conv,tr,",8)){ - filter=opt_arg+8; - } else { - filter=NULL; - } - - init_conversation_table(CONV_TYPE_TOKEN_RING, filter, tr_conversation_packet); - -} - -void -tr_conversation_cb(GtkAction *action _U_, gpointer user_data _U_) -{ - tr_conversation_init("conv,tr",NULL); -} - -void -register_tap_listener_tr_conversation(void) -{ - register_stat_cmd_arg("conv,tr", tr_conversation_init, NULL); - register_conversation_table(CONV_TYPE_TOKEN_RING, NULL /*filter*/, tr_conversation_packet); -} diff --git a/ui/gtk/conversations_udpip.c b/ui/gtk/conversations_udpip.c deleted file mode 100644 index 7663d4a335..0000000000 --- a/ui/gtk/conversations_udpip.c +++ /dev/null @@ -1,80 +0,0 @@ -/* conversations_udpip.c - * conversations_udpip 2003 Ronnie Sahlberg - * - * 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 - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <string.h> - -#include <gtk/gtk.h> - -#include <epan/packet.h> -#include <epan/stat_cmd_args.h> -#include <epan/tap.h> -#include <epan/dissectors/packet-udp.h> - -#include <epan/stat_groups.h> - -#include "ui/gtk/gui_stat_menu.h" -#include "ui/gtk/conversations_table.h" - -void register_tap_listener_udpip_conversation(void); - -static int -udpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) -{ - conversations_table *ct = (conversations_table *) pct; - const e_udphdr *udphdr=(const e_udphdr *)vip; - - add_conversation_table_data(&ct->hash, &udphdr->ip_src, &udphdr->ip_dst, udphdr->uh_sport, udphdr->uh_dport, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, CONV_TYPE_UDP, PT_UDP); - - return 1; -} - - - -static void -udpip_conversation_init(const char *opt_arg, void* userdata _U_) -{ - const char *filter=NULL; - - if(!strncmp(opt_arg,"conv,udp,",9)){ - filter=opt_arg+9; - } else { - filter=NULL; - } - - init_conversation_table(CONV_TYPE_UDP, filter, udpip_conversation_packet); - -} - -void -udpip_conversation_cb(GtkAction *action _U_, gpointer user_data _U_) -{ - udpip_conversation_init("conv,udp",NULL); -} - -void -register_tap_listener_udpip_conversation(void) -{ - register_stat_cmd_arg("conv,udp", udpip_conversation_init, NULL); - register_conversation_table(CONV_TYPE_UDP, NULL /*filter*/, udpip_conversation_packet); -} diff --git a/ui/gtk/conversations_usb.c b/ui/gtk/conversations_usb.c deleted file mode 100644 index a77b3327ca..0000000000 --- a/ui/gtk/conversations_usb.c +++ /dev/null @@ -1,78 +0,0 @@ -/* conversations_usb.c 2007 Jon Smirl - * modified from conversations_eth.c 2003 Ronnie Sahlberg - * - * 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 - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <string.h> - -#include <gtk/gtk.h> - -#include <epan/packet.h> -#include <epan/stat_cmd_args.h> -#include <epan/tap.h> - -#include <epan/stat_groups.h> - -#include "ui/gtk/gui_stat_menu.h" -#include "ui/gtk/conversations_table.h" - -void register_tap_listener_usb_conversation(void); - -static int -usb_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip _U_) -{ - conversations_table *ct = (conversations_table *) pct; - - add_conversation_table_data(&ct->hash, &pinfo->src, &pinfo->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, CONV_TYPE_USB, PT_NONE); - - return 1; -} - - - -static void -usb_conversation_init(const char *opt_arg, void* userdata _U_) -{ - const char *filter=NULL; - - if (!strncmp(opt_arg, "conv,usb,", 9)) { - filter = opt_arg + 9; - } else { - filter = NULL; - } - - init_conversation_table(CONV_TYPE_USB, filter, usb_conversation_packet); - -} - -void -usb_endpoints_cb(GtkAction *action _U_, gpointer user_data _U_) -{ - usb_conversation_init("conv,usb", NULL); -} - -void -register_tap_listener_usb_conversation(void) -{ - register_stat_cmd_arg("conv,usb", usb_conversation_init, NULL); - register_conversation_table(CONV_TYPE_USB, NULL /*filter*/, usb_conversation_packet); -} diff --git a/ui/gtk/conversations_wlan.c b/ui/gtk/conversations_wlan.c deleted file mode 100644 index e9b4e6e35c..0000000000 --- a/ui/gtk/conversations_wlan.c +++ /dev/null @@ -1,80 +0,0 @@ -/* conversations_wlan.c 2004 Giles Scott - * modified from conversations_eth.c 2003 Ronnie Sahlberg - * - * 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 - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <string.h> - -#include <gtk/gtk.h> - -#include <epan/packet.h> -#include <epan/stat_cmd_args.h> -#include <epan/tap.h> -#include <epan/dissectors/packet-ieee80211.h> - -#include <epan/stat_groups.h> - -#include "ui/gtk/gui_stat_menu.h" -#include "ui/gtk/conversations_table.h" - -void register_tap_listener_wlan_conversation(void); - -static int -wlan_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) -{ - conversations_table *ct = (conversations_table *) pct; - const wlan_hdr *whdr=(const wlan_hdr *)vip; - - add_conversation_table_data(&ct->hash, &whdr->src, &whdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, CONV_TYPE_WLAN, PT_NONE); - - return 1; -} - - - -static void -wlan_conversation_init(const char *opt_arg, void* userdata _U_) -{ - const char *filter=NULL; - - if(!strncmp(opt_arg,"conv,wlan,",10)){ - filter=opt_arg+10; - } else { - filter=NULL; - } - - init_conversation_table(CONV_TYPE_WLAN, filter, wlan_conversation_packet); - -} - -void -wlan_endpoints_cb(GtkAction *action _U_, gpointer user_data _U_) -{ - wlan_conversation_init("conv,wlan",NULL); -} - -void -register_tap_listener_wlan_conversation(void) -{ - register_stat_cmd_arg("conv,wlan", wlan_conversation_init,NULL); - register_conversation_table(CONV_TYPE_WLAN, NULL /*filter*/, wlan_conversation_packet); -} diff --git a/ui/gtk/hostlist_ncp.c b/ui/gtk/hostlist_ncp.c index d605d504ff..9889890c37 100644 --- a/ui/gtk/hostlist_ncp.c +++ b/ui/gtk/hostlist_ncp.c @@ -64,7 +64,7 @@ gtk_ncp_hostlist_init(const char *opt_arg, void* userdata _U_) filter=NULL; } - init_hostlist_table(TRUE, "NCP", "ncp_hdr", filter, ncp_hostlist_packet); + init_hostlist_table(TRUE, "NCP", "ncp", filter, ncp_hostlist_packet); } @@ -78,5 +78,5 @@ void register_tap_listener_ncp_hostlist(void) { register_stat_cmd_arg("hosts,ncp", gtk_ncp_hostlist_init,NULL); - register_hostlist_table(TRUE, "NCP", "ncp_hdr", NULL /*filter*/, ncp_hostlist_packet); + register_hostlist_table(TRUE, "NCP", "ncp", NULL /*filter*/, ncp_hostlist_packet); } diff --git a/ui/gtk/hostlist_table.h b/ui/gtk/hostlist_table.h index 41c0c9ffc1..eb1f157662 100644 --- a/ui/gtk/hostlist_table.h +++ b/ui/gtk/hostlist_table.h @@ -24,12 +24,34 @@ #ifndef __HOSTLIST_TABLE_H__ #define __HOSTLIST_TABLE_H__ -#include <ui/conversation_hash.h> +#include <ui/conversation_ui.h> /** @file * Hostlist definitions. */ +/** Conversation types */ +/* Sort alphabetically by title */ +typedef enum { + CONV_TYPE_ETHERNET, + CONV_TYPE_FIBRE_CHANNEL, + CONV_TYPE_FDDI, + CONV_TYPE_IPV4, + CONV_TYPE_IPV6, + CONV_TYPE_IPX, + CONV_TYPE_JXTA, + CONV_TYPE_NCP, + CONV_TYPE_RSVP, + CONV_TYPE_SCTP, + CONV_TYPE_TCP, + CONV_TYPE_TOKEN_RING, + CONV_TYPE_UDP, + CONV_TYPE_USB, + CONV_TYPE_WLAN, + N_CONV_TYPES +} conversation_type_e; + + /** Hostlist information */ typedef struct _hostlist_talker_t { address myaddress; /**< address */ diff --git a/ui/gtk/main.c b/ui/gtk/main.c index 17fa2a9a0d..453fa5a8c7 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -92,6 +92,7 @@ #include <epan/uat.h> #include <epan/print.h> #include <epan/timestamp.h> +#include <epan/conversation_table.h> #include <wsutil/cmdarg_err.h> #include <wsutil/plugins.h> @@ -189,6 +190,7 @@ #include "ui/gtk/proto_help.h" #include "ui/gtk/packet_list.h" #include "ui/gtk/filter_expression_save_dlg.h" +#include "ui/gtk/conversations_table.h" #include "ui/gtk/old-gtk-compat.h" @@ -2575,6 +2577,7 @@ main(int argc, char *argv[]) #endif register_all_tap_listeners(); + conversation_table_set_gui_info(init_conversation_table); splash_update(RA_PREFERENCES, NULL, (gpointer)splash_win); diff --git a/ui/gtk/main_menubar.c b/ui/gtk/main_menubar.c index 5ecbe53132..d36bc7c51f 100644 --- a/ui/gtk/main_menubar.c +++ b/ui/gtk/main_menubar.c @@ -1187,21 +1187,7 @@ static const char *ui_desc_menubar = " <menuitem name='IOGraphs' action='/Statistics/IOGraphs'/>\n" " <separator/>\n" " <menu name= 'ConversationListMenu' action='/Statistics/ConversationList'>\n" -" <menuitem name='Ethernet' action='/Statistics/ConversationList/Ethernet'/>\n" -" <menuitem name='FibreChannel' action='/Statistics/ConversationList/FibreChannel'/>\n" -" <menuitem name='FDDI' action='/Statistics/ConversationList/FDDI'/>\n" -" <menuitem name='IP' action='/Statistics/ConversationList/IP'/>\n" -" <menuitem name='IPv6' action='/Statistics/ConversationList/IPv6'/>\n" -" <menuitem name='IPX' action='/Statistics/ConversationList/IPX'/>\n" -" <menuitem name='JXTA' action='/Statistics/ConversationList/JXTA'/>\n" -" <menuitem name='NCP' action='/Statistics/ConversationList/NCP'/>\n" -" <menuitem name='RSVP' action='/Statistics/ConversationList/RSVP'/>\n" -" <menuitem name='SCTP' action='/Statistics/ConversationList/SCTP'/>\n" -" <menuitem name='TCPIP' action='/Statistics/ConversationList/TCPIP'/>\n" -" <menuitem name='TR' action='/Statistics/ConversationList/TR'/>\n" -" <menuitem name='UDPIP' action='/Statistics/ConversationList/UDPIP'/>\n" -" <menuitem name='USB' action='/Statistics/ConversationList/USB'/>\n" -" <menuitem name='WLAN' action='/Statistics/ConversationList/WLAN'/>\n" +" <placeholder name='Conversations'/>\n" " </menu>\n" " <menu name= 'EndpointListMenu' action='/Statistics/EndpointList'>\n" " <menuitem name='Ethernet' action='/Statistics/EndpointList/Ethernet'/>\n" @@ -1654,21 +1640,6 @@ static const GtkActionEntry main_menu_bar_entries[] = { { "/Statistics/ConversationList", NULL, "_Conversation List", NULL, NULL, NULL }, - { "/Statistics/ConversationList/Ethernet", WIRESHARK_STOCK_CONVERSATIONS, "Ethernet", NULL, NULL, G_CALLBACK(eth_endpoints_cb) }, - { "/Statistics/ConversationList/FibreChannel", WIRESHARK_STOCK_CONVERSATIONS, "Fibre Channel", NULL, NULL, G_CALLBACK(fc_endpoints_cb) }, - { "/Statistics/ConversationList/FDDI", WIRESHARK_STOCK_CONVERSATIONS, "FDDI", NULL, NULL, G_CALLBACK(fddi_endpoints_cb) }, - { "/Statistics/ConversationList/IP", WIRESHARK_STOCK_CONVERSATIONS, "IPv4", NULL, NULL, G_CALLBACK(ip_endpoints_cb) }, - { "/Statistics/ConversationList/IPv6", WIRESHARK_STOCK_CONVERSATIONS, "IPv6", NULL, NULL, G_CALLBACK(ipv6_endpoints_cb) }, - { "/Statistics/ConversationList/IPX", WIRESHARK_STOCK_CONVERSATIONS, "IPX", NULL, NULL, G_CALLBACK(ipx_endpoints_cb) }, - { "/Statistics/ConversationList/JXTA", WIRESHARK_STOCK_CONVERSATIONS, "JXTA", NULL, NULL, G_CALLBACK(jxta_conversation_cb) }, - { "/Statistics/ConversationList/NCP", WIRESHARK_STOCK_CONVERSATIONS, "NCP", NULL, NULL, G_CALLBACK(ncp_endpoints_cb) }, - { "/Statistics/ConversationList/RSVP", WIRESHARK_STOCK_CONVERSATIONS, "RSVP", NULL, NULL, G_CALLBACK(rsvp_endpoints_cb) }, - { "/Statistics/ConversationList/SCTP", WIRESHARK_STOCK_CONVERSATIONS, "SCTP", NULL, NULL, G_CALLBACK(sctp_conversation_cb) }, - { "/Statistics/ConversationList/TCPIP", WIRESHARK_STOCK_CONVERSATIONS, "TCP (IPv4 & IPv6)", NULL, NULL, G_CALLBACK(tcpip_conversation_cb) }, - { "/Statistics/ConversationList/TR", WIRESHARK_STOCK_CONVERSATIONS, "Token Ring", NULL, NULL, G_CALLBACK(tr_conversation_cb) }, - { "/Statistics/ConversationList/UDPIP", WIRESHARK_STOCK_CONVERSATIONS, "UDP (IPv4 & IPv6)", NULL, NULL, G_CALLBACK(udpip_conversation_cb) }, - { "/Statistics/ConversationList/USB", WIRESHARK_STOCK_CONVERSATIONS, "USB", NULL, NULL, G_CALLBACK(usb_endpoints_cb) }, - { "/Statistics/ConversationList/WLAN", WIRESHARK_STOCK_CONVERSATIONS, "WLAN", NULL, NULL, G_CALLBACK(wlan_endpoints_cb) }, { "/Statistics/EndpointList", NULL, "_Endpoint List", NULL, NULL, NULL }, { "/Statistics/EndpointList/Ethernet", WIRESHARK_STOCK_ENDPOINTS, "Ethernet", NULL, NULL, G_CALLBACK(gtk_eth_hostlist_cb) }, @@ -3315,7 +3286,7 @@ menu_dissector_filter(capture_file *cf) gtk_ui_manager_insert_action_group (ui_manager_main_menubar, action_group, 0); g_object_set_data (G_OBJECT (ui_manager_main_menubar), - "diessector-filters-merge-id", GUINT_TO_POINTER (merge_id)); + "dissector-filters-merge-id", GUINT_TO_POINTER (merge_id)); /* no items */ if (!list_entry){ @@ -3366,6 +3337,75 @@ menu_dissector_filter(capture_file *cf) } static void +menu_endpoints_cb(GtkAction *action _U_, gpointer user_data) +{ + register_ct_t *table = (register_ct_t*)user_data; + + conversation_endpoint_cb(table); +} + +typedef struct { + capture_file *cf; + guint merge_id; + GtkActionGroup *action_group; + int counter; +} conv_menu_t; + +static void +add_conversation_menuitem(gpointer data, gpointer user_data) +{ + register_ct_t *table = (register_ct_t*)data; + conv_menu_t *conv = (conv_menu_t*)user_data; + gchar *action_name; + GtkAction *action; + + action_name = g_strdup_printf ("conversation-%u", conv->counter); + /*g_warning("action_name %s, filter_entry->name %s",action_name,filter_entry->name);*/ + action = (GtkAction *)g_object_new (GTK_TYPE_ACTION, + "name", action_name, + "label", proto_get_protocol_short_name(find_protocol_by_id(get_conversation_proto_id(table))), + "sensitive", TRUE, + NULL); + g_signal_connect (action, "activate", + G_CALLBACK (menu_endpoints_cb), table); + gtk_action_group_add_action (conv->action_group, action); + g_object_unref (action); + + gtk_ui_manager_add_ui (ui_manager_main_menubar, conv->merge_id, + "/Menubar/StatisticsMenu/ConversationListMenu/Conversations", + action_name, + action_name, + GTK_UI_MANAGER_MENUITEM, + FALSE); + g_free(action_name); + conv->counter++; +} + +static void +menu_conversation_list(capture_file *cf) +{ + GtkWidget *submenu_conversation_list; + conv_menu_t conv_data; + + conv_data.merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar); + + conv_data.action_group = gtk_action_group_new ("conversation-list-group"); + + submenu_conversation_list = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/StatisticsMenu/ConversationListMenu"); + if(!submenu_conversation_list){ + g_warning("add_recent_items: No submenu_conversation_list found, path= /Menubar/StatisticsMenu/ConversationListMenu"); + } + + gtk_ui_manager_insert_action_group (ui_manager_main_menubar, conv_data.action_group, 0); + g_object_set_data (G_OBJECT (ui_manager_main_menubar), + "conversation-list-merge-id", GUINT_TO_POINTER (conv_data.merge_id)); + + conv_data.cf = cf; + conv_data.counter = 0; + conversation_table_iterate_tables(add_conversation_menuitem, &conv_data); +} + +static void menus_init(void) { GtkActionGroup *packet_list_heading_action_group, *packet_list_action_group, @@ -3628,6 +3668,7 @@ menus_init(void) popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_statusbar_profiles_menu); menu_dissector_filter(&cfile); + menu_conversation_list(&cfile); merge_menu_items(merge_menu_items_list); /* Add external menus and items */ |