2004-07-20 06:06:41 +00:00
/* conversations_table.c
* conversations_table 2003 Ronnie Sahlberg
* Helper routines common to all endpoint conversations tap .
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
*
2006-05-21 05:12:17 +00:00
* Wireshark - Network traffic analyzer
* By Gerald Combs < gerald @ wireshark . org >
2003-08-23 09:09:35 +00:00
* Copyright 1998 Gerald Combs
2004-06-03 21:46:27 +00:00
*
2003-08-23 09:09:35 +00:00
* 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 .
2004-06-03 21:46:27 +00:00
*
2003-08-23 09:09:35 +00:00
* 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 .
2004-06-03 21:46:27 +00:00
*
2003-08-23 09:09:35 +00:00
* 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
# include <string.h>
2009-10-06 07:44:48 +00:00
# include <locale.h>
2004-02-13 00:53:37 +00:00
2003-08-23 09:09:35 +00:00
# include <gtk/gtk.h>
2004-02-13 00:53:37 +00:00
2005-01-01 12:49:54 +00:00
# include <epan/packet_info.h>
# include <epan/to_str.h>
2005-09-16 16:25:53 +00:00
# include <epan/address.h>
2005-01-01 12:49:54 +00:00
# include <epan/addr_resolv.h>
# include <epan/tap.h>
2007-11-20 18:35:41 +00:00
# include <epan/nstime.h>
2005-01-01 12:49:54 +00:00
2008-04-13 00:55:59 +00:00
# include "../simple_dialog.h"
# include "../globals.h"
# include "gtk/sat.h"
# include "gtk/conversations_table.h"
2008-05-17 23:03:17 +00:00
# include "gtk/filter_utils.h"
2008-04-13 00:55:59 +00:00
# include "gtk/gtkglobals.h"
# include "gtk/gui_utils.h"
# include "gtk/dlg_utils.h"
# include "gtk/help_dlg.h"
2008-08-05 17:33:14 +00:00
# include "gtk/main.h"
2010-06-23 16:49:17 +00:00
# include "gtk/stock_icons.h"
# include "gtk/follow_tcp.h"
# include "gtk/follow_udp.h"
# include "gtk/keys.h"
2010-06-25 22:09:34 +00:00
# include "gtk/utf8_entities.h"
2008-04-13 00:55:59 +00:00
2007-11-20 18:35:41 +00:00
# define COL_STR_LEN 16
2005-09-16 16:25:53 +00:00
# define CONV_PTR_KEY "conversations-pointer"
2007-11-20 18:35:41 +00:00
# define NB_PAGES_KEY "notebook-pages"
2010-06-23 16:49:17 +00:00
# define FOLLOW_STREAM_BT_KEY "follow-stream-button"
2007-11-20 18:35:41 +00:00
# define NO_BPS_STR "N / A"
2003-08-23 09:09:35 +00:00
2009-03-19 17:44:57 +00:00
# define CMP_NUM(n1, n2) \
if ( ( n1 ) > ( n2 ) ) \
return 1 ; \
else if ( ( n1 ) < ( n2 ) ) \
return - 1 ; \
else \
return 0 ;
2003-09-04 11:07:51 +00:00
2003-09-04 23:12:46 +00:00
/* convert a port number into a string */
2003-09-04 11:07:51 +00:00
static char *
2010-01-29 16:13:26 +00:00
ct_port_to_str ( int port_type_val , guint32 port )
2003-09-04 11:07:51 +00:00
{
2009-03-19 17:44:57 +00:00
static int i = 0 ;
2009-10-06 07:44:48 +00:00
static gchar * strp , str [ 4 ] [ 12 ] ;
gchar * bp ;
strp = str [ i ] ;
2009-03-19 17:44:57 +00:00
2010-01-29 16:13:26 +00:00
switch ( port_type_val ) {
2009-03-19 17:44:57 +00:00
case PT_TCP :
case PT_UDP :
case PT_SCTP :
case PT_NCP :
i = ( i + 1 ) % 4 ;
2009-10-06 07:44:48 +00:00
bp = & strp [ 11 ] ;
2010-07-23 14:01:47 +00:00
2009-10-06 07:44:48 +00:00
* bp = 0 ;
do {
* - - bp = ( port % 10 ) + ' 0 ' ;
} while ( ( port / = 10 ) ! = 0 & & bp > strp ) ;
return bp ;
2009-03-19 17:44:57 +00:00
}
return NULL ;
2003-09-04 11:07:51 +00:00
}
2010-07-23 14:01:47 +00:00
# define FN_SRC_ADDRESS 0
# define FN_DST_ADDRESS 1
# define FN_ANY_ADDRESS 2
# define FN_SRC_PORT 3
# define FN_DST_PORT 4
# define FN_ANY_PORT 5
2010-01-29 16:13:26 +00:00
/* given an address (to distinguish between ipv4 and ipv6 for tcp/udp),
2003-09-04 11:07:51 +00:00
a port_type and a name_type ( FN_ . . . )
2010-01-29 16:13:26 +00:00
return a string for the filter name .
2003-09-04 11:07:51 +00:00
2010-01-29 16:13:26 +00:00
Some addresses , like AT_ETHER may actually be any of multiple types
2006-12-29 22:22:54 +00:00
of protocols , either ethernet , tokenring , fddi , wlan etc so we must be
2010-01-29 16:13:26 +00:00
more specific there ; that ' s why we need specific_addr_type .
2003-09-04 11:07:51 +00:00
*/
2005-08-05 20:59:08 +00:00
static const char *
2010-01-29 16:13:26 +00:00
ct_get_filter_name ( address * addr , int specific_addr_type_val , int port_type_val , int name_type_val )
2003-09-04 11:07:51 +00:00
{
2010-01-29 16:13:26 +00:00
switch ( name_type_val ) {
2009-03-19 17:44:57 +00:00
case FN_SRC_ADDRESS :
switch ( addr - > type ) {
case AT_ETHER :
2010-01-29 16:13:26 +00:00
switch ( specific_addr_type_val ) {
2009-03-19 17:44:57 +00:00
case SAT_ETHER :
return " eth.src " ;
case SAT_WLAN :
return " wlan.sa " ;
case SAT_FDDI :
return " fddi.src " ;
case SAT_TOKENRING :
return " tr.src " ;
default :
break ;
}
break ;
case AT_IPv4 :
return " ip.src " ;
case AT_IPv6 :
return " ipv6.src " ;
case AT_IPX :
return " ipx.src " ;
case AT_FC :
return " fc.s_id " ;
case AT_URI :
2010-01-29 16:13:26 +00:00
switch ( specific_addr_type_val ) {
2009-03-19 17:44:57 +00:00
case SAT_JXTA :
return " jxta.message.src " ;
default :
break ;
}
break ;
case AT_USB :
return " usb.sa " ;
default :
break ;
}
break ;
case FN_DST_ADDRESS :
switch ( addr - > type ) {
case AT_ETHER :
2010-01-29 16:13:26 +00:00
switch ( specific_addr_type_val ) {
2009-03-19 17:44:57 +00:00
case SAT_ETHER :
return " eth.dst " ;
case SAT_WLAN :
return " wlan.da " ;
case SAT_FDDI :
return " fddi.dst " ;
case SAT_TOKENRING :
return " tr.dst " ;
default :
2005-06-20 20:14:22 +00:00
break ;
2009-03-19 17:44:57 +00:00
}
break ;
case AT_IPv4 :
return " ip.dst " ;
case AT_IPv6 :
return " ipv6.dst " ;
case AT_IPX :
return " ipx.dst " ;
case AT_FC :
return " fc.d_id " ;
case AT_URI :
2010-01-29 16:13:26 +00:00
switch ( specific_addr_type_val ) {
2009-03-19 17:44:57 +00:00
case SAT_JXTA :
return " jxta.message.dst " ;
default :
break ;
}
break ;
case AT_USB :
return " usb.da " ;
default :
break ;
}
break ;
case FN_ANY_ADDRESS :
switch ( addr - > type ) {
case AT_ETHER :
2010-01-29 16:13:26 +00:00
switch ( specific_addr_type_val ) {
2009-03-19 17:44:57 +00:00
case SAT_ETHER :
return " eth.addr " ;
case SAT_WLAN :
return " wlan.addr " ;
case SAT_FDDI :
return " fddi.addr " ;
case SAT_TOKENRING :
return " tr.addr " ;
default :
2005-06-20 20:14:22 +00:00
break ;
2009-03-19 17:44:57 +00:00
}
break ;
case AT_IPv4 :
return " ip.addr " ;
case AT_IPv6 :
return " ipv6.addr " ;
case AT_IPX :
return " ipx.addr " ;
case AT_FC :
return " fc.id " ;
case AT_URI :
2010-01-29 16:13:26 +00:00
switch ( specific_addr_type_val ) {
2009-03-19 17:44:57 +00:00
case SAT_JXTA :
return " jxta.message.address " ;
default :
2005-06-20 20:14:22 +00:00
break ;
2009-03-19 17:44:57 +00:00
}
break ;
case AT_USB :
return " usb.addr " ;
default :
break ;
}
break ;
case FN_SRC_PORT :
2010-01-29 16:13:26 +00:00
switch ( port_type_val ) {
2009-03-19 17:44:57 +00:00
case PT_TCP :
return " tcp.srcport " ;
case PT_UDP :
return " udp.srcport " ;
case PT_SCTP :
return " sctp.srcport " ;
case PT_NCP :
return " ncp.connection " ;
default :
break ;
}
break ;
case FN_DST_PORT :
2010-01-29 16:13:26 +00:00
switch ( port_type_val ) {
2009-03-19 17:44:57 +00:00
case PT_TCP :
return " tcp.dstport " ;
case PT_UDP :
return " udp.dstport " ;
case PT_SCTP :
return " sctp.dstport " ;
case PT_NCP :
return " ncp.connection " ;
default :
break ;
}
break ;
case FN_ANY_PORT :
2010-01-29 16:13:26 +00:00
switch ( port_type_val ) {
2009-03-19 17:44:57 +00:00
case PT_TCP :
return " tcp.port " ;
case PT_UDP :
return " udp.port " ;
case PT_SCTP :
return " sctp.port " ;
case PT_NCP :
return " ncp.connection " ;
default :
break ;
}
break ;
}
g_assert_not_reached ( ) ;
return NULL ;
2003-09-04 11:07:51 +00:00
}
2003-09-04 23:11:03 +00:00
static void
2004-07-20 21:39:54 +00:00
reset_ct_table_data ( conversations_table * ct )
2003-08-23 09:09:35 +00:00
{
2004-06-03 21:46:27 +00:00
guint32 i ;
char title [ 256 ] ;
2008-02-17 00:35:55 +00:00
GString * error_string ;
const char * filter ;
2009-10-06 07:44:48 +00:00
GtkListStore * store ;
2005-09-16 16:25:53 +00:00
2008-02-17 00:35:55 +00:00
if ( ct - > use_dfilter ) {
filter = gtk_entry_get_text ( GTK_ENTRY ( main_display_filter_widget ) ) ;
} else {
filter = ct - > filter ;
}
error_string = set_tap_dfilter ( ct , filter ) ;
if ( error_string ) {
2008-10-31 09:53:56 +00:00
simple_dialog ( ESD_TYPE_ERROR , ESD_BTN_OK , " %s " , error_string - > str ) ;
2008-02-17 00:35:55 +00:00
g_string_free ( error_string , TRUE ) ;
return ;
}
2004-07-20 21:39:54 +00:00
if ( ct - > page_lb ) {
2009-03-19 17:44:57 +00:00
g_snprintf ( title , sizeof ( title ) , " Conversations: %s " , cf_get_display_name ( & cfile ) ) ;
2004-07-20 21:39:54 +00:00
gtk_window_set_title ( GTK_WINDOW ( ct - > win ) , title ) ;
2009-03-19 17:44:57 +00:00
g_snprintf ( title , sizeof ( title ) , " %s " , ct - > name ) ;
2004-07-20 21:39:54 +00:00
gtk_label_set_text ( GTK_LABEL ( ct - > page_lb ) , title ) ;
gtk_widget_set_sensitive ( ct - > page_lb , FALSE ) ;
2008-02-17 00:35:55 +00:00
if ( ct - > use_dfilter ) {
if ( filter & & strlen ( filter ) ) {
2009-03-19 17:44:57 +00:00
g_snprintf ( title , sizeof ( title ) , " %s Conversations - Filter: %s " , ct - > name , filter ) ;
2008-02-17 00:35:55 +00:00
} else {
2009-03-19 17:44:57 +00:00
g_snprintf ( title , sizeof ( title ) , " %s Conversations - No Filter " , ct - > name ) ;
2008-02-17 00:35:55 +00:00
}
} else {
2009-03-19 17:44:57 +00:00
g_snprintf ( title , sizeof ( title ) , " %s Conversations " , ct - > name ) ;
2008-02-17 00:35:55 +00:00
}
gtk_label_set_text ( GTK_LABEL ( ct - > name_lb ) , title ) ;
2004-05-02 17:25:10 +00:00
} else {
2009-03-19 17:44:57 +00:00
g_snprintf ( title , sizeof ( title ) , " %s Conversations: %s " , ct - > name , cf_get_display_name ( & cfile ) ) ;
2004-07-20 21:39:54 +00:00
gtk_window_set_title ( GTK_WINDOW ( ct - > win ) , title ) ;
2004-05-02 17:25:10 +00:00
}
2003-08-23 09:09:35 +00:00
2009-10-06 07:44:48 +00:00
/* remove all entries from the list */
store = GTK_LIST_STORE ( gtk_tree_view_get_model ( GTK_TREE_VIEW ( ct - > table ) ) ) ;
gtk_list_store_clear ( store ) ;
2003-08-23 09:09:35 +00:00
2004-07-20 21:39:54 +00:00
/* delete all conversations */
for ( i = 0 ; i < ct - > num_conversations ; i + + ) {
2009-10-06 07:44:48 +00:00
conv_t * conv = & g_array_index ( ct - > conversations , conv_t , i ) ;
g_free ( ( gpointer ) conv - > src_address . data ) ;
g_free ( ( gpointer ) conv - > dst_address . data ) ;
2004-06-03 21:46:27 +00:00
}
2009-10-06 07:44:48 +00:00
if ( ct - > conversations )
g_array_free ( ct - > conversations , TRUE ) ;
if ( ct - > hashtable ! = NULL )
g_hash_table_destroy ( ct - > hashtable ) ;
2004-07-20 21:39:54 +00:00
ct - > conversations = NULL ;
2009-10-06 07:44:48 +00:00
ct - > hashtable = NULL ;
2004-07-20 21:39:54 +00:00
ct - > num_conversations = 0 ;
2003-08-23 09:09:35 +00:00
}
2005-01-01 12:49:54 +00:00
static void
reset_ct_table_data_cb ( void * arg )
{
reset_ct_table_data ( arg ) ;
}
2003-08-30 01:18:16 +00:00
2003-09-04 23:11:03 +00:00
static void
2004-07-20 20:56:53 +00:00
ct_win_destroy_cb ( GtkWindow * win _U_ , gpointer data )
2003-09-04 23:11:03 +00:00
{
2009-03-19 17:44:57 +00:00
conversations_table * conversations = ( conversations_table * ) data ;
2003-09-04 23:11:03 +00:00
2009-03-19 17:44:57 +00:00
protect_thread_critical_region ( ) ;
remove_tap_listener ( conversations ) ;
unprotect_thread_critical_region ( ) ;
2003-09-04 23:11:03 +00:00
2009-03-19 17:44:57 +00:00
reset_ct_table_data ( conversations ) ;
g_free ( conversations ) ;
2003-09-04 23:11:03 +00:00
}
2010-07-23 14:01:47 +00:00
enum
2009-10-06 07:44:48 +00:00
{
SRC_ADR_COLUMN ,
SRC_PORT_COLUMN ,
DST_ADR_COLUMN ,
DST_PORT_COLUMN ,
PACKETS_COLUMN ,
BYTES_COLUMN ,
PKT_AB_COLUMN ,
BYTES_AB_COLUMN ,
PKT_BA_COLUMN ,
BYTES_BA_COLUMN ,
START_COLUMN ,
DURATION_COLUMN ,
BPS_AB_COLUMN ,
BPS_BA_COLUMN ,
INDEX_COLUMN ,
N_COLUMNS
} ;
2010-07-23 14:01:47 +00:00
2003-08-23 09:09:35 +00:00
static gint
2009-10-06 07:44:48 +00:00
ct_sort_func ( GtkTreeModel * model ,
2010-07-23 14:01:47 +00:00
GtkTreeIter * a ,
GtkTreeIter * b ,
gpointer user_data )
2003-08-23 09:09:35 +00:00
{
2009-03-19 17:44:57 +00:00
guint32 idx1 , idx2 ;
2009-10-06 07:44:48 +00:00
/* The col to get data from is in userdata */
gint data_column = GPOINTER_TO_INT ( user_data ) ;
conversations_table * ct = g_object_get_data ( G_OBJECT ( model ) , CONV_PTR_KEY ) ;
2009-03-19 17:44:57 +00:00
conv_t * conv1 = NULL ;
conv_t * conv2 = NULL ;
double duration1 , duration2 ;
2009-10-06 07:44:48 +00:00
gtk_tree_model_get ( model , a , INDEX_COLUMN , & idx1 , - 1 ) ;
gtk_tree_model_get ( model , b , INDEX_COLUMN , & idx2 , - 1 ) ;
2009-03-19 17:44:57 +00:00
if ( ! ct | | idx1 > = ct - > num_conversations | | idx2 > = ct - > num_conversations )
return 0 ;
2010-07-23 14:01:47 +00:00
conv1 = & g_array_index ( ct - > conversations , conv_t , idx1 ) ;
conv2 = & g_array_index ( ct - > conversations , conv_t , idx2 ) ;
2009-03-19 17:44:57 +00:00
2009-10-06 07:44:48 +00:00
switch ( data_column ) {
case SRC_ADR_COLUMN : /* Source address */
2009-03-19 17:44:57 +00:00
return ( CMP_ADDRESS ( & conv1 - > src_address , & conv2 - > src_address ) ) ;
2009-10-06 07:44:48 +00:00
case DST_ADR_COLUMN : /* Destination address */
2009-03-19 17:44:57 +00:00
return ( CMP_ADDRESS ( & conv1 - > dst_address , & conv2 - > dst_address ) ) ;
2009-10-06 07:44:48 +00:00
case SRC_PORT_COLUMN : /* Source port */
2009-03-19 17:44:57 +00:00
CMP_NUM ( conv1 - > src_port , conv2 - > src_port ) ;
2009-10-06 07:44:48 +00:00
case DST_PORT_COLUMN : /* Destination port */
2009-03-19 17:44:57 +00:00
CMP_NUM ( conv1 - > dst_port , conv2 - > dst_port ) ;
2009-10-06 07:44:48 +00:00
case START_COLUMN : /* Start time */
2009-03-19 17:44:57 +00:00
return nstime_cmp ( & conv1 - > start_time , & conv2 - > start_time ) ;
2009-10-06 07:44:48 +00:00
}
duration1 = nstime_to_sec ( & conv1 - > stop_time ) - nstime_to_sec ( & conv1 - > start_time ) ;
duration2 = nstime_to_sec ( & conv2 - > stop_time ) - nstime_to_sec ( & conv2 - > start_time ) ;
2010-07-23 14:01:47 +00:00
2009-10-06 07:44:48 +00:00
switch ( data_column ) {
case DURATION_COLUMN : /* Duration */
2009-03-19 17:44:57 +00:00
CMP_NUM ( duration1 , duration2 ) ;
2009-10-06 07:44:48 +00:00
case BPS_AB_COLUMN : /* bps A->B */
2009-03-19 17:44:57 +00:00
if ( duration1 > 0 & & conv1 - > tx_frames > 1 & & duration2 > 0 & & conv2 - > tx_frames > 1 ) {
CMP_NUM ( ( gint64 ) conv1 - > tx_bytes / duration1 , ( gint64 ) conv2 - > tx_bytes / duration2 ) ;
} else {
CMP_NUM ( conv1 - > tx_bytes , conv2 - > tx_bytes ) ;
}
2009-10-06 07:44:48 +00:00
case BPS_BA_COLUMN : /* bps A<-B */
2009-03-19 17:44:57 +00:00
if ( duration1 > 0 & & conv1 - > rx_frames > 1 & & duration2 > 0 & & conv2 - > rx_frames > 1 ) {
CMP_NUM ( ( gint64 ) conv1 - > rx_bytes / duration1 , ( gint64 ) conv2 - > rx_bytes / duration2 ) ;
} else {
CMP_NUM ( conv1 - > rx_bytes , conv2 - > rx_bytes ) ;
}
default :
g_assert_not_reached ( ) ;
}
2005-09-16 16:25:53 +00:00
2009-03-19 17:44:57 +00:00
return 0 ;
2003-08-23 09:09:35 +00:00
}
2007-12-09 09:04:39 +00:00
/* Filter direction */
2010-07-23 14:01:47 +00:00
# define DIR_A_TO_FROM_B 0
# define DIR_A_TO_B 1
# define DIR_A_FROM_B 2
# define DIR_A_TO_FROM_ANY 3
# define DIR_A_TO_ANY 4
# define DIR_A_FROM_ANY 5
# define DIR_ANY_TO_FROM_B 6
# define DIR_ANY_FROM_B 7
# define DIR_ANY_TO_B 8
2007-12-09 09:04:39 +00:00
2003-08-27 12:10:21 +00:00
static void
2004-07-20 20:56:53 +00:00
ct_select_filter_cb ( GtkWidget * widget _U_ , gpointer callback_data , guint callback_action )
2003-08-27 12:10:21 +00:00
{
2009-03-19 17:44:57 +00:00
int direction ;
2010-01-29 16:13:26 +00:00
guint32 idx = 0 ;
2009-03-19 17:44:57 +00:00
conversations_table * ct = ( conversations_table * ) callback_data ;
2009-10-06 07:44:48 +00:00
GtkTreeIter iter ;
GtkTreeModel * model ;
GtkTreeSelection * sel ;
2009-03-19 17:44:57 +00:00
char * str = NULL ;
char * sport , * dport ;
2009-10-06 07:44:48 +00:00
conv_t * conv ;
2009-03-19 17:44:57 +00:00
direction = FILTER_EXTRA ( callback_action ) ;
2009-10-06 07:44:48 +00:00
sel = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( ct - > table ) ) ;
if ( ! gtk_tree_selection_get_selected ( sel , & model , & iter ) )
return ;
2010-07-23 14:01:47 +00:00
gtk_tree_model_get ( model , & iter ,
INDEX_COLUMN , & idx ,
2009-10-06 07:44:48 +00:00
- 1 ) ;
2010-01-29 16:13:26 +00:00
if ( idx > = ct - > num_conversations ) {
2009-03-19 17:44:57 +00:00
simple_dialog ( ESD_TYPE_ERROR , ESD_BTN_OK , " No conversation selected " ) ;
return ;
}
2010-01-29 16:13:26 +00:00
conv = & g_array_index ( ct - > conversations , conv_t , idx ) ;
2009-10-06 07:44:48 +00:00
sport = ct_port_to_str ( conv - > port_type , conv - > src_port ) ;
dport = ct_port_to_str ( conv - > port_type , conv - > dst_port ) ;
2009-03-19 17:44:57 +00:00
switch ( direction ) {
case DIR_A_TO_FROM_B :
/* A <-> B */
str = g_strdup_printf ( " %s==%s%s%s%s%s && %s==%s%s%s%s%s " ,
2009-10-06 07:44:48 +00:00
ct_get_filter_name ( & conv - > src_address , conv - > sat , conv - > port_type , FN_ANY_ADDRESS ) ,
ep_address_to_str ( & conv - > src_address ) ,
2009-03-19 17:44:57 +00:00
sport ? " && " : " " ,
2009-10-06 07:44:48 +00:00
sport ? ct_get_filter_name ( & conv - > src_address , conv - > sat , conv - > port_type , FN_ANY_PORT ) : " " ,
2009-03-19 17:44:57 +00:00
sport ? " == " : " " ,
sport ? sport : " " ,
2009-10-06 07:44:48 +00:00
ct_get_filter_name ( & conv - > dst_address , conv - > sat , conv - > port_type , FN_ANY_ADDRESS ) ,
ep_address_to_str ( & conv - > dst_address ) ,
2009-03-19 17:44:57 +00:00
dport ? " && " : " " ,
2009-10-06 07:44:48 +00:00
dport ? ct_get_filter_name ( & conv - > dst_address , conv - > sat , conv - > port_type , FN_ANY_PORT ) : " " ,
2009-03-19 17:44:57 +00:00
dport ? " == " : " " ,
dport ? dport : " "
) ;
break ;
case DIR_A_TO_B :
/* A --> B */
str = g_strdup_printf ( " %s==%s%s%s%s%s && %s==%s%s%s%s%s " ,
2009-10-06 07:44:48 +00:00
ct_get_filter_name ( & conv - > src_address , conv - > sat , conv - > port_type , FN_SRC_ADDRESS ) ,
ep_address_to_str ( & conv - > src_address ) ,
2009-03-19 17:44:57 +00:00
sport ? " && " : " " ,
2009-10-06 07:44:48 +00:00
sport ? ct_get_filter_name ( & conv - > src_address , conv - > sat , conv - > port_type , FN_SRC_PORT ) : " " ,
2009-03-19 17:44:57 +00:00
sport ? " == " : " " ,
sport ? sport : " " ,
2009-10-06 07:44:48 +00:00
ct_get_filter_name ( & conv - > dst_address , conv - > sat , conv - > port_type , FN_DST_ADDRESS ) ,
ep_address_to_str ( & conv - > dst_address ) ,
2009-03-19 17:44:57 +00:00
dport ? " && " : " " ,
2009-10-06 07:44:48 +00:00
dport ? ct_get_filter_name ( & conv - > dst_address , conv - > sat , conv - > port_type , FN_DST_PORT ) : " " ,
2009-03-19 17:44:57 +00:00
dport ? " == " : " " ,
dport ? dport : " "
) ;
break ;
case DIR_A_FROM_B :
/* A <-- B */
str = g_strdup_printf ( " %s==%s%s%s%s%s && %s==%s%s%s%s%s " ,
2009-10-06 07:44:48 +00:00
ct_get_filter_name ( & conv - > src_address , conv - > sat , conv - > port_type , FN_DST_ADDRESS ) ,
ep_address_to_str ( & conv - > src_address ) ,
2009-03-19 17:44:57 +00:00
sport ? " && " : " " ,
2009-10-06 07:44:48 +00:00
sport ? ct_get_filter_name ( & conv - > src_address , conv - > sat , conv - > port_type , FN_DST_PORT ) : " " ,
2009-03-19 17:44:57 +00:00
sport ? " == " : " " ,
sport ? sport : " " ,
2009-10-06 07:44:48 +00:00
ct_get_filter_name ( & conv - > dst_address , conv - > sat , conv - > port_type , FN_SRC_ADDRESS ) ,
ep_address_to_str ( & conv - > dst_address ) ,
2009-03-19 17:44:57 +00:00
dport ? " && " : " " ,
2009-10-06 07:44:48 +00:00
dport ? ct_get_filter_name ( & conv - > dst_address , conv - > sat , conv - > port_type , FN_SRC_PORT ) : " " ,
2009-03-19 17:44:57 +00:00
dport ? " == " : " " ,
dport ? dport : " "
) ;
break ;
case DIR_A_TO_FROM_ANY :
/* A <-> ANY */
str = g_strdup_printf ( " %s==%s%s%s%s%s " ,
2009-10-06 07:44:48 +00:00
ct_get_filter_name ( & conv - > src_address , conv - > sat , conv - > port_type , FN_ANY_ADDRESS ) ,
ep_address_to_str ( & conv - > src_address ) ,
2009-03-19 17:44:57 +00:00
sport ? " && " : " " ,
2009-10-06 07:44:48 +00:00
sport ? ct_get_filter_name ( & conv - > src_address , conv - > sat , conv - > port_type , FN_ANY_PORT ) : " " ,
2009-03-19 17:44:57 +00:00
sport ? " == " : " " ,
sport ? sport : " "
) ;
break ;
case DIR_A_TO_ANY :
/* A --> ANY */
str = g_strdup_printf ( " %s==%s%s%s%s%s " ,
2009-10-06 07:44:48 +00:00
ct_get_filter_name ( & conv - > src_address , conv - > sat , conv - > port_type , FN_SRC_ADDRESS ) ,
ep_address_to_str ( & conv - > src_address ) ,
2009-03-19 17:44:57 +00:00
sport ? " && " : " " ,
2009-10-06 07:44:48 +00:00
sport ? ct_get_filter_name ( & conv - > src_address , conv - > sat , conv - > port_type , FN_SRC_PORT ) : " " ,
2009-03-19 17:44:57 +00:00
sport ? " == " : " " ,
sport ? sport : " "
) ;
break ;
case DIR_A_FROM_ANY :
/* A <-- ANY */
str = g_strdup_printf ( " %s==%s%s%s%s%s " ,
2009-10-06 07:44:48 +00:00
ct_get_filter_name ( & conv - > src_address , conv - > sat , conv - > port_type , FN_DST_ADDRESS ) ,
ep_address_to_str ( & conv - > src_address ) ,
2009-03-19 17:44:57 +00:00
sport ? " && " : " " ,
2009-10-06 07:44:48 +00:00
sport ? ct_get_filter_name ( & conv - > src_address , conv - > sat , conv - > port_type , FN_DST_PORT ) : " " ,
2009-03-19 17:44:57 +00:00
sport ? " == " : " " ,
sport ? sport : " "
) ;
break ;
case DIR_ANY_TO_FROM_B :
/* ANY <-> B */
str = g_strdup_printf ( " %s==%s%s%s%s%s " ,
2009-10-06 07:44:48 +00:00
ct_get_filter_name ( & conv - > dst_address , conv - > sat , conv - > port_type , FN_ANY_ADDRESS ) ,
ep_address_to_str ( & conv - > dst_address ) ,
2009-03-19 17:44:57 +00:00
dport ? " && " : " " ,
2009-10-06 07:44:48 +00:00
dport ? ct_get_filter_name ( & conv - > dst_address , conv - > sat , conv - > port_type , FN_ANY_PORT ) : " " ,
2009-03-19 17:44:57 +00:00
dport ? " == " : " " ,
dport ? dport : " "
) ;
break ;
case DIR_ANY_FROM_B :
/* ANY <-- B */
str = g_strdup_printf ( " %s==%s%s%s%s%s " ,
2009-10-06 07:44:48 +00:00
ct_get_filter_name ( & conv - > dst_address , conv - > sat , conv - > port_type , FN_SRC_ADDRESS ) ,
ep_address_to_str ( & conv - > dst_address ) ,
2009-03-19 17:44:57 +00:00
dport ? " && " : " " ,
2009-10-06 07:44:48 +00:00
dport ? ct_get_filter_name ( & conv - > dst_address , conv - > sat , conv - > port_type , FN_SRC_PORT ) : " " ,
2009-03-19 17:44:57 +00:00
dport ? " == " : " " ,
dport ? dport : " "
) ;
break ;
case DIR_ANY_TO_B :
/* ANY --> B */
str = g_strdup_printf ( " %s==%s%s%s%s%s " ,
2009-10-06 07:44:48 +00:00
ct_get_filter_name ( & conv - > dst_address , conv - > sat , conv - > port_type , FN_DST_ADDRESS ) ,
ep_address_to_str ( & conv - > dst_address ) ,
2009-03-19 17:44:57 +00:00
dport ? " && " : " " ,
2009-10-06 07:44:48 +00:00
dport ? ct_get_filter_name ( & conv - > dst_address , conv - > sat , conv - > port_type , FN_DST_PORT ) : " " ,
2009-03-19 17:44:57 +00:00
dport ? " == " : " " ,
dport ? dport : " "
) ;
break ;
2004-05-05 20:12:50 +00:00
default :
2009-03-19 17:44:57 +00:00
g_assert_not_reached ( ) ;
}
2003-08-27 12:10:21 +00:00
2009-03-19 17:44:57 +00:00
apply_selected_filter ( callback_action , str ) ;
2003-08-27 12:10:21 +00:00
2009-03-19 17:44:57 +00:00
g_free ( str ) ;
2003-08-27 12:10:21 +00:00
}
2010-07-30 12:41:56 +00:00
static gboolean
2004-07-20 21:39:54 +00:00
ct_show_popup_menu_cb ( void * widg _U_ , GdkEvent * event , conversations_table * ct )
2003-08-27 12:10:21 +00:00
{
2007-12-04 07:50:44 +00:00
GdkEventButton * bevent = ( GdkEventButton * ) event ;
2003-08-27 12:10:21 +00:00
2007-12-04 07:50:44 +00:00
if ( event - > type = = GDK_BUTTON_PRESS & & bevent - > button = = 3 ) {
gtk_menu_popup ( GTK_MENU ( ct - > menu ) , NULL , NULL , NULL , NULL ,
2009-03-19 17:44:57 +00:00
bevent - > button , bevent - > time ) ;
2004-05-05 20:12:50 +00:00
}
2003-08-27 12:10:21 +00:00
2007-12-04 07:50:44 +00:00
return FALSE ;
2003-08-27 12:10:21 +00:00
}
2010-08-19 19:05:11 +00:00
/* As Selected */
static void
conv_apply_as_selected_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_apply_as_selected_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_apply_as_selected_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_apply_as_selected_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_apply_as_selected_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_apply_as_selected_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_apply_as_selected_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_apply_as_selected_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_apply_as_selected_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_SELECTED , DIR_ANY_TO_B ) ) ;
}
/* As Not Selected */
static void
conv_apply_as_not_selected_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_NOT_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_apply_as_not_selected_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_NOT_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_apply_as_not_selected_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_NOT_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_apply_as_not_selected_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_NOT_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_apply_as_not_selected_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_NOT_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_apply_as_not_selected_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_NOT_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_apply_as_not_selected_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_NOT_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_apply_as_not_selected_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_NOT_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_apply_as_not_selected_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_NOT_SELECTED , DIR_ANY_TO_B ) ) ;
}
/* And Selected */
static void
conv_apply_and_selected_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_apply_and_selected_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_apply_and_selected_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_apply_and_selected_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_apply_and_selected_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_apply_and_selected_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_apply_and_selected_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_apply_and_selected_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_apply_and_selected_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_SELECTED , DIR_ANY_TO_B ) ) ;
}
/* Or Selected */
static void
conv_apply_or_selected_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_apply_or_selected_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_apply_or_selected_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_apply_or_selected_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_apply_or_selected_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_apply_or_selected_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_apply_or_selected_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_apply_or_selected_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_apply_or_selected_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_SELECTED , DIR_ANY_TO_B ) ) ;
}
/* And Not Selected */
static void
conv_apply_and_not_selected_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_NOT_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_apply_and_not_selected_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_NOT_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_apply_and_not_selected_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_NOT_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_apply_and_not_selected_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_NOT_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_apply_and_not_selected_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_NOT_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_apply_and_not_selected_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_NOT_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_apply_and_not_selected_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_NOT_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_apply_and_not_selected_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_NOT_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_apply_and_not_selected_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_NOT_SELECTED , DIR_ANY_TO_B ) ) ;
}
/* Or Not Selected */
static void
conv_apply_or_not_selected_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_NOT_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_apply_or_not_selected_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_AND_NOT_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_apply_or_not_selected_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_NOT_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_apply_or_not_selected_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_NOT_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_apply_or_not_selected_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_NOT_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_apply_or_not_selected_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_NOT_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_apply_or_not_selected_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_NOT_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_apply_or_not_selected_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_NOT_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_apply_or_not_selected_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_MATCH ( ACTYPE_OR_NOT_SELECTED , DIR_ANY_TO_B ) ) ;
}
/* Prepare As Selected*/
static void
conv_prepare_as_selected_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_prepare_as_selected_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_prepare_as_selected_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_prepare_as_selected_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_prepare_as_selected_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_prepare_as_selected_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_prepare_as_selected_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_prepare_as_selected_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_prepare_as_selected_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_SELECTED , DIR_ANY_TO_B ) ) ;
}
/* Prepare As Not Selected */
static void
conv_prepare_as_not_selected_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_NOT_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_prepare_as_not_selected_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_NOT_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_prepare_as_not_selected_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_NOT_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_prepare_as_not_selected_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_NOT_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_prepare_as_not_selected_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_NOT_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_prepare_as_not_selected_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_NOT_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_prepare_as_not_selected_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_NOT_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_prepare_as_not_selected_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_NOT_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_prepare_as_not_selected_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_NOT_SELECTED , DIR_ANY_TO_B ) ) ;
}
/* Prepare And Selected */
static void
conv_prepare_and_selected_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_prepare_and_selected_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_prepare_and_selected_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_prepare_and_selected_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_prepare_and_selected_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_prepare_and_selected_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_prepare_and_selected_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_prepare_and_selected_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_prepare_and_selected_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_SELECTED , DIR_ANY_TO_B ) ) ;
}
/* Prepare Or Selected */
static void
conv_prepare_or_selected_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_prepare_or_selected_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_prepare_or_selected_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_prepare_or_selected_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_prepare_or_selected_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_prepare_or_selected_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_prepare_or_selected_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_prepare_or_selected_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_prepare_or_selected_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_SELECTED , DIR_ANY_TO_B ) ) ;
}
/* Prepare And Not Selected */
static void
conv_prepare_and_not_selected_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_NOT_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_prepare_and_not_selected_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_NOT_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_prepare_and_not_selected_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_NOT_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_prepare_and_not_selected_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_NOT_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_prepare_and_not_selected_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_NOT_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_prepare_and_not_selected_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_NOT_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_prepare_and_not_selected_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_NOT_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_prepare_and_not_selected_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_NOT_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_prepare_and_not_selected_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_NOT_SELECTED , DIR_ANY_TO_B ) ) ;
}
/* Prepare Or Not Selected */
static void
conv_prepare_or_not_selected_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_NOT_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_prepare_or_not_selected_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_AND_NOT_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_prepare_or_not_selected_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_NOT_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_prepare_or_not_selected_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_NOT_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_prepare_or_not_selected_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_NOT_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_prepare_or_not_selected_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_NOT_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_prepare_or_not_selected_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_NOT_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_prepare_or_not_selected_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_NOT_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_prepare_or_not_selected_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_PREPARE ( ACTYPE_OR_NOT_SELECTED , DIR_ANY_TO_B ) ) ;
}
/* Find packet */
static void
conv_find_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_FRAME ( ACTYPE_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_find_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_FRAME ( ACTYPE_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_find_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_FRAME ( ACTYPE_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_find_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_FRAME ( ACTYPE_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_find_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_FRAME ( ACTYPE_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_find_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_FRAME ( ACTYPE_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_find_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_FRAME ( ACTYPE_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_find_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_FRAME ( ACTYPE_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_find_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_FRAME ( ACTYPE_SELECTED , DIR_ANY_TO_B ) ) ;
}
/* Find next */
static void
conv_find_next_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_NEXT ( ACTYPE_NOT_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_find_next_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_NEXT ( ACTYPE_NOT_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_find_next_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_NEXT ( ACTYPE_NOT_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_find_next_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_NEXT ( ACTYPE_NOT_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_find_next_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_NEXT ( ACTYPE_NOT_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_find_next_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_NEXT ( ACTYPE_NOT_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_find_next_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_NEXT ( ACTYPE_NOT_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_find_next_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_NEXT ( ACTYPE_NOT_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_find_next_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_NEXT ( ACTYPE_NOT_SELECTED , DIR_ANY_TO_B ) ) ;
}
/* Find Previous */
static void
conv_find_previous_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_PREVIOUS ( ACTYPE_AND_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_find_previous_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_PREVIOUS ( ACTYPE_AND_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_find_previous_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_PREVIOUS ( ACTYPE_AND_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_find_previous_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_PREVIOUS ( ACTYPE_AND_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_find_previous_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_PREVIOUS ( ACTYPE_AND_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_find_previous_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_PREVIOUS ( ACTYPE_AND_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_find_previous_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_PREVIOUS ( ACTYPE_AND_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_find_previous_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_PREVIOUS ( ACTYPE_AND_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_find_previous_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_FIND_PREVIOUS ( ACTYPE_AND_SELECTED , DIR_ANY_TO_B ) ) ;
}
/* Colorize Conversation */
static void
conv_color_AtofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_COLORIZE ( ACTYPE_SELECTED , DIR_A_TO_FROM_B ) ) ;
}
static void
conv_color_AtoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_COLORIZE ( ACTYPE_SELECTED , DIR_A_TO_B ) ) ;
}
static void
conv_color_AfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_COLORIZE ( ACTYPE_SELECTED , DIR_A_FROM_B ) ) ;
}
static void
conv_color_AtofromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_COLORIZE ( ACTYPE_SELECTED , DIR_A_TO_FROM_ANY ) ) ;
}
static void
conv_color_AtoAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_COLORIZE ( ACTYPE_SELECTED , DIR_A_TO_ANY ) ) ;
}
static void
conv_color_AfromAny_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_COLORIZE ( ACTYPE_SELECTED , DIR_A_FROM_ANY ) ) ;
}
static void
conv_color_AnytofromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_COLORIZE ( ACTYPE_SELECTED , DIR_ANY_TO_FROM_B ) ) ;
}
static void
conv_color_AnyfromB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_COLORIZE ( ACTYPE_SELECTED , DIR_ANY_FROM_B ) ) ;
}
static void
conv_color_AnytoB_cb ( GtkWidget * widget , gpointer user_data )
{
ct_select_filter_cb ( widget , user_data , CALLBACK_COLORIZE ( ACTYPE_SELECTED , DIR_ANY_TO_B ) ) ;
}
static const char * ui_desc_conv_filter_popup =
" <ui> \n "
" <popup name='ConversationFilterPopup' action='PopupAction'> \n "
" <menu name= 'ApplyAsFilter' action='/Apply as Filter'> \n "
" <menu name= 'ApplyAsFilterSelected' action='/Apply as Filter/Selected'> \n "
" <menuitem action='/Apply as Filter/Selected/A_to_from_B'/> \n "
" <menuitem action='/Apply as Filter/Selected/A_to_B'/> \n "
" <menuitem action='/Apply as Filter/Selected/A_from_B'/> \n "
" <menuitem action='/Apply as Filter/Selected/A_to_from_Any'/> \n "
" <menuitem action='/Apply as Filter/Selected/A_to_Any'/> \n "
" <menuitem action='/Apply as Filter/Selected/A_from_Any'/> \n "
" <menuitem action='/Apply as Filter/Selected/Any_tofrom_B'/> \n "
" <menuitem action='/Apply as Filter/Selected/Any_from_B'/> \n "
" <menuitem action='/Apply as Filter/Selected/Any_to_B'/> \n "
" </menu> \n "
" <menu name= 'ApplyAsFilterNotSelected' action='/Apply as Filter/Not Selected'> \n "
" <menuitem action='/Apply as Filter/Not Selected/A_to_from_B'/> \n "
" <menuitem action='/Apply as Filter/Not Selected/A_to_B'/> \n "
" <menuitem action='/Apply as Filter/Not Selected/A_from_B'/> \n "
" <menuitem action='/Apply as Filter/Not Selected/A_to_from_Any'/> \n "
" <menuitem action='/Apply as Filter/Not Selected/A_to_Any'/> \n "
" <menuitem action='/Apply as Filter/Not Selected/A_from_Any'/> \n "
" <menuitem action='/Apply as Filter/Not Selected/Any_tofrom_B'/> \n "
" <menuitem action='/Apply as Filter/Not Selected/Any_from_B'/> \n "
" <menuitem action='/Apply as Filter/Not Selected/Any_to_B'/> \n "
" </menu> \n "
2010-10-03 16:09:25 +00:00
" <menu name= 'ApplyAsFilterAndSelected' action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected'> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_from_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_from_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_from_Any'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_Any'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_from_Any'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/Any_tofrom_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/Any_from_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/Any_to_B'/> \n "
2010-08-19 19:05:11 +00:00
" </menu> \n "
2010-10-03 16:09:25 +00:00
" <menu name= 'ApplyAsFilterOrSelected' action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected'> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_from_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_from_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_from_Any'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_Any'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_from_Any'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/Any_tofrom_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/Any_from_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/Any_to_B'/> \n "
2010-08-19 19:05:11 +00:00
" </menu> \n "
2010-10-03 16:09:25 +00:00
" <menu name= 'ApplyAsFilterAndNotSelected' action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected'> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_from_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_from_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_from_Any'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_Any'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_from_Any'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/Any_tofrom_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/Any_from_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/Any_to_B'/> \n "
2010-08-19 19:05:11 +00:00
" </menu> \n "
2010-10-03 16:09:25 +00:00
" <menu name= 'ApplyAsFilterOrNotSelected' action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected'> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_from_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_from_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_from_Any'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_Any'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_from_Any'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/Any_tofrom_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/Any_from_B'/> \n "
" <menuitem action='/Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/Any_to_B'/> \n "
2010-10-03 15:22:16 +00:00
" </menu> \n "
2010-08-19 19:05:11 +00:00
" </menu> \n "
" <menu name= 'PrepareAFilter' action='/Prepare a Filter'> \n "
" <menu name= 'PrepareAFilterSelected' action='/Prepare a Filter/Selected'> \n "
" <menuitem action='/Prepare a Filter/Selected/A_to_from_B'/> \n "
" <menuitem action='/Prepare a Filter/Selected/A_to_B'/> \n "
" <menuitem action='/Prepare a Filter/Selected/A_from_B'/> \n "
" <menuitem action='/Prepare a Filter/Selected/A_to_from_Any'/> \n "
" <menuitem action='/Prepare a Filter/Selected/A_to_Any'/> \n "
" <menuitem action='/Prepare a Filter/Selected/A_from_Any'/> \n "
" <menuitem action='/Prepare a Filter/Selected/Any_tofrom_B'/> \n "
" <menuitem action='/Prepare a Filter/Selected/Any_from_B'/> \n "
" <menuitem action='/Prepare a Filter/Selected/Any_to_B'/> \n "
" </menu> \n "
" <menu name= 'PrepareAFilterNotSelected' action='/Prepare a Filter/Not Selected'> \n "
" <menuitem action='/Prepare a Filter/Not Selected/A_to_from_B'/> \n "
" <menuitem action='/Prepare a Filter/Not Selected/A_to_B'/> \n "
" <menuitem action='/Prepare a Filter/Not Selected/A_from_B'/> \n "
" <menuitem action='/Prepare a Filter/Not Selected/A_to_from_Any'/> \n "
" <menuitem action='/Prepare a Filter/Not Selected/A_to_Any'/> \n "
" <menuitem action='/Prepare a Filter/Not Selected/A_from_Any'/> \n "
" <menuitem action='/Prepare a Filter/Not Selected/Any_tofrom_B'/> \n "
" <menuitem action='/Prepare a Filter/Not Selected/Any_from_B'/> \n "
" <menuitem action='/Prepare a Filter/Not Selected/Any_to_B'/> \n "
" </menu> \n "
2010-10-03 16:09:25 +00:00
" <menu name= 'PrepareAFilterAndSelected' action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected'> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_from_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_from_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_from_Any'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_Any'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_from_Any'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/Any_tofrom_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/Any_from_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/Any_to_B'/> \n "
2010-08-19 19:05:11 +00:00
" </menu> \n "
2010-10-03 16:09:25 +00:00
" <menu name= 'PrepareAFilterOrSelected' action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected'> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_from_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_from_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_from_Any'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_Any'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_from_Any'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/Any_tofrom_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/Any_from_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/Any_to_B'/> \n "
2010-08-19 19:05:11 +00:00
" </menu> \n "
2010-10-03 16:09:25 +00:00
" <menu name= 'PrepareAFilterAndNotSelected' action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected'> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_from_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_from_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_from_Any'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_Any'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_from_Any'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/Any_tofrom_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/Any_from_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/Any_to_B'/> \n "
2010-08-19 19:05:11 +00:00
" </menu> \n "
2010-10-03 16:09:25 +00:00
" <menu name= 'PrepareAFilterOrNotSelected' action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected'> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_from_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_from_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_from_Any'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_Any'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_from_Any'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/Any_tofrom_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/Any_from_B'/> \n "
" <menuitem action='/Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/Any_to_B'/> \n "
2010-10-03 15:22:16 +00:00
" </menu> \n "
2010-08-19 19:05:11 +00:00
" </menu> \n "
" <menu name= 'FindPacket' action='/Find Packet'> \n "
" <menu name= 'FindPacketFindPacket' action='/Find Packet/Find Packet'> \n "
" <menuitem action='/Find Packet/Find Packet/A_to_from_B'/> \n "
" <menuitem action='/Find Packet/Find Packet/A_to_B'/> \n "
" <menuitem action='/Find Packet/Find Packet/A_from_B'/> \n "
" <menuitem action='/Find Packet/Find Packet/A_to_from_Any'/> \n "
" <menuitem action='/Find Packet/Find Packet/A_to_Any'/> \n "
" <menuitem action='/Find Packet/Find Packet/A_from_Any'/> \n "
" <menuitem action='/Find Packet/Find Packet/Any_tofrom_B'/> \n "
" <menuitem action='/Find Packet/Find Packet/Any_from_B'/> \n "
" <menuitem action='/Find Packet/Find Packet/Any_to_B'/> \n "
" </menu> \n "
" <menu name= 'FindPacketFindNext' action='/Find Packet/Find Next'> \n "
" <menuitem action='/Find Packet/Find Next/A_to_from_B'/> \n "
" <menuitem action='/Find Packet/Find Next/A_to_B'/> \n "
" <menuitem action='/Find Packet/Find Next/A_from_B'/> \n "
" <menuitem action='/Find Packet/Find Next/A_to_from_Any'/> \n "
" <menuitem action='/Find Packet/Find Next/A_to_Any'/> \n "
" <menuitem action='/Find Packet/Find Next/A_from_Any'/> \n "
" <menuitem action='/Find Packet/Find Next/Any_tofrom_B'/> \n "
" <menuitem action='/Find Packet/Find Next/Any_from_B'/> \n "
" <menuitem action='/Find Packet/Find Next/Any_to_B'/> \n "
" </menu> \n "
" <menu name= 'FindPacketFindPrevious' action='/Find Packet/Find Previous'> \n "
" <menuitem action='/Find Packet/Find Previous/A_to_from_B'/> \n "
" <menuitem action='/Find Packet/Find Previous/A_to_B'/> \n "
" <menuitem action='/Find Packet/Find Previous/A_from_B'/> \n "
" <menuitem action='/Find Packet/Find Previous/A_to_from_Any'/> \n "
" <menuitem action='/Find Packet/Find Previous/A_to_Any'/> \n "
" <menuitem action='/Find Packet/Find Previous/A_from_Any'/> \n "
" <menuitem action='/Find Packet/Find Previous/Any_tofrom_B'/> \n "
" <menuitem action='/Find Packet/Find Previous/Any_from_B'/> \n "
" <menuitem action='/Find Packet/Find Previous/Any_to_B'/> \n "
" </menu> \n "
" </menu> \n "
" <menu name= 'ColorizeConversation' action='/Colorize Conversation'> \n "
" <menuitem action='/Colorize Conversation/A_to_from_B'/> \n "
" <menuitem action='/Colorize Conversation/A_to_B'/> \n "
" <menuitem action='/Colorize Conversation/A_from_B'/> \n "
" <menuitem action='/Colorize Conversation/A_to_from_Any'/> \n "
" <menuitem action='/Colorize Conversation/A_to_Any'/> \n "
" <menuitem action='/Colorize Conversation/A_from_Any'/> \n "
" <menuitem action='/Colorize Conversation/Any_tofrom_B'/> \n "
" <menuitem action='/Colorize Conversation/Any_from_B'/> \n "
" <menuitem action='/Colorize Conversation/Any_to_B'/> \n "
" </menu> \n "
" </popup> \n "
" </ui> \n " ;
/*
* GtkActionEntry
* typedef struct {
* const gchar * name ;
* const gchar * stock_id ;
* const gchar * label ;
* const gchar * accelerator ;
* const gchar * tooltip ;
* GCallback callback ;
* } GtkActionEntry ;
* const gchar * name ; The name of the action .
* const gchar * stock_id ; The stock id for the action , or the name of an icon from the icon theme .
* const gchar * label ; The label for the action . This field should typically be marked for translation ,
* see gtk_action_group_set_translation_domain ( ) .
* If label is NULL , the label of the stock item with id stock_id is used .
* const gchar * accelerator ; The accelerator for the action , in the format understood by gtk_accelerator_parse ( ) .
* const gchar * tooltip ; The tooltip for the action . This field should typically be marked for translation ,
* see gtk_action_group_set_translation_domain ( ) .
* GCallback callback ; The function to call when the action is activated .
*
*/
static const GtkActionEntry conv_filter_menu_entries [ ] = {
/* Top level */
2010-08-19 20:11:28 +00:00
{ " /Apply as Filter " , NULL , " Apply as Filter " , NULL , NULL , NULL } ,
{ " /Prepare a Filter " , NULL , " Prepare a Filter " , NULL , NULL , NULL } ,
{ " /Find Packet " , NULL , " Find Packet " , NULL , NULL , NULL } ,
{ " /Colorize Conversation " , NULL , " Colorize Conversation " , NULL , NULL , NULL } ,
2010-08-19 19:05:11 +00:00
/* Apply as */
2010-08-19 20:11:28 +00:00
{ " /Apply as Filter/Selected " , NULL , " Selected " , NULL , NULL , NULL } ,
{ " /Apply as Filter/Not Selected " , NULL , " Not Selected " , NULL , NULL , NULL } ,
2010-10-03 16:09:25 +00:00
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected " , NULL , UTF8_HORIZONTAL_ELLIPSIS " and Selected " , NULL , NULL , NULL } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected " , NULL , UTF8_HORIZONTAL_ELLIPSIS " or Selected " , NULL , NULL , NULL } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected " , NULL , UTF8_HORIZONTAL_ELLIPSIS " and not Selected " , NULL , NULL , NULL } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected " , NULL , UTF8_HORIZONTAL_ELLIPSIS " or not Selected " , NULL , NULL , NULL } ,
2010-08-19 19:05:11 +00:00
/* Apply as Selected */
{ " /Apply as Filter/Selected/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_apply_as_selected_AtofromB_cb ) } ,
{ " /Apply as Filter/Selected/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_as_selected_AtoB_cb ) } ,
{ " /Apply as Filter/Selected/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_as_selected_AfromB_cb ) } ,
{ " /Apply as Filter/Selected/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_apply_as_selected_AtofromAny_cb ) } ,
{ " /Apply as Filter/Selected/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_apply_as_selected_AtoAny_cb ) } ,
{ " /Apply as Filter/Selected/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_apply_as_selected_AfromAny_cb ) } ,
{ " /Apply as Filter/Selected/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_apply_as_selected_AnytofromB_cb ) } ,
{ " /Apply as Filter/Selected/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_as_selected_AnytoB_cb ) } ,
{ " /Apply as Filter/Selected/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_as_selected_AnyfromB_cb ) } ,
/* Apply as Not Selected */
{ " /Apply as Filter/Not Selected/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_apply_as_not_selected_AtofromB_cb ) } ,
{ " /Apply as Filter/Not Selected/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_as_not_selected_AtoB_cb ) } ,
{ " /Apply as Filter/Not Selected/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_as_not_selected_AfromB_cb ) } ,
{ " /Apply as Filter/Not Selected/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_apply_as_not_selected_AtofromAny_cb ) } ,
{ " /Apply as Filter/Not Selected/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_apply_as_not_selected_AtoAny_cb ) } ,
{ " /Apply as Filter/Not Selected/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_apply_as_not_selected_AfromAny_cb ) } ,
{ " /Apply as Filter/Not Selected/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_apply_as_not_selected_AnytofromB_cb ) } ,
{ " /Apply as Filter/Not Selected/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_as_not_selected_AnytoB_cb ) } ,
{ " /Apply as Filter/Not Selected/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_as_not_selected_AnyfromB_cb ) } ,
/* Apply as ... and Selected */
2010-10-03 16:09:25 +00:00
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_apply_and_selected_AtofromB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_and_selected_AtoB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_and_selected_AfromB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_apply_and_selected_AtofromAny_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_apply_and_selected_AtoAny_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_apply_and_selected_AfromAny_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_apply_and_selected_AnytofromB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_and_selected_AnytoB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_and_selected_AnyfromB_cb ) } ,
2010-08-19 19:05:11 +00:00
/* Apply as ... or Selected */
2010-10-03 16:09:25 +00:00
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_apply_or_selected_AtofromB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_or_selected_AtoB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_or_selected_AfromB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_apply_or_selected_AtofromAny_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_apply_or_selected_AtoAny_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_apply_or_selected_AfromAny_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_apply_or_selected_AnytofromB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_or_selected_AnytoB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_or_selected_AnyfromB_cb ) } ,
2010-08-19 19:05:11 +00:00
/* Apply as ... and not Selected */
2010-10-03 16:09:25 +00:00
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_apply_and_not_selected_AtofromB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_and_not_selected_AtoB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_and_not_selected_AfromB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_apply_and_not_selected_AtofromAny_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_apply_and_not_selected_AtoAny_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_apply_and_not_selected_AfromAny_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_apply_and_not_selected_AnytofromB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_and_not_selected_AnytoB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_and_not_selected_AnyfromB_cb ) } ,
2010-08-19 19:05:11 +00:00
/* Apply as ... or not Selected */
2010-10-03 16:09:25 +00:00
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_apply_or_not_selected_AtofromB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_or_not_selected_AtoB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_or_not_selected_AfromB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_apply_or_not_selected_AtofromAny_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_apply_or_not_selected_AtoAny_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_apply_or_not_selected_AfromAny_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_apply_or_not_selected_AnytofromB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_or_not_selected_AnytoB_cb ) } ,
{ " /Apply as Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_apply_or_not_selected_AnyfromB_cb ) } ,
2010-08-19 19:05:11 +00:00
/* Prepare a */
2010-08-19 20:11:28 +00:00
{ " /Prepare a Filter/Selected " , NULL , " Selected " , NULL , NULL , NULL } ,
{ " /Prepare a Filter/Not Selected " , NULL , " Not Selected " , NULL , NULL , NULL } ,
2010-10-03 16:09:25 +00:00
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected " , NULL , UTF8_HORIZONTAL_ELLIPSIS " and Selected " , NULL , NULL , NULL } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected " , NULL , UTF8_HORIZONTAL_ELLIPSIS " or Selected " , NULL , NULL , NULL } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected " , NULL , UTF8_HORIZONTAL_ELLIPSIS " and not Selected " , NULL , NULL , NULL } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected " , NULL , UTF8_HORIZONTAL_ELLIPSIS " or not Selected " , NULL , NULL , NULL } ,
2010-08-19 19:05:11 +00:00
/* Prepare as Selected */
{ " /Prepare a Filter/Selected/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_prepare_as_selected_AtofromB_cb ) } ,
{ " /Prepare a Filter/Selected/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_as_selected_AtoB_cb ) } ,
{ " /Prepare a Filter/Selected/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_as_selected_AfromB_cb ) } ,
{ " /Prepare a Filter/Selected/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_prepare_as_selected_AtofromAny_cb ) } ,
{ " /Prepare a Filter/Selected/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_prepare_as_selected_AtoAny_cb ) } ,
{ " /Prepare a Filter/Selected/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_prepare_as_selected_AfromAny_cb ) } ,
{ " /Prepare a Filter/Selected/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_prepare_as_selected_AnytofromB_cb ) } ,
{ " /Prepare a Filter/Selected/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_as_selected_AnytoB_cb ) } ,
{ " /Prepare a Filter/Selected/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_as_selected_AnyfromB_cb ) } ,
/* Prepare a Not Selected */
{ " /Prepare a Filter/Not Selected/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_prepare_as_not_selected_AtofromB_cb ) } ,
{ " /Prepare a Filter/Not Selected/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_as_not_selected_AtoB_cb ) } ,
{ " /Prepare a Filter/Not Selected/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_as_not_selected_AfromB_cb ) } ,
{ " /Prepare a Filter/Not Selected/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_prepare_as_not_selected_AtofromAny_cb ) } ,
{ " /Prepare a Filter/Not Selected/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_prepare_as_not_selected_AtoAny_cb ) } ,
{ " /Prepare a Filter/Not Selected/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_prepare_as_not_selected_AfromAny_cb ) } ,
{ " /Prepare a Filter/Not Selected/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_prepare_as_not_selected_AnytofromB_cb ) } ,
{ " /Prepare a Filter/Not Selected/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_as_not_selected_AnytoB_cb ) } ,
{ " /Prepare a Filter/Not Selected/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_as_not_selected_AnyfromB_cb ) } ,
/* Prepare a ... and Selected */
2010-10-03 16:09:25 +00:00
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_prepare_and_selected_AtofromB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_and_selected_AtoB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_and_selected_AfromB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_prepare_and_selected_AtofromAny_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_prepare_and_selected_AtoAny_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_prepare_and_selected_AfromAny_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_prepare_and_selected_AnytofromB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_and_selected_AnytoB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and Selected/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_and_selected_AnyfromB_cb ) } ,
2010-08-19 19:05:11 +00:00
/* Prepare a ... or Selected */
2010-10-03 16:09:25 +00:00
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_prepare_or_selected_AtofromB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_or_selected_AtoB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_or_selected_AfromB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_prepare_or_selected_AtofromAny_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_prepare_or_selected_AtoAny_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_prepare_or_selected_AfromAny_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_prepare_or_selected_AnytofromB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_or_selected_AnytoB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or Selected/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_or_selected_AnyfromB_cb ) } ,
2010-08-19 19:05:11 +00:00
/* Prepare a ... and not Selected */
2010-10-03 16:09:25 +00:00
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_prepare_and_not_selected_AtofromB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_and_not_selected_AtoB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_and_not_selected_AfromB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_prepare_and_not_selected_AtofromAny_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_prepare_and_not_selected_AtoAny_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_prepare_and_not_selected_AfromAny_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_prepare_and_not_selected_AnytofromB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_and_not_selected_AnytoB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " and not Selected/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_and_not_selected_AnyfromB_cb ) } ,
2010-08-19 19:05:11 +00:00
/* Prepare a ... or not Selected */
2010-10-03 16:09:25 +00:00
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_prepare_or_not_selected_AtofromB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_or_not_selected_AtoB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_or_not_selected_AfromB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_prepare_or_not_selected_AtofromAny_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_prepare_or_not_selected_AtoAny_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_prepare_or_not_selected_AfromAny_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_prepare_or_not_selected_AnytofromB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_or_not_selected_AnytoB_cb ) } ,
{ " /Prepare a Filter/ " UTF8_HORIZONTAL_ELLIPSIS " or not Selected/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_prepare_or_not_selected_AnyfromB_cb ) } ,
2010-08-19 19:05:11 +00:00
/* Find packet*/
2010-08-19 20:11:28 +00:00
{ " /Find Packet/Find Packet " , NULL , " Find Packet " , NULL , NULL , NULL } ,
{ " /Find Packet/Find Next " , NULL , " Find Next " , NULL , NULL , NULL } ,
{ " /Find Packet/Find Previous " , NULL , " Find Previous " , NULL , NULL , NULL } ,
2010-08-19 19:05:11 +00:00
/* Find packet*/
{ " /Find Packet/Find Packet/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_find_AtofromB_cb ) } ,
{ " /Find Packet/Find Packet/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_find_AtoB_cb ) } ,
{ " /Find Packet/Find Packet/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_find_AfromB_cb ) } ,
{ " /Find Packet/Find Packet/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_find_AtofromAny_cb ) } ,
{ " /Find Packet/Find Packet/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_find_AtoAny_cb ) } ,
{ " /Find Packet/Find Packet/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_find_AfromAny_cb ) } ,
{ " /Find Packet/Find Packet/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_find_AnytofromB_cb ) } ,
{ " /Find Packet/Find Packet/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_find_AnytoB_cb ) } ,
{ " /Find Packet/Find Packet/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_find_AnyfromB_cb ) } ,
/* Find Next*/
{ " /Find Packet/Find Next/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_find_next_AtofromB_cb ) } ,
{ " /Find Packet/Find Next/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_find_next_AtoB_cb ) } ,
{ " /Find Packet/Find Next/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_find_next_AfromB_cb ) } ,
{ " /Find Packet/Find Next/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_find_next_AtofromAny_cb ) } ,
{ " /Find Packet/Find Next/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_find_next_AtoAny_cb ) } ,
{ " /Find Packet/Find Next/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_find_next_AfromAny_cb ) } ,
{ " /Find Packet/Find Next/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_find_next_AnytofromB_cb ) } ,
{ " /Find Packet/Find Next/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_find_next_AnytoB_cb ) } ,
{ " /Find Packet/Find Next/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_find_next_AnyfromB_cb ) } ,
/* Find packet*/
{ " /Find Packet/Find Previous/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_find_previous_AtofromB_cb ) } ,
{ " /Find Packet/Find Previous/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_find_previous_AtoB_cb ) } ,
{ " /Find Packet/Find Previous/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_find_previous_AfromB_cb ) } ,
{ " /Find Packet/Find Previous/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_find_previous_AtofromAny_cb ) } ,
{ " /Find Packet/Find Previous/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_find_previous_AtoAny_cb ) } ,
{ " /Find Packet/Find Previous/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_find_previous_AfromAny_cb ) } ,
{ " /Find Packet/Find Previous/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_find_previous_AnytofromB_cb ) } ,
{ " /Find Packet/Find Previous/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_find_previous_AnytoB_cb ) } ,
{ " /Find Packet/Find Previous/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_find_previous_AnyfromB_cb ) } ,
/* Colorize Conversation */
{ " /Colorize Conversation/A_to_from_B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_color_AtofromB_cb ) } ,
{ " /Colorize Conversation/A_to_B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , NULL , " A " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_color_AtoB_cb ) } ,
{ " /Colorize Conversation/A_from_B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , NULL , " A " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_color_AfromB_cb ) } ,
{ " /Colorize Conversation/A_to_from_Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , NULL , " A " UTF8_LEFT_RIGHT_ARROW " Any " , G_CALLBACK ( conv_color_AtofromAny_cb ) } ,
{ " /Colorize Conversation/A_to_Any " , NULL , " A " UTF8_RIGHTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_color_AtoAny_cb ) } ,
{ " /Colorize Conversation/A_from_Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , NULL , " A " UTF8_LEFTWARDS_ARROW " Any " , G_CALLBACK ( conv_color_AfromAny_cb ) } ,
{ " /Colorize Conversation/Any_tofrom_B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , NULL , " Any " UTF8_LEFT_RIGHT_ARROW " B " , G_CALLBACK ( conv_color_AnytofromB_cb ) } ,
{ " /Colorize Conversation/Any_to_B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , NULL , " Any " UTF8_RIGHTWARDS_ARROW " B " , G_CALLBACK ( conv_color_AnytoB_cb ) } ,
{ " /Colorize Conversation/Any_from_B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , NULL , " Any " UTF8_LEFTWARDS_ARROW " B " , G_CALLBACK ( conv_color_AnyfromB_cb ) } ,
} ;
2003-08-27 12:10:21 +00:00
static void
2004-07-20 21:39:54 +00:00
ct_create_popup_menu ( conversations_table * ct )
2003-08-27 12:10:21 +00:00
{
2010-08-19 19:05:11 +00:00
GtkUIManager * ui_manager ;
GtkActionGroup * action_group ;
GError * error = NULL ;
action_group = gtk_action_group_new ( " ConvActionGroup " ) ;
gtk_action_group_add_actions ( action_group , /* the action group */
conv_filter_menu_entries , /* an array of action descriptions */
G_N_ELEMENTS ( conv_filter_menu_entries ) , /* the number of entries */
ct ) ; /* data to pass to the action callbacks */
ui_manager = gtk_ui_manager_new ( ) ;
gtk_ui_manager_insert_action_group ( ui_manager , action_group , 0 ) ;
gtk_ui_manager_add_ui_from_string ( ui_manager , ui_desc_conv_filter_popup , - 1 , & error ) ;
if ( error ! = NULL )
{
fprintf ( stderr , " Warning: building conversation filter popup failed: %s \n " ,
error - > message ) ;
g_error_free ( error ) ;
error = NULL ;
}
ct - > menu = gtk_ui_manager_get_widget ( ui_manager , " /ConversationFilterPopup " ) ;
g_signal_connect ( ct - > table , " button_press_event " , G_CALLBACK ( ct_show_popup_menu_cb ) , ct ) ;
2003-08-27 12:10:21 +00:00
}
2004-07-27 18:34:02 +00:00
/* Draw/refresh the address fields of a single entry at the specified index */
static void
2009-10-06 07:44:48 +00:00
get_ct_table_address ( conversations_table * ct , conv_t * conv , char * * entries )
2004-07-27 18:34:02 +00:00
{
char * port ;
guint32 pt ;
2004-12-30 02:10:24 +00:00
if ( ! ct - > resolve_names )
2009-10-06 07:44:48 +00:00
entries [ 0 ] = ep_address_to_str ( & conv - > src_address ) ;
2004-12-30 02:10:24 +00:00
else {
2009-10-06 07:44:48 +00:00
entries [ 0 ] = ( char * ) get_addr_name ( & conv - > src_address ) ;
2004-07-27 18:34:02 +00:00
}
2009-10-06 07:44:48 +00:00
pt = conv - > port_type ;
2004-07-27 18:34:02 +00:00
if ( ! ct - > resolve_names ) pt = PT_NONE ;
switch ( pt ) {
case ( PT_TCP ) :
2009-10-06 07:44:48 +00:00
entries [ 1 ] = get_tcp_port ( conv - > src_port ) ;
2004-07-27 18:34:02 +00:00
break ;
case ( PT_UDP ) :
2009-10-06 07:44:48 +00:00
entries [ 1 ] = get_udp_port ( conv - > src_port ) ;
2004-07-27 18:34:02 +00:00
break ;
2008-02-08 12:33:26 +00:00
case ( PT_SCTP ) :
2009-10-06 07:44:48 +00:00
entries [ 1 ] = get_sctp_port ( conv - > src_port ) ;
2008-02-08 12:33:26 +00:00
break ;
2004-07-27 18:34:02 +00:00
default :
2009-10-06 07:44:48 +00:00
port = ct_port_to_str ( conv - > port_type , conv - > src_port ) ;
entries [ 1 ] = port ? port : " " ;
2004-07-27 18:34:02 +00:00
}
2004-12-30 02:10:24 +00:00
if ( ! ct - > resolve_names )
2009-10-06 07:44:48 +00:00
entries [ 2 ] = ep_address_to_str ( & conv - > dst_address ) ;
2004-12-30 02:10:24 +00:00
else {
2009-10-06 07:44:48 +00:00
entries [ 2 ] = ( char * ) get_addr_name ( & conv - > dst_address ) ;
2004-07-27 18:34:02 +00:00
}
switch ( pt ) {
case ( PT_TCP ) :
2009-10-06 07:44:48 +00:00
entries [ 3 ] = get_tcp_port ( conv - > dst_port ) ;
2004-07-27 18:34:02 +00:00
break ;
case ( PT_UDP ) :
2009-10-06 07:44:48 +00:00
entries [ 3 ] = get_udp_port ( conv - > dst_port ) ;
2004-07-27 18:34:02 +00:00
break ;
2008-02-08 12:33:26 +00:00
case ( PT_SCTP ) :
2009-10-06 07:44:48 +00:00
entries [ 3 ] = get_sctp_port ( conv - > dst_port ) ;
2008-02-08 12:33:26 +00:00
break ;
2004-07-27 18:34:02 +00:00
default :
2009-10-06 07:44:48 +00:00
port = ct_port_to_str ( conv - > port_type , conv - > dst_port ) ;
entries [ 3 ] = port ? port : " " ;
2004-07-27 18:34:02 +00:00
}
}
2003-08-27 12:10:21 +00:00
2004-07-27 18:34:02 +00:00
/* Refresh the address fields of all entries in the list */
2004-06-03 21:46:27 +00:00
static void
2004-07-20 21:39:54 +00:00
draw_ct_table_addresses ( conversations_table * ct )
2004-05-03 22:15:22 +00:00
{
2004-06-03 21:46:27 +00:00
guint32 i ;
2009-10-06 07:44:48 +00:00
char * entries [ 4 ] ;
GtkListStore * store ;
if ( ! ct - > num_conversations )
return ;
2010-07-23 14:01:47 +00:00
store = GTK_LIST_STORE ( gtk_tree_view_get_model ( ct - > table ) ) ;
2009-10-06 07:44:48 +00:00
g_object_ref ( store ) ;
gtk_tree_view_set_model ( GTK_TREE_VIEW ( ct - > table ) , NULL ) ;
2004-05-03 22:15:22 +00:00
2004-07-20 21:39:54 +00:00
for ( i = 0 ; i < ct - > num_conversations ; i + + ) {
2009-10-06 07:44:48 +00:00
conv_t * conv = & g_array_index ( ct - > conversations , conv_t , i ) ;
2010-07-23 14:01:47 +00:00
if ( ! conv - > iter_valid )
2009-10-06 07:44:48 +00:00
continue ;
get_ct_table_address ( ct , conv , entries ) ;
gtk_list_store_set ( store , & conv - > iter ,
2010-07-23 14:01:47 +00:00
SRC_ADR_COLUMN , entries [ 0 ] ,
2009-10-06 07:44:48 +00:00
SRC_PORT_COLUMN , entries [ 1 ] ,
2010-07-23 14:01:47 +00:00
DST_ADR_COLUMN , entries [ 2 ] ,
2009-10-06 07:44:48 +00:00
DST_PORT_COLUMN , entries [ 3 ] ,
- 1 ) ;
2004-06-03 21:46:27 +00:00
}
2010-07-23 14:01:47 +00:00
2009-10-06 07:44:48 +00:00
gtk_tree_view_set_model ( GTK_TREE_VIEW ( ct - > table ) , GTK_TREE_MODEL ( store ) ) ;
g_object_unref ( store ) ;
2004-05-03 22:15:22 +00:00
}
2004-06-03 21:46:27 +00:00
static void
2004-07-20 21:39:54 +00:00
draw_ct_table_data ( conversations_table * ct )
2003-09-04 23:11:03 +00:00
{
2004-06-03 21:46:27 +00:00
guint32 i ;
char title [ 256 ] ;
2009-10-06 07:44:48 +00:00
GtkListStore * store ;
gboolean first = TRUE ;
2004-05-02 17:25:10 +00:00
2004-07-20 21:39:54 +00:00
if ( ct - > page_lb ) {
if ( ct - > num_conversations ) {
2009-03-19 17:44:57 +00:00
g_snprintf ( title , sizeof ( title ) , " %s: %u " , ct - > name , ct - > num_conversations ) ;
2004-05-02 17:25:10 +00:00
} else {
2009-03-19 17:44:57 +00:00
g_snprintf ( title , sizeof ( title ) , " %s " , ct - > name ) ;
2004-05-02 17:25:10 +00:00
}
2004-07-20 21:39:54 +00:00
gtk_label_set_text ( GTK_LABEL ( ct - > page_lb ) , title ) ;
gtk_widget_set_sensitive ( ct - > page_lb , ct - > num_conversations ) ;
2008-02-17 00:35:55 +00:00
} else {
if ( ct - > num_conversations ) {
2009-03-19 17:44:57 +00:00
g_snprintf ( title , sizeof ( title ) , " %s Conversations: %u " , ct - > name , ct - > num_conversations ) ;
2008-02-17 00:35:55 +00:00
} else {
2009-03-19 17:44:57 +00:00
g_snprintf ( title , sizeof ( title ) , " %s Conversations " , ct - > name ) ;
2008-02-17 00:35:55 +00:00
}
gtk_label_set_text ( GTK_LABEL ( ct - > name_lb ) , title ) ;
2004-05-02 17:25:10 +00:00
}
2010-07-23 14:01:47 +00:00
store = GTK_LIST_STORE ( gtk_tree_view_get_model ( ct - > table ) ) ;
2003-09-04 23:11:03 +00:00
2004-07-20 21:39:54 +00:00
for ( i = 0 ; i < ct - > num_conversations ; i + + ) {
2009-10-06 07:44:48 +00:00
char start_time [ COL_STR_LEN ] , duration [ COL_STR_LEN ] ,
txbps [ COL_STR_LEN ] , rxbps [ COL_STR_LEN ] ;
char * tx_ptr , * rx_ptr ;
double duration_s ;
conv_t * conversation = & g_array_index ( ct - > conversations , conv_t , i ) ;
2003-09-04 23:11:03 +00:00
2009-10-06 07:44:48 +00:00
if ( ! conversation - > modified )
continue ;
2010-07-23 14:01:47 +00:00
2009-10-06 07:44:48 +00:00
if ( first ) {
g_object_ref ( store ) ;
gtk_tree_view_set_model ( GTK_TREE_VIEW ( ct - > table ) , NULL ) ;
2003-09-04 23:11:03 +00:00
2009-10-06 07:44:48 +00:00
first = FALSE ;
}
duration_s = nstime_to_sec ( & conversation - > stop_time ) - nstime_to_sec ( & conversation - > start_time ) ;
g_snprintf ( start_time , COL_STR_LEN , " %s " , rel_time_to_secs_str ( & conversation - > start_time ) ) ;
g_snprintf ( duration , COL_STR_LEN , " %.4f " , duration_s ) ;
2003-09-04 23:11:03 +00:00
2009-10-06 07:44:48 +00:00
if ( duration_s > 0 & & conversation - > tx_frames > 1 ) {
g_snprintf ( txbps , COL_STR_LEN , " %.2f " , ( gint64 ) conversation - > tx_bytes * 8 / duration_s ) ;
tx_ptr = txbps ;
2007-11-20 18:35:41 +00:00
} else {
2009-10-06 07:44:48 +00:00
tx_ptr = NO_BPS_STR ;
2007-11-20 18:35:41 +00:00
}
2009-10-06 07:44:48 +00:00
if ( duration_s > 0 & & conversation - > rx_frames > 1 ) {
g_snprintf ( rxbps , COL_STR_LEN , " %.2f " , ( gint64 ) conversation - > rx_bytes * 8 / duration_s ) ;
rx_ptr = rxbps ;
2007-11-20 18:35:41 +00:00
} else {
2009-10-06 07:44:48 +00:00
rx_ptr = NO_BPS_STR ;
}
conversation - > modified = FALSE ;
if ( ! conversation - > iter_valid ) {
char * entries [ 4 ] ;
2010-07-23 14:01:47 +00:00
2009-10-06 07:44:48 +00:00
get_ct_table_address ( ct , conversation , entries ) ;
conversation - > iter_valid = TRUE ;
# if GTK_CHECK_VERSION(2,6,0)
2010-07-23 14:01:47 +00:00
gtk_list_store_insert_with_values ( store , & conversation - > iter , G_MAXINT ,
2009-10-06 07:44:48 +00:00
# else
gtk_list_store_append ( store , & conversation - > iter ) ;
gtk_list_store_set ( store , & conversation - > iter ,
2010-07-23 14:01:47 +00:00
# endif
2009-10-06 07:44:48 +00:00
SRC_ADR_COLUMN , entries [ 0 ] ,
SRC_PORT_COLUMN , entries [ 1 ] ,
DST_ADR_COLUMN , entries [ 2 ] ,
DST_PORT_COLUMN , entries [ 3 ] ,
PACKETS_COLUMN , conversation - > tx_frames + conversation - > rx_frames ,
BYTES_COLUMN , conversation - > tx_bytes + conversation - > rx_bytes ,
PKT_AB_COLUMN , conversation - > tx_frames ,
BYTES_AB_COLUMN , conversation - > tx_bytes ,
PKT_BA_COLUMN , conversation - > rx_frames ,
BYTES_BA_COLUMN , conversation - > rx_bytes ,
START_COLUMN , start_time ,
DURATION_COLUMN , duration ,
BPS_AB_COLUMN , tx_ptr ,
BPS_BA_COLUMN , rx_ptr ,
INDEX_COLUMN , i ,
- 1 ) ;
}
else {
gtk_list_store_set ( store , & conversation - > iter ,
PACKETS_COLUMN , conversation - > tx_frames + conversation - > rx_frames ,
BYTES_COLUMN , conversation - > tx_bytes + conversation - > rx_bytes ,
PKT_AB_COLUMN , conversation - > tx_frames ,
BYTES_AB_COLUMN , conversation - > tx_bytes ,
PKT_BA_COLUMN , conversation - > rx_frames ,
BYTES_BA_COLUMN , conversation - > rx_bytes ,
START_COLUMN , start_time ,
DURATION_COLUMN , duration ,
BPS_AB_COLUMN , tx_ptr ,
BPS_BA_COLUMN , rx_ptr ,
- 1 ) ;
2007-11-20 18:35:41 +00:00
}
2004-06-03 21:46:27 +00:00
}
2009-10-06 07:44:48 +00:00
if ( ! first ) {
2010-07-23 14:01:47 +00:00
if ( ! ct - > fixed_col & & ct - > num_conversations > = 1000 ) {
/* finding the right size for a column isn't easy
* let it run in autosize a little ( 1000 is arbitrary )
* and then switch to fixed width .
*/
ct - > fixed_col = TRUE ;
switch_to_fixed_col ( ct - > table ) ;
}
2005-09-16 16:25:53 +00:00
2010-07-23 14:01:47 +00:00
gtk_tree_view_set_model ( GTK_TREE_VIEW ( ct - > table ) , GTK_TREE_MODEL ( store ) ) ;
g_object_unref ( store ) ;
2009-10-06 07:44:48 +00:00
}
2003-09-04 23:11:03 +00:00
}
2003-08-27 12:10:21 +00:00
2005-01-01 12:49:54 +00:00
static void
draw_ct_table_data_cb ( void * arg )
{
draw_ct_table_data ( arg ) ;
}
2003-08-27 12:10:21 +00:00
2009-10-06 07:44:48 +00:00
typedef struct {
2010-07-23 14:01:47 +00:00
int nb_cols ;
gint columns_order [ N_COLUMNS ] ;
GString * CSV_str ;
2009-10-06 07:44:48 +00:00
conversations_table * talkers ;
} csv_t ;
/* output in C locale */
static gboolean
csv_handle ( GtkTreeModel * model , GtkTreePath * path _U_ , GtkTreeIter * iter ,
gpointer data )
{
2010-07-23 14:01:47 +00:00
csv_t * csv = ( csv_t * ) data ;
gchar * table_text ;
int i ;
unsigned idx ;
conv_t * conv ;
double duration_s ;
guint64 value ;
gtk_tree_model_get ( model , iter , INDEX_COLUMN , & idx , - 1 ) ;
conv = & g_array_index ( csv - > talkers - > conversations , conv_t , idx ) ;
duration_s = nstime_to_sec ( & conv - > stop_time ) - nstime_to_sec ( & conv - > start_time ) ;
for ( i = 0 ; i < csv - > nb_cols ; i + + ) {
if ( i )
g_string_append ( csv - > CSV_str , " , " ) ;
switch ( csv - > columns_order [ i ] ) {
case SRC_ADR_COLUMN :
case SRC_PORT_COLUMN :
case DST_ADR_COLUMN :
case DST_PORT_COLUMN :
gtk_tree_model_get ( model , iter , csv - > columns_order [ i ] , & table_text , - 1 ) ;
if ( table_text ) {
g_string_append ( csv - > CSV_str , table_text ) ;
g_free ( table_text ) ;
}
break ;
case PACKETS_COLUMN :
case BYTES_COLUMN :
case PKT_AB_COLUMN :
case BYTES_AB_COLUMN :
case PKT_BA_COLUMN :
case BYTES_BA_COLUMN :
gtk_tree_model_get ( model , iter , csv - > columns_order [ i ] , & value , - 1 ) ;
g_string_append_printf ( csv - > CSV_str , " % " G_GINT64_MODIFIER " u " , value ) ;
break ;
case START_COLUMN :
g_string_append_printf ( csv - > CSV_str , " %s " , rel_time_to_secs_str ( & conv - > start_time ) ) ;
break ;
case DURATION_COLUMN :
g_string_append_printf ( csv - > CSV_str , " %.4f " , duration_s ) ;
break ;
case BPS_AB_COLUMN :
if ( duration_s > 0 & & conv - > tx_frames > 1 ) {
g_string_append_printf ( csv - > CSV_str , " %.2f " , ( gint64 ) conv - > tx_bytes * 8 / duration_s ) ;
} else {
g_string_append ( csv - > CSV_str , NO_BPS_STR ) ;
}
break ;
case BPS_BA_COLUMN :
if ( duration_s > 0 & & conv - > rx_frames > 1 ) {
g_string_append_printf ( csv - > CSV_str , " %.2f " , ( gint64 ) conv - > rx_bytes * 8 / duration_s ) ;
} else {
g_string_append ( csv - > CSV_str , NO_BPS_STR ) ;
2009-10-06 07:44:48 +00:00
}
2010-07-23 14:01:47 +00:00
break ;
default :
break ;
}
}
g_string_append ( csv - > CSV_str , " \n " ) ;
2009-10-06 07:44:48 +00:00
2010-07-23 14:01:47 +00:00
return FALSE ;
2009-10-06 07:44:48 +00:00
}
2004-07-22 16:36:50 +00:00
static void
2007-11-20 18:35:41 +00:00
copy_as_csv_cb ( GtkWindow * copy_bt , gpointer data _U_ )
2004-07-22 16:36:50 +00:00
{
2010-07-23 14:01:47 +00:00
GtkClipboard * cb ;
char * savelocale ;
GList * columns , * list ;
2009-10-06 07:44:48 +00:00
GtkTreeViewColumn * column ;
2010-07-23 14:01:47 +00:00
GtkListStore * store ;
csv_t csv ;
2009-10-06 07:44:48 +00:00
csv . talkers = g_object_get_data ( G_OBJECT ( copy_bt ) , CONV_PTR_KEY ) ;
if ( ! csv . talkers )
2009-03-19 17:44:57 +00:00
return ;
2009-10-06 07:44:48 +00:00
savelocale = setlocale ( LC_NUMERIC , NULL ) ;
setlocale ( LC_NUMERIC , " C " ) ;
csv . CSV_str = g_string_new ( " " ) ;
columns = gtk_tree_view_get_columns ( GTK_TREE_VIEW ( csv . talkers - > table ) ) ;
csv . nb_cols = 0 ;
2009-10-09 09:06:22 +00:00
list = columns ;
2009-10-06 07:44:48 +00:00
while ( columns ) {
column = columns - > data ;
if ( gtk_tree_view_column_get_visible ( column ) ) {
csv . columns_order [ csv . nb_cols ] = gtk_tree_view_column_get_sort_column_id ( column ) ;
if ( csv . nb_cols )
g_string_append ( csv . CSV_str , " , " ) ;
g_string_append ( csv . CSV_str , gtk_tree_view_column_get_title ( column ) ) ;
csv . nb_cols + + ;
2009-03-19 17:44:57 +00:00
}
2009-10-06 07:44:48 +00:00
columns = g_list_next ( columns ) ;
2005-09-16 16:25:53 +00:00
}
2009-10-09 09:06:22 +00:00
g_list_free ( list ) ;
2009-10-06 07:44:48 +00:00
g_string_append ( csv . CSV_str , " \n " ) ;
store = GTK_LIST_STORE ( gtk_tree_view_get_model ( GTK_TREE_VIEW ( csv . talkers - > table ) ) ) ;
gtk_tree_model_foreach ( GTK_TREE_MODEL ( store ) , csv_handle , & csv ) ;
2004-07-22 16:36:50 +00:00
2009-03-19 17:44:57 +00:00
/* Now that we have the CSV data, copy it into the default clipboard */
cb = gtk_clipboard_get ( GDK_SELECTION_CLIPBOARD ) ; /* Get the default clipboard */
2009-10-06 07:44:48 +00:00
gtk_clipboard_set_text ( cb , csv . CSV_str - > str , - 1 ) ; /* Copy the CSV data into the clipboard */
setlocale ( LC_NUMERIC , savelocale ) ;
g_string_free ( csv . CSV_str , TRUE ) ; /* Free the memory */
}
static gint default_col_size [ N_COLUMNS ] ;
static void
init_default_col_size ( GtkWidget * view )
{
2010-07-23 14:01:47 +00:00
default_col_size [ SRC_ADR_COLUMN ] = get_default_col_size ( view , " 00000000.000000000000 " ) ;
default_col_size [ DST_ADR_COLUMN ] = default_col_size [ SRC_ADR_COLUMN ] ;
2009-10-06 07:44:48 +00:00
default_col_size [ SRC_PORT_COLUMN ] = get_default_col_size ( view , " 000000 " ) ;
default_col_size [ DST_PORT_COLUMN ] = default_col_size [ SRC_PORT_COLUMN ] ;
2010-07-23 14:01:47 +00:00
default_col_size [ PACKETS_COLUMN ] = get_default_col_size ( view , " 00 000 000 " ) ;
default_col_size [ BYTES_COLUMN ] = get_default_col_size ( view , " 0 000 000 000 " ) ;
default_col_size [ PKT_AB_COLUMN ] = default_col_size [ PACKETS_COLUMN ] ;
default_col_size [ PKT_BA_COLUMN ] = default_col_size [ PACKETS_COLUMN ] ;
2009-10-06 07:44:48 +00:00
default_col_size [ BYTES_AB_COLUMN ] = default_col_size [ BYTES_COLUMN ] ;
default_col_size [ BYTES_BA_COLUMN ] = default_col_size [ BYTES_COLUMN ] ;
2010-07-23 14:01:47 +00:00
default_col_size [ START_COLUMN ] = get_default_col_size ( view , " 000000.000000000 " ) ;
2009-10-06 07:44:48 +00:00
default_col_size [ DURATION_COLUMN ] = get_default_col_size ( view , " 000000.0000 " ) ;
2010-07-23 14:01:47 +00:00
default_col_size [ BPS_AB_COLUMN ] = get_default_col_size ( view , " 000000000.00 " ) ;
default_col_size [ BPS_BA_COLUMN ] = default_col_size [ BPS_AB_COLUMN ] ;
2009-10-06 07:44:48 +00:00
}
2004-07-22 16:36:50 +00:00
2005-01-01 12:49:54 +00:00
static gboolean
2010-07-23 14:01:47 +00:00
init_ct_table_page ( conversations_table * conversations , GtkWidget * vbox , gboolean hide_ports , const char * table_name , const char * tap_name , const char * filter ,
2009-10-06 07:44:48 +00:00
tap_packet_cb packet_func )
2003-08-23 09:09:35 +00:00
{
2004-06-03 21:46:27 +00:00
int i ;
GString * error_string ;
char title [ 256 ] ;
2003-08-23 09:09:35 +00:00
2009-10-06 07:44:48 +00:00
GtkListStore * store ;
GtkWidget * tree ;
GtkTreeViewColumn * column ;
GtkCellRenderer * renderer ;
GtkTreeSortable * sortable ;
GtkTreeSelection * sel ;
static gboolean col_size = FALSE ;
2004-07-22 16:36:50 +00:00
conversations - > page_lb = NULL ;
conversations - > resolve_names = TRUE ;
2005-09-16 16:25:53 +00:00
conversations - > has_ports = ! hide_ports ;
2009-10-06 07:44:48 +00:00
conversations - > fixed_col = FALSE ;
2004-07-22 16:36:50 +00:00
conversations - > default_titles [ 0 ] = " Address A " ,
2009-10-06 07:44:48 +00:00
conversations - > default_titles [ 1 ] = " Port A " ;
2004-07-22 16:36:50 +00:00
conversations - > default_titles [ 2 ] = " Address B " ;
conversations - > default_titles [ 3 ] = " Port B " ;
conversations - > default_titles [ 4 ] = " Packets " ;
conversations - > default_titles [ 5 ] = " Bytes " ;
2010-06-25 22:09:34 +00:00
conversations - > default_titles [ 6 ] = " Packets A " UTF8_RIGHTWARDS_ARROW " B " ;
conversations - > default_titles [ 7 ] = " Bytes A " UTF8_RIGHTWARDS_ARROW " B " ;
conversations - > default_titles [ 8 ] = " Packets A " UTF8_LEFTWARDS_ARROW " B " ;
conversations - > default_titles [ 9 ] = " Bytes A " UTF8_LEFTWARDS_ARROW " B " ;
2007-11-20 18:35:41 +00:00
conversations - > default_titles [ 10 ] = " Rel Start " ;
conversations - > default_titles [ 11 ] = " Duration " ;
2010-06-25 22:09:34 +00:00
conversations - > default_titles [ 12 ] = " bps A " UTF8_RIGHTWARDS_ARROW " B " ;
conversations - > default_titles [ 13 ] = " bps A " UTF8_LEFTWARDS_ARROW " B " ;
2009-10-06 07:44:48 +00:00
2006-03-02 20:50:33 +00:00
if ( strcmp ( table_name , " NCP " ) = = 0 ) {
conversations - > default_titles [ 1 ] = " Connection A " ;
conversations - > default_titles [ 3 ] = " Connection B " ;
}
2004-07-22 16:36:50 +00:00
2009-03-19 17:44:57 +00:00
g_snprintf ( title , sizeof ( title ) , " %s Conversations " , table_name ) ;
2008-02-17 00:35:55 +00:00
conversations - > name_lb = gtk_label_new ( title ) ;
2003-09-04 23:11:03 +00:00
2010-07-23 14:01:47 +00:00
2009-10-06 07:44:48 +00:00
/* Create the store */
store = gtk_list_store_new ( N_COLUMNS , /* Total number of columns */
2010-07-23 14:01:47 +00:00
G_TYPE_STRING , /* Address A */
G_TYPE_STRING , /* Port A */
G_TYPE_STRING , /* Address B */
G_TYPE_STRING , /* Port B */
G_TYPE_UINT64 , /* Packets */
G_TYPE_UINT64 , /* Bytes */
G_TYPE_UINT64 , /* Packets A->B */
G_TYPE_UINT64 , /* Bytes A->B */
G_TYPE_UINT64 , /* Packets A<-B */
G_TYPE_UINT64 , /* Bytes A<-B */
G_TYPE_STRING , /* Start */
G_TYPE_STRING , /* Duration */
G_TYPE_STRING , /* bps A->B */
G_TYPE_STRING , /* bps A<-B */
G_TYPE_UINT ) ; /* Index */
2009-10-06 07:44:48 +00:00
gtk_box_pack_start ( GTK_BOX ( vbox ) , conversations - > name_lb , FALSE , FALSE , 0 ) ;
2003-08-23 09:09:35 +00:00
2004-07-20 20:56:53 +00:00
conversations - > scrolled_window = scrolled_window_new ( NULL , NULL ) ;
gtk_box_pack_start ( GTK_BOX ( vbox ) , conversations - > scrolled_window , TRUE , TRUE , 0 ) ;
2003-09-04 23:11:03 +00:00
2009-10-06 07:44:48 +00:00
tree = gtk_tree_view_new_with_model ( GTK_TREE_MODEL ( store ) ) ;
conversations - > table = GTK_TREE_VIEW ( tree ) ;
sortable = GTK_TREE_SORTABLE ( store ) ;
2003-09-04 23:11:03 +00:00
2009-10-06 07:44:48 +00:00
if ( ! col_size ) {
col_size = TRUE ;
init_default_col_size ( GTK_WIDGET ( conversations - > table ) ) ;
2004-06-03 21:46:27 +00:00
}
2003-08-23 09:09:35 +00:00
2009-10-06 07:44:48 +00:00
/* The view now holds a reference. We can get rid of our own reference */
g_object_unref ( G_OBJECT ( store ) ) ;
2003-08-23 09:09:35 +00:00
2009-10-06 07:44:48 +00:00
g_object_set_data ( G_OBJECT ( store ) , CONV_PTR_KEY , conversations ) ;
g_object_set_data ( G_OBJECT ( conversations - > table ) , CONV_PTR_KEY , conversations ) ;
2003-08-23 09:09:35 +00:00
2009-10-06 07:44:48 +00:00
for ( i = 0 ; i < N_COLUMNS - 1 ; i + + ) {
renderer = gtk_cell_renderer_text_new ( ) ;
g_object_set ( renderer , " ypad " , 0 , NULL ) ;
2009-10-09 08:52:36 +00:00
switch ( i ) {
2010-07-23 14:01:47 +00:00
case SRC_ADR_COLUMN : /* addresses and ports */
case SRC_PORT_COLUMN :
case DST_ADR_COLUMN :
case DST_PORT_COLUMN :
column = gtk_tree_view_column_new_with_attributes ( conversations - > default_titles [ i ] , renderer , " text " ,
i , NULL ) ;
2009-10-06 07:44:48 +00:00
if ( hide_ports & & ( i = = 1 | | i = = 3 ) ) {
/* hide srcport and dstport if we don't use ports */
gtk_tree_view_column_set_visible ( column , FALSE ) ;
}
gtk_tree_sortable_set_sort_func ( sortable , i , ct_sort_func , GINT_TO_POINTER ( i ) , NULL ) ;
2009-10-09 08:52:36 +00:00
break ;
2010-07-23 14:01:47 +00:00
case PACKETS_COLUMN : /* counts */
case BYTES_COLUMN :
case PKT_AB_COLUMN :
case BYTES_AB_COLUMN :
case PKT_BA_COLUMN :
case BYTES_BA_COLUMN :
2009-10-09 08:52:36 +00:00
g_object_set ( G_OBJECT ( renderer ) , " xalign " , 1.0 , NULL ) ;
column = gtk_tree_view_column_new_with_attributes ( conversations - > default_titles [ i ] , renderer , NULL ) ;
gtk_tree_view_column_set_cell_data_func ( column , renderer , u64_data_func , GINT_TO_POINTER ( i ) , NULL ) ;
break ;
default : /* times and bps */
g_object_set ( G_OBJECT ( renderer ) , " xalign " , 1.0 , NULL ) ;
2010-07-23 14:01:47 +00:00
column = gtk_tree_view_column_new_with_attributes ( conversations - > default_titles [ i ] , renderer , " text " ,
i , NULL ) ;
2009-10-09 08:52:36 +00:00
gtk_tree_sortable_set_sort_func ( sortable , i , ct_sort_func , GINT_TO_POINTER ( i ) , NULL ) ;
break ;
2009-10-06 07:44:48 +00:00
}
gtk_tree_view_column_set_sort_column_id ( column , i ) ;
gtk_tree_view_column_set_resizable ( column , TRUE ) ;
gtk_tree_view_column_set_reorderable ( column , TRUE ) ;
gtk_tree_view_column_set_min_width ( column , 40 ) ;
gtk_tree_view_column_set_fixed_width ( column , default_col_size [ i ] ) ;
gtk_tree_view_append_column ( conversations - > table , column ) ;
#if 0
/* for capture with ten thousands conversations it's too slow */
if ( i = = PACKETS_COLUMN ) {
gtk_tree_view_column_clicked ( column ) ;
2010-07-23 14:01:47 +00:00
gtk_tree_view_column_clicked ( column ) ;
2009-10-06 07:44:48 +00:00
}
# endif
2007-11-20 18:35:41 +00:00
}
2004-07-20 20:56:53 +00:00
gtk_container_add ( GTK_CONTAINER ( conversations - > scrolled_window ) , ( GtkWidget * ) conversations - > table ) ;
2009-10-06 07:44:48 +00:00
gtk_tree_view_set_rules_hint ( conversations - > table , TRUE ) ;
gtk_tree_view_set_headers_clickable ( conversations - > table , TRUE ) ;
gtk_tree_view_set_reorderable ( conversations - > table , TRUE ) ;
2003-08-23 09:09:35 +00:00
2004-07-20 21:39:54 +00:00
conversations - > num_conversations = 0 ;
conversations - > conversations = NULL ;
2009-10-06 07:44:48 +00:00
conversations - > hashtable = NULL ;
2003-08-23 09:09:35 +00:00
2009-10-06 07:44:48 +00:00
sel = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( conversations - > table ) ) ;
gtk_tree_selection_set_mode ( sel , GTK_SELECTION_SINGLE ) ;
2003-08-27 12:10:21 +00:00
2004-06-03 21:46:27 +00:00
/* create popup menu for this table */
2004-07-20 20:56:53 +00:00
ct_create_popup_menu ( conversations ) ;
2003-09-04 23:11:03 +00:00
2004-06-03 21:46:27 +00:00
/* register the tap and rerun the taps on the packet list */
2010-07-23 14:01:47 +00:00
error_string = register_tap_listener ( tap_name , conversations , filter , 0 , reset_ct_table_data_cb , packet_func ,
2009-10-06 07:44:48 +00:00
draw_ct_table_data_cb ) ;
2004-06-03 21:46:27 +00:00
if ( error_string ) {
2008-10-31 09:53:56 +00:00
simple_dialog ( ESD_TYPE_ERROR , ESD_BTN_OK , " %s " , error_string - > str ) ;
2004-06-03 21:46:27 +00:00
g_string_free ( error_string , TRUE ) ;
return FALSE ;
}
2003-09-04 23:11:03 +00:00
2004-05-02 17:25:10 +00:00
return TRUE ;
}
2010-06-23 19:49:33 +00:00
static void
follow_stream_cb ( GtkWidget * follow_stream_bt , gpointer data _U_ )
{
conversations_table * ct = g_object_get_data ( G_OBJECT ( follow_stream_bt ) , CONV_PTR_KEY ) ;
GtkTreeIter iter ;
GtkTreeModel * model ;
GtkTreeSelection * sel ;
guint32 idx = 0 ;
gchar * filter ;
conv_t * conv ;
sel = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( ct - > table ) ) ;
if ( ! gtk_tree_selection_get_selected ( sel , & model , & iter ) ) {
simple_dialog ( ESD_TYPE_ERROR , ESD_BTN_OK , " No conversation selected " ) ;
return ;
}
gtk_tree_model_get ( model , & iter , INDEX_COLUMN , & idx , - 1 ) ;
if ( idx > = ct - > num_conversations ) {
simple_dialog ( ESD_TYPE_ERROR , ESD_BTN_OK , " No conversation selected " ) ;
return ;
}
conv = & g_array_index ( ct - > conversations , conv_t , idx ) ;
filter = g_strdup_printf ( " %s==%s && %s==%s && %s==%s && %s==%s " ,
ct_get_filter_name ( & conv - > src_address , conv - > sat , conv - > port_type , FN_ANY_ADDRESS ) ,
ep_address_to_str ( & conv - > src_address ) ,
ct_get_filter_name ( & conv - > src_address , conv - > sat , conv - > port_type , FN_ANY_PORT ) ,
ct_port_to_str ( conv - > port_type , conv - > src_port ) ,
ct_get_filter_name ( & conv - > dst_address , conv - > sat , conv - > port_type , FN_ANY_ADDRESS ) ,
ep_address_to_str ( & conv - > dst_address ) ,
ct_get_filter_name ( & conv - > dst_address , conv - > sat , conv - > port_type , FN_ANY_PORT ) ,
ct_port_to_str ( conv - > port_type , conv - > dst_port ) ) ;
apply_selected_filter ( ACTYPE_SELECTED | ACTION_MATCH , filter ) ;
2010-07-23 14:01:47 +00:00
if ( strcmp ( ct - > name , " TCP " ) = = 0 )
2010-06-23 19:49:33 +00:00
follow_tcp_stream_cb ( follow_stream_bt , data ) ;
2010-07-23 14:01:47 +00:00
else if ( strcmp ( ct - > name , " UDP " ) = = 0 )
2010-06-23 19:49:33 +00:00
follow_udp_stream_cb ( follow_stream_bt , data ) ;
2010-07-23 14:01:47 +00:00
else
2010-06-23 19:49:33 +00:00
simple_dialog ( ESD_TYPE_ERROR , ESD_BTN_OK , " Unknown stream: %s " , ct - > name ) ;
g_free ( filter ) ;
}
2004-05-02 17:25:10 +00:00
void
2005-08-05 20:59:08 +00:00
init_conversation_table ( gboolean hide_ports , const char * table_name , const char * tap_name , const char * filter , tap_packet_cb packet_func )
2004-05-02 17:25:10 +00:00
{
2004-07-20 20:56:53 +00:00
conversations_table * conversations ;
2004-06-03 21:46:27 +00:00
char title [ 256 ] ;
2004-05-02 17:25:10 +00:00
GtkWidget * vbox ;
GtkWidget * bbox ;
2005-01-20 23:17:23 +00:00
GtkWidget * close_bt , * help_bt ;
2004-05-02 17:25:10 +00:00
gboolean ret ;
2010-06-23 19:49:33 +00:00
GtkWidget * copy_bt , * follow_stream_bt ;
gboolean add_follow_stream_button = FALSE ;
2007-11-20 18:35:41 +00:00
GtkTooltips * tooltips = gtk_tooltips_new ( ) ;
2004-06-03 21:46:27 +00:00
2009-10-06 07:44:48 +00:00
conversations = g_malloc0 ( sizeof ( conversations_table ) ) ;
2004-05-02 17:25:10 +00:00
2004-07-20 20:56:53 +00:00
conversations - > name = table_name ;
2008-02-17 00:35:55 +00:00
conversations - > filter = filter ;
conversations - > use_dfilter = FALSE ;
2009-03-19 17:44:57 +00:00
g_snprintf ( title , sizeof ( title ) , " %s Conversations: %s " , table_name , cf_get_display_name ( & cfile ) ) ;
2010-07-23 14:01:47 +00:00
conversations - > win = dlg_window_new ( title ) ; /* transient_for top_level */
gtk_window_set_destroy_with_parent ( GTK_WINDOW ( conversations - > win ) , TRUE ) ;
2004-07-22 16:36:50 +00:00
2004-07-20 20:56:53 +00:00
gtk_window_set_default_size ( GTK_WINDOW ( conversations - > win ) , 750 , 400 ) ;
2004-05-02 17:25:10 +00:00
2004-06-03 21:46:27 +00:00
vbox = gtk_vbox_new ( FALSE , 3 ) ;
2004-07-20 20:56:53 +00:00
gtk_container_add ( GTK_CONTAINER ( conversations - > win ) , vbox ) ;
2004-06-03 21:46:27 +00:00
gtk_container_set_border_width ( GTK_CONTAINER ( vbox ) , 12 ) ;
2004-05-02 17:25:10 +00:00
2004-07-20 20:56:53 +00:00
ret = init_ct_table_page ( conversations , vbox , hide_ports , table_name , tap_name , filter , packet_func ) ;
2004-05-02 17:25:10 +00:00
if ( ret = = FALSE ) {
2004-07-20 20:56:53 +00:00
g_free ( conversations ) ;
2004-05-02 17:25:10 +00:00
return ;
}
2010-06-23 19:49:33 +00:00
if ( ( strcmp ( table_name , " TCP " ) = = 0 ) | | ( strcmp ( table_name , " UDP " ) = = 0 ) )
add_follow_stream_button = TRUE ;
2004-06-03 21:46:27 +00:00
/* Button row. */
2007-11-20 18:35:41 +00:00
/* XXX - maybe we want to have a "Copy as CSV" stock button here? */
/*copy_bt = gtk_button_new_with_label ("Copy content to clipboard as CSV");*/
2010-06-23 19:49:33 +00:00
if ( add_follow_stream_button )
bbox = dlg_button_row_new ( GTK_STOCK_CLOSE , GTK_STOCK_COPY , WIRESHARK_STOCK_FOLLOW_STREAM , GTK_STOCK_HELP , NULL ) ;
else
bbox = dlg_button_row_new ( GTK_STOCK_CLOSE , GTK_STOCK_COPY , GTK_STOCK_HELP , NULL ) ;
2004-06-03 21:46:27 +00:00
gtk_box_pack_end ( GTK_BOX ( vbox ) , bbox , FALSE , FALSE , 0 ) ;
2004-04-12 07:10:11 +00:00
2008-04-11 16:26:32 +00:00
close_bt = g_object_get_data ( G_OBJECT ( bbox ) , GTK_STOCK_CLOSE ) ;
2004-07-20 20:56:53 +00:00
window_set_cancel_button ( conversations - > win , close_bt , window_cancel_button_cb ) ;
2004-04-12 07:10:11 +00:00
2008-04-11 16:26:32 +00:00
copy_bt = g_object_get_data ( G_OBJECT ( bbox ) , GTK_STOCK_COPY ) ;
2007-11-20 18:35:41 +00:00
gtk_tooltips_set_tip ( tooltips , copy_bt ,
2009-03-19 17:44:57 +00:00
" Copy all statistical values of this page to the clipboard in CSV (Comma Separated Values) format. " , NULL ) ;
2008-04-11 16:26:32 +00:00
g_object_set_data ( G_OBJECT ( copy_bt ) , CONV_PTR_KEY , conversations ) ;
2008-04-11 21:20:51 +00:00
g_signal_connect ( copy_bt , " clicked " , G_CALLBACK ( copy_as_csv_cb ) , NULL ) ;
2007-11-20 18:35:41 +00:00
2010-06-23 19:49:33 +00:00
if ( add_follow_stream_button ) {
follow_stream_bt = g_object_get_data ( G_OBJECT ( bbox ) , WIRESHARK_STOCK_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 , conversations ) ;
g_signal_connect ( follow_stream_bt , " clicked " , G_CALLBACK ( follow_stream_cb ) , NULL ) ;
}
2008-06-21 13:36:31 +00:00
help_bt = g_object_get_data ( G_OBJECT ( bbox ) , GTK_STOCK_HELP ) ;
g_signal_connect ( help_bt , " clicked " , G_CALLBACK ( topic_cb ) , ( gpointer ) HELP_STATS_CONVERSATIONS_DIALOG ) ;
2005-01-20 23:17:23 +00:00
2008-04-11 21:20:51 +00:00
g_signal_connect ( conversations - > win , " delete_event " , G_CALLBACK ( window_delete_event_cb ) , NULL ) ;
g_signal_connect ( conversations - > win , " destroy " , G_CALLBACK ( ct_win_destroy_cb ) , conversations ) ;
2004-04-12 07:10:11 +00:00
2004-07-20 20:56:53 +00:00
gtk_widget_show_all ( conversations - > win ) ;
window_present ( conversations - > win ) ;
2004-05-23 23:24:07 +00:00
2009-06-05 22:42:47 +00:00
cf_retap_packets ( & cfile ) ;
2008-10-13 18:16:35 +00:00
gdk_window_raise ( conversations - > win - > window ) ;
2005-09-16 16:25:53 +00:00
2004-05-02 17:25:10 +00:00
}
2007-11-20 18:35:41 +00:00
static void
ct_nb_switch_page_cb ( GtkNotebook * nb , GtkNotebookPage * pg _U_ , guint page , gpointer data )
{
GtkWidget * copy_bt = ( GtkWidget * ) data ;
2010-06-23 16:49:17 +00:00
GtkWidget * follow_stream_bt = g_object_get_data ( G_OBJECT ( nb ) , FOLLOW_STREAM_BT_KEY ) ;
void * * pages = g_object_get_data ( G_OBJECT ( nb ) , NB_PAGES_KEY ) ;
GtkTooltips * tooltips = gtk_tooltips_new ( ) ;
2007-11-20 18:35:41 +00:00
page + + ;
if ( pages & & page > 0 & & ( int ) page < = GPOINTER_TO_INT ( pages [ 0 ] ) & & copy_bt ) {
2008-04-11 16:26:32 +00:00
g_object_set_data ( G_OBJECT ( copy_bt ) , CONV_PTR_KEY , pages [ page ] ) ;
2010-06-23 16:49:17 +00:00
g_object_set_data ( G_OBJECT ( follow_stream_bt ) , CONV_PTR_KEY , pages [ page ] ) ;
}
/* Filter Stream only available for TCP and UDP */
if ( strcmp ( ( ( conversations_table * ) pages [ page ] ) - > name , " TCP " ) = = 0 ) {
gtk_tooltips_set_tip ( tooltips , follow_stream_bt , " Follow TCP Stream. " , NULL ) ;
gtk_widget_set_sensitive ( follow_stream_bt , TRUE ) ;
} else if ( strcmp ( ( ( conversations_table * ) pages [ page ] ) - > name , " UDP " ) = = 0 ) {
gtk_tooltips_set_tip ( tooltips , follow_stream_bt , " Follow UDP Stream. " , NULL ) ;
gtk_widget_set_sensitive ( follow_stream_bt , TRUE ) ;
} else {
gtk_tooltips_set_tip ( tooltips , follow_stream_bt , " Follow TCP or UDP Stream. " , NULL ) ;
gtk_widget_set_sensitive ( follow_stream_bt , FALSE ) ;
2007-11-20 18:35:41 +00:00
}
}
2004-05-02 17:25:10 +00:00
static void
2004-07-20 20:56:53 +00:00
ct_win_destroy_notebook_cb ( GtkWindow * win _U_ , gpointer data )
2004-05-02 17:25:10 +00:00
{
void * * pages = data ;
int page ;
/* first "page" contains the number of pages */
for ( page = 1 ; page < = GPOINTER_TO_INT ( pages [ 0 ] ) ; page + + ) {
2004-07-20 20:56:53 +00:00
ct_win_destroy_cb ( NULL , pages [ page ] ) ;
2004-05-02 17:25:10 +00:00
}
2007-11-20 18:35:41 +00:00
g_free ( pages ) ;
2004-05-02 17:25:10 +00:00
}
2004-07-20 06:06:41 +00:00
static conversations_table *
2005-08-05 20:59:08 +00:00
init_ct_notebook_page_cb ( gboolean hide_ports , const char * table_name , const char * tap_name , const char * filter , tap_packet_cb packet_func )
2004-05-02 17:25:10 +00:00
{
gboolean ret ;
GtkWidget * page_vbox ;
2004-07-20 20:56:53 +00:00
conversations_table * conversations ;
2004-05-02 17:25:10 +00:00
2009-10-06 07:44:48 +00:00
conversations = g_malloc0 ( sizeof ( conversations_table ) ) ;
2004-07-20 20:56:53 +00:00
conversations - > name = table_name ;
2008-02-17 00:35:55 +00:00
conversations - > filter = filter ;
2004-07-20 20:56:53 +00:00
conversations - > resolve_names = TRUE ;
2008-02-17 00:35:55 +00:00
conversations - > use_dfilter = FALSE ;
2004-05-02 17:25:10 +00:00
page_vbox = gtk_vbox_new ( FALSE , 6 ) ;
2004-07-20 20:56:53 +00:00
conversations - > win = page_vbox ;
2004-06-03 21:46:27 +00:00
gtk_container_set_border_width ( GTK_CONTAINER ( page_vbox ) , 6 ) ;
2004-05-02 17:25:10 +00:00
2004-07-20 20:56:53 +00:00
ret = init_ct_table_page ( conversations , page_vbox , hide_ports , table_name , tap_name , filter , packet_func ) ;
2004-05-02 17:25:10 +00:00
if ( ret = = FALSE ) {
2004-07-20 20:56:53 +00:00
g_free ( conversations ) ;
2004-05-02 17:25:10 +00:00
return NULL ;
}
2004-07-20 20:56:53 +00:00
return conversations ;
2004-05-02 17:25:10 +00:00
}
typedef struct {
2005-01-01 12:49:54 +00:00
gboolean hide_ports ; /* hide TCP / UDP port columns */
2005-08-05 20:59:08 +00:00
const char * table_name ; /* GUI output name */
const char * tap_name ; /* internal name */
const char * filter ; /* display filter string (unused) */
2005-01-01 12:49:54 +00:00
tap_packet_cb packet_func ; /* function to be called for new incoming packets */
2004-07-20 20:56:53 +00:00
} register_ct_t ;
2004-05-02 17:25:10 +00:00
2004-07-20 20:56:53 +00:00
static GSList * registered_ct_tables = NULL ;
2004-05-02 17:25:10 +00:00
void
2005-08-05 20:59:08 +00:00
register_conversation_table ( gboolean hide_ports , const char * table_name , const char * tap_name , const char * filter , tap_packet_cb packet_func )
2004-05-02 17:25:10 +00:00
{
2004-07-20 20:56:53 +00:00
register_ct_t * table ;
2004-05-02 17:25:10 +00:00
2004-07-20 20:56:53 +00:00
table = g_malloc ( sizeof ( register_ct_t ) ) ;
2004-05-02 17:25:10 +00:00
table - > hide_ports = hide_ports ;
table - > table_name = table_name ;
table - > tap_name = tap_name ;
table - > filter = filter ;
table - > packet_func = packet_func ;
2004-07-20 20:56:53 +00:00
registered_ct_tables = g_slist_append ( registered_ct_tables , table ) ;
2004-05-02 17:25:10 +00:00
}
2004-05-03 22:15:22 +00:00
static void
2004-07-20 20:56:53 +00:00
ct_resolve_toggle_dest ( GtkWidget * widget , gpointer data )
2004-05-03 22:15:22 +00:00
{
int page ;
void * * pages = data ;
gboolean resolve_names ;
2004-07-20 20:56:53 +00:00
conversations_table * conversations ;
2004-05-03 22:15:22 +00:00
resolve_names = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( widget ) ) ;
for ( page = 1 ; page < = GPOINTER_TO_INT ( pages [ 0 ] ) ; page + + ) {
2004-07-20 20:56:53 +00:00
conversations = pages [ page ] ;
conversations - > resolve_names = resolve_names ;
2004-05-03 22:15:22 +00:00
2004-07-20 20:56:53 +00:00
draw_ct_table_addresses ( conversations ) ;
2004-07-27 18:34:02 +00:00
2004-05-03 22:15:22 +00:00
}
}
2008-02-17 00:35:55 +00:00
static void
ct_filter_toggle_dest ( GtkWidget * widget , gpointer data )
{
int page ;
void * * pages = data ;
gboolean use_filter ;
2008-10-13 18:16:35 +00:00
conversations_table * conversations = NULL ;
2008-02-17 00:35:55 +00:00
use_filter = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( widget ) ) ;
for ( page = 1 ; page < = GPOINTER_TO_INT ( pages [ 0 ] ) ; page + + ) {
conversations = pages [ page ] ;
conversations - > use_dfilter = use_filter ;
reset_ct_table_data ( conversations ) ;
}
2009-06-05 22:42:47 +00:00
cf_retap_packets ( & cfile ) ;
2008-10-13 18:16:35 +00:00
if ( conversations ) {
gdk_window_raise ( conversations - > win - > window ) ;
}
2008-02-17 00:35:55 +00:00
}
2004-05-02 17:25:10 +00:00
void
2004-07-20 20:56:53 +00:00
init_conversation_notebook_cb ( GtkWidget * w _U_ , gpointer d _U_ )
2004-05-02 17:25:10 +00:00
{
2004-07-20 20:56:53 +00:00
conversations_table * conversations ;
2004-06-03 21:46:27 +00:00
char title [ 256 ] ;
2004-05-02 17:25:10 +00:00
GtkWidget * vbox ;
2004-05-03 22:15:22 +00:00
GtkWidget * hbox ;
2004-05-02 17:25:10 +00:00
GtkWidget * bbox ;
2005-01-20 23:17:23 +00:00
GtkWidget * close_bt , * help_bt ;
2004-05-02 17:25:10 +00:00
GtkWidget * win ;
2004-05-03 22:15:22 +00:00
GtkWidget * resolv_cb ;
2008-02-17 00:35:55 +00:00
GtkWidget * filter_cb ;
2004-05-02 17:25:10 +00:00
int page ;
void * * pages ;
GtkWidget * nb ;
GtkWidget * page_lb ;
GSList * current_table ;
2004-07-20 20:56:53 +00:00
register_ct_t * registered ;
2004-05-03 22:15:22 +00:00
GtkTooltips * tooltips = gtk_tooltips_new ( ) ;
2009-10-06 07:44:48 +00:00
2007-11-20 18:35:41 +00:00
GtkWidget * copy_bt ;
2010-06-23 16:49:17 +00:00
GtkWidget * follow_stream_bt ;
2004-05-02 17:25:10 +00:00
2004-07-20 20:56:53 +00:00
pages = g_malloc ( sizeof ( void * ) * ( g_slist_length ( registered_ct_tables ) + 1 ) ) ;
2004-05-02 17:25:10 +00:00
2009-03-19 17:44:57 +00:00
g_snprintf ( title , sizeof ( title ) , " Conversations: %s " , cf_get_display_name ( & cfile ) ) ;
2010-07-23 14:01:47 +00:00
win = dlg_window_new ( title ) ; /* transient_for top_level */
gtk_window_set_destroy_with_parent ( GTK_WINDOW ( win ) , TRUE ) ;
2009-06-21 20:42:07 +00:00
2004-06-03 21:46:27 +00:00
gtk_window_set_default_size ( GTK_WINDOW ( win ) , 750 , 400 ) ;
2004-05-02 17:25:10 +00:00
vbox = gtk_vbox_new ( FALSE , 6 ) ;
2004-06-03 21:46:27 +00:00
gtk_container_add ( GTK_CONTAINER ( win ) , vbox ) ;
gtk_container_set_border_width ( GTK_CONTAINER ( vbox ) , 12 ) ;
2004-05-02 17:25:10 +00:00
nb = gtk_notebook_new ( ) ;
2004-06-03 21:46:27 +00:00
gtk_container_add ( GTK_CONTAINER ( vbox ) , nb ) ;
2008-04-11 16:26:32 +00:00
g_object_set_data ( G_OBJECT ( nb ) , NB_PAGES_KEY , pages ) ;
2004-05-02 17:25:10 +00:00
page = 0 ;
2004-07-20 20:56:53 +00:00
current_table = registered_ct_tables ;
2004-05-02 17:25:10 +00:00
while ( current_table ) {
registered = current_table - > data ;
page_lb = gtk_label_new ( " " ) ;
2004-07-20 20:56:53 +00:00
conversations = init_ct_notebook_page_cb ( registered - > hide_ports , registered - > table_name , registered - > tap_name ,
2009-03-19 17:44:57 +00:00
registered - > filter , registered - > packet_func ) ;
2008-04-11 16:26:32 +00:00
g_object_set_data ( G_OBJECT ( conversations - > win ) , CONV_PTR_KEY , conversations ) ;
2004-07-20 20:56:53 +00:00
gtk_notebook_append_page ( GTK_NOTEBOOK ( nb ) , conversations - > win , page_lb ) ;
conversations - > win = win ;
conversations - > page_lb = page_lb ;
pages [ + + page ] = conversations ;
2004-05-02 17:25:10 +00:00
current_table = g_slist_next ( current_table ) ;
}
pages [ 0 ] = GINT_TO_POINTER ( page ) ;
2004-05-03 22:15:22 +00:00
hbox = gtk_hbox_new ( FALSE , 3 ) ;
2004-06-03 21:46:27 +00:00
gtk_box_pack_start ( GTK_BOX ( vbox ) , hbox , FALSE , FALSE , 0 ) ;
2004-05-03 22:15:22 +00:00
2008-04-11 19:04:34 +00:00
resolv_cb = gtk_check_button_new_with_mnemonic ( " Name resolution " ) ;
2004-06-03 21:46:27 +00:00
gtk_container_add ( GTK_CONTAINER ( hbox ) , resolv_cb ) ;
2008-06-29 15:51:43 +00:00
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( resolv_cb ) , TRUE ) ;
2004-05-03 22:15:22 +00:00
gtk_tooltips_set_tip ( tooltips , resolv_cb , " Show results of name resolutions rather than the \" raw \" values. "
2009-03-19 17:44:57 +00:00
" Please note: The corresponding name resolution must be enabled. " , NULL ) ;
2004-05-03 22:15:22 +00:00
2008-04-11 21:20:51 +00:00
g_signal_connect ( resolv_cb , " toggled " , G_CALLBACK ( ct_resolve_toggle_dest ) , pages ) ;
2004-05-03 22:15:22 +00:00
2008-04-11 19:04:34 +00:00
filter_cb = gtk_check_button_new_with_mnemonic ( " Limit to display filter " ) ;
2008-02-17 00:35:55 +00:00
gtk_container_add ( GTK_CONTAINER ( hbox ) , filter_cb ) ;
2008-06-29 15:51:43 +00:00
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( filter_cb ) , FALSE ) ;
2008-02-17 00:35:55 +00:00
gtk_tooltips_set_tip ( tooltips , filter_cb , " Limit the list to conversations matching the current display filter. " , NULL ) ;
2008-04-11 21:20:51 +00:00
g_signal_connect ( filter_cb , " toggled " , G_CALLBACK ( ct_filter_toggle_dest ) , pages ) ;
2008-02-17 00:35:55 +00:00
2004-06-03 21:46:27 +00:00
/* Button row. */
2007-11-20 18:35:41 +00:00
/* XXX - maybe we want to have a "Copy as CSV" stock button here? */
/*copy_bt = gtk_button_new_with_label ("Copy content to clipboard as CSV");*/
2010-06-23 16:49:17 +00:00
bbox = dlg_button_row_new ( GTK_STOCK_CLOSE , GTK_STOCK_COPY , WIRESHARK_STOCK_FOLLOW_STREAM , GTK_STOCK_HELP , NULL ) ;
2008-04-07 03:46:01 +00:00
2004-06-03 21:46:27 +00:00
gtk_box_pack_end ( GTK_BOX ( vbox ) , bbox , FALSE , FALSE , 0 ) ;
2004-05-02 17:25:10 +00:00
2008-04-11 16:26:32 +00:00
close_bt = g_object_get_data ( G_OBJECT ( bbox ) , GTK_STOCK_CLOSE ) ;
2004-05-23 23:24:07 +00:00
window_set_cancel_button ( win , close_bt , window_cancel_button_cb ) ;
2004-05-02 17:25:10 +00:00
2008-04-11 16:26:32 +00:00
copy_bt = g_object_get_data ( G_OBJECT ( bbox ) , GTK_STOCK_COPY ) ;
2007-11-20 18:35:41 +00:00
gtk_tooltips_set_tip ( tooltips , copy_bt ,
2009-03-19 17:44:57 +00:00
" Copy all statistical values of this page to the clipboard in CSV (Comma Separated Values) format. " , NULL ) ;
2008-04-11 21:20:51 +00:00
g_signal_connect ( copy_bt , " clicked " , G_CALLBACK ( copy_as_csv_cb ) , NULL ) ;
2008-04-11 16:26:32 +00:00
g_object_set_data ( G_OBJECT ( copy_bt ) , CONV_PTR_KEY , pages [ page ] ) ;
2007-11-20 18:35:41 +00:00
2010-06-23 16:49:17 +00:00
follow_stream_bt = g_object_get_data ( G_OBJECT ( bbox ) , WIRESHARK_STOCK_FOLLOW_STREAM ) ;
gtk_tooltips_set_tip ( tooltips , follow_stream_bt , " Follow Stream. " , NULL ) ;
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_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 ) ;
2008-04-11 21:20:51 +00:00
g_signal_connect ( nb , " switch-page " , G_CALLBACK ( ct_nb_switch_page_cb ) , copy_bt ) ;
2007-11-20 18:35:41 +00:00
2008-06-21 13:36:31 +00:00
help_bt = g_object_get_data ( G_OBJECT ( bbox ) , GTK_STOCK_HELP ) ;
g_signal_connect ( help_bt , " clicked " , G_CALLBACK ( topic_cb ) , ( gpointer ) HELP_STATS_CONVERSATIONS_DIALOG ) ;
2005-01-20 23:17:23 +00:00
2008-04-11 21:20:51 +00:00
g_signal_connect ( win , " delete_event " , G_CALLBACK ( window_delete_event_cb ) , NULL ) ;
g_signal_connect ( win , " destroy " , G_CALLBACK ( ct_win_destroy_notebook_cb ) , pages ) ;
2004-05-02 17:25:10 +00:00
2004-06-03 21:46:27 +00:00
gtk_widget_show_all ( win ) ;
2004-05-23 23:24:07 +00:00
window_present ( win ) ;
2009-06-05 22:42:47 +00:00
cf_retap_packets ( & cfile ) ;
2008-10-13 18:16:35 +00:00
gdk_window_raise ( win - > window ) ;
2004-05-02 17:25:10 +00:00
2009-10-06 07:44:48 +00:00
}
typedef struct _key {
2010-07-23 14:01:47 +00:00
address addr1 ;
address addr2 ;
guint32 port1 ;
guint32 port2 ;
2009-10-06 07:44:48 +00:00
} conv_key_t ;
/*
* Compute the hash value for two given address / port pairs if the match
* is to be exact .
*/
static guint
conversation_hash ( gconstpointer v )
{
2010-07-23 14:01:47 +00:00
const conv_key_t * key = ( const conv_key_t * ) v ;
guint hash_val ;
2009-10-06 07:44:48 +00:00
2010-07-23 14:01:47 +00:00
hash_val = 0 ;
ADD_ADDRESS_TO_HASH ( hash_val , & key - > addr1 ) ;
hash_val + = key - > port1 ;
ADD_ADDRESS_TO_HASH ( hash_val , & key - > addr2 ) ;
hash_val + = key - > port2 ;
2009-10-06 07:44:48 +00:00
2010-07-23 14:01:47 +00:00
return hash_val ;
2009-10-06 07:44:48 +00:00
}
/*
* Compare two conversation keys for an exact match .
*/
static gint
conversation_match ( gconstpointer v , gconstpointer w )
{
2010-07-23 14:01:47 +00:00
const conv_key_t * v1 = ( const conv_key_t * ) v ;
const conv_key_t * v2 = ( const conv_key_t * ) w ;
if ( v1 - > port1 = = v2 - > port1 & &
v1 - > port2 = = v2 - > port2 & &
ADDRESSES_EQUAL ( & v1 - > addr1 , & v2 - > addr1 ) & &
ADDRESSES_EQUAL ( & v1 - > addr2 , & v2 - > addr2 ) ) {
return 1 ;
}
if ( v1 - > port2 = = v2 - > port1 & &
v1 - > port1 = = v2 - > port2 & &
ADDRESSES_EQUAL ( & v1 - > addr2 , & v2 - > addr1 ) & &
ADDRESSES_EQUAL ( & v1 - > addr1 , & v2 - > addr2 ) ) {
return 1 ;
}
/*
* The addresses or the ports don ' t match .
*/
return 0 ;
2003-08-23 09:09:35 +00:00
}
2004-06-03 21:46:27 +00:00
void
2010-01-29 16:13:26 +00:00
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_val )
2003-08-23 09:09:35 +00:00
{
2005-01-01 12:49:54 +00:00
const address * addr1 , * addr2 ;
2004-06-03 21:46:27 +00:00
guint32 port1 , port2 ;
2007-11-10 16:09:10 +00:00
conv_t * conversation = NULL ;
2009-10-06 07:44:48 +00:00
unsigned int conversation_idx = 0 ;
2004-06-03 21:46:27 +00:00
if ( src_port > dst_port ) {
addr1 = src ;
addr2 = dst ;
port1 = src_port ;
port2 = dst_port ;
} else if ( src_port < dst_port ) {
addr2 = src ;
addr1 = dst ;
port2 = src_port ;
port1 = dst_port ;
} else if ( CMP_ADDRESS ( src , dst ) < 0 ) {
addr1 = src ;
addr2 = dst ;
port1 = src_port ;
port2 = dst_port ;
} else {
addr2 = src ;
addr1 = dst ;
port2 = src_port ;
port1 = dst_port ;
}
2003-08-23 09:09:35 +00:00
2004-06-03 21:46:27 +00:00
/* if we dont have any entries at all yet */
2004-07-20 21:39:54 +00:00
if ( ct - > conversations = = NULL ) {
2009-10-06 07:44:48 +00:00
ct - > conversations = g_array_sized_new ( FALSE , FALSE , sizeof ( conv_t ) , 10000 ) ;
2003-08-23 09:09:35 +00:00
2009-10-08 07:56:48 +00:00
ct - > hashtable = g_hash_table_new_full ( conversation_hash ,
2010-07-23 14:01:47 +00:00
conversation_match , /* key_equal_func */
g_free , /* key_destroy_func */
NULL ) ; /* value_destroy_func */
2009-10-06 07:44:48 +00:00
}
else {
/* try to find it among the existing known conversations */
2010-07-23 14:01:47 +00:00
conv_key_t existing_key ;
existing_key . addr1 = * addr1 ;
existing_key . addr2 = * addr2 ;
existing_key . port1 = port1 ;
existing_key . port2 = port2 ;
conversation_idx = GPOINTER_TO_UINT ( g_hash_table_lookup ( ct - > hashtable , & existing_key ) ) ;
if ( conversation_idx ) {
conversation_idx - - ;
2009-10-06 07:44:48 +00:00
conversation = & g_array_index ( ct - > conversations , conv_t , conversation_idx ) ;
2010-07-23 14:01:47 +00:00
}
2004-06-03 21:46:27 +00:00
}
2003-08-23 09:09:35 +00:00
2004-07-20 06:06:41 +00:00
/* if we still dont know what conversation this is it has to be a new one
2004-06-03 21:46:27 +00:00
and we have to allocate it and append it to the end of the list */
2004-07-20 06:06:41 +00:00
if ( conversation = = NULL ) {
2010-07-23 14:01:47 +00:00
conv_key_t * new_key ;
2009-10-06 07:44:48 +00:00
conv_t conv ;
2010-07-23 14:01:47 +00:00
2009-10-06 07:44:48 +00:00
COPY_ADDRESS ( & conv . src_address , addr1 ) ;
COPY_ADDRESS ( & conv . dst_address , addr2 ) ;
conv . sat = sat ;
2010-01-29 16:13:26 +00:00
conv . port_type = port_type_val ;
2009-10-06 07:44:48 +00:00
conv . src_port = port1 ;
conv . dst_port = port2 ;
conv . rx_frames = 0 ;
conv . tx_frames = 0 ;
conv . rx_bytes = 0 ;
conv . tx_bytes = 0 ;
conv . iter_valid = FALSE ;
conv . modified = TRUE ;
2010-07-23 14:01:47 +00:00
2007-11-20 18:35:41 +00:00
if ( ts ) {
2009-10-06 07:44:48 +00:00
memcpy ( & conv . start_time , ts , sizeof ( conv . start_time ) ) ;
memcpy ( & conv . stop_time , ts , sizeof ( conv . stop_time ) ) ;
2007-11-20 18:35:41 +00:00
} else {
2009-10-06 07:44:48 +00:00
nstime_set_unset ( & conv . start_time ) ;
nstime_set_unset ( & conv . stop_time ) ;
2007-11-20 18:35:41 +00:00
}
2009-10-06 07:44:48 +00:00
g_array_append_val ( ct - > conversations , conv ) ;
conversation_idx = ct - > num_conversations ;
conversation = & g_array_index ( ct - > conversations , conv_t , conversation_idx ) ;
2009-10-08 07:56:48 +00:00
/* ct->conversations address is not a constant but src/dst_address.data are */
new_key = g_new ( conv_key_t , 1 ) ;
2010-07-23 14:01:47 +00:00
SET_ADDRESS ( & new_key - > addr1 , conversation - > src_address . type , conversation - > src_address . len , conversation - > src_address . data ) ;
SET_ADDRESS ( & new_key - > addr2 , conversation - > dst_address . type , conversation - > dst_address . len , conversation - > dst_address . data ) ;
new_key - > port1 = port1 ;
new_key - > port2 = port2 ;
2009-10-06 07:44:48 +00:00
g_hash_table_insert ( ct - > hashtable , new_key , GUINT_TO_POINTER ( conversation_idx + 1 ) ) ;
ct - > num_conversations + + ;
2004-06-03 21:46:27 +00:00
}
2003-08-23 09:09:35 +00:00
2004-07-20 06:06:41 +00:00
/* update the conversation struct */
2009-10-06 07:44:48 +00:00
conversation - > modified = TRUE ;
2004-06-03 21:46:27 +00:00
if ( ( ! CMP_ADDRESS ( src , addr1 ) ) & & ( ! CMP_ADDRESS ( dst , addr2 ) ) & & ( src_port = = port1 ) & & ( dst_port = = port2 ) ) {
2004-07-20 06:06:41 +00:00
conversation - > tx_frames + = num_frames ;
conversation - > tx_bytes + = num_bytes ;
2004-06-03 21:46:27 +00:00
} else {
2004-07-20 06:06:41 +00:00
conversation - > rx_frames + = num_frames ;
conversation - > rx_bytes + = num_bytes ;
2004-06-03 21:46:27 +00:00
}
2003-08-23 09:09:35 +00:00
2007-11-20 18:35:41 +00:00
if ( ts ) {
if ( nstime_cmp ( ts , & conversation - > stop_time ) > 0 ) {
memcpy ( & conversation - > stop_time , ts , sizeof ( conversation - > stop_time ) ) ;
} else if ( nstime_cmp ( ts , & conversation - > start_time ) < 0 ) {
memcpy ( & conversation - > start_time , ts , sizeof ( conversation - > start_time ) ) ;
}
}
2003-08-23 09:09:35 +00:00
}
2007-11-20 18:35:41 +00:00
/*
* Editor modelines
*
* Local Variables :
* c - basic - offset : 4
* tab - width : 8
* indent - tabs - mode : nil
* End :
*
* ex : set shiftwidth = 4 tabstop = 8 expandtab
* : indentSize = 4 : tabSize = 8 : noTabs = true :
*/