aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/conversations_table.h
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2014-04-29 11:10:27 -0400
committerMichael Mann <mmann78@netscape.net>2014-07-21 23:19:09 +0000
commit59ef97dd652131a6df0edd26cc8709461587a224 (patch)
treec3428c9388757895136b7ea43d168b1966feb68e /ui/gtk/conversations_table.h
parentd81a34cc24598778d3f8073cf85027a777cbbc10 (diff)
[WIP] Add a conversation dialog.
Items are sorted by value. Move common conversation code to ui/conversation_hash.[ch]. Add a conversation_type_e enum along with convenience functions for fetching titles, tap names, etc. We have a single main dialog instead of a main dialog + individual protocol dialogs. It de-clutters the statistics menu and results in simpler code. Conversation type tabs can be added and removed within the dialog itself. The tab list is sticky and saved with the current profile when the dialog closes. Data can be copied as CSV or YAML. Add a FilterAction class and a corresponding filterAction slot to MainWindow. Use it for the Conversations context menu. Add an addressResolutionChanged signal and related plumbing. Get rid of the iterator members in the conversation item struct. Update the GTK+ code accordingly. Excercise for the reader: - Update TShark to use the common hash code. Ping-Bug: 9231 Ping-Bug: 8703 Ping-Bug: 6727 Change-Id: I8728d771fc5b1a85937bed9d898e53c3ecc3a544 Reviewed-on: https://code.wireshark.org/review/2987 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/gtk/conversations_table.h')
-rw-r--r--ui/gtk/conversations_table.h80
1 files changed, 4 insertions, 76 deletions
diff --git a/ui/gtk/conversations_table.h b/ui/gtk/conversations_table.h
index 74a0ea48ff..25e6bc6968 100644
--- a/ui/gtk/conversations_table.h
+++ b/ui/gtk/conversations_table.h
@@ -25,35 +25,12 @@
#define __CONVERSATIONS_TABLE_H__
#include <epan/conv_id.h>
-#include "sat.h"
+#include <ui/conversation_hash.h>
/** @file
* Conversation definitions.
*/
-/** Conversation information */
-typedef struct _conversation_t {
- 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 */
- conv_id_t conv_id; /**< conversation id */
-
- guint64 rx_frames; /**< number of received packets */
- guint64 tx_frames; /**< number of transmitted packets */
- guint64 rx_bytes; /**< number of received bytes */
- guint64 tx_bytes; /**< number of transmitted bytes */
-
- nstime_t start_time; /**< start time for the conversation */
- nstime_t stop_time; /**< stop time for the conversation */
-
- gboolean modified; /**< new to redraw the row */
- GtkTreeIter iter;
- gboolean iter_valid; /**< not a new row */
-} conv_t;
-
/** Conversation widget */
typedef struct _conversations_table {
const char *name; /**< the name of the table */
@@ -67,9 +44,7 @@ typedef struct _conversations_table {
const char *default_titles[14]; /**< Column headers */
GtkWidget *menu; /**< context menu */
gboolean has_ports; /**< table has ports */
- guint32 num_conversations; /**< number of conversations */
- GArray *conversations; /**< array of conversation values */
- GHashTable *hashtable; /**< conversations hash table */
+ conv_hash_t hash; /**< conversations hash table */
gboolean fixed_col; /**< if switched to fixed column */
gboolean resolve_names; /**< resolve address names? */
@@ -85,7 +60,7 @@ typedef struct _conversations_table {
* @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(gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter, tap_packet_cb packet_func);
+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.
*
@@ -95,7 +70,7 @@ extern void register_conversation_table(gboolean hide_ports, const char *table_n
* @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(gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter, tap_packet_cb packet_func);
+extern void init_conversation_table(conversation_type_e conv_type, const char *filter, tap_packet_cb packet_func);
/** Callback for "Conversations" statistics item.
*
@@ -104,51 +79,4 @@ extern void init_conversation_table(gboolean hide_ports, const char *table_name,
*/
extern void init_conversation_notebook_cb(GtkWidget *widget, gpointer data);
-/** Add some data to the conversation table.
- *
- * @param ct the table to add the data to
- * @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 ts timestamp
- * @param sat address type
- * @param port_type the port type (e.g. PT_TCP)
- */
-extern void add_conversation_table_data(conversations_table *ct, const address *src, const address *dst,
- guint32 src_port, guint32 dst_port, int num_frames, int num_bytes, nstime_t *ts,
- SAT_E sat, int port_type);
-
-/** Add some data to the conversation table, passing a value to be used in
- * addition to the address and port quadruple to uniquely identify the
- * conversation.
- *
- * @param ct the table to add the data to
- * @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 ts timestamp
- * @param sat address type
- * @param port_type the port type (e.g. PT_TCP)
- * @param conv_id a value to help differentiate the conversation in case the address and port quadruple is not sufficiently unique
- */
-extern void
-add_conversation_table_data_with_conv_id(
- conversations_table *ct,
- const address *src,
- const address *dst,
- guint32 src_port,
- guint32 dst_port,
- conv_id_t conv_id,
- int num_frames,
- int num_bytes,
- nstime_t *ts,
- SAT_E sat,
- int port_type);
-
#endif /* __CONVERSATIONS_TABLE_H__ */