2004-07-20 06:06:41 +00:00
|
|
|
/* conversations_table.h
|
|
|
|
* conversations_table 2003 Ronnie Sahlberg
|
|
|
|
* Helper routines common to all conversations taps.
|
2003-08-23 09:09:35 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2003-08-23 09:09:35 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2004-06-03 21:46:27 +00:00
|
|
|
#include "sat.h"
|
|
|
|
|
2004-06-01 20:28:05 +00:00
|
|
|
/** @file
|
|
|
|
* Conversation definitions.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** Conversation information */
|
2004-07-20 06:06:41 +00:00
|
|
|
typedef struct _conversation_t {
|
2004-06-01 20:28:05 +00:00
|
|
|
address src_address; /**< source address */
|
|
|
|
address dst_address; /**< destination address */
|
|
|
|
SAT_E sat; /**< address type */
|
|
|
|
guint32 port_type; /**< port_type (e.g. PT_TCP) */
|
|
|
|
guint32 src_port; /**< source port */
|
|
|
|
guint32 dst_port; /**< destination port */
|
2003-08-23 09:09:35 +00:00
|
|
|
|
2004-06-01 20:28:05 +00:00
|
|
|
guint32 rx_frames; /**< number of received packets */
|
|
|
|
guint32 tx_frames; /**< number of transmitted packets */
|
|
|
|
guint32 rx_bytes; /**< number of received bytes */
|
|
|
|
guint32 tx_bytes; /**< number of transmitted bytes */
|
2004-07-20 06:06:41 +00:00
|
|
|
} conversation_t;
|
2003-08-23 09:09:35 +00:00
|
|
|
|
2004-06-01 20:28:05 +00:00
|
|
|
/** Conversation widget */
|
2004-07-20 06:06:41 +00:00
|
|
|
typedef struct _conversations_table {
|
2004-06-01 20:28:05 +00:00
|
|
|
char *name; /**< the name of the table */
|
|
|
|
GtkWidget *win; /**< GTK window */
|
|
|
|
GtkWidget *page_lb; /**< label */
|
2004-06-03 21:46:27 +00:00
|
|
|
GtkWidget *scrolled_window; /**< the scrolled window */
|
2004-06-01 20:28:05 +00:00
|
|
|
GtkCList *table; /**< the GTK table */
|
2004-07-22 16:36:50 +00:00
|
|
|
guint32 num_columns; /**< number of columns in the above table */
|
|
|
|
char *default_titles[10]; /**< Column headers */
|
2004-06-01 20:28:05 +00:00
|
|
|
GtkWidget *menu; /**< context menu */
|
|
|
|
gboolean has_ports; /**< table has ports */
|
2004-07-20 21:39:54 +00:00
|
|
|
guint32 num_conversations; /**< number of conversations */
|
|
|
|
conversation_t *conversations; /**< array of conversation values */
|
2004-06-01 20:28:05 +00:00
|
|
|
gboolean resolve_names; /**< resolve address names? */
|
2004-07-20 06:06:41 +00:00
|
|
|
} conversations_table;
|
2003-08-23 09:09:35 +00:00
|
|
|
|
2004-06-01 20:28:05 +00:00
|
|
|
/** Register the conversation table for the multiple conversation window.
|
|
|
|
*
|
|
|
|
* @param hide_ports hide the port columns
|
|
|
|
* @param table_name the table name to be displayed
|
|
|
|
* @param tap_name the registered tap name
|
|
|
|
* @param filter the optional filter name or NULL
|
|
|
|
* @param packet_func the function to be called for each incoming packet
|
|
|
|
*/
|
2005-01-01 12:49:54 +00:00
|
|
|
extern void register_conversation_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func);
|
2003-09-04 23:11:03 +00:00
|
|
|
|
2004-06-01 20:28:05 +00:00
|
|
|
/** Init the conversation table for the single conversation window.
|
|
|
|
*
|
|
|
|
* @param hide_ports hide the port columns
|
|
|
|
* @param table_name the table name to be displayed
|
|
|
|
* @param tap_name the registered tap name
|
|
|
|
* @param filter the optional filter name or NULL
|
|
|
|
* @param packet_func the function to be called for each incoming packet
|
|
|
|
*/
|
2005-01-01 12:49:54 +00:00
|
|
|
extern void init_conversation_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func);
|
2003-08-27 12:10:21 +00:00
|
|
|
|
2004-06-03 21:46:27 +00:00
|
|
|
/** Callback for "Conversations" statistics item.
|
|
|
|
*
|
2004-07-20 20:56:53 +00:00
|
|
|
* @param widget unused
|
|
|
|
* @param data unused
|
2004-06-03 21:46:27 +00:00
|
|
|
*/
|
2004-07-20 20:56:53 +00:00
|
|
|
extern void init_conversation_notebook_cb(GtkWidget *widget, gpointer data);
|
2004-06-03 21:46:27 +00:00
|
|
|
|
2004-07-20 20:56:53 +00:00
|
|
|
/** Add some data to the conversation table.
|
2004-06-01 20:28:05 +00:00
|
|
|
*
|
2004-07-20 06:06:41 +00:00
|
|
|
* @param ct the table to add the data to
|
2004-06-01 20:28:05 +00:00
|
|
|
* @param src source address
|
|
|
|
* @param dst destination address
|
|
|
|
* @param src_port source port
|
|
|
|
* @param dst_port destination port
|
|
|
|
* @param num_frames number of packets
|
|
|
|
* @param num_bytes number of bytes
|
|
|
|
* @param sat address type
|
|
|
|
* @param port_type the port type (e.g. PT_TCP)
|
|
|
|
*/
|
2005-01-01 12:49:54 +00:00
|
|
|
extern void add_conversation_table_data(conversations_table *ct, const address *src, const address *dst,
|
2004-06-01 20:28:05 +00:00
|
|
|
guint32 src_port, guint32 dst_port, int num_frames, int num_bytes, SAT_E sat, int port_type);
|