1 /* conversations_table.h
2 * conversations_table 2003 Ronnie Sahlberg
3 * Helper routines common to all conversations taps.
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #ifndef __CONVERSATIONS_TABLE_H__
26 #define __CONVERSATIONS_TABLE_H__
30 * Conversation definitions.
33 /** Conversation information */
34 typedef struct _conversation_t {
35 address src_address; /**< source address */
36 address dst_address; /**< destination address */
37 SAT_E sat; /**< address type */
38 guint32 port_type; /**< port_type (e.g. PT_TCP) */
39 guint32 src_port; /**< source port */
40 guint32 dst_port; /**< destination port */
42 guint64 rx_frames; /**< number of received packets */
43 guint64 tx_frames; /**< number of transmitted packets */
44 guint64 rx_bytes; /**< number of received bytes */
45 guint64 tx_bytes; /**< number of transmitted bytes */
48 /** Conversation widget */
49 typedef struct _conversations_table {
50 const char *name; /**< the name of the table */
51 GtkWidget *win; /**< GTK window */
52 GtkWidget *page_lb; /**< label */
53 GtkWidget *scrolled_window; /**< the scrolled window */
54 GtkCList *table; /**< the GTK table */
55 guint32 num_columns; /**< number of columns in the above table */
56 const char *default_titles[10]; /**< Column headers */
57 GtkWidget *menu; /**< context menu */
58 gboolean has_ports; /**< table has ports */
59 guint32 num_conversations; /**< number of conversations */
60 conversation_t *conversations; /**< array of conversation values */
61 gboolean resolve_names; /**< resolve address names? */
62 } conversations_table;
64 /** Register the conversation table for the multiple conversation window.
66 * @param hide_ports hide the port columns
67 * @param table_name the table name to be displayed
68 * @param tap_name the registered tap name
69 * @param filter the optional filter name or NULL
70 * @param packet_func the function to be called for each incoming packet
72 extern void register_conversation_table(gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter, tap_packet_cb packet_func);
74 /** Init the conversation table for the single conversation window.
76 * @param hide_ports hide the port columns
77 * @param table_name the table name to be displayed
78 * @param tap_name the registered tap name
79 * @param filter the optional filter name or NULL
80 * @param packet_func the function to be called for each incoming packet
82 extern void init_conversation_table(gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter, tap_packet_cb packet_func);
84 /** Callback for "Conversations" statistics item.
86 * @param widget unused
89 extern void init_conversation_notebook_cb(GtkWidget *widget, gpointer data);
91 /** Add some data to the conversation table.
93 * @param ct the table to add the data to
94 * @param src source address
95 * @param dst destination address
96 * @param src_port source port
97 * @param dst_port destination port
98 * @param num_frames number of packets
99 * @param num_bytes number of bytes
100 * @param sat address type
101 * @param port_type the port type (e.g. PT_TCP)
103 extern void add_conversation_table_data(conversations_table *ct, const address *src, const address *dst,
104 guint32 src_port, guint32 dst_port, int num_frames, int num_bytes, SAT_E sat, int port_type);
105 #endif /* __CONVERSATIONS_TABLE_H__ */