aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/conversations_tcpip.c
diff options
context:
space:
mode:
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2004-07-20 06:06:41 +0000
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2004-07-20 06:06:41 +0000
commit6866ed217f2df43683c2facf56034045e44a1994 (patch)
treea4ca4f0fc11aafebf24453ba2b91b2a4c734e39c /gtk/conversations_tcpip.c
parent64a6994f2764122165d3948f93900cde839f0f33 (diff)
renamed endpoint_talkers to conversations, as this reduces confusion in combination with the hostlist/endpoints table
(some code refactoring still needs to be done in table.c/.h). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11439 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/conversations_tcpip.c')
-rw-r--r--gtk/conversations_tcpip.c88
1 files changed, 88 insertions, 0 deletions
diff --git a/gtk/conversations_tcpip.c b/gtk/conversations_tcpip.c
new file mode 100644
index 0000000000..603e266b41
--- /dev/null
+++ b/gtk/conversations_tcpip.c
@@ -0,0 +1,88 @@
+/* conversations_tcpip.c
+ * conversations_tcpip 2003 Ronnie Sahlberg
+ *
+ * $Id$
+ *
+ * Ethereal - Network traffic analyzer
+ * By Gerald Combs <gerald@ethereal.com>
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#include <gtk/gtk.h>
+#include <string.h>
+#include "epan/packet.h"
+#include "tap_menu.h"
+#include "../tap.h"
+#include "../register.h"
+#include "conversations_table.h"
+#include <epan/dissectors/packet-tcp.h>
+
+
+static int
+tcpip_talkers_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+{
+ struct tcpheader *tcphdr=vip;
+
+ add_ett_table_data((conversations_table *)pct, &tcphdr->ip_src, &tcphdr->ip_dst, tcphdr->th_sport, tcphdr->th_dport, 1, pinfo->fd->pkt_len, SAT_NONE, PT_TCP);
+
+ return 1;
+}
+
+
+
+static void
+gtk_tcpip_talkers_init(char *optarg)
+{
+ char *filter=NULL;
+
+ if(!strncmp(optarg,"conv,tcp,",9)){
+ filter=optarg+9;
+ } else {
+ filter=NULL;
+ }
+
+ init_ett_table(FALSE, "TCP", "tcp", filter, (void *)tcpip_talkers_packet);
+
+}
+
+
+static void
+gtk_tcpip_endpoints_cb(GtkWidget *w _U_, gpointer d _U_)
+{
+ gtk_tcpip_talkers_init("conv,tcp");
+}
+
+
+void
+register_tap_listener_tcpip_talkers(void)
+{
+ register_ethereal_tap("conv,tcp", gtk_tcpip_talkers_init);
+
+ register_tap_menu_item("TCP (IPv4 & IPv6)", REGISTER_TAP_GROUP_CONVERSATION_LIST,
+ gtk_tcpip_endpoints_cb, NULL, NULL, NULL);
+
+ register_ett_table(FALSE, "TCP", "tcp", NULL /*filter*/, (void *)tcpip_talkers_packet);
+}
+