6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 #ifdef MAIN_MENU_USE_UIMANAGER
35 #include <epan/packet.h>
36 #include <epan/addr_resolv.h>
37 #include <epan/prefs.h>
38 #include <epan/prefs-int.h>
40 #include <epan/timestamp.h>
41 #include <epan/etypes.h>
42 #include <epan/ipproto.h>
43 #include <epan/dissector_filters.h>
44 #include <epan/strutil.h>
45 #include <epan/plugins.h>
46 #include <epan/epan_dissect.h>
47 #include <epan/column.h>
49 #include <epan/filesystem.h>
52 #include "../ui_util.h"
53 #include "../simple_dialog.h"
54 #include "../main_statusbar.h"
55 #include "../color_filters.h"
56 #include "../stat_menu.h"
59 #include "gtk/about_dlg.h"
60 #include "gtk/capture_dlg.h"
61 #include "gtk/capture_if_dlg.h"
62 #include "gtk/color_dlg.h"
63 #include "gtk/filter_dlg.h"
64 #include "gtk/profile_dlg.h"
65 #include "gtk/dlg_utils.h"
66 #include "gtk/capture_file_dlg.h"
67 #include "gtk/fileset_dlg.h"
68 #include "gtk/file_import_dlg.h"
69 #include "gtk/find_dlg.h"
70 #include "gtk/goto_dlg.h"
71 #include "gtk/summary_dlg.h"
72 #include "gtk/prefs_dlg.h"
73 #include "gtk/packet_win.h"
74 #include "gtk/follow_tcp.h"
75 #include "gtk/follow_udp.h"
76 #include "gtk/follow_ssl.h"
77 #include "gtk/decode_as_dlg.h"
78 #include "gtk/help_dlg.h"
79 #include "gtk/supported_protos_dlg.h"
80 #include "gtk/proto_dlg.h"
81 #include "gtk/proto_hier_stats_dlg.h"
83 #include "gtk/stock_icons.h"
84 #include "gtk/gtkglobals.h"
85 #include "gtk/recent.h"
86 #include "gtk/main_proto_draw.h"
87 #include "gtk/conversations_table.h"
88 #include "gtk/hostlist_table.h"
89 #include "gtk/packet_history.h"
90 #include "gtk/sctp_stat.h"
91 #include "gtk/firewall_dlg.h"
92 #include "gtk/macros_dlg.h"
93 #include "gtk/export_object.h"
94 #include "epan/dissectors/packet-ssl-utils.h"
95 #include "gtk/export_sslkeys.h"
96 #include "gtk/gui_stat_menu.h"
98 #include "gtk/menus.h"
99 #include "gtk/main_toolbar.h"
100 #include "gtk/main_welcome.h"
101 #include "gtk/uat_gui.h"
102 #include "gtk/gui_utils.h"
103 #include "gtk/manual_addr_resolv.h"
104 #include "gtk/proto_help.h"
105 #include "gtk/dissector_tables_dlg.h"
106 #include "gtk/utf8_entities.h"
107 #include "gtk/expert_comp_dlg.h"
108 #include "gtk/time_shift_dlg.h"
110 #include "gtk/new_packet_list.h"
113 #include "capture_opts.h"
114 #include "gtk/capture_globals.h"
116 #ifdef HAVE_IGE_MAC_INTEGRATION
117 #include <ige-mac-menu.h>
120 #ifdef HAVE_GTKOSXAPPLICATION
121 #include <igemacintegration/gtkosxapplication.h>
124 static int initialize = TRUE;
125 GtkActionGroup *main_menu_bar_action_group;
126 static GtkUIManager *ui_manager_main_menubar = NULL;
127 static GtkUIManager *ui_manager_packet_list_heading = NULL;
128 static GtkUIManager *ui_manager_packet_list_menu = NULL;
129 static GtkUIManager *ui_manager_tree_view_menu = NULL;
130 static GtkUIManager *ui_manager_bytes_menu = NULL;
131 static GtkUIManager *ui_manager_statusbar_profiles_menu = NULL;
132 static GSList *popup_menu_list = NULL;
134 static GtkAccelGroup *grp;
136 static GList *merge_lua_menu_items_list = NULL;
138 GtkWidget *popup_menu_object;
140 static void menu_open_recent_file_cmd_cb(GtkAction *action, gpointer data _U_ );
141 static void add_recent_items (guint merge_id, GtkUIManager *ui_manager);
143 static void menus_init(void);
144 static void merge_lua_menu_items(GList *node);
145 static void set_menu_sensitivity (GtkUIManager *ui_manager, const gchar *, gint);
146 static void show_hide_cb(GtkWidget *w, gpointer data, gint action);
147 static void timestamp_seconds_time_cb(GtkWidget *w, gpointer d, gint action);
148 static void name_resolution_cb(GtkWidget *w, gpointer d, gint action);
149 static void colorize_cb(GtkWidget *w, gpointer d);
152 /* As a general GUI guideline, we try to follow the Gnome Human Interface Guidelines, which can be found at:
153 http://developer.gnome.org/projects/gup/hig/1.0/index.html
155 Please note: there are some differences between the Gnome HIG menu suggestions and our implementation:
157 File/Open Recent: the Gnome HIG suggests putting the list of recently used files as elements into the File menuitem.
158 As this is ok for only a few items, this will become unhandy for 10 or even more list entries.
159 For this reason, we use a submenu for this.
161 File/Close: the Gnome HIG suggests putting this item just above the Quit item.
162 This results in unintuitive behaviour as both Close and Quit items are very near together.
163 By putting the Close item near the open item(s), it better suggests that it will close the
164 currently opened/captured file only.
168 SHOW_HIDE_MAIN_TOOLBAR = 1,
169 SHOW_HIDE_FILTER_TOOLBAR,
170 SHOW_HIDE_AIRPCAP_TOOLBAR,
172 SHOW_HIDE_PACKET_LIST,
175 } show_hide_values_e;
186 build_conversation_filter(int action, gboolean show_dialog)
188 packet_info *pi = &cfile.edt->pi;
194 if (pi->profinet_type == 0) {
196 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
197 "Error filtering conversation. Please make\n"
198 "sure you have a PROFINET CBA packet selected.");
203 if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4
204 && pi->ipproto == IP_PROTO_TCP ) {
206 switch(pi->profinet_type) {
208 buf = g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 0)",
209 ip_to_str( pi->net_dst.data),
210 ip_to_str( pi->net_src.data),
211 ip_to_str( pi->net_src.data),
212 ip_to_str( pi->net_dst.data));
215 buf = g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 0)",
216 ip_to_str( pi->net_src.data),
217 ip_to_str( pi->net_dst.data),
218 ip_to_str( pi->net_dst.data),
219 ip_to_str( pi->net_src.data));
222 buf = g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.srt == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.srt == 0)",
223 ip_to_str( pi->net_dst.data),
224 ip_to_str( pi->net_src.data),
225 ip_to_str( pi->net_src.data),
226 ip_to_str( pi->net_dst.data));
229 buf = g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.srt == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.srt == 0)",
230 ip_to_str( pi->net_src.data),
231 ip_to_str( pi->net_dst.data),
232 ip_to_str( pi->net_dst.data),
233 ip_to_str( pi->net_src.data));
243 if (pi->ipproto != IP_PROTO_TCP) {
245 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
246 "Error filtering conversation. Please make\n"
247 "sure you have a TCP packet selected.");
252 if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4 ) {
254 buf = g_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
255 ip_to_str( pi->net_src.data),
256 ip_to_str( pi->net_dst.data),
257 pi->srcport, pi->destport );
258 } else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6 ) {
260 buf = g_strdup_printf("(ipv6.addr eq %s and ipv6.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
261 ip6_to_str((const struct e_in6_addr *)pi->net_src.data),
262 ip6_to_str((const struct e_in6_addr *)pi->net_dst.data),
263 pi->srcport, pi->destport );
269 if (pi->ipproto != IP_PROTO_UDP) {
271 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
272 "Error filtering conversation. Please make\n"
273 "sure you have a UDP packet selected.");
278 if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4 ) {
280 buf = g_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (udp.port eq %d and udp.port eq %d)",
281 ip_to_str( pi->net_src.data),
282 ip_to_str( pi->net_dst.data),
283 pi->srcport, pi->destport );
284 } else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6 ) {
286 buf = g_strdup_printf("(ipv6.addr eq %s and ipv6.addr eq %s) and (udp.port eq %d and udp.port eq %d)",
287 ip6_to_str((const struct e_in6_addr *)pi->net_src.data),
288 ip6_to_str((const struct e_in6_addr *)pi->net_dst.data),
289 pi->srcport, pi->destport );
295 if ((pi->ethertype != ETHERTYPE_IP) && (pi->ethertype != ETHERTYPE_IPv6)) {
297 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
298 "Error filtering conversation. Please make\n"
299 "sure you have a IP packet selected.");
304 if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4 ) {
306 buf = g_strdup_printf("ip.addr eq %s and ip.addr eq %s",
307 ip_to_str( pi->net_src.data),
308 ip_to_str( pi->net_dst.data));
309 } else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6 ) {
311 buf = g_strdup_printf("ipv6.addr eq %s and ipv6.addr eq %s",
312 ip6_to_str((const struct e_in6_addr *)pi->net_src.data),
313 ip6_to_str((const struct e_in6_addr *)pi->net_dst.data));
319 /* XXX - is this the right way to check for Ethernet? */
320 /* check for the data link address type */
321 /* (ethertype will be 0 when used as length field) */
322 if (pi->dl_src.type != AT_ETHER) {
324 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
325 "Error filtering conversation. Please make\n"
326 "sure you have a Ethernet packet selected.");
331 if( pi->dl_src.type == AT_ETHER && pi->dl_dst.type == AT_ETHER ) {
333 buf = g_strdup_printf("eth.addr eq %s and eth.addr eq %s",
334 ether_to_str( pi->dl_src.data),
335 ether_to_str( pi->dl_dst.data));
348 new_window_cb(GtkWidget *widget)
350 new_packet_window(widget, FALSE);
353 #ifdef WANT_PACKET_EDITOR
355 edit_window_cb(GtkWidget *widget)
357 new_packet_window(widget, TRUE);
362 conversation_cb(GtkAction *a _U_, gpointer data _U_, int action)
365 GtkWidget *filter_te;
367 if (cfile.current_frame) {
368 /* create a filter-string based on the selected packet and action */
369 filter = build_conversation_filter(action, TRUE);
371 /* Run the display filter so it goes in effect - even if it's the
372 same as the previous display filter. */
373 filter_te = gtk_bin_get_child(GTK_BIN(g_object_get_data(G_OBJECT(top_level), E_DFILTER_CM_KEY)));
375 gtk_entry_set_text(GTK_ENTRY(filter_te), filter);
376 main_filter_packets(&cfile, filter, TRUE);
383 colorize_conversation_cb(GtkAction *action _U_, gpointer data _U_, int action_num)
385 gchar *filter = NULL;
387 if( (action_num>>8) == 255 ) {
388 color_filters_reset_tmp();
389 new_packet_list_colorize_packets();
390 } else if (cfile.current_frame) {
391 if( (action_num&0xff) == 0 ) {
392 /* colorize_conversation_cb was called from the window-menu
393 * or through an accelerator key. Try to build a conversation
394 * filter in the order TCP, UDP, IP, Ethernet and apply the
396 filter = build_conversation_filter(CONV_TCP,FALSE);
398 filter = build_conversation_filter(CONV_UDP,FALSE);
400 filter = build_conversation_filter(CONV_IP,FALSE);
402 filter = build_conversation_filter(CONV_ETHER,FALSE);
403 if( filter == NULL ) {
404 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Unable to build conversation filter.");
408 /* create a filter-string based on the selected packet and action_num */
409 filter = build_conversation_filter(action_num&0xff, TRUE);
412 if( (action_num>>8) == 0) {
413 /* Open the "new coloring filter" dialog with the filter */
414 color_display_with_filter(filter);
416 /* Set one of the temporary coloring filters */
417 color_filters_set_tmp((guint8)(action_num>>8),filter,FALSE);
418 new_packet_list_colorize_packets();
426 goto_conversation_frame(gboolean dir)
429 dfilter_t *dfcode = NULL;
430 gboolean found_packet=FALSE;
432 filter = build_conversation_filter(CONV_TCP,FALSE);
434 filter = build_conversation_filter(CONV_UDP,FALSE);
436 filter = build_conversation_filter(CONV_IP,FALSE);
437 if( filter == NULL ) {
438 statusbar_push_temporary_msg("Unable to build conversation filter.");
443 if (!dfilter_compile(filter, &dfcode)) {
444 /* The attempt failed; report an error. */
445 statusbar_push_temporary_msg("Error compiling filter for this conversation.");
450 found_packet = cf_find_packet_dfilter(&cfile, dfcode, dir);
453 /* We didn't find a packet */
454 statusbar_push_temporary_msg("No previous/next packet in conversation.");
457 dfilter_free(dfcode);
462 goto_next_frame_conversation_cb(GtkAction *action _U_, gpointer user_data _U_)
464 goto_conversation_frame(FALSE);
468 goto_previous_frame_conversation_cb(GtkAction *action _U_, gpointer user_data _U_)
470 goto_conversation_frame(TRUE);
477 tree_view_menu_apply_selected_cb(GtkAction *action _U_, gpointer user_data)
479 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/Selected");
480 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_REPLACE|MATCH_SELECTED_APPLY_NOW);
484 tree_view_menu_apply_not_selected_cb(GtkAction *action _U_, gpointer user_data)
486 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/NotSelected");
487 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_NOT|MATCH_SELECTED_APPLY_NOW);
491 tree_view_menu_apply_and_selected_cb(GtkAction *action _U_, gpointer user_data)
493 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/AndSelected");
494 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_AND|MATCH_SELECTED_APPLY_NOW);
498 tree_view_menu_apply_or_selected_cb(GtkAction *action _U_, gpointer user_data)
500 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/OrSelected");
501 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_OR|MATCH_SELECTED_APPLY_NOW);
505 tree_view_menu_apply_and_not_selected_cb(GtkAction *action _U_, gpointer user_data)
507 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/AndNotSelected");
508 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_AND_NOT|MATCH_SELECTED_APPLY_NOW);
512 tree_view_menu_apply_or_not_selected_cb(GtkAction *action _U_, gpointer user_data)
514 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/OrNotSelected");
515 match_selected_ptree_cb( widget , user_data,MATCH_SELECTED_OR_NOT|MATCH_SELECTED_APPLY_NOW);
517 /* Prepare a filter */
519 tree_view_menu_prepare_selected_cb(GtkAction *action _U_, gpointer user_data)
521 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/Selected");
522 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_REPLACE);
526 tree_view_menu_prepare_not_selected_cb(GtkAction *action _U_, gpointer user_data)
528 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/NotSelected");
529 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_NOT);
533 tree_view_menu_prepare_and_selected_cb(GtkAction *action _U_, gpointer user_data)
535 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/AndSelected");
536 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_AND);
540 tree_view_menu_prepare_or_selected_cb(GtkAction *action _U_, gpointer user_data)
542 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/OrSelected");
543 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_OR);
547 tree_view_menu_prepare_and_not_selected_cb(GtkAction *action _U_, gpointer user_data)
549 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/AndNotSelected");
550 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_AND_NOT);
554 tree_view_menu_prepare_or_not_selected_cb(GtkAction *action _U_, gpointer user_data)
556 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/OrNotSelected");
557 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_OR_NOT);
561 copy_description_cb(GtkAction *action _U_, gpointer user_data)
563 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_DESCRIPTION);
567 copy_fieldname_cb(GtkAction *action _U_, gpointer user_data)
569 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_FIELDNAME);
573 copy_value_cb(GtkAction *action _U_, gpointer user_data)
575 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_VALUE);
579 copy_as_filter_cb(GtkAction *action _U_, gpointer user_data)
581 match_selected_ptree_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_REPLACE|MATCH_SELECTED_COPY_ONLY);
585 set_reftime_cb(GtkAction *action _U_, gpointer user_data)
587 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_TOGGLE);
591 find_next_ref_time_cb(GtkAction *action _U_, gpointer user_data)
593 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_FIND_NEXT);
597 find_previous_ref_time_cb(GtkAction *action _U_, gpointer user_data)
599 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_FIND_PREV);
603 menus_prefs_cb(GtkAction *action _U_, gpointer user_data)
605 prefs_page_cb( NULL /* widget _U_ */ , user_data, PREFS_PAGE_USER_INTERFACE);
609 main_toolbar_show_hide_cb(GtkAction *action _U_, gpointer user_data)
611 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/MainToolbar");
614 g_warning("main_toolbar_show_hide_cb: No widget found");
616 show_hide_cb( widget, user_data, SHOW_HIDE_MAIN_TOOLBAR);
621 filter_toolbar_show_hide_cb(GtkAction * action _U_, gpointer user_data)
623 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/FilterToolbar");
625 g_warning("filter_toolbar_show_hide_cb: No widget found");
627 show_hide_cb( widget, user_data, SHOW_HIDE_FILTER_TOOLBAR);
633 wireless_toolbar_show_hide_cb(GtkAction *action _U_, gpointer user_data)
635 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/WirelessToolbar");
637 g_warning("wireless_toolbar_show_hide_cb: No widget found");
639 show_hide_cb( widget, user_data, SHOW_HIDE_AIRPCAP_TOOLBAR);
642 #endif /* HAVE_AIRPCAP */
645 status_bar_show_hide_cb(GtkAction *action _U_, gpointer user_data)
647 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/Statusbar");
649 g_warning("status_bar_show_hide_cb: No widget found");
651 show_hide_cb( widget, user_data, SHOW_HIDE_STATUSBAR);
655 packet_list_show_hide_cb(GtkAction *action _U_, gpointer user_data)
657 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketList");
659 g_warning("packet_list_show_hide_cb: No widget found");
661 show_hide_cb( widget, user_data, SHOW_HIDE_PACKET_LIST);
665 packet_details_show_hide_cb(GtkAction *action _U_, gpointer user_data)
667 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketDetails");
669 g_warning("packet_details_show_hide_cb: No widget found");
671 show_hide_cb( widget, user_data, SHOW_HIDE_TREE_VIEW);
675 packet_bytes_show_hide_cb(GtkAction *action _U_, gpointer user_data)
677 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketBytes");
679 g_warning("packet_bytes_show_hide_cb: No widget found");
681 show_hide_cb( widget, user_data, SHOW_HIDE_BYTE_VIEW);
686 timestamp_format_new_cb (GtkRadioAction *action, GtkRadioAction *current _U_, gpointer user_data _U_)
690 value = gtk_radio_action_get_current_value (action);
691 g_warning("timestamp_format_new_cb, value %u, recent.gui_time_format %u",value, recent.gui_time_format);
692 if (recent.gui_time_format != value) {
693 timestamp_set_type(value);
694 recent.gui_time_format = value;
695 /* This call adjusts column width */
696 cf_timestamp_auto_precision(&cfile);
697 new_packet_list_queue_draw();
703 timestamp_precision_new_cb (GtkRadioAction *action, GtkRadioAction *current _U_, gpointer user_data _U_)
707 value = gtk_radio_action_get_current_value (action);
708 g_warning("timestamp_precision_new_cb, value %u, recent.gui_time_precision %u",value, recent.gui_time_precision);
709 if (recent.gui_time_precision != value) {
710 /* the actual precision will be set in new_packet_list_queue_draw() below */
711 if (value == TS_PREC_AUTO) {
712 timestamp_set_precision(TS_PREC_AUTO_SEC);
714 timestamp_set_precision(value);
716 recent.gui_time_precision = value;
717 /* This call adjusts column width */
718 cf_timestamp_auto_precision(&cfile);
719 new_packet_list_queue_draw();
725 view_menu_seconds_time_cb(GtkAction *action _U_, gpointer user_data)
727 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes");
729 g_warning("view_menu_seconds_time_cb: No widget found");
731 timestamp_seconds_time_cb(widget, user_data, 0);
736 view_menu_en_for_MAC_cb(GtkAction *action _U_, gpointer user_data)
738 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforMACLayer");
740 g_warning("view_menu_en_for_MAC_cb: No widget found");
742 name_resolution_cb( widget , user_data, RESOLV_MAC);
747 view_menu_en_for_network_cb(GtkAction *action _U_, gpointer user_data)
749 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforNetworkLayer");
751 g_warning("view_menu_en_for_network_cb: No widget found");
753 name_resolution_cb( widget , user_data, RESOLV_NETWORK);
758 view_menu_en_for_transport_cb(GtkAction *action _U_, gpointer user_data)
760 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforTransportLayer");
762 g_warning("view_menu_en_for_transport_cb: No widget found");
764 name_resolution_cb( widget , user_data, RESOLV_TRANSPORT);
769 view_menu_colorize_pkt_lst_cb(GtkAction *action _U_, gpointer user_data)
771 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizePacketList");
773 g_warning("view_menu_colorize_pkt_lst_cb: No widget found");
775 colorize_cb( widget , user_data);
782 view_menu_auto_scroll_live_cb(GtkAction *action _U_, gpointer user_data _U_)
784 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/AutoScrollinLiveCapture");
787 g_warning("view_menu_auto_scroll_live_cb: No widget found");
789 menu_auto_scroll_live_changed(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)));
795 view_menu_color_conv_color1_cb(GtkAction *action, gpointer user_data)
797 colorize_conversation_cb(action, user_data, 1*256);
801 view_menu_color_conv_color2_cb(GtkAction *action, gpointer user_data)
803 colorize_conversation_cb(action, user_data, 2*256);
807 view_menu_color_conv_color3_cb(GtkAction *action, gpointer user_data)
809 colorize_conversation_cb(action, user_data, 3*256);
813 view_menu_color_conv_color4_cb(GtkAction *action, gpointer user_data)
815 colorize_conversation_cb(action, user_data, 4*256);
819 view_menu_color_conv_color5_cb(GtkAction *action, gpointer user_data)
821 colorize_conversation_cb(action, user_data, 5*256);
825 view_menu_color_conv_color6_cb(GtkAction *action, gpointer user_data)
827 colorize_conversation_cb(action, user_data, 6*256);
831 view_menu_color_conv_color7_cb(GtkAction *action, gpointer user_data)
833 colorize_conversation_cb(action, user_data, 7*256);
837 view_menu_color_conv_color8_cb(GtkAction *action, gpointer user_data)
839 colorize_conversation_cb(action, user_data, 8*256);
843 view_menu_color_conv_color9_cb(GtkAction *action, gpointer user_data)
845 colorize_conversation_cb(action, user_data, 9*256);
849 view_menu_color_conv_color10_cb(GtkAction *action, gpointer user_data)
851 colorize_conversation_cb(action, user_data, 10*256);
855 view_menu_color_conv_new_rule_cb(GtkAction *action, gpointer user_data)
857 colorize_conversation_cb(action, user_data, 0);
861 view_menu_reset_coloring_cb(GtkAction *action, gpointer user_data)
863 colorize_conversation_cb(action, user_data, 255*256);
867 help_menu_cont_cb(GtkAction *action _U_, gpointer user_data _U_)
869 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(HELP_CONTENT));
873 help_menu_faq_cb(GtkAction *action _U_, gpointer user_data _U_)
875 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_FAQ));
879 help_menu_wireshark_cb(GtkAction *action _U_, gpointer user_data _U_)
881 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_WIRESHARK));
885 help_menu_wireshark_flt_cb(GtkAction *action _U_, gpointer user_data _U_)
887 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_WIRESHARK_FILTER));
891 help_menu_Tshark_cb(GtkAction *action _U_, gpointer user_data _U_)
893 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_TSHARK));
897 help_menu_RawShark_cb(GtkAction *action _U_, gpointer user_data _U_)
899 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_RAWSHARK));
903 help_menu_Dumpcap_cb(GtkAction *action _U_, gpointer user_data _U_)
905 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_DUMPCAP));
909 help_menu_Mergecap_cb(GtkAction *action _U_, gpointer user_data _U_)
911 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_MERGECAP));
915 help_menu_Editcap_cb(GtkAction *action _U_, gpointer user_data _U_)
917 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_EDITCAP));
921 help_menu_Text2pcap_cb(GtkAction *action _U_, gpointer user_data _U_)
923 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_TEXT2PCAP));
927 help_menu_Website_cb(GtkAction *action _U_, gpointer user_data _U_)
929 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_HOME));
933 help_menu_Wiki_cb(GtkAction *action _U_, gpointer user_data _U_)
935 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_WIKI));
939 help_menu_Downloads_cb(GtkAction *action _U_, gpointer user_data _U_)
941 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_DOWNLOAD));
945 help_menu_SampleCaptures_cb(GtkAction *action _U_, gpointer user_data _U_)
947 topic_menu_cb( NULL/* widget_U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_SAMPLE_FILES));
950 static const char *ui_desc_menubar =
952 " <menubar name ='Menubar'>\n"
953 " <menu name= 'FileMenu' action='/File'>\n"
954 " <menuitem name='Open' action='/File/Open'/>\n"
955 " <menu name='OpenRecent' action='/File/OpenRecent'>\n"
956 " <placeholder name='RecentFiles'/>\n"
958 " <menuitem name='Merge' action='/File/Merge'/>\n"
959 " <menuitem name='Import' action='/File/Import'/>\n"
960 " <menuitem name='Close' action='/File/Close'/>\n"
962 " <menuitem name='Save' action='/File/Save'/>\n"
963 " <menuitem name='SaveAs' action='/File/SaveAs'/>\n"
965 " <menu name= 'Set' action='/File/Set'>\n"
966 " <menuitem name='ListFiles' action='/File/Set/ListFiles'/>\n"
967 " <menuitem name='NextFile' action='/File/Set/NextFile'/>\n"
968 " <menuitem name='PreviousFile' action='/File/Set/PreviousFile'/>\n"
971 " <menu name= 'Export' action='/File/Export'>\n"
972 " <menu name= 'File' action='/File/Export/File'>\n"
973 " <menuitem name='AsTxt' action='/File/Export/File/Text'/>\n"
974 " <menuitem name='AsPostScript' action='/File/Export/File/PostScript'/>\n"
975 " <menuitem name='AsCSV' action='/File/Export/File/CSV'/>\n"
976 " <menuitem name='AsCArrays' action='/File/Export/File/CArrays'/>\n"
978 " <menuitem name='AsPSML' action='/File/Export/File/PSML'/>\n"
979 " <menuitem name='AsPDML' action='/File/Export/File/PDML'/>\n"
982 " <menuitem name='SelectedPacketBytes' action='/File/Export/SelectedPacketBytes'/>\n"
983 " <menu name= 'Objects' action='/File/Export/Objects'>\n"
984 " <menuitem name='HTTP' action='/File/Export/Objects/HTTP'/>\n"
985 " <menuitem name='DICOM' action='/File/Export/Objects/DICOM'/>\n"
986 " <menuitem name='SMB' action='/File/Export/Objects/SMB'/>\n"
990 " <menuitem name='Print' action='/File/Print'/>\n"
992 " <menuitem name='Quit' action='/File/Quit'/>\n"
994 " <menu name= 'EditMenu' action='/Edit'>\n"
995 " <menu name= 'Copy' action='/Edit/Copy'>\n"
996 " <menuitem name='Description' action='/Edit/Copy/Description'/>\n"
997 " <menuitem name='Fieldname' action='/Edit/Copy/Fieldname'/>\n"
998 " <menuitem name='Value' action='/Edit/Copy/Value'/>\n"
1000 " <menuitem name='AsFilter' action='/Edit/Copy/AsFilter'/>\n"
1002 " <menuitem name='FindPacket' action='/Edit/FindPacket'/>\n"
1003 " <menuitem name='FindNext' action='/Edit/FindNext'/>\n"
1004 " <menuitem name='FindPrevious' action='/Edit/FindPrevious'/>\n"
1006 " <menuitem name='MarkPacket' action='/Edit/MarkPacket'/>\n"
1007 " <menuitem name='MarkAllDisplayedPackets' action='/Edit/MarkAllDisplayedPackets'/>\n"
1008 " <menuitem name='UnmarkAllDisplayedPackets' action='/Edit/UnmarkAllDisplayedPackets'/>\n"
1009 " <menuitem name='FindNextMark' action='/Edit/FindNextMark'/>\n"
1010 " <menuitem name='FindPreviousMark' action='/Edit/FindPreviousMark'/>\n"
1012 " <menuitem name='IgnorePacket' action='/Edit/IgnorePacket'/>\n"
1013 " <menuitem name='IgnoreAllDisplayedPackets' action='/Edit/IgnoreAllDisplayedPackets'/>\n"
1014 " <menuitem name='Un-IgnoreAllPackets' action='/Edit/Un-IgnoreAllPackets'/>\n"
1016 " <menuitem name='SetTimeReference' action='/Edit/SetTimeReference'/>\n"
1017 " <menuitem name='Un-TimeReferenceAllPackets' action='/Edit/Un-TimeReferenceAllPackets'/>\n"
1018 " <menuitem name='FindNextTimeReference' action='/Edit/FindNextTimeReference'/>\n"
1019 " <menuitem name='FindPreviousTimeReference' action='/Edit/FindPreviousTimeReference'/>\n"
1020 " <menuitem name='TimeShift' action='/Edit/TimeShift'/>\n"
1022 #ifdef WANT_PACKET_EDITOR
1023 " <menuitem name='EditPacket' action='/Edit/EditPacket'/>\n"
1026 " <menuitem name='ConfigurationProfiles' action='/Edit/ConfigurationProfiles'/>\n"
1027 " <menuitem name='Preferences' action='/Edit/Preferences'/>\n"
1029 " <menu name= 'ViewMenu' action='/View'>\n"
1030 " <menuitem name='MainToolbar' action='/View/MainToolbar'/>\n"
1031 " <menuitem name='FilterToolbar' action='/View/FilterToolbar'/>\n"
1033 " <menuitem name='WirelessToolbar' action='/View/WirelessToolbar'/>\n"
1035 " <menuitem name='Statusbar' action='/View/Statusbar'/>\n"
1037 " <menuitem name='PacketList' action='/View/PacketList'/>\n"
1038 " <menuitem name='PacketDetails' action='/View/PacketDetails'/>\n"
1039 " <menuitem name='PacketBytes' action='/View/PacketBytes'/>\n"
1041 " <menu name= 'TimeDisplayFormat' action='/View/TimeDisplayFormat'>\n"
1042 " <menuitem name='DateandTimeofDay' action='/View/TimeDisplayFormat/DateandTimeofDay'/>\n"
1043 " <menuitem name='TimeofDay' action='/View/TimeDisplayFormat/TimeofDay'/>\n"
1044 " <menuitem name='SecondsSinceEpoch' action='/View/TimeDisplayFormat/SecondsSinceEpoch'/>\n"
1045 " <menuitem name='SecondsSinceBeginningofCapture' action='/View/TimeDisplayFormat/SecondsSinceBeginningofCapture'/>\n"
1046 " <menuitem name='SecondsSincePreviousCapturedPacket' action='/View/TimeDisplayFormat/SecondsSincePreviousCapturedPacket'/>\n"
1047 " <menuitem name='SecondsSincePreviousDisplayedPacket' action='/View/TimeDisplayFormat/SecondsSincePreviousDisplayedPacket'/>\n"
1048 " <menuitem name='UTCDateandTimeofDay' action='/View/TimeDisplayFormat/UTCDateandTimeofDay'/>\n"
1049 " <menuitem name='UTCTimeofDay' action='/View/TimeDisplayFormat/UTCTimeofDay'/>\n"
1051 " <menuitem name='FileFormatPrecision-Automatic' action='/View/TimeDisplayFormat/FileFormatPrecision-Automatic'/>\n"
1052 " <menuitem name='FileFormatPrecision-Seconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Seconds'/>\n"
1053 " <menuitem name='FileFormatPrecision-Deciseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Deciseconds'/>\n"
1054 " <menuitem name='FileFormatPrecision-Centiseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Centiseconds'/>\n"
1055 " <menuitem name='FileFormatPrecision-Milliseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Milliseconds'/>\n"
1056 " <menuitem name='FileFormatPrecision-Microseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Microseconds'/>\n"
1057 " <menuitem name='FileFormatPrecision-Nanoseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Nanoseconds'/>\n"
1059 " <menuitem name='DisplaySecondsWithHoursAndMinutes' action='/View/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes'/>\n"
1061 " <menu name= 'NameResolution' action='/View/NameResolution'>\n"
1062 " <menuitem name='ResolveName' action='/View/NameResolution/ResolveName'/>\n"
1064 " <menuitem name='EnableforMACLayer' action='/View/NameResolution/EnableforMACLayer'/>\n"
1065 " <menuitem name='EnableforNetworkLayer' action='/View/NameResolution/EnableforNetworkLayer'/>\n"
1066 " <menuitem name='EnableforTransportLayer' action='/View/NameResolution/EnableforTransportLayer'/>\n"
1068 " <menuitem name='ColorizePacketList' action='/View/ColorizePacketList'/>\n"
1069 " <menuitem name='AutoScrollinLiveCapture' action='/View/AutoScrollinLiveCapture'/>\n"
1071 " <menuitem name='ZoomIn' action='/View/ZoomIn'/>\n"
1072 " <menuitem name='ZoomOut' action='/View/ZoomOut'/>\n"
1073 " <menuitem name='NormalSize' action='/View/NormalSize'/>\n"
1075 " <menuitem name='ResizeAllColumns' action='/View/ResizeAllColumns'/>\n"
1076 " <menuitem name='DisplayedColumns' action='/View/DisplayedColumns'/>\n"
1078 " <menuitem name='ExpandSubtrees' action='/View/ExpandSubtrees'/>\n"
1079 " <menuitem name='ExpandAll' action='/View/ExpandAll'/>\n"
1080 " <menuitem name='CollapseAll' action='/View/CollapseAll'/>\n"
1082 " <menu name= 'ColorizeConversation' action='/View/ColorizeConversation'>\n"
1083 " <menuitem name='Color1' action='/View/ColorizeConversation/Color 1'/>\n"
1084 " <menuitem name='Color2' action='/View/ColorizeConversation/Color 2'/>\n"
1085 " <menuitem name='Color3' action='/View/ColorizeConversation/Color 3'/>\n"
1086 " <menuitem name='Color4' action='/View/ColorizeConversation/Color 4'/>\n"
1087 " <menuitem name='Color5' action='/View/ColorizeConversation/Color 5'/>\n"
1088 " <menuitem name='Color6' action='/View/ColorizeConversation/Color 6'/>\n"
1089 " <menuitem name='Color7' action='/View/ColorizeConversation/Color 7'/>\n"
1090 " <menuitem name='Color8' action='/View/ColorizeConversation/Color 8'/>\n"
1091 " <menuitem name='Color9' action='/View/ColorizeConversation/Color 9'/>\n"
1092 " <menuitem name='Color10' action='/View/ColorizeConversation/Color 10'/>\n"
1093 " <menuitem name='NewColoringRule' action='/View/ColorizeConversation/NewColoringRule'/>\n"
1096 " <menuitem name='ResetColoring1-10' action='/View/ResetColoring1-10'/>\n"
1097 " <menuitem name='ColoringRules' action='/View/ColoringRules'/>\n"
1099 " <menuitem name='ShowPacketinNewWindow' action='/View/ShowPacketinNewWindow'/>\n"
1100 " <menuitem name='Reload' action='/View/Reload'/>\n"
1102 " <menu name= 'GoMenu' action='/Go'>\n"
1103 " <menuitem name='Back' action='/Go/Back'/>\n"
1104 " <menuitem name='Forward' action='/Go/Forward'/>\n"
1105 " <menuitem name='Goto' action='/Go/Goto'/>\n"
1106 " <menuitem name='GotoCorrespondingPacket' action='/Go/GotoCorrespondingPacket'/>\n"
1108 " <menuitem name='PreviousPacket' action='/Go/PreviousPacket'/>\n"
1109 " <menuitem name='NextPacket' action='/Go/NextPacket'/>\n"
1110 " <menuitem name='FirstPacket' action='/Go/FirstPacket'/>\n"
1111 " <menuitem name='LastPacket' action='/Go/LastPacket'/>\n"
1112 " <menuitem name='PreviousPacketInConversation' action='/Go/PreviousPacketInConversation'/>\n"
1113 " <menuitem name='NextPacketInConversation' action='/Go/NextPacketInConversation'/>\n"
1116 " <menu name= 'CaptureMenu' action='/Capture'>\n"
1117 " <menuitem name='Interfaces' action='/Capture/Interfaces'/>\n"
1118 " <menuitem name='Options' action='/Capture/Options'/>\n"
1119 " <menuitem name='Start' action='/Capture/Start'/>\n"
1120 " <menuitem name='Stop' action='/Capture/Stop'/>\n"
1121 " <menuitem name='Restart' action='/Capture/Restart'/>\n"
1122 " <menuitem name='CaptureFilters' action='/Capture/CaptureFilters'/>\n"
1124 #endif /* HAVE_LIBPCAP */
1125 " <menu name= 'AnalyzeMenu' action='/Analyze'>\n"
1126 " <menuitem name='DisplayFilters' action='/Analyze/DisplayFilters'/>\n"
1127 " <menuitem name='DisplayFilterMacros' action='/Analyze/DisplayFilterMacros'/>\n"
1129 " <menuitem name='ApplyasColumn' action='/Analyze/ApplyasColumn'/>\n"
1130 " <menu name= 'ApplyAsFilter' action='/Analyze/ApplyasFilter'>\n"
1131 " <menuitem name='Selected' action='/Analyze/ApplyasFilter/Selected'/>\n"
1132 " <menuitem name='NotSelected' action='/Analyze/ApplyasFilter/NotSelected'/>\n"
1133 " <menuitem name='AndSelected' action='/Analyze/ApplyasFilter/AndSelected'/>\n"
1134 " <menuitem name='OrSelected' action='/Analyze/ApplyasFilter/OrSelected'/>\n"
1135 " <menuitem name='AndNotSelected' action='/Analyze/ApplyasFilter/AndNotSelected'/>\n"
1136 " <menuitem name='OrNotSelected' action='/Analyze/ApplyasFilter/OrNotSelected'/>\n"
1138 " <menu name= 'PrepareaFilter' action='/Analyze/PrepareaFilter'>\n"
1139 " <menuitem name='Selected' action='/Analyze/PrepareaFilter/Selected'/>\n"
1140 " <menuitem name='NotSelected' action='/Analyze/PrepareaFilter/NotSelected'/>\n"
1141 " <menuitem name='AndSelected' action='/Analyze/PrepareaFilter/AndSelected'/>\n"
1142 " <menuitem name='OrSelected' action='/Analyze/PrepareaFilter/OrSelected'/>\n"
1143 " <menuitem name='AndNotSelected' action='/Analyze/PrepareaFilter/AndNotSelected'/>\n"
1144 " <menuitem name='OrNotSelected' action='/Analyze/PrepareaFilter/OrNotSelected'/>\n"
1147 " <menuitem name='EnabledProtocols' action='/Analyze/EnabledProtocols'/>\n"
1148 " <menuitem name='DecodeAs' action='/Analyze/DecodeAs'/>\n"
1149 " <menuitem name='UserSpecifiedDecodes' action='/Analyze/UserSpecifiedDecodes'/>\n"
1151 " <menuitem name='FollowTCPStream' action='/Analyze/FollowTCPStream'/>\n"
1152 " <menuitem name='FollowUDPStream' action='/Analyze/FollowUDPStream'/>\n"
1153 " <menuitem name='FollowSSLStream' action='/Analyze/FollowSSLStream'/>\n"
1154 " <menuitem name='ExpertInfoComposite' action='/Analyze/ExpertInfoComposite'/>\n"
1155 " <menu name= 'ConversationFilterMenu' action='/Analyze/ConversationFilter'>\n"
1156 " <placeholder name='Filters'/>\n"
1159 " <menu name= 'StatisticsMenu' action='/Statistics'>\n"
1160 " <menuitem name='Summary' action='/Statistics/Summary'/>\n"
1161 " <menuitem name='ProtocolHierarchy' action='/Statistics/ProtocolHierarchy'/>\n"
1162 " <menuitem name='Conversations' action='/Statistics/Conversations'/>\n"
1163 " <menuitem name='Endpoints' action='/Statistics/Endpoints'/>\n"
1164 " <menuitem name='PacketLengths' action='/Statistics/plen'/>\n"
1165 " <menuitem name='IOGraphs' action='/Statistics/IOGraphs'/>\n"
1167 " <menu name= 'ConversationListMenu' action='/Stataistics/ConversationList'>\n"
1168 " <menuitem name='Ethernet' action='/Stataistics/ConversationList/Ethernet'/>\n"
1169 " <menuitem name='FibreChannel' action='/Stataistics/ConversationList/FibreChannel'/>\n"
1170 " <menuitem name='FDDI' action='/Stataistics/ConversationList/FDDI'/>\n"
1171 " <menuitem name='IP' action='/Stataistics/ConversationList/IP'/>\n"
1172 " <menuitem name='IPv6' action='/Stataistics/ConversationList/IPv6'/>\n"
1173 " <menuitem name='JXTA' action='/Stataistics/ConversationList/JXTA'/>\n"
1174 " <menuitem name='NCP' action='/Stataistics/ConversationList/NCP'/>\n"
1175 " <menuitem name='RSVP' action='/Stataistics/ConversationList/RSVP'/>\n"
1176 " <menuitem name='SCTP' action='/Stataistics/ConversationList/SCTP'/>\n"
1177 " <menuitem name='TCPIP' action='/Stataistics/ConversationList/TCPIP'/>\n"
1178 " <menuitem name='TR' action='/Stataistics/ConversationList/TR'/>\n"
1179 " <menuitem name='UDPIP' action='/Stataistics/ConversationList/UDPIP'/>\n"
1180 " <menuitem name='USB' action='/Stataistics/ConversationList/USB'/>\n"
1181 " <menuitem name='WLAN' action='/Stataistics/ConversationList/WLAN'/>\n"
1183 " <menu name= 'EndpointListMenu' action='/Statistics/EndpointList'>\n"
1184 " <menuitem name='Ethernet' action='/Statistics/EndpointList/Ethernet'/>\n"
1185 " <menuitem name='FibreChannel' action='/Statistics/EndpointList/FibreChannel'/>\n"
1186 " <menuitem name='FDDI' action='/Statistics/EndpointList/FDDI'/>\n"
1187 " <menuitem name='IP' action='/Statistics/EndpointList/IP'/>\n"
1188 " <menuitem name='IPv6' action='/Statistics/EndpointList/IPv6'/>\n"
1189 " <menuitem name='JXTA' action='/Statistics/EndpointList/JXTA'/>\n"
1190 " <menuitem name='RSVP' action='/Statistics/EndpointList/RSVP'/>\n"
1191 " <menuitem name='SCTP' action='/Statistics/EndpointList/SCTP'/>\n"
1192 " <menuitem name='TCPIP' action='/Statistics/EndpointList/TCPIP'/>\n"
1193 " <menuitem name='TR' action='/Statistics/EndpointList/TR'/>\n"
1194 " <menuitem name='UDPIP' action='/Statistics/EndpointList/UDPIP'/>\n"
1195 " <menuitem name='USB' action='/Statistics/EndpointList/USB'/>\n"
1196 " <menuitem name='WLAN' action='/Statistics/EndpointList/WLAN'/>\n"
1198 " <menu name='ServiceResponseTimeMenu' action='/Statistics/ServiceResponseTime'>\n"
1199 " <menuitem name='AFP' action='/Statistics/ServiceResponseTime/AFP'/>\n"
1200 " <menuitem name='ONC-RPC' action='/Statistics/ServiceResponseTime/ONC-RPC'/>\n"
1201 " <menuitem name='Camel' action='/Statistics/ServiceResponseTime/Camel'/>\n"
1202 " <menuitem name='DCE-RPC' action='/Statistics/ServiceResponseTime/DCE-RPC'/>\n"
1203 " <menuitem name='Diameter' action='/Statistics/ServiceResponseTime/Diameter'/>\n"
1204 " <menuitem name='FibreChannel' action='/Statistics/ServiceResponseTime/FibreChannel'/>\n"
1205 " <menuitem name='GTP' action='/Statistics/ServiceResponseTime/GTP'/>\n"
1206 " <menuitem name='H225' action='/Statistics/ServiceResponseTime/H225'/>\n"
1207 " <menuitem name='LDAP' action='/Statistics/ServiceResponseTime/LDAP'/>\n"
1208 " <menuitem name='MEGACO' action='/Statistics/ServiceResponseTime/MEGACO'/>\n"
1209 " <menuitem name='MGCP' action='/Statistics/ServiceResponseTime/MGCP'/>\n"
1210 " <menuitem name='NCP' action='/Statistics/ServiceResponseTime/NCP'/>\n"
1211 " <menuitem name='RADIUS' action='/Statistics/ServiceResponseTime/RADIUS'/>\n"
1212 " <menuitem name='SCSI' action='/Statistics/ServiceResponseTime/SCSI'/>\n"
1213 " <menuitem name='SMB2' action='/Statistics/ServiceResponseTime/SMB2'/>\n"
1216 " <menuitem name='ANCP' action='/StatisticsMenu/ancp'/>\n"
1217 " <menu name= 'BACnetMenu' action='/StatisticsMenu/BACnet'>\n"
1218 " <menuitem name='bacapp_instanceid' action='/StatisticsMenu/BACnet/bacapp_instanceid'/>\n"
1219 " <menuitem name='bacapp_ip' action='/StatisticsMenu/BACnet/bacapp_ip'/>\n"
1220 " <menuitem name='bacapp_objectid' action='/StatisticsMenu/BACnet/bacapp_objectid'/>\n"
1221 " <menuitem name='bacapp_service' action='/StatisticsMenu/BACnet/bacapp_service'/>\n"
1223 " <menuitem name='BOOTP-DHCP' action='/StatisticsMenu/BOOTP-DHCP'/>\n"
1224 " <menuitem name='Collectd' action='/StatisticsMenu/collectd'/>\n"
1225 " <menuitem name='Compare' action='/StatisticsMenu/compare'/>\n"
1226 " <menuitem name='FlowGraph' action='/StatisticsMenu/FlowGraph'/>\n"
1227 " <menu name= 'HTTPMenu' action='/StatisticsMenu/HTTP'>\n"
1228 " <menuitem name='http' action='/StatisticsMenu/HTTP/http'/>\n"
1229 " <menuitem name='http_req' action='/StatisticsMenu/HTTP/http_req'/>\n"
1230 " <menuitem name='http_srv' action='/StatisticsMenu/HTTP/http_srv'/>\n"
1232 " <menuitem name='IPAddresses' action='/StatisticsMenu/ip_hosts'/>\n"
1233 " <menuitem name='IPDestinations' action='/StatisticsMenu/dests'/>\n"
1234 " <menuitem name='IPptype' action='/StatisticsMenu/ptype'/>\n"
1235 " <menuitem name='ONC-RPC-Programs' action='/StatisticsMenu/ONC-RPC-Programs'/>\n"
1236 " <menu name= 'SametimeMenu' action='/StatisticsMenu/Sametime'>\n"
1237 " <menuitem name='sametime' action='/StatisticsMenu/Sametime/sametime'/>\n"
1239 " <menu name= 'TCPStreamGraphMenu' action='/StatisticsMenu/TCPStreamGraphMenu'>\n"
1240 " <menuitem name='Sequence-Graph-Stevens' action='/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-Stevens'/>\n"
1241 " <menuitem name='Sequence-Graph-tcptrace' action='/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-tcptrace'/>\n"
1242 " <menuitem name='Throughput-Graph' action='/StatisticsMenu/TCPStreamGraphMenu/Throughput-Graph'/>\n"
1243 " <menuitem name='RTT-Graph' action='/StatisticsMenu/TCPStreamGraphMenu/RTT-Graph'/>\n"
1244 " <menuitem name='Window-Scaling-Graph' action='/StatisticsMenu/TCPStreamGraphMenu/Window-Scaling-Graph'/>\n"
1246 " <menuitem name='UDPMulticastStreams' action='/StatisticsMenu/UDPMulticastStreams'/>\n"
1247 " <menuitem name='WLANTraffic' action='/StatisticsMenu/WLANTraffic'/>\n"
1249 " <menu name= 'TelephonyMenu' action='/Telephony'>\n"
1250 " <menu name= 'ANSI' action='/Telephony/ANSI'>\n"
1251 " <menuitem name='BSMAP' action='/Telephony/ANSI/BSMAP'/>\n"
1252 " <menuitem name='DTAP' action='/Telephony/ANSI/DTAP'/>\n"
1253 " <menuitem name='MAP-OP' action='/Telephony/ANSI/MAP-OP'/>\n"
1255 " <menu name= 'GSM' action='/Telephony/GSM'>\n"
1256 " <menuitem name='BSSMAP' action='/Telephony/GSM/BSSMAP'/>\n"
1257 " <menu name='GSM-DTAP' action='/Telephony/GSM/DTAP'>\n"
1258 " <menuitem name='CallControl' action='/Telephony/GSM/DTAP/CC'/>\n"
1259 " <menuitem name='GPRS-MM' action='/Telephony/GSM/DTAP/GMM'/>\n"
1260 " <menuitem name='GPRS-SM' action='/Telephony/GSM/DTAP/SM'/>\n"
1261 " <menuitem name='MM' action='/Telephony/GSM/DTAP/MM'/>\n"
1262 " <menuitem name='RR' action='/Telephony/GSM/DTAP/RR'/>\n"
1263 " <menuitem name='SMS' action='/Telephony/GSM/DTAP/SMS'/>\n"
1264 " <menuitem name='TP' action='/Telephony/GSM/DTAP/TP'/>\n"
1265 " <menuitem name='SS' action='/Telephony/GSM/DTAP/SS'/>\n"
1267 " <menuitem name='SACCH' action='/Telephony/GSM/SACCH'/>\n"
1268 " <menuitem name='MAP-OP' action='/Telephony/GSM/MAP-OP'/>\n"
1269 " <menuitem name='MAP-Summary' action='/Telephony/GSM/MAPSummary'/>\n"
1271 " <menuitem name='H225' action='/Telephony/H225'/>\n"
1272 " <menu name= 'IAX2menu' action='/Telephony/IAX2'>\n"
1273 " <menuitem name='StreamAnalysis' action='/Telephony/IAX2/StreamAnalysis'/>\n"
1275 " <menuitem name='ISUP' action='/Telephony/isup_msg'/>\n"
1276 " <menu name= 'LTEmenu' action='/Telephony/LTE'>\n"
1277 " <menuitem name='LTE_MAC' action='/Telephony/LTE/MAC'/>\n"
1278 " <menuitem name='LTE_RLC' action='/Telephony/LTE/RLC'/>\n"
1280 " <menu name= 'MTP3menu' action='/Telephony/MTP3'>\n"
1281 " <menuitem name='MSUs' action='/Telephony/MTP3/MSUs'/>\n"
1282 " <menuitem name='MSUSummary' action='/Telephony/MTP3/MSUSummary'/>\n"
1284 " <menu name= 'RTPmenu' action='/Telephony/RTP'>\n"
1285 " <menuitem name='ShowAllStreams' action='/Telephony/RTP/ShowAllStreams'/>\n"
1286 " <menuitem name='StreamAnalysis' action='/Telephony/RTP/StreamAnalysis'/>\n"
1288 " <menu name= 'RTSPmenu' action='/Telephony/RTSP'>\n"
1289 " <menuitem name='rtsp' action='/Telephony/RTSP/rtsp'/>\n"
1291 " <menu name= 'SCTPmenu' action='/Telephony/SCTP'>\n"
1292 " <menuitem name='AnalysethisAssociation' action='/Telephony/SCTP/AnalysethisAssociation'/>\n"
1293 " <menuitem name='ShowAllAssociations' action='/Telephony/SCTP/ShowAllAssociations'/>\n"
1294 " <menuitem name='ChunkCounter' action='/Telephony/SCTP/ChunkCounter'/>\n"
1296 " <menuitem name='SIP' action='/Telephony/SIP'/>\n"
1297 " <menuitem name='SMPP' action='/Telephony/smpp_commands'/>\n"
1298 " <menuitem name='UCP' action='/Telephony/ucp_messages'/>\n"
1299 " <menuitem name='VoIPCalls' action='/Telephony/VoIPCalls'/>\n"
1300 " <menuitem name='WSP' action='/Telephony/WSP'/>\n"
1302 " <menu name= 'ToolsMenu' action='/Tools'>\n"
1303 " <menuitem name='FirewallACLRules' action='/Tools/FirewallACLRules'/>\n"
1304 " <menu name='LUA' action='/Tools/LUA'>\n"
1305 " <placeholder name='LUA-menu-items'/>\n"
1308 " <menu name= 'InternalsMenu' action='/Internals'>\n"
1309 " <menuitem name='Dissectortables' action='/Internals/Dissectortables'/>\n"
1310 " <menuitem name='SupportedProtocols' action='/Internals/SupportedProtocols'/>\n"
1312 " <menu name= 'HelpMenu' action='/Help'>\n"
1313 " <menuitem name='Contents' action='/Help/Contents'/>\n"
1314 " <menu name= 'ManualPages' action='/Help/ManualPages'>\n"
1315 " <menuitem name='Wireshark' action='/Help/ManualPages/Wireshark'/>\n"
1316 " <menuitem name='WiresharkFilter' action='/Help/ManualPages/WiresharkFilter'/>\n"
1318 " <menuitem name='TShark' action='/Help/ManualPages/TShark'/>\n"
1319 " <menuitem name='RawShark' action='/Help/ManualPages/RawShark'/>\n"
1320 " <menuitem name='Dumpcap' action='/Help/ManualPages/Dumpcap'/>\n"
1321 " <menuitem name='Mergecap' action='/Help/ManualPages/Mergecap'/>\n"
1322 " <menuitem name='Editcap' action='/Help/ManualPages/Editcap'/>\n"
1323 " <menuitem name='Text2pcap' action='/Help/ManualPages/Text2pcap'/>\n"
1326 " <menuitem name='Website' action='/Help/Website'/>\n"
1327 " <menuitem name='FAQs' action='/Help/FAQs'/>\n"
1328 " <menuitem name='Downloads' action='/Help/Downloads'/>\n"
1330 " <menuitem name='Wiki' action='/Help/Wiki'/>\n"
1331 " <menuitem name='SampleCaptures' action='/Help/SampleCaptures'/>\n"
1333 " <menuitem name='AboutWireshark' action='/Help/AboutWireshark'/>\n"
1342 * Please do not use keystrokes that are used as "universal" shortcuts in
1343 * various desktop environments:
1346 * http://support.microsoft.com/kb/126449
1349 * http://library.gnome.org/users/user-guide/nightly/keyboard-skills.html.en
1352 * http://developer.kde.org/documentation/standards/kde/style/keys/shortcuts.html
1354 * In particular, do not use the following <control> sequences for anything
1355 * other than their standard purposes:
1357 * <control>O File->Open
1358 * <control>S File->Save
1359 * <control>P File->Print
1360 * <control>W File->Close
1361 * <control>Q File->Quit
1362 * <control>Z Edit->Undo (which we don't currently have)
1363 * <control>X Edit->Cut (which we don't currently have)
1364 * <control>C Edit->Copy (which we don't currently have)
1365 * <control>V Edit->Paste (which we don't currently have)
1366 * <control>A Edit->Select All (which we don't currently have)
1368 * Note that some if not all of the Edit keys above already perform those
1369 * functions in text boxes, such as the Filter box. Do no, under any
1370 * circumstances, make a change that keeps them from doing so.
1376 * const gchar *name;
1377 * const gchar *stock_id;
1378 * const gchar *label;
1379 * const gchar *accelerator;
1380 * const gchar *tooltip;
1381 * GCallback callback;
1383 * const gchar *name; The name of the action.
1384 * const gchar *stock_id; The stock id for the action, or the name of an icon from the icon theme.
1385 * const gchar *label; The label for the action. This field should typically be marked for translation,
1386 * see gtk_action_group_set_translation_domain().
1387 * If label is NULL, the label of the stock item with id stock_id is used.
1388 * const gchar *accelerator; The accelerator for the action, in the format understood by gtk_accelerator_parse().
1389 * const gchar *tooltip; The tooltip for the action. This field should typically be marked for translation,
1390 * see gtk_action_group_set_translation_domain().
1391 * GCallback callback; The function to call when the action is activated.
1394 static const GtkActionEntry main_menu_bar_entries[] = {
1396 { "/File", NULL, "_File", NULL, NULL, NULL },
1397 { "/Edit", NULL, "_Edit", NULL, NULL, NULL },
1398 { "/View", NULL, "_View", NULL, NULL, NULL },
1399 { "/Go", NULL, "_Go", NULL, NULL, NULL },
1401 { "/Capture", NULL, "_Capture", NULL, NULL, NULL },
1403 { "/Analyze", NULL, "_Analyze", NULL, NULL, NULL },
1404 { "/Statistics", NULL, "_Statistics", NULL, NULL, NULL },
1405 { "/Telephony", NULL, "Telephon_y", NULL, NULL, NULL },
1406 { "/Tools", NULL, "_Tools", NULL, NULL, NULL },
1407 { "/Internals", NULL, "_Internals", NULL, NULL, NULL },
1408 { "/Help", NULL, "_Help", NULL, NULL, NULL },
1410 { "/File/Open", GTK_STOCK_OPEN, "_Open...", "<control>O", "Open a file", G_CALLBACK(file_open_cmd_cb) },
1411 { "/File/OpenRecent", NULL, "Open _Recent", NULL, NULL, NULL },
1412 { "/File/Merge", NULL, "_Merge...", NULL, NULL, G_CALLBACK(file_merge_cmd_cb) },
1413 { "/File/Import", NULL, "_Import...", NULL, NULL, G_CALLBACK(file_import_cmd_cb) },
1414 { "/File/Close", GTK_STOCK_CLOSE, "_Close", "<control>W", NULL, G_CALLBACK(file_close_cmd_cb) },
1416 { "/File/Save", GTK_STOCK_SAVE, "_Save", "<control>S", NULL, G_CALLBACK(file_save_cmd_cb) },
1417 { "/File/SaveAs", GTK_STOCK_SAVE_AS, "Save _As...", "<shift><control>S", NULL, G_CALLBACK(file_save_as_cmd_cb) },
1419 { "/File/Set", NULL, "File Set", NULL, NULL, NULL },
1420 { "/File/Export", NULL, "Export", NULL, NULL, NULL },
1421 { "/File/Print", GTK_STOCK_PRINT, "_Print...", "<control>P", NULL, G_CALLBACK(file_print_cmd_cb) },
1422 { "/File/Quit", GTK_STOCK_QUIT, "_Quit", "<control>Q", NULL, G_CALLBACK(file_quit_cmd_cb) },
1424 { "/File/Set/ListFiles", WIRESHARK_STOCK_FILE_SET_LIST, "List Files", NULL, NULL, G_CALLBACK(fileset_cb) },
1425 { "/File/Set/NextFile", WIRESHARK_STOCK_FILE_SET_NEXT, "Next File", NULL, NULL, G_CALLBACK(fileset_next_cb) },
1426 { "/File/Set/PreviousFile",WIRESHARK_STOCK_FILE_SET_PREVIOUS, "Previous File", NULL, NULL, G_CALLBACK(fileset_previous_cb) },
1428 { "/File/Export/File", NULL, "File", NULL, NULL, NULL },
1429 { "/File/Export/File/Text", NULL, "as \"Plain _Text\" file...", NULL, NULL, G_CALLBACK(export_text_cmd_cb) },
1432 { "/File/Export/File/PostScript", NULL, "as \"_PostScript\" file...", NULL, NULL, G_CALLBACK(export_ps_cmd_cb) },
1433 { "/File/Export/File/CSV", NULL, "as \"_CSV\" (Comma Separated Values packet summary) file...",
1434 NULL, NULL, G_CALLBACK(export_csv_cmd_cb) },
1435 { "/File/Export/File/CArrays", NULL, "as \"C _Arrays\" (packet bytes) file...",
1436 NULL, NULL, G_CALLBACK(export_carrays_cmd_cb) },
1437 { "/File/Export/File/PSML", NULL, "as XML - \"P_SML\" (packet summary) file...",
1438 NULL, NULL, G_CALLBACK(export_psml_cmd_cb) },
1439 { "/File/Export/File/PDML", NULL, "as XML - \"P_DML\" (packet details) file...",
1440 NULL, NULL, G_CALLBACK(export_pdml_cmd_cb) },
1442 { "/File/Export/SelectedPacketBytes", NULL, "Selected Packet _Bytes...", "<control>H", NULL, G_CALLBACK(savehex_cb) },
1443 { "/File/Export/SslSessionKeys", NULL, "SSL Session Keys...", NULL, NULL, G_CALLBACK(savesslkeys_cb) },
1444 { "/File/Export/Objects", NULL, "Objects", NULL, NULL, NULL },
1445 { "/File/Export/Objects/HTTP", NULL, "_HTTP", NULL, NULL, G_CALLBACK(eo_http_cb) },
1446 { "/File/Export/Objects/DICOM", NULL, "_DICOM", NULL, NULL, G_CALLBACK(eo_dicom_cb) },
1447 { "/File/Export/Objects/SMB", NULL, "_SMB", NULL, NULL, G_CALLBACK(eo_smb_cb) },
1450 { "/Edit/Copy", NULL, "Copy", NULL, NULL, NULL },
1452 { "/Edit/Copy/Description", NULL, "Description", "<shift><control>D", NULL, G_CALLBACK(copy_description_cb) },
1453 { "/Edit/Copy/Fieldname", NULL, "Fieldname", "<shift><control>F", NULL, G_CALLBACK(copy_fieldname_cb) },
1454 { "/Edit/Copy/Value", NULL, "Value", "<shift><control>V", NULL, G_CALLBACK(copy_value_cb) },
1455 { "/Edit/Copy/AsFilter", NULL, "As Filter", "<shift><control>C", NULL, G_CALLBACK(copy_as_filter_cb) },
1459 * Un-#if this when we actually implement Cut/Copy/Paste for the
1460 * packet list and packet detail windows.
1462 * Note: when we implement Cut/Copy/Paste in those windows, we
1463 * will almost certainly want to allow multiple packets to be
1464 * selected in the packet list pane and multiple packet detail
1465 * items to be selected in the packet detail pane, so that
1466 * the user can, for example, copy the summaries of multiple
1467 * packets to the clipboard from the packet list pane and multiple
1468 * packet detail items - perhaps *all* packet detail items - from
1469 * the packet detail pane. Given that, we'll also want to
1470 * implement Select All.
1472 * If multiple packets are selected, we would probably display nothing
1473 * in the packet detail pane, just as we do if no packet is selected,
1474 * and any menu items etc. that would pertain only to a single packet
1475 * would be disabled.
1477 * If multiple packet detail items are selected, we would probably
1478 * disable all items that pertain only to a single packet detail
1479 * item, such as some items in the status bar.
1481 * XXX - the actions for these will be different depending on what
1482 * widget we're in; ^C should copy from the filter text widget if
1483 * we're in that widget, the packet list if we're in that widget
1484 * (presumably copying the summaries of selected packets to the
1485 * clipboard, e.g. the text copy would be the text of the columns),
1486 * the packet detail if we're in that widget (presumably copying
1487 * the contents of selected protocol tree items to the clipboard,
1488 * e.g. the text copy would be the text displayed for those items),
1491 * Given that those menu items should also affect text widgets
1492 * such as the filter box, we would again want Select All, and,
1493 * at least for the filter box, we would also want Undo and Redo.
1494 * We would only want Cut, Paste, Undo, and Redo for the packet
1495 * list and packet detail panes if we support modifying them.
1497 {"/Edit/_Undo", "<control>Z", NULL,
1498 0, "<StockItem>", GTK_STOCK_UNDO,},
1499 {"/Edit/_Redo", "<shift><control>Z", NULL,
1500 0, "<StockItem>", GTK_STOCK_REDO,},
1501 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1502 {"/Edit/Cu_t", "<control>X", NULL,
1503 0, "<StockItem>", GTK_STOCK_CUT,},
1504 {"/Edit/_Copy", "<control>C", NULL,
1505 0, "<StockItem>", GTK_STOCK_COPY,},
1506 {"/Edit/_Paste", "<control>V", NULL,
1507 0, "<StockItem>", GTK_STOCK_PASTE,},
1508 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1509 {"/Edit/Select _All", "<control>A", NULL, 0,
1510 #ifdef GTK_STOCK_SELECT_ALL /* first appeared in 2.10 */
1511 "<StockItem>", GTK_STOCK_SELECT_ALL,
1514 #endif /* GTK_STOCK_SELECT_ALL */
1516 { "/Edit/FindPacket", GTK_STOCK_FIND, "_Find Packet...", "<control>F", NULL, G_CALLBACK(find_frame_cb) },
1517 { "/Edit/FindNext", NULL, "Find Ne_xt", "<control>N", NULL, G_CALLBACK(find_next_cb) },
1518 { "/Edit/FindPrevious", NULL, "Find Pre_vious", "<control>B", NULL, G_CALLBACK(find_previous_cb) },
1520 { "/Edit/MarkPacket", NULL, "_Mark Packet (toggle)", "<control>M", NULL, G_CALLBACK(new_packet_list_mark_frame_cb) },
1521 { "/Edit/ToggleMarkingOfAllDisplayedPackets", NULL, "Toggle Marking Of All Displayed Packets", "<shift><alt><control>M", NULL, G_CALLBACK(new_packet_list_toggle_mark_all_displayed_frames_cb) },
1522 { "/Edit/MarkAllDisplayedPackets", NULL, "Mark All Displayed Packets", "<shift><control>M", NULL, G_CALLBACK(new_packet_list_mark_all_displayed_frames_cb) },
1523 { "/Edit/UnmarkAllDisplayedPackets", NULL, "_Unmark All Displayed Packets", "<alt><control>M", NULL, G_CALLBACK(new_packet_list_unmark_all_displayed_frames_cb) },
1524 { "/Edit/FindNextMark", NULL, "Find Next Mark", "<shift><control>N", NULL, G_CALLBACK(find_next_mark_cb) },
1525 { "/Edit/FindPreviousMark", NULL, "Find Next Mark", "<shift><control>B", NULL, G_CALLBACK(find_prev_mark_cb) },
1527 { "/Edit/IgnorePacket", NULL, "_Ignore Packet (toggle)", "<control>X", NULL, G_CALLBACK(new_packet_list_ignore_frame_cb) },
1529 * XXX - this next one overrides /Edit/Copy/Description
1531 { "/Edit/IgnoreAllDisplayedPackets", NULL, "_Ignore All Displayed Packets (toggle)","<alt><shift><control>X", NULL, G_CALLBACK(new_packet_list_ignore_all_displayed_frames_cb) },
1532 { "/Edit/Un-IgnoreAllPackets", NULL, "U_n-Ignore All Packets", "<shift><control>X", NULL, G_CALLBACK(new_packet_list_unignore_all_frames_cb) },
1533 { "/Edit/SetTimeReference", WIRESHARK_STOCK_TIME, "Set Time Reference (toggle)", "<control>T", NULL, G_CALLBACK(set_reftime_cb) },
1534 { "/Edit/Un-TimeReferenceAllPackets",NULL, "Un-Time Reference All Packets", "<alt><control>T", NULL, G_CALLBACK(new_packet_list_untime_reference_all_frames_cb) },
1535 { "/Edit/FindNextTimeReference", NULL, "Find Next Time Reference", "<alt><control>N", NULL, G_CALLBACK(find_next_ref_time_cb) },
1536 { "/Edit/FindPreviousTimeReference", NULL, "Find Previous Time Reference", "<alt><control>B", NULL, G_CALLBACK(find_previous_ref_time_cb) },
1537 { "/Edit/TimeShift", WIRESHARK_STOCK_TIME, "Time Shift...", "<shift><control>T", NULL, G_CALLBACK(time_shift_cb) },
1539 { "/Edit/ConfigurationProfiles", NULL, "_Configuration Profiles...", "<shift><control>A", NULL, G_CALLBACK(profile_dialog_cb) },
1540 { "/Edit/Preferences", GTK_STOCK_PREFERENCES, "_Preferences...", "<shift><control>P", NULL, G_CALLBACK(menus_prefs_cb) },
1541 #ifdef WANT_PACKET_EDITOR
1542 { "/Edit/EditPacket", NULL, "_Edit Packet", NULL, NULL, G_CALLBACK(edit_window_cb) },
1546 { "/View/TimeDisplayFormat", NULL, "_Time Display Format", NULL, NULL, NULL },
1548 { "/View/NameResolution", NULL, "Name Resol_ution", NULL, NULL, NULL },
1549 { "/View/ZoomIn", GTK_STOCK_ZOOM_IN, "_Zoom In", "<control>plus", NULL, G_CALLBACK(view_zoom_in_cb) },
1550 { "/View/ZoomOut", GTK_STOCK_ZOOM_OUT, "Zoom _Out", "<control>minus", NULL, G_CALLBACK(view_zoom_out_cb) },
1551 { "/View/NormalSize", GTK_STOCK_ZOOM_100, "_Normal Size", "<control>equal", NULL, G_CALLBACK(view_zoom_100_cb) },
1552 { "/View/ResizeAllColumns", WIRESHARK_STOCK_RESIZE_COLUMNS, "Resize All Columns", "<shift><control>R", NULL, G_CALLBACK(new_packet_list_resize_columns_cb) },
1553 { "/View/DisplayedColumns", NULL, "Displayed Columns", NULL, NULL, NULL },
1554 { "/View/ExpandSubtrees", NULL, "Expand Subtrees", NULL, NULL, G_CALLBACK(expand_tree_cb) },
1555 { "/View/ExpandAll", NULL, "Expand All", NULL, NULL, G_CALLBACK(expand_all_cb) },
1556 { "/View/CollapseAll", NULL, "Collapse All", NULL, NULL, G_CALLBACK(collapse_all_cb) },
1557 { "/View/ColorizeConversation", NULL, "Colorize Conversation",NULL, NULL, NULL },
1559 { "/View/ColorizeConversation/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(view_menu_color_conv_color1_cb) },
1560 { "/View/ColorizeConversation/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(view_menu_color_conv_color2_cb) },
1561 { "/View/ColorizeConversation/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(view_menu_color_conv_color3_cb) },
1562 { "/View/ColorizeConversation/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(view_menu_color_conv_color4_cb) },
1563 { "/View/ColorizeConversation/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(view_menu_color_conv_color5_cb) },
1564 { "/View/ColorizeConversation/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(view_menu_color_conv_color6_cb) },
1565 { "/View/ColorizeConversation/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(view_menu_color_conv_color7_cb) },
1566 { "/View/ColorizeConversation/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(view_menu_color_conv_color8_cb) },
1567 { "/View/ColorizeConversation/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(view_menu_color_conv_color9_cb) },
1568 { "/View/ColorizeConversation/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(view_menu_color_conv_color10_cb) },
1569 { "/View/ColorizeConversation/NewColoringRule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(view_menu_color_conv_new_rule_cb) },
1571 { "/View/ResetColoring1-10", NULL, "Reset Coloring 1-10", "<control>space", NULL, G_CALLBACK(view_menu_reset_coloring_cb) },
1572 { "/View/ColoringRules", GTK_STOCK_SELECT_COLOR, "_Coloring Rules...", NULL, NULL, G_CALLBACK(color_display_cb) },
1573 { "/View/ShowPacketinNewWindow", NULL, "Show Packet in New _Window", NULL, NULL, G_CALLBACK(new_window_cb) },
1574 { "/View/Reload", GTK_STOCK_REFRESH, "_Reload", "<control>R", NULL, G_CALLBACK(file_reload_cmd_cb) },
1577 { "/Go/Back", GTK_STOCK_GO_BACK, "_Back", "<alt>Left", NULL, G_CALLBACK(history_back_cb) },
1578 { "/Go/Forward", GTK_STOCK_GO_FORWARD, "_Forward", "<alt>Right", NULL, G_CALLBACK(history_forward_cb) },
1579 { "/Go/Goto", GTK_STOCK_JUMP_TO, "_Go to Packet...", "<control>G", NULL, G_CALLBACK(goto_frame_cb) },
1580 { "/Go/GotoCorrespondingPacket", NULL, "Go to _Corresponding Packet", NULL, NULL, G_CALLBACK(goto_framenum_cb) },
1581 { "/Go/PreviousPacket", GTK_STOCK_GO_UP, "Previous Packet", "<control>Up", NULL, G_CALLBACK(goto_previous_frame_cb) },
1582 { "/Go/NextPacket", GTK_STOCK_GO_DOWN, "Next Packet", "<control>Down", NULL, G_CALLBACK(goto_next_frame_cb) },
1583 { "/Go/FirstPacket", GTK_STOCK_GOTO_TOP, "F_irst Packet", "<control>Home", NULL, G_CALLBACK(goto_top_frame_cb) },
1584 { "/Go/LastPacket", GTK_STOCK_GOTO_BOTTOM, "_Last Packet", "<control>End", NULL, G_CALLBACK(goto_bottom_frame_cb) },
1585 { "/Go/PreviousPacketInConversation", GTK_STOCK_GO_UP, "Previous Packet In Conversation", "<control>comma", NULL, G_CALLBACK(goto_previous_frame_conversation_cb) },
1586 { "/Go/NextPacketInConversation", GTK_STOCK_GO_DOWN, "Next Packet In Conversation", "<control>period", NULL, G_CALLBACK(goto_next_frame_conversation_cb) },
1589 { "/Capture/Interfaces", WIRESHARK_STOCK_CAPTURE_INTERFACES, "_Interfaces...", "<control>I", NULL, G_CALLBACK(capture_if_cb) },
1590 { "/Capture/Options", WIRESHARK_STOCK_CAPTURE_OPTIONS, "_Options...", "<control>K", NULL, G_CALLBACK(capture_prep_cb) },
1591 { "/Capture/Start", WIRESHARK_STOCK_CAPTURE_START, "_Start", "<control>E", NULL, G_CALLBACK(capture_start_cb) },
1592 { "/Capture/Stop", WIRESHARK_STOCK_CAPTURE_STOP, "S_top", "<control>E", NULL, G_CALLBACK(capture_stop_cb) },
1593 { "/Capture/Restart", WIRESHARK_STOCK_CAPTURE_RESTART, "_Restart", "<control>R", NULL, G_CALLBACK(capture_restart_cb) },
1594 { "/Capture/CaptureFilters", WIRESHARK_STOCK_CAPTURE_FILTER, "Capture _Filters...", NULL, NULL, G_CALLBACK(cfilter_dialog_cb) },
1596 #endif /* HAVE_LIBPCAP */
1597 { "/Analyze/DisplayFilters", WIRESHARK_STOCK_DISPLAY_FILTER, "_Display Filters...", NULL, NULL, G_CALLBACK(dfilter_dialog_cb) },
1599 { "/Analyze/DisplayFilterMacros", NULL, "Display Filter _Macros...", NULL, NULL, G_CALLBACK(macros_dialog_cb) },
1600 { "/Analyze/ApplyasColumn", NULL, "Apply as Column", NULL, NULL, G_CALLBACK(apply_as_custom_column_cb) },
1601 { "/Analyze/ApplyasFilter", NULL, "Apply as Filter", NULL, NULL, NULL },
1603 { "/Analyze/ApplyasFilter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(tree_view_menu_apply_selected_cb) },
1604 { "/Analyze/ApplyasFilter/NotSelected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_not_selected_cb) },
1605 { "/Analyze/ApplyasFilter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_and_selected_cb) },
1606 { "/Analyze/ApplyasFilter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_or_selected_cb) },
1607 { "/Analyze/ApplyasFilter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_and_not_selected_cb) },
1608 { "/Analyze/ApplyasFilter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_or_not_selected_cb) },
1610 { "/Analyze/PrepareaFilter", NULL, "Prepare a Filter", NULL, NULL, NULL },
1611 { "/Analyze/PrepareaFilter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(tree_view_menu_prepare_selected_cb) },
1612 { "/Analyze/PrepareaFilter/NotSelected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_not_selected_cb) },
1613 { "/Analyze/PrepareaFilter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_and_selected_cb) },
1614 { "/Analyze/PrepareaFilter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_or_selected_cb) },
1615 { "/Analyze/PrepareaFilter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_and_not_selected_cb) },
1616 { "/Analyze/PrepareaFilter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_or_not_selected_cb) },
1618 { "/Analyze/EnabledProtocols", WIRESHARK_STOCK_CHECKBOX, "_Enabled Protocols...", "<shift><control>E", NULL, G_CALLBACK(proto_cb) },
1619 { "/Analyze/DecodeAs", WIRESHARK_STOCK_DECODE_AS, "Decode _As...", NULL, NULL, G_CALLBACK(decode_as_cb) },
1620 { "/Analyze/UserSpecifiedDecodes", WIRESHARK_STOCK_DECODE_AS, "_User Specified Decodes...", NULL, NULL, G_CALLBACK(decode_show_cb) },
1622 { "/Analyze/FollowTCPStream", NULL, "Follow TCP Stream", NULL, NULL, G_CALLBACK(follow_tcp_stream_cb) },
1623 { "/Analyze/FollowUDPStream", NULL, "Follow UDP Stream", NULL, NULL, G_CALLBACK(follow_udp_stream_cb) },
1624 { "/Analyze/FollowSSLStream", NULL, "Follow SSL Stream", NULL, NULL, G_CALLBACK(follow_ssl_stream_cb) },
1626 { "/Analyze/ExpertInfoComposite",WIRESHARK_STOCK_EXPERT_INFO, "Expert Info _Composite", NULL, NULL, G_CALLBACK(expert_comp_dlg_launch) },
1628 { "/Analyze/ConversationFilter", NULL, "Conversation Filter", NULL, NULL, NULL },
1631 { "/Stataistics/ConversationList", NULL, "_Conversation List", NULL, NULL, NULL },
1632 { "/Stataistics/ConversationList/Ethernet", WIRESHARK_STOCK_CONVERSATIONS, "Ethernet", NULL, NULL, G_CALLBACK(eth_endpoints_cb) },
1633 { "/Stataistics/ConversationList/FibreChannel", WIRESHARK_STOCK_CONVERSATIONS, "Fibre Channel", NULL, NULL, G_CALLBACK(fc_endpoints_cb) },
1634 { "/Stataistics/ConversationList/FDDI", WIRESHARK_STOCK_CONVERSATIONS, "FDDI", NULL, NULL, G_CALLBACK(fddi_endpoints_cb) },
1635 { "/Stataistics/ConversationList/IP", WIRESHARK_STOCK_CONVERSATIONS, "IPv4", NULL, NULL, G_CALLBACK(ip_endpoints_cb) },
1636 { "/Stataistics/ConversationList/IPv6", WIRESHARK_STOCK_CONVERSATIONS, "IPv6", NULL, NULL, G_CALLBACK(ipv6_endpoints_cb) },
1637 { "/Stataistics/ConversationList/IPX", WIRESHARK_STOCK_CONVERSATIONS, "IPX", NULL, NULL, G_CALLBACK(ipx_endpoints_cb) },
1638 { "/Stataistics/ConversationList/JXTA", WIRESHARK_STOCK_CONVERSATIONS, "JXTA", NULL, NULL, G_CALLBACK(jxta_conversation_cb) },
1639 { "/Stataistics/ConversationList/NCP", WIRESHARK_STOCK_CONVERSATIONS, "NCP", NULL, NULL, G_CALLBACK(ncp_endpoints_cb) },
1640 { "/Stataistics/ConversationList/RSVP", WIRESHARK_STOCK_CONVERSATIONS, "RSVP", NULL, NULL, G_CALLBACK(rsvp_endpoints_cb) },
1641 { "/Stataistics/ConversationList/SCTP", WIRESHARK_STOCK_CONVERSATIONS, "SCTP", NULL, NULL, G_CALLBACK(sctp_conversation_cb) },
1642 { "/Stataistics/ConversationList/TCPIP", WIRESHARK_STOCK_CONVERSATIONS, "TCP (IPv4 & IPv6)", NULL, NULL, G_CALLBACK(tcpip_conversation_cb) },
1643 { "/Stataistics/ConversationList/TR", WIRESHARK_STOCK_CONVERSATIONS, "Token Ring", NULL, NULL, G_CALLBACK(tr_conversation_cb) },
1644 { "/Stataistics/ConversationList/UDPIP", WIRESHARK_STOCK_CONVERSATIONS, "UDP (IPv4 & IPv6)", NULL, NULL, G_CALLBACK(udpip_conversation_cb) },
1645 { "/Stataistics/ConversationList/USB", WIRESHARK_STOCK_CONVERSATIONS, "USB", NULL, NULL, G_CALLBACK(usb_endpoints_cb) },
1646 { "/Stataistics/ConversationList/WLAN", WIRESHARK_STOCK_CONVERSATIONS, "WLAN", NULL, NULL, G_CALLBACK(wlan_endpoints_cb) },
1648 { "/Statistics/EndpointList", NULL, "_Endpoint List", NULL, NULL, NULL },
1649 { "/Statistics/EndpointList/Ethernet", WIRESHARK_STOCK_ENDPOINTS, "Ethernet", NULL, NULL, G_CALLBACK(gtk_eth_hostlist_cb) },
1650 { "/Statistics/EndpointList/FibreChannel", WIRESHARK_STOCK_ENDPOINTS, "Fibre Channel", NULL, NULL, G_CALLBACK(gtk_fc_hostlist_cb) },
1651 { "/Statistics/EndpointList/FDDI", WIRESHARK_STOCK_ENDPOINTS, "FDDI", NULL, NULL, G_CALLBACK(gtk_fddi_hostlist_cb) },
1652 { "/Statistics/EndpointList/IP", WIRESHARK_STOCK_ENDPOINTS, "IPv4", NULL, NULL, G_CALLBACK(gtk_ip_hostlist_cb) },
1653 { "/Statistics/EndpointList/IPv6", WIRESHARK_STOCK_ENDPOINTS, "IPv6", NULL, NULL, G_CALLBACK(gtk_ipv6_hostlist_cb) },
1654 { "/Statistics/EndpointList/IPX", WIRESHARK_STOCK_ENDPOINTS, "IPX", NULL, NULL, G_CALLBACK(gtk_ipx_hostlist_cb) },
1655 { "/Statistics/EndpointList/JXTA", WIRESHARK_STOCK_ENDPOINTS, "JXTA", NULL, NULL, G_CALLBACK(gtk_jxta_hostlist_cb) },
1656 { "/Statistics/EndpointList/NCP", WIRESHARK_STOCK_ENDPOINTS, "NCP", NULL, NULL, G_CALLBACK(gtk_ncp_hostlist_cb) },
1657 { "/Statistics/EndpointList/RSVP", WIRESHARK_STOCK_ENDPOINTS, "RSVP", NULL, NULL, G_CALLBACK(gtk_rsvp_hostlist_cb) },
1658 { "/Statistics/EndpointList/SCTP", WIRESHARK_STOCK_ENDPOINTS, "SCTP", NULL, NULL, G_CALLBACK(gtk_sctp_hostlist_cb) },
1659 { "/Statistics/EndpointList/TCPIP", WIRESHARK_STOCK_ENDPOINTS, "TCP (IPv4 & IPv6)", NULL, NULL, G_CALLBACK(gtk_tcpip_hostlist_cb) },
1660 { "/Statistics/EndpointList/TR", WIRESHARK_STOCK_ENDPOINTS, "Token Ring", NULL, NULL, G_CALLBACK(gtk_tr_hostlist_cb) },
1661 { "/Statistics/EndpointList/UDPIP", WIRESHARK_STOCK_ENDPOINTS, "UDP (IPv4 & IPv6)", NULL, NULL, G_CALLBACK(gtk_udpip_hostlist_cb) },
1662 { "/Statistics/EndpointList/USB", WIRESHARK_STOCK_ENDPOINTS, "USB", NULL, NULL, G_CALLBACK(gtk_usb_hostlist_cb) },
1663 { "/Statistics/EndpointList/WLAN", WIRESHARK_STOCK_ENDPOINTS, "WLAN", NULL, NULL, G_CALLBACK(gtk_wlan_hostlist_cb) },
1665 { "/Statistics/ServiceResponseTime", NULL, "Service _Response Time", NULL, NULL, NULL },
1666 { "/Statistics/ServiceResponseTime/ONC-RPC", WIRESHARK_STOCK_TIME, "ONC-RPC...", NULL, NULL, G_CALLBACK(gtk_rpcstat_cb) },
1667 { "/Statistics/ServiceResponseTime/AFP", WIRESHARK_STOCK_TIME, "AFP...", NULL, NULL, G_CALLBACK(afp_srt_stat_cb) },
1668 { "/Statistics/ServiceResponseTime/Camel", WIRESHARK_STOCK_TIME, "Camel...", NULL, NULL, G_CALLBACK(camel_srt_cb) },
1669 { "/Statistics/ServiceResponseTime/DCE-RPC", WIRESHARK_STOCK_TIME, "DCE-RPC...", NULL, NULL, G_CALLBACK(gtk_dcerpcstat_cb) },
1670 { "/Statistics/ServiceResponseTime/Diameter", WIRESHARK_STOCK_TIME, "Diameter...", NULL, NULL, G_CALLBACK(diameter_srt_cb) },
1671 { "/Statistics/ServiceResponseTime/FibreChannel", WIRESHARK_STOCK_TIME, "Fibre Channel...", NULL, NULL, G_CALLBACK(fc_srt_cb) },
1672 { "/Statistics/ServiceResponseTime/GTP", WIRESHARK_STOCK_TIME, "GTP...", NULL, NULL, G_CALLBACK(gtp_srt_cb) },
1673 { "/Statistics/ServiceResponseTime/H225", WIRESHARK_STOCK_TIME, "H225...", NULL, NULL, G_CALLBACK(h225_srt_cb) },
1674 { "/Statistics/ServiceResponseTime/LDAP", WIRESHARK_STOCK_TIME, "LDAP...", NULL, NULL, G_CALLBACK(ldap_srt_cb) },
1675 { "/Statistics/ServiceResponseTime/MEGACO", WIRESHARK_STOCK_TIME, "MEGACO...", NULL, NULL, G_CALLBACK(megaco_srt_cb) },
1676 { "/Statistics/ServiceResponseTime/MGCP", WIRESHARK_STOCK_TIME, "MGCP...", NULL, NULL, G_CALLBACK(mgcp_srt_cb) },
1677 { "/Statistics/ServiceResponseTime/NCP", WIRESHARK_STOCK_TIME, "NCP...", NULL, NULL, G_CALLBACK(ncp_srt_cb) },
1678 { "/Statistics/ServiceResponseTime/RADIUS", WIRESHARK_STOCK_TIME, "RADIUS...", NULL, NULL, G_CALLBACK(radius_srt_cb) },
1679 { "/Statistics/ServiceResponseTime/SCSI", WIRESHARK_STOCK_TIME, "SCSI...", NULL, NULL, G_CALLBACK(scsi_srt_cb) },
1680 { "/Statistics/ServiceResponseTime/SMB", WIRESHARK_STOCK_TIME, "SMB...", NULL, NULL, G_CALLBACK(smb_srt_cb) },
1681 { "/Statistics/ServiceResponseTime/SMB2", WIRESHARK_STOCK_TIME, "SMB2...", NULL, NULL, G_CALLBACK(smb2_srt_cb) },
1683 { "/StatisticsMenu/ancp", NULL, "ANCP", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1684 { "/StatisticsMenu/BACnet", NULL, "BACnet", NULL, NULL, NULL },
1685 { "/StatisticsMenu/BACnet/bacapp_instanceid", NULL, "Packets sorted by Instance ID", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1686 { "/StatisticsMenu/BACnet/bacapp_ip", NULL, "Packets sorted by IP", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1687 { "/StatisticsMenu/BACnet/bacapp_objectid", NULL, "Packets sorted by Object Type", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1688 { "/StatisticsMenu/BACnet/bacapp_service", NULL, "Packets sorted by Service", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1689 { "/StatisticsMenu/BOOTP-DHCP", NULL, "BOOTP-DHCP...", NULL, NULL, G_CALLBACK(bootp_dhcp_stat_cb) },
1691 { "/StatisticsMenu/collectd", NULL, "Collectd...", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1692 { "/StatisticsMenu/compare", NULL, "Compare...", NULL, NULL, G_CALLBACK(gtk_comparestat_cb) },
1693 { "/StatisticsMenu/FlowGraph", WIRESHARK_STOCK_FLOW_GRAPH, "Flo_w Graph...", NULL, NULL, G_CALLBACK(flow_graph_launch) },
1694 { "/StatisticsMenu/HTTP", NULL, "HTTP", NULL, NULL, NULL },
1695 { "/StatisticsMenu/HTTP/http", NULL, "Packet Counter", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1696 { "/StatisticsMenu/HTTP/http_req", NULL, "Requests", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1697 { "/StatisticsMenu/HTTP/http_srv", NULL, "Load Distribution", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1699 { "/StatisticsMenu/ip_hosts", NULL, "IP Addresses...", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1700 { "/StatisticsMenu/dests", NULL, "IP Destinations...", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1701 { "/StatisticsMenu/ptype", NULL, "IP Protocol Types..", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1702 { "/StatisticsMenu/ONC-RPC-Programs", NULL, "ONC-RPC Programs", NULL, NULL, G_CALLBACK(gtk_rpcprogs_cb) },
1703 { "/StatisticsMenu/Sametime", NULL, "Sametime", NULL, NULL, NULL },
1704 { "/StatisticsMenu/Sametime/sametime", NULL, "Messages", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1705 { "/StatisticsMenu/TCPStreamGraphMenu", NULL, "TCP StreamGraph", NULL, NULL, NULL },
1706 { "/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-Stevens", NULL, "Time-Sequence Graph (Stevens)", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1707 { "/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-tcptrace", NULL, "Time-Sequence Graph (tcptrace)", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1708 { "/StatisticsMenu/TCPStreamGraphMenu/Throughput-Graph", NULL, "Throughput Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1709 { "/StatisticsMenu/TCPStreamGraphMenu/RTT-Graph", NULL, "Round Trip Time Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1710 { "/StatisticsMenu/TCPStreamGraphMenu/Window-Scaling-Graph", NULL, "Window Scaling Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1712 { "/StatisticsMenu/UDPMulticastStreams", NULL, "UDP Multicast Streams", NULL, NULL, G_CALLBACK(mcaststream_launch) },
1713 { "/StatisticsMenu/WLANTraffic", NULL, "WLAN Traffic", NULL, NULL, G_CALLBACK(wlanstat_launch) },
1715 { "/Statistics/Summary", GTK_STOCK_PROPERTIES, "_Summary", NULL, NULL, G_CALLBACK(summary_open_cb) },
1716 { "/Statistics/ProtocolHierarchy", NULL, "_Protocol Hierarchy", NULL, NULL, G_CALLBACK(proto_hier_stats_cb) },
1717 { "/Statistics/Conversations", WIRESHARK_STOCK_CONVERSATIONS, "Conversations", NULL, NULL, G_CALLBACK(init_conversation_notebook_cb) },
1718 { "/Statistics/Endpoints", WIRESHARK_STOCK_ENDPOINTS, "Endpoints", NULL, NULL, G_CALLBACK(init_hostlist_notebook_cb) },
1719 { "/Statistics/IOGraphs", WIRESHARK_STOCK_GRAPHS, "_IO Graph", NULL, NULL, G_CALLBACK(gui_iostat_cb) },
1720 { "/Statistics/plen", NULL, "Packet Lengths...", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1722 { "/Telephony/ANSI", NULL, "_ANSI", NULL, NULL, NULL },
1723 { "/Telephony/ANSI/BSMAP", NULL, "A-Interface BSMAP", NULL, NULL, G_CALLBACK(ansi_a_stat_gtk_bsmap_cb) },
1724 { "/Telephony/ANSI/DTAP", NULL, "A-Interface DTAP", NULL, NULL, G_CALLBACK(ansi_a_stat_gtk_dtap_cb) },
1725 { "/Telephony/ANSI/MAP-OP", NULL, "MAP Operation", NULL, NULL, G_CALLBACK(ansi_map_stat_gtk_cb) },
1727 { "/Telephony/GSM", NULL, "_GSM", NULL, NULL, NULL },
1728 { "/Telephony/GSM/CAMEL", NULL, "CAMEL Messages and Response Status", NULL, NULL, G_CALLBACK(camel_counter_cb) },
1729 { "/Telephony/GSM/BSSMAP", NULL, "_GSM/A-Interface BSSMAP", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_bssmap_cb) },
1731 { "/Telephony/GSM/DTAP", NULL, "_GSM/A-Interface DTAP", NULL, NULL, NULL },
1732 { "/Telephony/GSM/DTAP/CC", NULL, "Call Control", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_cc_cb) },
1733 { "/Telephony/GSM/DTAP/GMM", NULL, "GPRS Mobility Management", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_gmm_cb) },
1734 { "/Telephony/GSM/DTAP/SM", NULL, "GPRS Session Management", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_sm_cb) },
1735 { "/Telephony/GSM/DTAP/MM", NULL, "Mobility Management", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_mm_cb) },
1736 { "/Telephony/GSM/DTAP/RR", NULL, "Radio Resource Management",NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_rr_cb) },
1737 { "/Telephony/GSM/DTAP/SMS", NULL, "Short Message Service", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_sms_cb) },
1738 { "/Telephony/GSM/DTAP/TP", NULL, "Special Conformance Testing Functions", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_tp_cb) },
1739 { "/Telephony/GSM/DTAP/SS", NULL, "Supplementary Services", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_ss_cb) },
1741 { "/Telephony/GSM/SACCH", NULL, "_GSM/A-Interface SACCH", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_sacch_rr_cb) },
1742 { "/Telephony/GSM/MAP-OP", NULL, "_GSM/MAP Operation", NULL, NULL, G_CALLBACK(gsm_map_stat_gtk_cb) },
1743 { "/Telephony/GSM/MAPSummary", NULL, "MAP Summary", NULL, NULL, G_CALLBACK(gsm_map_stat_gtk_sum_cb) },
1745 { "/Telephony/H225", NULL, "_H.225...", NULL, NULL, G_CALLBACK(h225_counter_cb) },
1747 { "/Telephony/IAX2", NULL, "IA_X2", NULL, NULL, NULL },
1748 { "/Telephony/IAX2/StreamAnalysis", NULL, "Stream Analysis...", NULL, NULL, G_CALLBACK(iax2_analysis_cb) },
1750 { "/Telephony/isup_msg", NULL, "_ISUP Messages", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1752 { "/Telephony/LTE", NULL, "_LTE", NULL, NULL, NULL },
1753 { "/Telephony/LTE/MAC", NULL, "_MAC...", NULL, NULL, G_CALLBACK(mac_lte_stat_cb) },
1754 { "/Telephony/LTE/RLC", NULL, "_RLC...", NULL, NULL, G_CALLBACK(rlc_lte_stat_cb) },
1755 { "/Telephony/MTP3", NULL, "_MTP3", NULL, NULL, NULL },
1756 { "/Telephony/MTP3/MSUs", NULL, "MSUs", NULL, NULL, G_CALLBACK(mtp3_stat_gtk_cb) },
1757 { "/Telephony/MTP3/MSUSummary", NULL, "MSU Summary", NULL, NULL, G_CALLBACK(mtp3_sum_gtk_sum_cb) },
1758 { "/Telephony/RTP", NULL, "_RTP", NULL, NULL, NULL },
1759 { "/Telephony/RTP/StreamAnalysis", NULL, "Stream Analysis...", NULL, NULL, G_CALLBACK(rtp_analysis_cb) },
1760 { "/Telephony/RTP/ShowAllStreams", NULL, "Show All Streams", NULL, NULL, G_CALLBACK(rtpstream_launch) },
1761 { "/Telephony/RTSP", NULL, "RTSP", NULL, NULL, NULL },
1762 { "/Telephony/RTSP/rtsp", NULL, "Packet Counter", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1763 { "/Telephony/SCTP", NULL, "S_CTP", NULL, NULL, NULL },
1764 { "/Telephony/SCTP/AnalysethisAssociation", NULL, "Analyse this Association", NULL, NULL, G_CALLBACK(sctp_analyse_start) },
1765 { "/Telephony/SCTP/ShowAllAssociations", NULL, "Show All Associations...", NULL, NULL, G_CALLBACK(sctp_stat_start) },
1766 { "/Telephony/SCTP/ChunkCounter", NULL, "Chunk Counter", NULL, NULL, G_CALLBACK(sctp_chunk_counter_cb) },
1767 { "/Telephony/SIP", NULL, "_SIP...", NULL, NULL, G_CALLBACK(sipstat_cb) },
1768 { "/Telephony/smpp_commands", NULL, "SM_PPOperations", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1769 { "/Telephony/ucp_messages", NULL, "_UCP Messages", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1770 { "/Telephony/VoIPCalls", WIRESHARK_STOCK_TELEPHONE, "_VoIP Calls", NULL, NULL, G_CALLBACK(voip_calls_launch) },
1771 { "/Telephony/WSP", NULL, "_WAP-WSP...", NULL, NULL, G_CALLBACK(wsp_stat_cb) },
1773 { "/Tools/FirewallACLRules", NULL, "Firewall ACL Rules", NULL, NULL, G_CALLBACK(firewall_rule_cb) },
1774 { "/Tools/LUA", NULL, "LUA", NULL, NULL, NULL },
1776 { "/Internals/Dissectortables", NULL, "_Dissector tables", NULL, NULL, G_CALLBACK(dissector_tables_dlg_cb) },
1777 { "/Internals/SupportedProtocols", NULL, "_Supported Protocols (slow!)", NULL, NULL, G_CALLBACK(supported_cb) },
1779 { "/Help/Contents", GTK_STOCK_HELP, "_Contents", "F1", NULL, G_CALLBACK(help_menu_cont_cb) },
1780 { "/Help/ManualPages", NULL, "ManualPages", NULL, NULL, NULL },
1781 { "/Help/ManualPages/Wireshark", NULL, "Wireshark", NULL, NULL, G_CALLBACK(help_menu_wireshark_cb) },
1782 { "/Help/ManualPages/WiresharkFilter", NULL, "Wireshark Filter", NULL, NULL, G_CALLBACK(help_menu_wireshark_flt_cb) },
1783 { "/Help/ManualPages/TShark", NULL, "Wireshark", NULL, NULL, G_CALLBACK(help_menu_Tshark_cb) },
1784 { "/Help/ManualPages/RawShark", NULL, "RawShark", NULL, NULL, G_CALLBACK(help_menu_RawShark_cb) },
1785 { "/Help/ManualPages/Dumpcap", NULL, "Dumpcap", NULL, NULL, G_CALLBACK(help_menu_Dumpcap_cb) },
1786 { "/Help/ManualPages/Mergecap", NULL, "Mergecap", NULL, NULL, G_CALLBACK(help_menu_Mergecap_cb) },
1787 { "/Help/ManualPages/Editcap", NULL, "Editcap", NULL, NULL, G_CALLBACK(help_menu_Editcap_cb) },
1788 { "/Help/ManualPages/Text2pcap", NULL, "Text2pcap", NULL, NULL, G_CALLBACK(help_menu_Text2pcap_cb) },
1790 { "/Help/Website", GTK_STOCK_HOME, "Website", NULL, NULL, G_CALLBACK(help_menu_Website_cb) },
1791 { "/Help/FAQs", NULL, "FAQ's", NULL, NULL, G_CALLBACK(help_menu_faq_cb) },
1792 { "/Help/Downloads", NULL, "Downloads", NULL, NULL, G_CALLBACK(help_menu_Downloads_cb) },
1793 { "/Help/Wiki", WIRESHARK_STOCK_WIKI, "Wiki", NULL, NULL, G_CALLBACK(help_menu_Wiki_cb) },
1794 { "/Help/SampleCaptures", NULL, "Sample Captures", NULL, NULL, G_CALLBACK(help_menu_SampleCaptures_cb) },
1795 { "/Help/AboutWireshark", WIRESHARK_STOCK_ABOUT, "_About Wireshark", NULL, NULL, G_CALLBACK(about_wireshark_cb) },
1798 static const GtkToggleActionEntry main_menu_bar_toggle_action_entries[] =
1800 /* name, stock id, label, accel, tooltip, callback, is_active */
1801 {"/View/MainToolbar", NULL, "_Main Toolbar", NULL, NULL, G_CALLBACK(main_toolbar_show_hide_cb), TRUE},
1802 {"/View/FilterToolbar", NULL, "_FilterToolbar", NULL, NULL, G_CALLBACK(filter_toolbar_show_hide_cb), TRUE},
1804 {"/View/WirelessToolbar", NULL, "_WirelessToolbar", NULL, NULL, G_CALLBACK(wireless_toolbar_show_hide_cb), TRUE},
1805 #endif /* HAVE_AIRPCAP */
1806 {"/View/Statusbar", NULL, "_Statusbar", NULL, NULL, G_CALLBACK(status_bar_show_hide_cb), TRUE},
1807 {"/View/PacketList", NULL, "Packet _List", NULL, NULL, G_CALLBACK(packet_list_show_hide_cb), TRUE},
1808 {"/View/PacketDetails", NULL, "Packet _Details", NULL, NULL, G_CALLBACK(packet_details_show_hide_cb), TRUE},
1809 {"/View/PacketBytes", NULL, "Packet _Bytes", NULL, NULL, G_CALLBACK(packet_bytes_show_hide_cb), TRUE},
1810 {"/View/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes", NULL, "Display Seconds with hours and minutes", NULL, NULL, G_CALLBACK(view_menu_seconds_time_cb), FALSE},
1811 {"/View/NameResolution/ResolveName", NULL, "_Resolve Name", NULL, NULL, G_CALLBACK(resolve_name_cb), FALSE},
1812 {"/View/NameResolution/EnableforMACLayer", NULL, "Enable for _MAC Layer", NULL, NULL, G_CALLBACK(view_menu_en_for_MAC_cb), TRUE},
1813 {"/View/NameResolution/EnableforNetworkLayer", NULL, "Enable for _Network Layer", NULL, NULL, G_CALLBACK(view_menu_en_for_network_cb), TRUE },
1814 {"/View/NameResolution/EnableforTransportLayer", NULL, "Enable for _Transport Layer", NULL, NULL, G_CALLBACK(view_menu_en_for_transport_cb), TRUE },
1815 {"/View/ColorizePacketList", NULL, "Colorize Packet List", NULL, NULL, G_CALLBACK(view_menu_colorize_pkt_lst_cb), TRUE },
1817 {"/View/AutoScrollinLiveCapture", NULL, "Auto Scroll in Li_ve Capture", NULL, NULL, G_CALLBACK(view_menu_auto_scroll_live_cb), TRUE },
1821 static const GtkRadioActionEntry main_menu_bar_radio_view_time_entries [] =
1823 /* name, stock id, label, accel, tooltip, value */
1824 { "/View/TimeDisplayFormat/DateandTimeofDay", NULL, "Date and Time of Day: 1970-01-01 01:02:03.123456", "<alt><control>1", NULL, TS_ABSOLUTE_WITH_DATE },
1825 { "/View/TimeDisplayFormat/TimeofDay", NULL, "Time of Day: 01:02:03.123456", "<alt><control>2", NULL, TS_ABSOLUTE },
1826 { "/View/TimeDisplayFormat/SecondsSinceEpoch", NULL, "Seconds Since Epoch (1970-01-01): 1234567890.123456", "<alt><control>3", NULL, TS_EPOCH },
1827 { "/View/TimeDisplayFormat/SecondsSinceBeginningofCapture", NULL, "Seconds Since Beginning of Capture: 123.123456", "<alt><control>4", NULL, TS_RELATIVE },
1828 { "/View/TimeDisplayFormat/SecondsSincePreviousCapturedPacket", NULL, "Seconds Since Previous Captured Packet: 1.123456", "<alt><control>5", NULL, TS_DELTA },
1829 { "/View/TimeDisplayFormat/SecondsSincePreviousDisplayedPacket",NULL, "Seconds Since Previous Displayed Packet: 1.123456", "<alt><control>6", NULL, TS_DELTA_DIS },
1830 { "/View/TimeDisplayFormat/UTCDateandTimeofDay", NULL, "UTC Date and Time of Day: 1970-01-01 01:02:03.123456", "<alt><control>7", NULL, TS_UTC_WITH_DATE },
1831 { "/View/TimeDisplayFormat/UTCTimeofDay", NULL, "UTC Time of Day: 01:02:03.123456", "<alt><control>7", NULL, TS_UTC },
1834 static const GtkRadioActionEntry main_menu_bar_radio_view_time_fileformat_prec_entries [] =
1836 /* name, stock id, label, accel, tooltip, value */
1837 { "/View/TimeDisplayFormat/FileFormatPrecision-Automatic", NULL, "Automatic (File Format Precision)", NULL, NULL, TS_PREC_AUTO },
1838 { "/View/TimeDisplayFormat/FileFormatPrecision-Seconds", NULL, "Seconds: 0", NULL, NULL, TS_PREC_FIXED_SEC },
1839 { "/View/TimeDisplayFormat/FileFormatPrecision-Deciseconds", NULL, "Deciseconds: 0.1", NULL, NULL, TS_PREC_FIXED_DSEC },
1840 { "/View/TimeDisplayFormat/FileFormatPrecision-Centiseconds", NULL, "Centiseconds: 0.12", NULL, NULL, TS_PREC_FIXED_CSEC },
1841 { "/View/TimeDisplayFormat/FileFormatPrecision-Milliseconds", NULL, "Milliseconds: 0.123", NULL, NULL, TS_PREC_FIXED_MSEC },
1842 { "/View/TimeDisplayFormat/FileFormatPrecision-Microseconds", NULL, "Microseconds: 0.123456", NULL, NULL, TS_PREC_FIXED_USEC },
1843 { "/View/TimeDisplayFormat/FileFormatPrecision-Nanoseconds", NULL, "Nanoseconds: 0.123456789", NULL, NULL, TS_PREC_FIXED_NSEC },
1848 select_bytes_view_cb (GtkRadioAction *action, GtkRadioAction *current _U_, gpointer user_data _U_)
1852 value = gtk_radio_action_get_current_value (action);
1854 select_bytes_view( NULL, NULL, value);
1858 sort_ascending_cb(GtkAction *action _U_, gpointer user_data)
1860 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortAscending");
1861 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_SORT_ASCENDING);
1865 sort_descending_cb(GtkAction *action _U_, gpointer user_data)
1867 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortDescending");
1868 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_SORT_DESCENDING);
1872 no_sorting_cb(GtkAction *action _U_, gpointer user_data)
1874 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/NoSorting");
1875 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_SORT_NONE);
1879 packet_list_heading_show_resolved_cb(GtkAction *action _U_, gpointer user_data _U_)
1881 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ShowResolved");
1883 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_TOGGLE_RESOLVED);
1887 packet_list_heading_align_left_cb(GtkAction *action _U_, gpointer user_data)
1889 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/AlignLeft");
1890 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_ALIGN_LEFT);
1894 packet_list_heading_align_center_cb(GtkAction *action _U_, gpointer user_data)
1896 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/AlignCenter");
1897 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_ALIGN_CENTER);
1901 packet_list_heading_align_right_cb(GtkAction *action _U_, gpointer user_data)
1903 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/AlignRight");
1904 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_ALIGN_RIGHT);
1908 packet_list_heading_col_pref_cb(GtkAction *action _U_, gpointer user_data)
1910 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ColumnPreferences");
1911 prefs_page_cb( widget , user_data, PREFS_PAGE_COLUMNS);
1915 packet_list_heading_resize_col_cb(GtkAction *action _U_, gpointer user_data)
1917 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ResizeColumn");
1918 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_RESIZE);
1922 packet_list_heading_change_col_cb(GtkAction *action _U_, gpointer user_data)
1924 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/EditColumnDetails");
1925 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_CHANGE);
1929 packet_list_heading_activate_all_columns_cb(GtkAction *action _U_, gpointer user_data _U_)
1931 new_packet_list_set_all_columns_visible ();
1935 packet_list_heading_hide_col_cb(GtkAction *action _U_, gpointer user_data)
1937 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/HideColumn");
1938 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_HIDE);
1942 packet_list_heading_remove_col_cb(GtkAction *action _U_, gpointer user_data)
1944 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/RemoveColumn");
1945 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_REMOVE);
1949 packet_list_menu_set_ref_time_cb(GtkAction *action _U_, gpointer user_data)
1951 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_TOGGLE);
1956 packet_list_menu_apply_selected_cb(GtkAction *action _U_, gpointer user_data)
1958 match_selected_plist_cb( NULL /* widget _U_ */, user_data, MATCH_SELECTED_REPLACE|MATCH_SELECTED_APPLY_NOW);
1962 packet_list_menu_apply_not_selected_cb(GtkAction *action _U_, gpointer user_data)
1964 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_NOT|MATCH_SELECTED_APPLY_NOW);
1968 packet_list_menu_apply_and_selected_cb(GtkAction *action _U_, gpointer user_data)
1970 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_AND|MATCH_SELECTED_APPLY_NOW);
1974 packet_list_menu_apply_or_selected_cb(GtkAction *action _U_, gpointer user_data)
1976 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_OR|MATCH_SELECTED_APPLY_NOW);
1980 packet_list_menu_apply_and_not_selected_cb(GtkAction *action _U_, gpointer user_data)
1982 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_AND_NOT|MATCH_SELECTED_APPLY_NOW);
1986 packet_list_menu_apply_or_not_selected_cb(GtkAction *action _U_, gpointer user_data)
1988 match_selected_plist_cb( NULL /* widget _U_ */ , user_data,MATCH_SELECTED_OR_NOT|MATCH_SELECTED_APPLY_NOW);
1990 /* Prepare a filter */
1992 packet_list_menu_prepare_selected_cb(GtkAction *action _U_, gpointer user_data)
1994 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_REPLACE);
1998 packet_list_menu_prepare_not_selected_cb(GtkAction *action _U_, gpointer user_data)
2000 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_NOT);
2004 packet_list_menu_prepare_and_selected_cb(GtkAction *action _U_, gpointer user_data)
2006 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_AND);
2010 packet_list_menu_prepare_or_selected_cb(GtkAction *action _U_, gpointer user_data)
2012 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_OR);
2016 packet_list_menu_prepare_and_not_selected_cb(GtkAction *action _U_, gpointer user_data)
2018 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_AND_NOT);
2022 packet_list_menu_prepare_or_not_selected_cb(GtkAction *action _U_, gpointer user_data)
2024 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_OR_NOT);
2028 packet_list_menu_conversation_ethernet_cb(GtkAction *action, gpointer user_data)
2030 conversation_cb( action, user_data, CONV_ETHER);
2034 packet_list_menu_conversation_ip_cb(GtkAction *action _U_, gpointer user_data)
2036 conversation_cb( action, user_data, CONV_IP);
2040 packet_list_menu_conversation_tcp_cb(GtkAction *action _U_, gpointer user_data)
2042 conversation_cb( action, user_data, CONV_TCP);
2046 packet_list_menu_conversation_udp_cb(GtkAction *action _U_, gpointer user_data)
2048 conversation_cb( action, user_data, CONV_UDP);
2052 packet_list_menu_conversation_pn_cba_cb(GtkAction *action _U_, gpointer user_data)
2054 conversation_cb( action, user_data, CONV_CBA);
2060 packet_list_menu_color_conv_ethernet_color1_cb(GtkAction *action, gpointer user_data)
2062 colorize_conversation_cb(action, user_data, CONV_ETHER+1*256);
2066 packet_list_menu_color_conv_ethernet_color2_cb(GtkAction *action, gpointer user_data)
2068 colorize_conversation_cb(action, user_data, CONV_ETHER+2*256);
2072 packet_list_menu_color_conv_ethernet_color3_cb(GtkAction *action, gpointer user_data)
2074 colorize_conversation_cb(action, user_data, CONV_ETHER+3*256);
2078 packet_list_menu_color_conv_ethernet_color4_cb(GtkAction *action, gpointer user_data)
2080 colorize_conversation_cb(action, user_data, CONV_ETHER+4*256);
2084 packet_list_menu_color_conv_ethernet_color5_cb(GtkAction *action, gpointer user_data)
2086 colorize_conversation_cb(action, user_data, CONV_ETHER+5*256);
2090 packet_list_menu_color_conv_ethernet_color6_cb(GtkAction *action, gpointer user_data)
2092 colorize_conversation_cb(action, user_data, CONV_ETHER+6*256);
2096 packet_list_menu_color_conv_ethernet_color7_cb(GtkAction *action, gpointer user_data)
2098 colorize_conversation_cb(action, user_data, CONV_ETHER+7*256);
2102 packet_list_menu_color_conv_ethernet_color8_cb(GtkAction *action, gpointer user_data)
2104 colorize_conversation_cb(action, user_data, CONV_ETHER+8*256);
2108 packet_list_menu_color_conv_ethernet_color9_cb(GtkAction *action, gpointer user_data)
2110 colorize_conversation_cb(action, user_data, CONV_ETHER+9*256);
2114 packet_list_menu_color_conv_ethernet_color10_cb(GtkAction *action, gpointer user_data)
2116 colorize_conversation_cb(action, user_data, CONV_ETHER+10*256);
2120 packet_list_menu_color_conv_ethernet_new_rule_cb(GtkAction *action, gpointer user_data)
2122 colorize_conversation_cb(action, user_data, CONV_ETHER);
2128 packet_list_menu_color_conv_ip_color1_cb(GtkAction *action, gpointer user_data)
2130 colorize_conversation_cb(action, user_data, CONV_IP+1*256);
2134 packet_list_menu_color_conv_ip_color2_cb(GtkAction *action, gpointer user_data)
2136 colorize_conversation_cb(action, user_data, CONV_IP+2*256);
2140 packet_list_menu_color_conv_ip_color3_cb(GtkAction *action, gpointer user_data)
2142 colorize_conversation_cb(action, user_data, CONV_IP+3*256);
2146 packet_list_menu_color_conv_ip_color4_cb(GtkAction *action, gpointer user_data)
2148 colorize_conversation_cb(action, user_data, CONV_IP+4*256);
2152 packet_list_menu_color_conv_ip_color5_cb(GtkAction *action, gpointer user_data)
2154 colorize_conversation_cb(action, user_data, CONV_IP+5*256);
2158 packet_list_menu_color_conv_ip_color6_cb(GtkAction *action, gpointer user_data)
2160 colorize_conversation_cb(action, user_data, CONV_IP+6*256);
2164 packet_list_menu_color_conv_ip_color7_cb(GtkAction *action, gpointer user_data)
2166 colorize_conversation_cb(action, user_data, CONV_IP+7*256);
2170 packet_list_menu_color_conv_ip_color8_cb(GtkAction *action, gpointer user_data)
2172 colorize_conversation_cb(action, user_data, CONV_IP+8*256);
2176 packet_list_menu_color_conv_ip_color9_cb(GtkAction *action, gpointer user_data)
2178 colorize_conversation_cb(action, user_data, CONV_IP+9*256);
2182 packet_list_menu_color_conv_ip_color10_cb(GtkAction *action, gpointer user_data)
2184 colorize_conversation_cb(action, user_data, CONV_IP+10*256);
2188 packet_list_menu_color_conv_ip_new_rule_cb(GtkAction *action, gpointer user_data)
2190 colorize_conversation_cb(action, user_data, CONV_TCP);
2196 packet_list_menu_color_conv_tcp_color1_cb(GtkAction *action, gpointer user_data)
2198 colorize_conversation_cb(action, user_data, CONV_TCP+1*256);
2202 packet_list_menu_color_conv_tcp_color2_cb(GtkAction *action, gpointer user_data)
2204 colorize_conversation_cb(action, user_data, CONV_TCP+2*256);
2208 packet_list_menu_color_conv_tcp_color3_cb(GtkAction *action, gpointer user_data)
2210 colorize_conversation_cb(action, user_data, CONV_TCP+3*256);
2214 packet_list_menu_color_conv_tcp_color4_cb(GtkAction *action, gpointer user_data)
2216 colorize_conversation_cb(action, user_data, CONV_TCP+4*256);
2220 packet_list_menu_color_conv_tcp_color5_cb(GtkAction *action, gpointer user_data)
2222 colorize_conversation_cb(action, user_data, CONV_TCP+5*256);
2226 packet_list_menu_color_conv_tcp_color6_cb(GtkAction *action, gpointer user_data)
2228 colorize_conversation_cb(action, user_data, CONV_TCP+6*256);
2232 packet_list_menu_color_conv_tcp_color7_cb(GtkAction *action, gpointer user_data)
2234 colorize_conversation_cb(action, user_data, CONV_TCP+7*256);
2238 packet_list_menu_color_conv_tcp_color8_cb(GtkAction *action, gpointer user_data)
2240 colorize_conversation_cb(action, user_data, CONV_TCP+8*256);
2244 packet_list_menu_color_conv_tcp_color9_cb(GtkAction *action, gpointer user_data)
2246 colorize_conversation_cb(action, user_data, CONV_TCP+9*256);
2250 packet_list_menu_color_conv_tcp_color10_cb(GtkAction *action, gpointer user_data)
2252 colorize_conversation_cb(action, user_data, CONV_TCP+10*256);
2256 packet_list_menu_color_conv_tcp_new_rule_cb(GtkAction *action, gpointer user_data)
2258 colorize_conversation_cb(action, user_data, CONV_TCP);
2264 packet_list_menu_color_conv_udp_color1_cb(GtkAction *action, gpointer user_data)
2266 colorize_conversation_cb(action, user_data, CONV_UDP+1*256);
2270 packet_list_menu_color_conv_udp_color2_cb(GtkAction *action, gpointer user_data)
2272 colorize_conversation_cb(action, user_data, CONV_UDP+2*256);
2276 packet_list_menu_color_conv_udp_color3_cb(GtkAction *action, gpointer user_data)
2278 colorize_conversation_cb(action, user_data, CONV_UDP+3*256);
2282 packet_list_menu_color_conv_udp_color4_cb(GtkAction *action, gpointer user_data)
2284 colorize_conversation_cb(action, user_data, CONV_UDP+4*256);
2288 packet_list_menu_color_conv_udp_color5_cb(GtkAction *action, gpointer user_data)
2290 colorize_conversation_cb(action, user_data, CONV_UDP+5*256);
2294 packet_list_menu_color_conv_udp_color6_cb(GtkAction *action, gpointer user_data)
2296 colorize_conversation_cb(action, user_data, CONV_UDP+6*256);
2300 packet_list_menu_color_conv_udp_color7_cb(GtkAction *action, gpointer user_data)
2302 colorize_conversation_cb(action, user_data, CONV_UDP+7*256);
2306 packet_list_menu_color_conv_udp_color8_cb(GtkAction *action, gpointer user_data)
2308 colorize_conversation_cb(action, user_data, CONV_UDP+8*256);
2312 packet_list_menu_color_conv_udp_color9_cb(GtkAction *action, gpointer user_data)
2314 colorize_conversation_cb(action, user_data, CONV_UDP+9*256);
2318 packet_list_menu_color_conv_udp_color10_cb(GtkAction *action, gpointer user_data)
2320 colorize_conversation_cb(action, user_data, CONV_UDP+10*256);
2324 packet_list_menu_color_conv_udp_new_rule_cb(GtkAction *action, gpointer user_data)
2326 colorize_conversation_cb(action, user_data, CONV_UDP);
2332 packet_list_menu_color_conv_cba_color1_cb(GtkAction *action, gpointer user_data)
2334 colorize_conversation_cb(action, user_data, CONV_CBA+1*256);
2338 packet_list_menu_color_conv_cba_color2_cb(GtkAction *action, gpointer user_data)
2340 colorize_conversation_cb(action, user_data, CONV_CBA+2*256);
2344 packet_list_menu_color_conv_cba_color3_cb(GtkAction *action, gpointer user_data)
2346 colorize_conversation_cb(action, user_data, CONV_CBA+3*256);
2350 packet_list_menu_color_conv_cba_color4_cb(GtkAction *action, gpointer user_data)
2352 colorize_conversation_cb(action, user_data, CONV_CBA+4*256);
2356 packet_list_menu_color_conv_cba_color5_cb(GtkAction *action, gpointer user_data)
2358 colorize_conversation_cb(action, user_data, CONV_CBA+5*256);
2362 packet_list_menu_color_conv_cba_color6_cb(GtkAction *action, gpointer user_data)
2364 colorize_conversation_cb(action, user_data, CONV_CBA+6*256);
2368 packet_list_menu_color_conv_cba_color7_cb(GtkAction *action, gpointer user_data)
2370 colorize_conversation_cb(action, user_data, CONV_CBA+7*256);
2374 packet_list_menu_color_conv_cba_color8_cb(GtkAction *action, gpointer user_data)
2376 colorize_conversation_cb(action, user_data, CONV_CBA+8*256);
2380 packet_list_menu_color_conv_cba_color9_cb(GtkAction *action, gpointer user_data)
2382 colorize_conversation_cb(action, user_data, CONV_CBA+9*256);
2386 packet_list_menu_color_conv_cba_color10_cb(GtkAction *action, gpointer user_data)
2388 colorize_conversation_cb(action, user_data, CONV_CBA+10*256);
2392 packet_list_menu_color_conv_cba_new_rule_cb(GtkAction *action, gpointer user_data)
2394 colorize_conversation_cb(action, user_data, CONV_CBA);
2398 packet_list_menu_copy_sum_txt(GtkAction *action _U_, gpointer user_data)
2400 new_packet_list_copy_summary_cb(user_data, CS_TEXT);
2404 packet_list_menu_copy_sum_csv(GtkAction *action _U_, gpointer user_data)
2406 new_packet_list_copy_summary_cb(user_data, CS_CSV);
2410 packet_list_menu_copy_as_flt(GtkAction *action _U_, gpointer user_data)
2412 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_REPLACE|MATCH_SELECTED_COPY_ONLY);
2416 packet_list_menu_copy_bytes_oht_cb(GtkAction *action _U_, gpointer user_data)
2418 copy_hex_cb( NULL /* widget _U_ */ , user_data, CD_ALLINFO | CD_FLAGS_SELECTEDONLY);
2422 packet_list_menu_copy_bytes_oh_cb(GtkAction *action _U_, gpointer user_data)
2424 copy_hex_cb( NULL /* widget _U_ */ , user_data, CD_HEXCOLUMNS | CD_FLAGS_SELECTEDONLY);
2428 packet_list_menu_copy_bytes_text_cb(GtkAction *action _U_, gpointer user_data)
2430 copy_hex_cb( NULL /* widget _U_ */ , user_data, CD_TEXTONLY | CD_FLAGS_SELECTEDONLY);
2434 packet_list_menu_copy_bytes_hex_strm_cb(GtkAction *action _U_, gpointer user_data)
2436 copy_hex_cb( NULL /* widget _U_ */ , user_data, CD_HEX | CD_FLAGS_SELECTEDONLY);
2440 packet_list_menu_copy_bytes_bin_strm_cb(GtkAction *action _U_, gpointer user_data)
2442 copy_hex_cb( NULL /* widget _U_ */ , user_data, CD_BINARY | CD_FLAGS_SELECTEDONLY);
2448 tree_view_menu_color_with_flt_color1_cb(GtkAction *action _U_, gpointer user_data)
2450 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 1);
2454 tree_view_menu_color_with_flt_color2_cb(GtkAction *action _U_, gpointer user_data)
2456 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 2);
2460 tree_view_menu_color_with_flt_color3_cb(GtkAction *action _U_, gpointer user_data)
2462 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 3);
2466 tree_view_menu_color_with_flt_color4_cb(GtkAction *action _U_, gpointer user_data)
2468 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 4);
2472 tree_view_menu_color_with_flt_color5_cb(GtkAction *action _U_, gpointer user_data)
2474 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 5);
2478 tree_view_menu_color_with_flt_color6_cb(GtkAction *action _U_, gpointer user_data)
2480 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 6);
2484 tree_view_menu_color_with_flt_color7_cb(GtkAction *action _U_, gpointer user_data)
2486 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 7);
2490 tree_view_menu_color_with_flt_color8_cb(GtkAction *action _U_, gpointer user_data)
2492 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 8);
2496 tree_view_menu_color_with_flt_color9_cb(GtkAction *action _U_, gpointer user_data)
2498 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 9);
2502 tree_view_menu_color_with_flt_color10_cb(GtkAction *action _U_, gpointer user_data)
2504 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 10);
2508 tree_view_menu_color_with_flt_new_rule_cb(GtkAction *action _U_, gpointer user_data)
2510 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 0);
2515 tree_view_menu_copy_desc(GtkAction *action _U_, gpointer user_data)
2517 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_DESCRIPTION);
2521 tree_view_menu_copy_field(GtkAction *action _U_, gpointer user_data)
2523 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_FIELDNAME);
2527 tree_view_menu_copy_value(GtkAction *action _U_, gpointer user_data)
2529 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_VALUE);
2533 tree_view_menu_copy_as_flt(GtkAction *action _U_, gpointer user_data)
2535 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/Copy/AsFilter");
2536 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_REPLACE|MATCH_SELECTED_COPY_ONLY);
2539 static const char *ui_desc_packet_list_heading_menu_popup =
2541 " <popup name='PacketListHeadingPopup' action='PopupAction'>\n"
2542 " <menuitem name='SortAscending' action='/Sort Ascending'/>\n"
2543 " <menuitem name='SortDescending' action='/Sort Descending'/>\n"
2544 " <menuitem name='NoSorting' action='/No Sorting'/>\n"
2546 " <menuitem name='ShowResolved' action='/Show Resolved'/>\n"
2548 " <menuitem name='AlignLeft' action='/Align Left'/>\n"
2549 " <menuitem name='AlignCenter' action='/Align Center'/>\n"
2550 " <menuitem name='AlignRight' action='/Align Right'/>\n"
2552 " <menuitem name='ColumnPreferences' action='/Column Preferences'/>\n"
2553 " <menuitem name='EditColumnDetails' action='/Edit Column Details'/>\n"
2554 " <menuitem name='ResizeColumn' action='/Resize Column'/>\n"
2556 " <menu name='DisplayedColumns' action='/Displayed Columns'>\n"
2557 " <menuitem name='Display All' action='/Displayed Columns/Display All'/>\n"
2559 " <menuitem name='HideColumn' action='/Hide Column'/>\n"
2560 " <menuitem name='RemoveColumn' action='/Remove Column'/>\n"
2564 static const GtkActionEntry packet_list_heading_menu_popup_action_entries[] = {
2565 { "/Sort Ascending", GTK_STOCK_SORT_ASCENDING, "Sort Ascending", NULL, NULL, G_CALLBACK(sort_ascending_cb) },
2566 { "/Sort Descending", GTK_STOCK_SORT_DESCENDING, "Sort Descending", NULL, NULL, G_CALLBACK(sort_descending_cb) },
2567 { "/No Sorting", NULL, "No Sorting", NULL, NULL, G_CALLBACK(no_sorting_cb) },
2568 { "/Align Left", GTK_STOCK_JUSTIFY_LEFT, "Align Left", NULL, NULL, G_CALLBACK(packet_list_heading_align_left_cb) },
2569 { "/Align Center", GTK_STOCK_JUSTIFY_CENTER, "Align Center", NULL, NULL, G_CALLBACK(packet_list_heading_align_center_cb) },
2570 { "/Align Right", GTK_STOCK_JUSTIFY_RIGHT, "Align Right", NULL, NULL, G_CALLBACK(packet_list_heading_align_right_cb) },
2571 { "/Column Preferences", GTK_STOCK_PREFERENCES, "Column Preferences...", NULL, NULL, G_CALLBACK(packet_list_heading_col_pref_cb) },
2572 { "/Edit Column Details", WIRESHARK_STOCK_EDIT, "Edit Column Details...", NULL, NULL, G_CALLBACK(packet_list_heading_change_col_cb) },
2573 { "/Resize Column", WIRESHARK_STOCK_RESIZE_COLUMNS, "Resize Column", NULL, NULL, G_CALLBACK(packet_list_heading_resize_col_cb) },
2574 { "/Displayed Columns", NULL, "Displayed Columns", NULL, NULL, NULL },
2575 { "/Displayed Columns/Display All", NULL, "Display All", NULL, NULL, G_CALLBACK(packet_list_heading_activate_all_columns_cb) },
2576 { "/Hide Column", NULL, "Hide Column", NULL, NULL, G_CALLBACK(packet_list_heading_hide_col_cb) },
2577 { "/Remove Column", GTK_STOCK_DELETE, "Remove Column", NULL, NULL, G_CALLBACK(packet_list_heading_remove_col_cb) },
2580 static const GtkToggleActionEntry packet_list_heading_menu_toggle_action_entries[] =
2582 /* name, stock id, label, accel, tooltip, callback, is_active */
2583 {"/Show Resolved", NULL, "Show Resolved", NULL, NULL, G_CALLBACK(packet_list_heading_show_resolved_cb), FALSE},
2586 static const char *ui_desc_packet_list_menu_popup =
2588 " <popup name='PacketListMenuPopup' action='PopupAction'>\n"
2589 " <menuitem name='MarkPacket' action='/MarkPacket'/>\n"
2590 " <menuitem name='IgnorePacket' action='/IgnorePacket'/>\n"
2591 " <menuitem name='SetTimeReference' action='/Set Time Reference'/>\n"
2592 " <menuitem name='TimeShift' action='/TimeShift'/>\n"
2594 " <menuitem name='ManuallyResolveAddress' action='/ManuallyResolveAddress'/>\n"
2596 " <menu name= 'ApplyAsFilter' action='/Apply as Filter'>\n"
2597 " <menuitem name='Selected' action='/Apply as Filter/Selected'/>\n"
2598 " <menuitem name='NotSelected' action='/Apply as Filter/Not Selected'/>\n"
2599 " <menuitem name='AndSelected' action='/Apply as Filter/AndSelected'/>\n"
2600 " <menuitem name='OrSelected' action='/Apply as Filter/OrSelected'/>\n"
2601 " <menuitem name='AndNotSelected' action='/Apply as Filter/AndNotSelected'/>\n"
2602 " <menuitem name='OrNotSelected' action='/Apply as Filter/OrNotSelected'/>\n"
2604 " <menu name= 'PrepareaFilter' action='/Prepare a Filter'>\n"
2605 " <menuitem name='Selected' action='/Prepare a Filter/Selected'/>\n"
2606 " <menuitem name='NotSelected' action='/Prepare a Filter/Not Selected'/>\n"
2607 " <menuitem name='AndSelected' action='/Prepare a Filter/AndSelected'/>\n"
2608 " <menuitem name='OrSelected' action='/Prepare a Filter/OrSelected'/>\n"
2609 " <menuitem name='AndNotSelected' action='/Prepare a Filter/AndNotSelected'/>\n"
2610 " <menuitem name='OrNotSelected' action='/Prepare a Filter/OrNotSelected'/>\n"
2612 " <menu name= 'ConversationFilter' action='/Conversation Filter'>\n"
2613 " <menuitem name='Ethernet' action='/Conversation Filter/Ethernet'/>\n"
2614 " <menuitem name='IP' action='/Conversation Filter/IP'/>\n"
2615 " <menuitem name='TCP' action='/Conversation Filter/TCP'/>\n"
2616 " <menuitem name='UDP' action='/Conversation Filter/UDP'/>\n"
2617 " <menuitem name='PN-CBA' action='/Conversation Filter/PN-CBA'/>\n"
2619 " <menu name= 'ColorizeConversation' action='/Colorize Conversation'>\n"
2620 " <menu name= 'Ethernet' action='/Colorize Conversation/Ethernet'>\n"
2621 " <menuitem name='Color1' action='/Colorize Conversation/Ethernet/Color 1'/>\n"
2622 " <menuitem name='Color2' action='/Colorize Conversation/Ethernet/Color 2'/>\n"
2623 " <menuitem name='Color3' action='/Colorize Conversation/Ethernet/Color 3'/>\n"
2624 " <menuitem name='Color4' action='/Colorize Conversation/Ethernet/Color 4'/>\n"
2625 " <menuitem name='Color5' action='/Colorize Conversation/Ethernet/Color 5'/>\n"
2626 " <menuitem name='Color6' action='/Colorize Conversation/Ethernet/Color 6'/>\n"
2627 " <menuitem name='Color7' action='/Colorize Conversation/Ethernet/Color 7'/>\n"
2628 " <menuitem name='Color8' action='/Colorize Conversation/Ethernet/Color 8'/>\n"
2629 " <menuitem name='Color9' action='/Colorize Conversation/Ethernet/Color 9'/>\n"
2630 " <menuitem name='Color10' action='/Colorize Conversation/Ethernet/Color 10'/>\n"
2631 " <menuitem name='NewColoringRule' action='/Colorize Conversation/Ethernet/New Coloring Rule'/>\n"
2633 " <menu name= 'IP' action='/Colorize Conversation/IP'>\n"
2634 " <menuitem name='Color1' action='/Colorize Conversation/IP/Color 1'/>\n"
2635 " <menuitem name='Color2' action='/Colorize Conversation/IP/Color 2'/>\n"
2636 " <menuitem name='Color3' action='/Colorize Conversation/IP/Color 3'/>\n"
2637 " <menuitem name='Color4' action='/Colorize Conversation/IP/Color 4'/>\n"
2638 " <menuitem name='Color5' action='/Colorize Conversation/IP/Color 5'/>\n"
2639 " <menuitem name='Color6' action='/Colorize Conversation/IP/Color 6'/>\n"
2640 " <menuitem name='Color7' action='/Colorize Conversation/IP/Color 7'/>\n"
2641 " <menuitem name='Color8' action='/Colorize Conversation/IP/Color 8'/>\n"
2642 " <menuitem name='Color9' action='/Colorize Conversation/IP/Color 9'/>\n"
2643 " <menuitem name='Color10' action='/Colorize Conversation/IP/Color 10'/>\n"
2644 " <menuitem name='NewColoringRule' action='/Colorize Conversation/IP/New Coloring Rule'/>\n"
2646 " <menu name= 'TCP' action='/Colorize Conversation/TCP'>\n"
2647 " <menuitem name='Color1' action='/Colorize Conversation/TCP/Color 1'/>\n"
2648 " <menuitem name='Color2' action='/Colorize Conversation/TCP/Color 2'/>\n"
2649 " <menuitem name='Color3' action='/Colorize Conversation/TCP/Color 3'/>\n"
2650 " <menuitem name='Color4' action='/Colorize Conversation/TCP/Color 4'/>\n"
2651 " <menuitem name='Color5' action='/Colorize Conversation/TCP/Color 5'/>\n"
2652 " <menuitem name='Color6' action='/Colorize Conversation/TCP/Color 6'/>\n"
2653 " <menuitem name='Color7' action='/Colorize Conversation/TCP/Color 7'/>\n"
2654 " <menuitem name='Color8' action='/Colorize Conversation/TCP/Color 8'/>\n"
2655 " <menuitem name='Color9' action='/Colorize Conversation/TCP/Color 9'/>\n"
2656 " <menuitem name='Color10' action='/Colorize Conversation/TCP/Color 10'/>\n"
2657 " <menuitem name='NewColoringRule' action='/Colorize Conversation/TCP/New Coloring Rule'/>\n"
2659 " <menu name= 'UDP' action='/Colorize Conversation/UDP'>\n"
2660 " <menuitem name='Color1' action='/Colorize Conversation/UDP/Color 1'/>\n"
2661 " <menuitem name='Color2' action='/Colorize Conversation/UDP/Color 2'/>\n"
2662 " <menuitem name='Color3' action='/Colorize Conversation/UDP/Color 3'/>\n"
2663 " <menuitem name='Color4' action='/Colorize Conversation/UDP/Color 4'/>\n"
2664 " <menuitem name='Color5' action='/Colorize Conversation/UDP/Color 5'/>\n"
2665 " <menuitem name='Color6' action='/Colorize Conversation/UDP/Color 6'/>\n"
2666 " <menuitem name='Color7' action='/Colorize Conversation/UDP/Color 7'/>\n"
2667 " <menuitem name='Color8' action='/Colorize Conversation/UDP/Color 8'/>\n"
2668 " <menuitem name='Color9' action='/Colorize Conversation/UDP/Color 9'/>\n"
2669 " <menuitem name='Color10' action='/Colorize Conversation/UDP/Color 10'/>\n"
2670 " <menuitem name='NewColoringRule' action='/Colorize Conversation/UDP/New Coloring Rule'/>\n"
2672 " <menu name= 'PN-CBA' action='/Colorize Conversation/PN-CBA'>\n"
2673 " <menuitem name='Color1' action='/Colorize Conversation/PN-CBA/Color 1'/>\n"
2674 " <menuitem name='Color2' action='/Colorize Conversation/PN-CBA/Color 2'/>\n"
2675 " <menuitem name='Color3' action='/Colorize Conversation/PN-CBA/Color 3'/>\n"
2676 " <menuitem name='Color4' action='/Colorize Conversation/PN-CBA/Color 4'/>\n"
2677 " <menuitem name='Color5' action='/Colorize Conversation/PN-CBA/Color 5'/>\n"
2678 " <menuitem name='Color6' action='/Colorize Conversation/PN-CBA/Color 6'/>\n"
2679 " <menuitem name='Color7' action='/Colorize Conversation/PN-CBA/Color 7'/>\n"
2680 " <menuitem name='Color8' action='/Colorize Conversation/PN-CBA/Color 8'/>\n"
2681 " <menuitem name='Color9' action='/Colorize Conversation/PN-CBA/Color 9'/>\n"
2682 " <menuitem name='Color10' action='/Colorize Conversation/PN-CBA/Color 10'/>\n"
2683 " <menuitem name='NewColoringRule' action='/Colorize Conversation/PN-CBA/New Coloring Rule'/>\n"
2686 " <menu name= 'SCTP' action='/SCTP'>\n"
2687 " <menuitem name='AnalysethisAssociation' action='/SCTP/Analyse this Association'/>\n"
2688 " <menuitem name='PrepareFilterforthisAssociation' action='/SCTP/Prepare Filter for this Association'/>\n"
2690 " <menuitem name='FollowTCPStream' action='/Follow TCP Stream'/>\n"
2691 " <menuitem name='FollowUDPStream' action='/Follow UDP Stream'/>\n"
2692 " <menuitem name='FollowSSLStream' action='/Follow SSL Stream'/>\n"
2694 " <menu name= 'Copy' action='/Copy'>\n"
2695 " <menuitem name='SummaryTxt' action='/Copy/SummaryTxt'/>\n"
2696 " <menuitem name='SummaryCSV' action='/Copy/SummaryCSV'/>\n"
2697 " <menuitem name='AsFilter' action='/Copy/AsFilter'/>\n"
2699 " <menu name= 'Bytes' action='/Copy/Bytes'>\n"
2700 " <menuitem name='OffsetHexText' action='/Copy/Bytes/OffsetHexText'/>\n"
2701 " <menuitem name='OffsetHex' action='/Copy/Bytes/OffsetHex'/>\n"
2702 " <menuitem name='PrintableTextOnly' action='/Copy/Bytes/PrintableTextOnly'/>\n"
2704 " <menuitem name='HexStream' action='/Copy/Bytes/HexStream'/>\n"
2705 " <menuitem name='BinaryStream' action='/Copy/Bytes/BinaryStream'/>\n"
2709 " <menuitem name='DecodeAs' action='/DecodeAs'/>\n"
2710 " <menuitem name='Print' action='/Print'/>\n"
2711 " <menuitem name='ShowPacketinNewWindow' action='/ShowPacketinNewWindow'/>\n"
2715 static const GtkActionEntry packet_list_menu_popup_action_entries[] = {
2716 { "/MarkPacket", NULL, "Mark Packet (toggle)", NULL, NULL, G_CALLBACK(new_packet_list_mark_frame_cb) },
2717 { "/IgnorePacket", NULL, "Ignore Packet (toggle)", NULL, NULL, G_CALLBACK(new_packet_list_ignore_frame_cb) },
2718 { "/Set Time Reference", WIRESHARK_STOCK_TIME, "Set Time Reference (toggle)", NULL, NULL, G_CALLBACK(packet_list_menu_set_ref_time_cb) },
2719 { "/TimeShift", WIRESHARK_STOCK_TIME, "Time Shift...", NULL, NULL, G_CALLBACK(time_shift_cb) },
2720 { "/ManuallyResolveAddress", NULL, "Manually Resolve Address", NULL, NULL, G_CALLBACK(manual_addr_resolv_dlg) },
2721 { "/Apply as Filter", NULL, "Apply as Filter", NULL, NULL, NULL },
2723 { "/Apply as Filter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(packet_list_menu_apply_selected_cb) },
2724 { "/Apply as Filter/Not Selected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_apply_not_selected_cb) },
2725 { "/Apply as Filter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(packet_list_menu_apply_and_selected_cb) },
2726 { "/Apply as Filter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(packet_list_menu_apply_or_selected_cb) },
2727 { "/Apply as Filter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_apply_and_not_selected_cb) },
2728 { "/Apply as Filter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_apply_or_not_selected_cb) },
2730 { "/Prepare a Filter", NULL, "Prepare a Filter", NULL, NULL, NULL },
2731 { "/Prepare a Filter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(packet_list_menu_prepare_selected_cb) },
2732 { "/Prepare a Filter/Not Selected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_prepare_not_selected_cb) },
2733 { "/Prepare a Filter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(packet_list_menu_prepare_and_selected_cb) },
2734 { "/Prepare a Filter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(packet_list_menu_prepare_or_selected_cb) },
2735 { "/Prepare a Filter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_prepare_and_not_selected_cb) },
2736 { "/Prepare a Filter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_prepare_or_not_selected_cb) },
2738 { "/Conversation Filter", NULL, "Conversation Filter", NULL, NULL, NULL },
2739 { "/Conversation Filter/Ethernet", NULL, "Ethernet", NULL, NULL, G_CALLBACK(packet_list_menu_conversation_ethernet_cb) },
2740 { "/Conversation Filter/IP", NULL, "IP", NULL, NULL, G_CALLBACK(packet_list_menu_conversation_ip_cb) },
2741 { "/Conversation Filter/TCP", NULL, "TCP", NULL, NULL, G_CALLBACK(packet_list_menu_conversation_tcp_cb) },
2742 { "/Conversation Filter/UDP", NULL, "UDP", NULL, NULL, G_CALLBACK(packet_list_menu_conversation_udp_cb) },
2743 { "/Conversation Filter/PN-CBA", NULL, "PN-CBA", NULL, NULL, G_CALLBACK(packet_list_menu_conversation_pn_cba_cb) },
2745 { "/Colorize Conversation", NULL, "Colorize Conversation", NULL, NULL, NULL },
2747 { "/Colorize Conversation/Ethernet", NULL, "Ethernet", NULL, NULL, NULL },
2749 { "/Colorize Conversation/Ethernet/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color1_cb) },
2750 { "/Colorize Conversation/Ethernet/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color2_cb) },
2751 { "/Colorize Conversation/Ethernet/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color3_cb) },
2752 { "/Colorize Conversation/Ethernet/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color4_cb) },
2753 { "/Colorize Conversation/Ethernet/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color5_cb) },
2754 { "/Colorize Conversation/Ethernet/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color6_cb) },
2755 { "/Colorize Conversation/Ethernet/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color7_cb) },
2756 { "/Colorize Conversation/Ethernet/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color8_cb) },
2757 { "/Colorize Conversation/Ethernet/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color9_cb) },
2758 { "/Colorize Conversation/Ethernet/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color10_cb) },
2759 { "/Colorize Conversation/Ethernet/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_new_rule_cb) },
2761 { "/Colorize Conversation/IP", NULL, "IP", NULL, NULL, NULL },
2763 { "/Colorize Conversation/IP/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color1_cb) },
2764 { "/Colorize Conversation/IP/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color2_cb) },
2765 { "/Colorize Conversation/IP/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color3_cb) },
2766 { "/Colorize Conversation/IP/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color4_cb) },
2767 { "/Colorize Conversation/IP/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color5_cb) },
2768 { "/Colorize Conversation/IP/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color6_cb) },
2769 { "/Colorize Conversation/IP/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color7_cb) },
2770 { "/Colorize Conversation/IP/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color8_cb) },
2771 { "/Colorize Conversation/IP/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color9_cb) },
2772 { "/Colorize Conversation/IP/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color10_cb) },
2773 { "/Colorize Conversation/IP/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_new_rule_cb) },
2775 { "/Colorize Conversation/TCP", NULL, "TCP", NULL, NULL, NULL },
2777 { "/Colorize Conversation/TCP/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color1_cb) },
2778 { "/Colorize Conversation/TCP/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color2_cb) },
2779 { "/Colorize Conversation/TCP/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color3_cb) },
2780 { "/Colorize Conversation/TCP/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color4_cb) },
2781 { "/Colorize Conversation/TCP/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color5_cb) },
2782 { "/Colorize Conversation/TCP/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color6_cb) },
2783 { "/Colorize Conversation/TCP/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color7_cb) },
2784 { "/Colorize Conversation/TCP/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color8_cb) },
2785 { "/Colorize Conversation/TCP/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color9_cb) },
2786 { "/Colorize Conversation/TCP/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color10_cb) },
2787 { "/Colorize Conversation/TCP/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_new_rule_cb) },
2789 { "/Colorize Conversation/UDP", NULL, "UDP", NULL, NULL, NULL },
2791 { "/Colorize Conversation/UDP/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color1_cb) },
2792 { "/Colorize Conversation/UDP/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color2_cb) },
2793 { "/Colorize Conversation/UDP/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color3_cb) },
2794 { "/Colorize Conversation/UDP/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color4_cb) },
2795 { "/Colorize Conversation/UDP/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color5_cb) },
2796 { "/Colorize Conversation/UDP/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color6_cb) },
2797 { "/Colorize Conversation/UDP/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color7_cb) },
2798 { "/Colorize Conversation/UDP/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color8_cb) },
2799 { "/Colorize Conversation/UDP/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color9_cb) },
2800 { "/Colorize Conversation/UDP/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color10_cb) },
2801 { "/Colorize Conversation/UDP/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_new_rule_cb) },
2803 { "/Colorize Conversation/PN-CBA", NULL, "PN-CBA Server", NULL, NULL, NULL },
2805 { "/Colorize Conversation/PN-CBA/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color1_cb) },
2806 { "/Colorize Conversation/PN-CBA/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color2_cb) },
2807 { "/Colorize Conversation/PN-CBA/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color3_cb) },
2808 { "/Colorize Conversation/PN-CBA/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color4_cb) },
2809 { "/Colorize Conversation/PN-CBA/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color5_cb) },
2810 { "/Colorize Conversation/PN-CBA/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color6_cb) },
2811 { "/Colorize Conversation/PN-CBA/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color7_cb) },
2812 { "/Colorize Conversation/PN-CBA/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color8_cb) },
2813 { "/Colorize Conversation/PN-CBA/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color9_cb) },
2814 { "/Colorize Conversation/PN-CBA/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color10_cb) },
2815 { "/Colorize Conversation/PN-CBA/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_new_rule_cb) },
2817 { "/SCTP", NULL, "SCTP", NULL, NULL, NULL },
2818 { "/SCTP/Analyse this Association", NULL, "Analyse this Association", NULL, NULL, G_CALLBACK(sctp_analyse_start) },
2819 { "/SCTP/Prepare Filter for this Association", NULL, "Prepare Filter for this Association", NULL, NULL, G_CALLBACK(sctp_set_assoc_filter) },
2822 { "/Follow TCP Stream", NULL, "Follow TCP Stream", NULL, NULL, G_CALLBACK(follow_tcp_stream_cb) },
2823 { "/Follow UDP Stream", NULL, "Follow UDP Stream", NULL, NULL, G_CALLBACK(follow_udp_stream_cb) },
2824 { "/Follow SSL Stream", NULL, "Follow SSL Stream", NULL, NULL, G_CALLBACK(follow_ssl_stream_cb) },
2826 { "/Copy", NULL, "Copy", NULL, NULL, NULL },
2827 { "/Copy/SummaryTxt", NULL, "Summary (Text)", NULL, NULL, G_CALLBACK(packet_list_menu_copy_sum_txt) },
2828 { "/Copy/SummaryCSV", NULL, "Summary (CSV)", NULL, NULL, G_CALLBACK(packet_list_menu_copy_sum_csv) },
2829 { "/Copy/AsFilter", NULL, "As Filter", NULL, NULL, G_CALLBACK(packet_list_menu_copy_as_flt) },
2832 { "/Copy/Bytes", NULL, "Bytes", NULL, NULL, NULL },
2833 { "/Copy/Bytes/OffsetHexText", NULL, "Offset Hex Text", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oht_cb) },
2834 { "/Copy/Bytes/OffsetHex", NULL, "Offset Hex", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oh_cb) },
2835 { "/Copy/Bytes/PrintableTextOnly", NULL, "Printable Text Only", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_text_cb) },
2837 { "/Copy/Bytes/HexStream", NULL, "Hex Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_hex_strm_cb) },
2838 { "/Copy/Bytes/BinaryStream", NULL, "Binary Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_bin_strm_cb) },
2840 { "/DecodeAs", WIRESHARK_STOCK_DECODE_AS, "Decode As...", NULL, NULL, G_CALLBACK(decode_as_cb) },
2841 { "/Print", GTK_STOCK_PRINT, "Print...", NULL, NULL, G_CALLBACK(file_print_selected_cmd_cb) },
2842 { "/ShowPacketinNewWindow", NULL, "Show Packet in New Window", NULL, NULL, G_CALLBACK(new_window_cb) },
2846 static const char *ui_desc_tree_view_menu_popup =
2848 " <popup name='TreeViewPopup' action='PopupAction'>\n"
2849 " <menuitem name='ExpandSubtrees' action='/ExpandSubtrees'/>\n"
2850 " <menuitem name='ExpandAll' action='/ExpandAll'/>\n"
2851 " <menuitem name='CollapseAll' action='/CollapseAll'/>\n"
2853 " <menuitem name='ApplyasColumn' action='/Apply as Column'/>\n"
2855 " <menu name= 'ApplyAsFilter' action='/Apply as Filter'>\n"
2856 " <menuitem name='Selected' action='/Apply as Filter/Selected'/>\n"
2857 " <menuitem name='NotSelected' action='/Apply as Filter/Not Selected'/>\n"
2858 " <menuitem name='AndSelected' action='/Apply as Filter/AndSelected'/>\n"
2859 " <menuitem name='OrSelected' action='/Apply as Filter/OrSelected'/>\n"
2860 " <menuitem name='AndNotSelected' action='/Apply as Filter/AndNotSelected'/>\n"
2861 " <menuitem name='OrNotSelected' action='/Apply as Filter/OrNotSelected'/>\n"
2863 " <menu name= 'PrepareaFilter' action='/Prepare a Filter'>\n"
2864 " <menuitem name='Selected' action='/Prepare a Filter/Selected'/>\n"
2865 " <menuitem name='NotSelected' action='/Prepare a Filter/Not Selected'/>\n"
2866 " <menuitem name='AndSelected' action='/Prepare a Filter/AndSelected'/>\n"
2867 " <menuitem name='OrSelected' action='/Prepare a Filter/OrSelected'/>\n"
2868 " <menuitem name='AndNotSelected' action='/Prepare a Filter/AndNotSelected'/>\n"
2869 " <menuitem name='OrNotSelected' action='/Prepare a Filter/OrNotSelected'/>\n"
2871 " <menu name= 'ColorizewithFilter' action='/Colorize with Filter'>\n"
2872 " <menuitem name='Color1' action='/Colorize with Filter/Color 1'/>\n"
2873 " <menuitem name='Color2' action='/Colorize with Filter/Color 2'/>\n"
2874 " <menuitem name='Color3' action='/Colorize with Filter/Color 3'/>\n"
2875 " <menuitem name='Color4' action='/Colorize with Filter/Color 4'/>\n"
2876 " <menuitem name='Color5' action='/Colorize with Filter/Color 5'/>\n"
2877 " <menuitem name='Color6' action='/Colorize with Filter/Color 6'/>\n"
2878 " <menuitem name='Color7' action='/Colorize with Filter/Color 7'/>\n"
2879 " <menuitem name='Color8' action='/Colorize with Filter/Color 8'/>\n"
2880 " <menuitem name='Color9' action='/Colorize with Filter/Color 9'/>\n"
2881 " <menuitem name='Color10' action='/Colorize with Filter/Color 10'/>\n"
2882 " <menuitem name='NewColoringRule' action='/Colorize with Filter/New Coloring Rule'/>\n"
2884 " <menuitem name='FollowTCPStream' action='/Follow TCP Stream'/>\n"
2885 " <menuitem name='FollowUDPStream' action='/Follow UDP Stream'/>\n"
2886 " <menuitem name='FollowSSLStream' action='/Follow SSL Stream'/>\n"
2888 " <menu name= 'Copy' action='/Copy'>\n"
2889 " <menuitem name='Description' action='/Copy/Description'/>\n"
2890 " <menuitem name='Fieldname' action='/Copy/Fieldname'/>\n"
2891 " <menuitem name='Value' action='/Copy/Value'/>\n"
2893 " <menuitem name='AsFilter' action='/Copy/AsFilter'/>\n"
2895 " <menu name= 'Bytes' action='/Copy/Bytes'>\n"
2896 " <menuitem name='OffsetHexText' action='/Copy/Bytes/OffsetHexText'/>\n"
2897 " <menuitem name='OffsetHex' action='/Copy/Bytes/OffsetHex'/>\n"
2898 " <menuitem name='PrintableTextOnly' action='/Copy/Bytes/PrintableTextOnly'/>\n"
2900 " <menuitem name='HexStream' action='/Copy/Bytes/HexStream'/>\n"
2901 " <menuitem name='BinaryStream' action='/Copy/Bytes/BinaryStream'/>\n"
2904 " <menuitem name='ExportSelectedPacketBytes' action='/ExportSelectedPacketBytes'/>\n"
2906 " <menuitem name='WikiProtocolPage' action='/WikiProtocolPage'/>\n"
2907 " <menuitem name='FilterFieldReference' action='/FilterFieldReference'/>\n"
2908 " <menuitem name='ProtocolHelp' action='/ProtocolHelp'/>\n"
2909 " <menuitem name='ProtocolPreferences' action='/ProtocolPreferences'/>\n"
2911 " <menuitem name='DecodeAs' action='/DecodeAs'/>\n"
2912 " <menuitem name='DisableProtocol' action='/DisableProtocol'/>\n"
2913 " <menuitem name='ResolveName' action='/ResolveName'/>\n"
2914 " <menuitem name='GotoCorrespondingPacket' action='/GotoCorrespondingPacket'/>\n"
2918 static const GtkActionEntry tree_view_menu_popup_action_entries[] = {
2919 { "/ExpandSubtrees", NULL, "Expand Subtrees", NULL, NULL, G_CALLBACK(expand_tree_cb) },
2920 { "/ExpandAll", NULL, "Expand All", NULL, NULL, G_CALLBACK(expand_all_cb) },
2921 { "/CollapseAll", NULL, "Collapse All", NULL, NULL, G_CALLBACK(collapse_all_cb) },
2922 { "/Apply as Column", NULL, "Apply as Column", NULL, NULL, G_CALLBACK(apply_as_custom_column_cb) },
2923 { "/Apply as Filter", NULL, "Apply as Filter", NULL, NULL, NULL },
2925 { "/Apply as Filter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(tree_view_menu_apply_selected_cb) },
2926 { "/Apply as Filter/Not Selected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_not_selected_cb) },
2927 { "/Apply as Filter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_and_selected_cb) },
2928 { "/Apply as Filter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_or_selected_cb) },
2929 { "/Apply as Filter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_and_not_selected_cb) },
2930 { "/Apply as Filter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_or_not_selected_cb) },
2932 { "/Prepare a Filter", NULL, "Prepare a Filter", NULL, NULL, NULL },
2933 { "/Prepare a Filter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(tree_view_menu_prepare_selected_cb) },
2934 { "/Prepare a Filter/Not Selected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_not_selected_cb) },
2935 { "/Prepare a Filter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_and_selected_cb) },
2936 { "/Prepare a Filter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_or_selected_cb) },
2937 { "/Prepare a Filter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_and_not_selected_cb) },
2938 { "/Prepare a Filter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_or_not_selected_cb) },
2940 { "/Colorize with Filter", NULL, "Colorize with Filter", NULL, NULL, NULL },
2941 { "/Colorize with Filter/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color1_cb) },
2942 { "/Colorize with Filter/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color2_cb) },
2943 { "/Colorize with Filter/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color3_cb) },
2944 { "/Colorize with Filter/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color4_cb) },
2945 { "/Colorize with Filter/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color5_cb) },
2946 { "/Colorize with Filter/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color6_cb) },
2947 { "/Colorize with Filter/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color7_cb) },
2948 { "/Colorize with Filter/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color8_cb) },
2949 { "/Colorize with Filter/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color9_cb) },
2950 { "/Colorize with Filter/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color10_cb) },
2951 { "/Colorize with Filter/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_new_rule_cb) },
2953 { "/Follow TCP Stream", NULL, "Follow TCP Stream", NULL, NULL, G_CALLBACK(follow_tcp_stream_cb) },
2954 { "/Follow UDP Stream", NULL, "Follow UDP Stream", NULL, NULL, G_CALLBACK(follow_udp_stream_cb) },
2955 { "/Follow SSL Stream", NULL, "Follow SSL Stream", NULL, NULL, G_CALLBACK(follow_ssl_stream_cb) },
2957 { "/Copy", NULL, "Copy", NULL, NULL, NULL },
2958 { "/Copy/Description", NULL, "Description", NULL, NULL, G_CALLBACK(tree_view_menu_copy_desc) },
2959 { "/Copy/Fieldname", NULL, "Fieldname", NULL, NULL, G_CALLBACK(tree_view_menu_copy_field) },
2960 { "/Copy/Value", NULL, "Value", NULL, NULL, G_CALLBACK(tree_view_menu_copy_value) },
2962 { "/Copy/AsFilter", NULL, "As Filter", NULL, NULL, G_CALLBACK(tree_view_menu_copy_as_flt) },
2964 { "/Copy/Bytes", NULL, "Bytes", NULL, NULL, NULL },
2965 { "/Copy/Bytes/OffsetHexText", NULL, "Offset Hex Text", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oht_cb) },
2966 { "/Copy/Bytes/OffsetHex", NULL, "Offset Hex", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oh_cb) },
2967 { "/Copy/Bytes/PrintableTextOnly", NULL, "Printable Text Only", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_text_cb) },
2969 { "/Copy/Bytes/HexStream", NULL, "Hex Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_hex_strm_cb) },
2970 { "/Copy/Bytes/BinaryStream", NULL, "Binary Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_bin_strm_cb) },
2972 { "/ExportSelectedPacketBytes", NULL, "Export Selected Packet Bytes...", NULL, NULL, G_CALLBACK(savehex_cb) },
2974 { "/WikiProtocolPage", WIRESHARK_STOCK_WIKI, "Wiki Protocol Page", NULL, NULL, G_CALLBACK(selected_ptree_info_cb) },
2975 { "/FilterFieldReference", WIRESHARK_STOCK_INTERNET, "Filter Field Reference", NULL, NULL, G_CALLBACK(selected_ptree_ref_cb) },
2976 { "/ProtocolHelp", NULL, "Protocol Help", NULL, NULL, NULL },
2977 { "/ProtocolPreferences", NULL, "Protocol Preferences", NULL, NULL, NULL },
2978 { "/DecodeAs", WIRESHARK_STOCK_DECODE_AS, "Decode As...", NULL, NULL, G_CALLBACK(decode_as_cb) },
2979 { "/DisableProtocol", WIRESHARK_STOCK_CHECKBOX, "Disable Protocol...", NULL, NULL, G_CALLBACK(proto_disable_cb) },
2980 { "/ResolveName", NULL, "_Resolve Name", NULL, NULL, G_CALLBACK(resolve_name_cb) },
2981 { "/GotoCorrespondingPacket", NULL, "_Go to Corresponding Packet", NULL, NULL, G_CALLBACK(goto_framenum_cb) },
2984 static const char *ui_desc_bytes_menu_popup =
2986 " <popup name='BytesMenuPopup' action='PopupAction'>\n"
2987 " <menuitem name='HexView' action='/HexView'/>\n"
2988 " <menuitem name='BitsView' action='/BitsView'/>\n"
2991 static const GtkRadioActionEntry bytes_menu_radio_action_entries [] =
2993 /* name, stock id, label, accel, tooltip, value */
2994 { "/HexView", NULL, "Hex View", NULL, NULL, BYTES_HEX },
2995 { "/BitsView", NULL, "Bits View", NULL, NULL, BYTES_BITS },
2998 static const char *ui_statusbar_profiles_menu_popup =
3000 " <popup name='ProfilesMenuPopup' action='PopupAction'>\n"
3001 " <menuitem name='Profiles' action='/Profiles'/>\n"
3003 " <menuitem name='New' action='/New'/>\n"
3004 " <menuitem name='Edit' action='/Edit'/>\n"
3005 " <menuitem name='Delete' action='/Delete'/>\n"
3007 " <menu name='Change' action='/Change'>\n"
3008 " <menuitem name='Default' action='/Change/Default'/>\n"
3012 static const GtkActionEntry statusbar_profiles_menu_action_entries [] =
3014 { "/Profiles", NULL, "Configuration Profiles...", NULL, NULL, G_CALLBACK(profile_dialog_cb) },
3015 { "/New", GTK_STOCK_NEW, "New...", NULL, NULL, G_CALLBACK(profile_new_cb) },
3016 { "/Edit", GTK_STOCK_EDIT, "Edit...", NULL, NULL, G_CALLBACK(profile_edit_cb) },
3017 { "/Delete", GTK_STOCK_DELETE, "Delete", NULL, NULL, G_CALLBACK(profile_delete_cb) },
3018 { "/Change", NULL, "Change", NULL, NULL, NULL },
3019 { "/Change/Default", NULL, "Default", NULL, NULL, NULL },
3023 main_menu_new(GtkAccelGroup ** table) {
3025 #ifdef HAVE_IGE_MAC_INTEGRATION
3026 GtkWidget *quit_item, *about_item, *preferences_item;
3027 IgeMacMenuGroup *group;
3029 #ifdef HAVE_GTKOSXAPPLICATION
3030 GtkOSXApplication *theApp;
3032 GtkOSXApplicationMenuGroup *group;
3033 GtkWidget * dock_menu;
3036 grp = gtk_accel_group_new();
3041 menubar = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar");
3042 #ifdef HAVE_IGE_MAC_INTEGRATION
3043 if(prefs.gui_macosx_style) {
3044 ige_mac_menu_set_menu_bar(GTK_MENU_SHELL(menubar));
3045 ige_mac_menu_set_global_key_handler_enabled(TRUE);
3047 /* Create menu items to populate the application menu with. We have to
3048 * do this because we are still using the old GtkItemFactory API for
3050 group = ige_mac_menu_add_app_menu_group();
3051 about_item = gtk_menu_item_new_with_label("About");
3052 g_signal_connect(about_item, "activate", G_CALLBACK(about_wireshark_cb),
3054 ige_mac_menu_add_app_menu_item(group, GTK_MENU_ITEM(about_item), NULL);
3056 group = ige_mac_menu_add_app_menu_group();
3057 preferences_item = gtk_menu_item_new_with_label("Preferences");
3058 g_signal_connect(preferences_item, "activate", G_CALLBACK(prefs_cb),
3060 ige_mac_menu_add_app_menu_item(group, GTK_MENU_ITEM(preferences_item),
3064 /* The quit item in the application menu shows up whenever ige mac
3065 * integration is enabled, even if the OS X UI style in Wireshark isn't
3067 quit_item = gtk_menu_item_new_with_label("Quit");
3068 g_signal_connect(quit_item, "activate", G_CALLBACK(file_quit_cmd_cb), NULL);
3069 ige_mac_menu_set_quit_menu_item(GTK_MENU_ITEM(quit_item));
3072 #ifdef HAVE_GTKOSXAPPLICATION
3073 theApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
3075 if(prefs.gui_macosx_style) {
3076 gtk_osxapplication_set_menu_bar(theApp, GTK_MENU_SHELL(menubar));
3077 gtk_osxapplication_set_use_quartz_accelerators(theApp, TRUE);
3079 group = gtk_osxapplication_add_app_menu_group (theApp);
3080 item = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/HelpMenu/AboutWireshark");
3081 gtk_osxapplication_add_app_menu_item(theApp, group,GTK_MENU_ITEM (item));
3083 group = gtk_osxapplication_add_app_menu_group (theApp);
3084 item = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/EditMenu/Preferences");
3085 gtk_osxapplication_add_app_menu_item(theApp, group,GTK_MENU_ITEM (item));
3087 group = gtk_osxapplication_add_app_menu_group (theApp);
3088 item = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/HelpMenu");
3089 gtk_osxapplication_set_help_menu(theApp,GTK_MENU_ITEM(item));
3091 /* Quit item is not needed */
3093 /*gtk_item_factory_delete_item(main_menu_factory,"/File/Quit");*/
3096 /* generate dock menu */
3097 dock_menu = gtk_menu_new();
3099 item = gtk_menu_item_new_with_label("Start");
3100 g_signal_connect(item, "activate", G_CALLBACK (capture_start_cb), NULL);
3101 gtk_menu_shell_append(GTK_MENU_SHELL(dock_menu), item);
3103 item = gtk_menu_item_new_with_label("Stop");
3104 g_signal_connect(item, "activate", G_CALLBACK (capture_stop_cb), NULL);
3105 gtk_menu_shell_append(GTK_MENU_SHELL(dock_menu), item);
3107 item = gtk_menu_item_new_with_label("Restart");
3108 g_signal_connect(item, "activate", G_CALLBACK (capture_restart_cb), NULL);
3109 gtk_menu_shell_append(GTK_MENU_SHELL(dock_menu), item);
3111 gtk_osxapplication_set_dock_menu(theApp, GTK_MENU_SHELL(dock_menu));
3121 menu_dissector_filter_cb( GtkAction *action _U_, gpointer callback_data)
3123 dissector_filter_t *filter_entry = callback_data;
3124 GtkWidget *filter_te;
3127 filter_te = gtk_bin_get_child(GTK_BIN(g_object_get_data(G_OBJECT(top_level), E_DFILTER_CM_KEY)));
3129 /* XXX - this gets the packet_info of the last dissected packet, */
3130 /* which is not necessarily the last selected packet */
3131 /* e.g. "Update list of packets in real time" won't work correct */
3132 buf = filter_entry->build_filter_string(&cfile.edt->pi);
3134 gtk_entry_set_text(GTK_ENTRY(filter_te), buf);
3136 /* Run the display filter so it goes in effect - even if it's the
3137 same as the previous display filter. */
3138 main_filter_packets(&cfile, buf, TRUE);
3140 g_free( (void *) buf);
3143 static gboolean menu_dissector_filter_spe_cb(frame_data *fd _U_, epan_dissect_t *edt, gpointer callback_data) {
3144 dissector_filter_t *filter_entry = callback_data;
3146 /* XXX - this gets the packet_info of the last dissected packet, */
3147 /* which is not necessarily the last selected packet */
3148 /* e.g. "Update list of packets in real time" won't work correct */
3149 return (edt != NULL) ? filter_entry->is_filter_valid(&edt->pi) : FALSE;
3152 static void menu_dissector_filter(capture_file *cf) {
3153 GList *list_entry = dissector_filter_list;
3154 dissector_filter_t *filter_entry;
3157 GtkActionGroup *action_group;
3159 GtkWidget *submenu_dissector_filters;
3164 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
3166 action_group = gtk_action_group_new ("diessector-filters-group");
3168 submenu_dissector_filters = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ConversationFilterMenu");
3169 if(!submenu_dissector_filters){
3170 g_warning("add_recent_items: No submenu_dissector_filters found, path= /Menubar/AnalyzeMenu/ConversationFilterMenu");
3173 gtk_ui_manager_insert_action_group (ui_manager_main_menubar, action_group, 0);
3174 g_object_set_data (G_OBJECT (ui_manager_main_menubar),
3175 "diessector-filters-merge-id", GUINT_TO_POINTER (merge_id));
3180 action = g_object_new (GTK_TYPE_ACTION,
3181 "name", "filter-list-empty",
3182 "label", "No fileters",
3185 gtk_action_group_add_action (action_group, action);
3186 gtk_action_set_sensitive(action, FALSE);
3187 g_object_unref (action);
3189 gtk_ui_manager_add_ui (ui_manager_main_menubar, merge_id,
3190 "/Menubar/AnalyzeMenu/ConversationFilterMenu/Filters",
3191 "filter-list-empty",
3192 "filter-list-empty",
3193 GTK_UI_MANAGER_MENUITEM,
3199 while(list_entry != NULL) {
3200 filter_entry = list_entry->data;
3201 action_name = g_strdup_printf ("filter-%u", i);
3202 /*g_warning("action_name %s, filter_entry->name %s",action_name,filter_entry->name);*/
3203 action = g_object_new (GTK_TYPE_ACTION,
3204 "name", action_name,
3205 "label", filter_entry->name,
3206 "sensitive", menu_dissector_filter_spe_cb(/* frame_data *fd _U_*/ NULL, cf->edt, filter_entry),
3208 g_signal_connect (action, "activate",
3209 G_CALLBACK (menu_dissector_filter_cb), filter_entry);
3210 gtk_action_group_add_action (action_group, action);
3211 g_object_unref (action);
3213 gtk_ui_manager_add_ui (ui_manager_main_menubar, merge_id,
3214 "/Menubar/AnalyzeMenu/ConversationFilterMenu/Filters",
3217 GTK_UI_MANAGER_MENUITEM,
3220 list_entry = g_list_next(list_entry);
3226 GtkActionGroup *packet_list_heading_action_group, *packet_list_action_group,
3227 *packet_list_details_action_group, *packet_list_byte_menu_action_group,
3228 *statusbar_profiles_action_group;
3229 GError *error = NULL;
3231 /*char *gui_desc_file_name;*/
3236 popup_menu_object = gtk_menu_new();
3238 /* packet list heading pop-up menu */
3239 packet_list_heading_action_group = gtk_action_group_new ("PacketListHeadingPopUpMenuActionGroup");
3241 gtk_action_group_add_actions (packet_list_heading_action_group, /* the action group */
3242 (gpointer)packet_list_heading_menu_popup_action_entries, /* an array of action descriptions */
3243 G_N_ELEMENTS(packet_list_heading_menu_popup_action_entries), /* the number of entries */
3244 popup_menu_object); /* data to pass to the action callbacks */
3246 gtk_action_group_add_toggle_actions(packet_list_heading_action_group, /* the action group */
3247 (gpointer)packet_list_heading_menu_toggle_action_entries, /* an array of action descriptions */
3248 G_N_ELEMENTS(packet_list_heading_menu_toggle_action_entries), /* the number of entries */
3249 NULL); /* data to pass to the action callbacks */
3251 ui_manager_packet_list_heading = gtk_ui_manager_new ();
3252 gtk_ui_manager_insert_action_group (ui_manager_packet_list_heading,
3253 packet_list_heading_action_group,
3254 0); /* the position at which the group will be inserted. */
3256 gtk_ui_manager_add_ui_from_string (ui_manager_packet_list_heading,ui_desc_packet_list_heading_menu_popup, -1, &error);
3259 fprintf (stderr, "Warning: building Packet List Heading Pop-Up failed: %s\n",
3261 g_error_free (error);
3265 g_object_set_data(G_OBJECT(popup_menu_object), PM_PACKET_LIST_COL_KEY,
3266 gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup"));
3268 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_packet_list_heading);
3270 /* packet list pop-up menu */
3271 packet_list_action_group = gtk_action_group_new ("PacketListPopUpMenuActionGroup");
3273 gtk_action_group_add_actions (packet_list_action_group, /* the action group */
3274 (gpointer)packet_list_menu_popup_action_entries, /* an array of action descriptions */
3275 G_N_ELEMENTS(packet_list_menu_popup_action_entries), /* the number of entries */
3276 popup_menu_object); /* data to pass to the action callbacks */
3278 ui_manager_packet_list_menu = gtk_ui_manager_new ();
3280 gtk_ui_manager_insert_action_group (ui_manager_packet_list_menu,
3281 packet_list_action_group,
3282 0); /* the position at which the group will be inserted. */
3284 gtk_ui_manager_add_ui_from_string (ui_manager_packet_list_menu, ui_desc_packet_list_menu_popup, -1, &error);
3287 fprintf (stderr, "Warning: building Packet List Pop-Up menu failed: %s\n",
3289 g_error_free (error);
3293 g_object_set_data(G_OBJECT(popup_menu_object), PM_PACKET_LIST_KEY,
3294 gtk_ui_manager_get_widget(ui_manager_packet_list_menu, "/PacketListMenuPopup"));
3296 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_packet_list_menu);
3299 /* packet detail pop-up menu */
3300 packet_list_details_action_group = gtk_action_group_new ("PacketListDetailsMenuPopUpActionGroup");
3302 gtk_action_group_add_actions (packet_list_details_action_group, /* the action group */
3303 (gpointer)tree_view_menu_popup_action_entries, /* an array of action descriptions */
3304 G_N_ELEMENTS(tree_view_menu_popup_action_entries), /* the number of entries */
3305 popup_menu_object); /* data to pass to the action callbacks */
3307 ui_manager_tree_view_menu = gtk_ui_manager_new ();
3309 gtk_ui_manager_insert_action_group (ui_manager_tree_view_menu,
3310 packet_list_details_action_group,
3311 0); /* the position at which the group will be inserted. */
3313 gtk_ui_manager_add_ui_from_string (ui_manager_tree_view_menu, ui_desc_tree_view_menu_popup, -1, &error);
3314 /*gui_desc_file_name = g_strdup_printf("%s" G_DIR_SEPARATOR_S "ui" G_DIR_SEPARATOR_S "tree-view-ui.xml", get_datafile_dir());
3315 gtk_ui_manager_add_ui_from_file ( ui_manager_tree_view_menu, gui_desc_file_name, &error);*/
3318 fprintf (stderr, "Warning: building TreeWiew Pop-Up menu failed: %s\n",
3320 g_error_free (error);
3323 /*g_free (gui_desc_file_name);*/
3325 g_object_set_data(G_OBJECT(popup_menu_object), PM_TREE_VIEW_KEY,
3326 gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup"));
3328 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_tree_view_menu);
3331 * Hex dump pop-up menu.
3332 * We provide our own empty menu to suppress the default pop-up menu
3335 packet_list_byte_menu_action_group = gtk_action_group_new ("PacketListByteMenuPopUpActionGroup");
3338 gtk_action_group_add_radio_actions (packet_list_byte_menu_action_group, /* the action group */
3339 (gpointer)bytes_menu_radio_action_entries, /* an array of radio action descriptions */
3340 G_N_ELEMENTS(bytes_menu_radio_action_entries), /* the number of entries */
3341 recent.gui_bytes_view, /* the value of the action to activate initially, or -1 if no action should be activated */
3342 G_CALLBACK(select_bytes_view_cb), /* the callback to connect to the changed signal */
3343 popup_menu_object); /* data to pass to the action callbacks */
3345 ui_manager_bytes_menu = gtk_ui_manager_new ();
3347 gtk_ui_manager_insert_action_group (ui_manager_bytes_menu,
3348 packet_list_byte_menu_action_group,
3349 0); /* the position at which the group will be inserted. */
3351 gtk_ui_manager_add_ui_from_string (ui_manager_bytes_menu, ui_desc_bytes_menu_popup, -1, &error);
3352 /*gui_desc_file_name = g_strdup_printf("%s" G_DIR_SEPARATOR_S "ui" G_DIR_SEPARATOR_S "bytes-view-ui.xml", get_datafile_dir());
3353 gtk_ui_manager_add_ui_from_file ( ui_manager_bytes_menu, gui_desc_file_name, &error);*/
3356 fprintf (stderr, "Warning: building Bytes Pop-Up menu failed: %s\n",
3358 g_error_free (error);
3361 /*g_free (gui_desc_file_name);*/
3363 g_object_unref(packet_list_byte_menu_action_group);
3365 g_object_set_data(G_OBJECT(popup_menu_object), PM_BYTES_VIEW_KEY,
3366 gtk_ui_manager_get_widget(ui_manager_bytes_menu, "/BytesMenuPopup"));
3368 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_bytes_menu);
3371 main_menu_bar_action_group = gtk_action_group_new ("MenuActionGroup");
3372 gtk_action_group_add_actions (main_menu_bar_action_group, /* the action group */
3373 main_menu_bar_entries, /* an array of action descriptions */
3374 G_N_ELEMENTS(main_menu_bar_entries), /* the number of entries */
3375 NULL); /* data to pass to the action callbacks */
3377 gtk_action_group_add_toggle_actions(main_menu_bar_action_group, /* the action group */
3378 main_menu_bar_toggle_action_entries, /* an array of action descriptions */
3379 G_N_ELEMENTS(main_menu_bar_toggle_action_entries), /* the number of entries */
3380 NULL); /* data to pass to the action callbacks */
3382 gtk_action_group_add_radio_actions (main_menu_bar_action_group, /* the action group */
3383 main_menu_bar_radio_view_time_entries, /* an array of radio action descriptions */
3384 G_N_ELEMENTS(main_menu_bar_radio_view_time_entries), /* the number of entries */
3385 recent.gui_time_format, /* the value of the action to activate initially, or -1 if no action should be activated */
3386 G_CALLBACK(timestamp_format_new_cb), /* the callback to connect to the changed signal */
3387 NULL); /* data to pass to the action callbacks */
3389 gtk_action_group_add_radio_actions (main_menu_bar_action_group, /* the action group */
3390 main_menu_bar_radio_view_time_fileformat_prec_entries, /* an array of radio action descriptions */
3391 G_N_ELEMENTS(main_menu_bar_radio_view_time_fileformat_prec_entries), /* the number of entries */
3392 recent.gui_time_precision, /* the value of the action to activate initially, or -1 if no action should be activated */
3393 G_CALLBACK(timestamp_precision_new_cb), /* the callback to connect to the changed signal */
3394 NULL); /* data to pass to the action callbacks */
3398 ui_manager_main_menubar = gtk_ui_manager_new ();
3399 gtk_ui_manager_insert_action_group (ui_manager_main_menubar, main_menu_bar_action_group, 0);
3400 gtk_ui_manager_add_ui_from_string (ui_manager_main_menubar,ui_desc_menubar, -1, &error);
3401 /*gui_desc_file_name = g_strdup_printf("%s" G_DIR_SEPARATOR_S "ui" G_DIR_SEPARATOR_S "main-menubar-ui.xml", get_datafile_dir());
3402 gtk_ui_manager_add_ui_from_file ( ui_manager_main_menubar, gui_desc_file_name, &error);*/
3406 fprintf (stderr, "Warning: building main menubar failed: %s\n",
3408 g_error_free (error);
3411 /*g_free (gui_desc_file_name);*/
3412 g_object_unref(main_menu_bar_action_group);
3413 gtk_window_add_accel_group (GTK_WINDOW(top_level),
3414 gtk_ui_manager_get_accel_group(ui_manager_main_menubar));
3417 /* Add the recent files items to the menu
3418 * use place holders and
3419 * gtk_ui_manager_add_ui().
3421 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
3422 add_recent_items (merge_id, ui_manager_main_menubar);
3424 statusbar_profiles_action_group = gtk_action_group_new ("StatusBarProfilesPopUpMenuActionGroup");
3426 gtk_action_group_add_actions (statusbar_profiles_action_group, /* the action group */
3427 (gpointer)statusbar_profiles_menu_action_entries, /* an array of action descriptions */
3428 G_N_ELEMENTS(statusbar_profiles_menu_action_entries), /* the number of entries */
3429 popup_menu_object); /* data to pass to the action callbacks */
3431 ui_manager_statusbar_profiles_menu = gtk_ui_manager_new ();
3432 gtk_ui_manager_insert_action_group (ui_manager_statusbar_profiles_menu,
3433 statusbar_profiles_action_group,
3434 0); /* the position at which the group will be inserted. */
3436 gtk_ui_manager_add_ui_from_string (ui_manager_statusbar_profiles_menu,ui_statusbar_profiles_menu_popup, -1, &error);
3439 fprintf (stderr, "Warning: building Statusbar Profiles Pop-Up failed: %s\n",
3441 g_error_free (error);
3445 g_object_unref(statusbar_profiles_action_group);
3447 g_object_set_data(G_OBJECT(popup_menu_object), PM_STATUSBAR_PROFILES_KEY,
3448 gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup"));
3450 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_statusbar_profiles_menu);
3452 menu_dissector_filter(&cfile);
3453 /* Only LUA uses this currently. NOTE that "placeholders" must exist in the GUI description */
3454 merge_lua_menu_items(merge_lua_menu_items_list);
3456 /* Initialize enabled/disabled state of menu items */
3457 set_menus_for_capture_file(NULL);
3459 /* Un-#if this when we actually implement Cut/Copy/Paste.
3460 Then make sure you enable them when they can be done. */
3461 set_menu_sensitivity_old("/Edit/Cut", FALSE);
3462 set_menu_sensitivity_old("/Edit/Copy", FALSE);
3463 set_menu_sensitivity_old("/Edit/Paste", FALSE);
3466 set_menus_for_captured_packets(FALSE);
3467 set_menus_for_selected_packet(&cfile);
3468 set_menus_for_selected_tree_row(&cfile);
3469 set_menus_for_capture_in_progress(FALSE);
3470 set_menus_for_file_set(/* dialog */TRUE, /* previous file */ FALSE, /* next_file */ FALSE);
3475 typedef struct _menu_item {
3476 const char *gui_path;
3478 const char *stock_id;
3480 const char *accelerator;
3481 const gchar *tooltip;
3483 gpointer callback_data;
3485 gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data);
3486 gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data);
3489 void register_lua_menu_bar_menu_items(
3490 const char *gui_path,
3492 const gchar *stock_id,
3494 const char *accelerator,
3495 const gchar *tooltip,
3497 gpointer callback_data,
3499 gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data),
3500 gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data))
3502 menu_item_t *menu_item_data;
3504 menu_item_data = g_malloc0(sizeof (menu_item_t));
3505 menu_item_data->gui_path = gui_path;
3506 menu_item_data->name = name;
3507 menu_item_data->label = label;
3508 menu_item_data->stock_id = stock_id;
3509 menu_item_data->accelerator = accelerator;
3510 menu_item_data->tooltip = tooltip;
3511 menu_item_data->callback = callback;
3512 menu_item_data->callback_data = callback_data;
3513 menu_item_data->enabled = enabled;
3514 menu_item_data->selected_packet_enabled = selected_packet_enabled;
3515 menu_item_data->selected_tree_row_enabled = selected_tree_row_enabled;
3517 merge_lua_menu_items_list = g_list_append(merge_lua_menu_items_list, menu_item_data);
3522 merge_lua_menu_items(GList *merge_lua_menu_items_list)
3525 GtkActionGroup *action_group;
3527 GtkWidget *lua_submenu;
3530 menu_item_t *menu_item_data;
3532 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
3534 action_group = gtk_action_group_new ("LUA-action-group");
3536 lua_submenu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ToolsMenu/LUA");
3538 g_warning("lua_submenu: No submenu for LUA found, path= /Menubar/ToolsMenu/LUA");
3541 gtk_ui_manager_insert_action_group (ui_manager_main_menubar, action_group, 0);
3543 while(merge_lua_menu_items_list != NULL) {
3544 menu_item_data = merge_lua_menu_items_list->data;
3545 action_name = g_strdup_printf ("LUA-menuitem-%u", i);
3546 /*g_warning("action_name %s, filter_entry->name %s",action_name,filter_entry->name);*/
3547 action = g_object_new (GTK_TYPE_ACTION,
3548 "name", action_name,
3549 "label", menu_item_data->label,
3550 "stock-id", menu_item_data->stock_id,
3551 "tooltip", menu_item_data->tooltip,
3552 "sensitive", menu_item_data->enabled,
3554 g_signal_connect (action, "activate",
3555 G_CALLBACK (menu_item_data->callback), menu_item_data->callback_data);
3556 gtk_action_group_add_action (action_group, action);
3557 g_object_unref (action);
3559 gtk_ui_manager_add_ui (ui_manager_main_menubar, merge_id,
3560 "/Menubar/ToolsMenu/LUA/LUA-menu-items",
3563 GTK_UI_MANAGER_MENUITEM,
3566 merge_lua_menu_items_list = g_list_next(merge_lua_menu_items_list);
3571 GtkActionGroup *action_group;
3573 GtkWidget *submenu_dissector_filters;
3578 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
3580 action_group = gtk_action_group_new ("diessector-filters-group");
3582 submenu_dissector_filters = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ConversationFilterMenu");
3583 if(!submenu_dissector_filters){
3584 g_warning("add_recent_items: No submenu_dissector_filters found, path= /Menubar/AnalyzeMenu/ConversationFilterMenu");
3587 gtk_ui_manager_insert_action_group (ui_manager_main_menubar, action_group, 0);
3588 g_object_set_data (G_OBJECT (ui_manager_main_menubar),
3589 "diessector-filters-merge-id", GUINT_TO_POINTER (merge_id));
3594 action = g_object_new (GTK_TYPE_ACTION,
3595 "name", "filter-list-empty",
3596 "label", "No fileters",
3599 gtk_action_group_add_action (action_group, action);
3600 gtk_action_set_sensitive(action, FALSE);
3601 g_object_unref (action);
3603 gtk_ui_manager_add_ui (ui_manager_main_menubar, merge_id,
3604 "/Menubar/AnalyzeMenu/ConversationFilterMenu/Filters",
3605 "filter-list-empty",
3606 "filter-list-empty",
3607 GTK_UI_MANAGER_MENUITEM,
3613 while(list_entry != NULL) {
3614 filter_entry = list_entry->data;
3615 action_name = g_strdup_printf ("filter-%u", i);
3616 /*g_warning("action_name %s, filter_entry->name %s",action_name,filter_entry->name);*/
3617 action = g_object_new (GTK_TYPE_ACTION,
3618 "name", action_name,
3619 "label", filter_entry->name,
3620 "sensitive", menu_dissector_filter_spe_cb(/* frame_data *fd _U_*/ NULL, cf->edt, filter_entry),
3622 g_signal_connect (action, "activate",
3623 G_CALLBACK (menu_dissector_filter_cb), filter_entry);
3624 gtk_action_group_add_action (action_group, action);
3625 g_object_unref (action);
3627 gtk_ui_manager_add_ui (ui_manager_main_menubar, merge_id,
3628 "/Menubar/AnalyzeMenu/ConversationFilterMenu/Filters",
3631 GTK_UI_MANAGER_MENUITEM,
3634 list_entry = g_list_next(list_entry);
3642 add_menu_item(menu_item_t *node_data){
3643 GtkActionGroup *action_group = NULL;
3645 GList *action_groups, *l;
3648 g_warning("path '%s', node_data->name '%s'",node_data->gui_path,node_data->name);
3649 if(node_data->stock_id){
3650 g_warning("node_data->stock_id %s",node_data->stock_id);
3653 action_groups = gtk_ui_manager_get_action_groups (ui_manager_main_menubar);
3654 for (l = action_groups; l != NULL; l = l->next)
3656 GtkActionGroup *group = l->data;
3658 if (strcmp (gtk_action_group_get_name (group), "MenuActionGroup") == 0){
3659 /* This unrefs the action group and all of its actions */
3660 action_group = group;
3665 g_warning("Failed to find the action group");
3668 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
3670 action = g_object_new (GTK_TYPE_ACTION,
3671 "name", node_data->name,
3672 "label", node_data->label,
3673 "stock_id", node_data->stock_id,
3674 "sensitive", node_data->enabled,
3676 gtk_action_group_add_action (action_group, action);
3677 g_signal_connect (action, "activate",
3678 G_CALLBACK (node_data->callback), node_data->callback_data);
3680 g_object_unref (action);
3682 gtk_ui_manager_add_ui (ui_manager_main_menubar, merge_id,
3683 node_data->gui_path,
3684 node_data->name, /* XXX is this ok, the name for the added UI element */
3685 node_data->name, /* the name of the action to be proxied, or NULL to add a separator */
3686 GTK_UI_MANAGER_MENUITEM,
3694 * Enable/disable menu sensitivity.
3697 set_menu_sensitivity(GtkUIManager *ui_manager, const gchar *path, gint val)
3701 action = gtk_ui_manager_get_action(ui_manager, path);
3704 fprintf (stderr, "Warning: couldn't find action path= %s\n",
3709 gtk_action_set_sensitive (action,
3710 val); /* TRUE to make the action sensitive */
3715 set_menu_object_data_meat(GtkUIManager *ui_manager, const gchar *path, const gchar *key, gpointer data)
3717 GtkWidget *menu = NULL;
3719 if ((menu = gtk_ui_manager_get_widget(ui_manager, path)) != NULL){
3720 g_object_set_data(G_OBJECT(menu), key, data);
3723 g_warning("set_menu_object_data_meat: no menu, path: %s",path);
3729 set_menu_object_data (const gchar *path, const gchar *key, gpointer data) {
3730 if (strncmp (path,"/Menubar",8) == 0){
3731 set_menu_object_data_meat(ui_manager_main_menubar, path, key, data);
3732 }else if (strncmp (path,"/PacketListMenuPopup",20) == 0){
3733 set_menu_object_data_meat(ui_manager_packet_list_menu, path, key, data);
3734 }else if (strncmp (path,"/TreeViewPopup",14) == 0){
3735 set_menu_object_data_meat(ui_manager_tree_view_menu, path, key, data);
3736 }else if (strncmp (path,"/BytesMenuPopup",15) == 0){
3737 set_menu_object_data_meat(ui_manager_bytes_menu, path, key, data);
3738 }else if (strncmp (path,"/ProfilesMenuPopup",18) == 0){
3739 set_menu_object_data_meat(ui_manager_statusbar_profiles_menu, path, key, data);
3744 /* Recently used capture files submenu:
3745 * Submenu containing the recently used capture files.
3746 * The capture filenames are always kept with the absolute path, to be independant
3747 * of the current path.
3748 * They are only stored inside the labels of the submenu (no separate list). */
3750 #define MENU_RECENT_FILES_PATH "/Menubar/FileMenu/OpenRecent"
3751 #define MENU_RECENT_FILES_KEY "Recent File Name"
3753 /* Add a file name to the top of the list, if its allrady present remove it first */
3755 remove_present_file_name(GList *recent_files_list, const gchar *cf_name){
3757 gchar *widget_cf_name;
3759 for (li = g_list_first(recent_files_list); li; li = li->next) {
3760 widget_cf_name = li->data;
3763 /* do a case insensitive compare on win32 */
3764 g_ascii_strncasecmp(widget_cf_name, cf_name, 1000) == 0){
3766 /* do a case sensitive compare on unix */
3767 strncmp(widget_cf_name, cf_name, 1000) == 0 ){
3769 recent_files_list = g_list_remove(recent_files_list,widget_cf_name);
3773 return recent_files_list;
3777 recent_changed_cb (GtkUIManager *ui_manager,
3778 gpointer user_data _U_)
3781 GList *action_groups, *l;
3784 merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (ui_manager),
3785 "recent-files-merge-id"));
3788 gtk_ui_manager_remove_ui (ui_manager, merge_id);
3790 /* remove the action group; gtk_ui_manager_remove_action_group()
3791 * should really take the action group's name instead of its
3794 action_groups = gtk_ui_manager_get_action_groups (ui_manager);
3795 for (l = action_groups; l != NULL; l = l->next)
3797 GtkActionGroup *group = l->data;
3799 if (strcmp (gtk_action_group_get_name (group), "recent-files-group") == 0){
3800 /* this unrefs the action group and all of its actions */
3801 gtk_ui_manager_remove_action_group (ui_manager, group);
3806 /* generate a new merge id and re-add everything */
3807 merge_id = gtk_ui_manager_new_merge_id (ui_manager);
3808 add_recent_items (merge_id, ui_manager);
3812 recent_clear_cb(GtkAction *action _U_, gpointer user_data _U_)
3814 GtkWidget *submenu_recent_files;
3815 GList *recent_files_list;
3817 /* Get the list of recent files, free the list and store the empty list with the widget */
3818 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
3819 recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
3820 /* Free the name strings ?? */
3821 g_list_free(recent_files_list);
3822 recent_files_list = NULL;
3823 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
3824 /* Calling recent_changed_cb will rebuild the GUI call add_recent_items which will in turn call
3825 * main_welcome_reset_recent_capture_files
3827 recent_changed_cb(ui_manager_main_menubar, NULL);
3831 add_recent_items (guint merge_id, GtkUIManager *ui_manager)
3833 GtkActionGroup *action_group;
3835 GtkWidget *submenu_recent_files;
3840 /* Reset the recent files list in the welcome screen */
3841 main_welcome_reset_recent_capture_files();
3843 action_group = gtk_action_group_new ("recent-files-group");
3845 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
3846 if(!submenu_recent_files){
3847 g_warning("add_recent_items: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
3849 items = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
3851 gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
3852 g_object_set_data (G_OBJECT (ui_manager),
3853 "recent-files-merge-id", GUINT_TO_POINTER (merge_id));
3858 action = g_object_new (GTK_TYPE_ACTION,
3859 "name", "recent-info-empty",
3860 "label", "No recently used files",
3863 gtk_action_group_add_action (action_group, action);
3864 gtk_action_set_sensitive(action, FALSE);
3865 g_object_unref (action);
3867 gtk_ui_manager_add_ui (ui_manager, merge_id,
3868 "/Menubar/FileMenu/OpenRecent/RecentFiles",
3869 "recent-info-empty",
3870 "recent-info-empty",
3871 GTK_UI_MANAGER_MENUITEM,
3877 for (i = 0, l = items;
3878 i < prefs.gui_recent_files_count_max && l != NULL;
3881 gchar *item_name = l->data;
3882 action_name = g_strdup_printf ("recent-info-%u", i);
3884 action = g_object_new (GTK_TYPE_ACTION,
3885 "name", action_name,
3887 "stock_id", WIRESHARK_STOCK_FILE,
3889 g_signal_connect (action, "activate",
3890 G_CALLBACK (menu_open_recent_file_cmd_cb), NULL);
3891 #if !GTK_CHECK_VERSION(2,16,0)
3892 g_object_set_data (G_OBJECT (action), "FileName", item_name);
3894 gtk_action_group_add_action (action_group, action);
3895 g_object_unref (action);
3897 gtk_ui_manager_add_ui (ui_manager, merge_id,
3898 "/Menubar/FileMenu/OpenRecent/RecentFiles",
3901 GTK_UI_MANAGER_MENUITEM,
3904 /* Add the file name to the recent files list on the Welcome screen */
3905 main_welcome_add_recent_capture_file(item_name, G_OBJECT(action));
3907 g_free (action_name);
3909 /* Add a Separator */
3910 gtk_ui_manager_add_ui (ui_manager, merge_id,
3911 "/Menubar/FileMenu/OpenRecent/RecentFiles",
3912 "separator-recent-info",
3914 GTK_UI_MANAGER_SEPARATOR,
3917 /* Add a clear Icon */
3918 action = g_object_new (GTK_TYPE_ACTION,
3919 "name", "clear-recent-info",
3920 "label", "Clear the recent files list",
3921 "stock_id", GTK_STOCK_CLEAR,
3924 g_signal_connect (action, "activate",
3925 G_CALLBACK (recent_clear_cb), NULL);
3927 gtk_action_group_add_action (action_group, action);
3928 g_object_unref (action);
3930 gtk_ui_manager_add_ui (ui_manager, merge_id,
3931 "/Menubar/FileMenu/OpenRecent/RecentFiles",
3932 "clear-recent-info",
3933 "clear-recent-info",
3934 GTK_UI_MANAGER_MENUITEM,
3940 /* Open a file by it's name
3941 (Beware: will not ask to close existing capture file!) */
3943 menu_open_filename(gchar *cf_name)
3945 GtkWidget *submenu_recent_files;
3947 GList *recent_files_list;
3950 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
3951 if(!submenu_recent_files){
3952 g_warning("menu_open_filename: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
3954 recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
3955 /* XXX: ask user to remove item, it's maybe only a temporary problem */
3956 /* open and read the capture file (this will close an existing file) */
3957 if (cf_open(&cfile, cf_name, FALSE, &err) == CF_OK) {
3958 cf_read(&cfile, FALSE);
3960 recent_files_list = remove_present_file_name(recent_files_list, cf_name);
3961 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
3962 /* Calling recent_changed_cb will rebuild the GUI call add_recent_items which will in turn call
3963 * main_welcome_reset_recent_capture_files
3965 recent_changed_cb(ui_manager_main_menubar, NULL);
3969 /* callback, if the user pushed a recent file submenu item */
3971 menu_open_recent_file_cmd(gpointer action)
3973 GtkWidget *submenu_recent_files;
3974 GList *recent_files_list;
3975 const gchar *cf_name;
3978 #if GTK_CHECK_VERSION(2,16,0)
3979 cf_name = gtk_action_get_label(action);
3981 cf_name = g_object_get_data(G_OBJECT(action), "FileName");
3984 /* open and read the capture file (this will close an existing file) */
3985 if (cf_open(&cfile, cf_name, FALSE, &err) == CF_OK) {
3986 cf_read(&cfile, FALSE);
3988 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
3989 recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
3991 recent_files_list = remove_present_file_name(recent_files_list, cf_name);
3992 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
3993 /* Calling recent_changed_cb will rebuild the GUI call add_recent_items which will in turn call
3994 * main_welcome_reset_recent_capture_files
3996 recent_changed_cb(ui_manager_main_menubar, NULL);
4000 static void menu_open_recent_file_answered_cb(gpointer dialog _U_, gint btn, gpointer data)
4004 /* save file first */
4005 file_save_as_cmd(after_save_open_recent_file, data);
4009 menu_open_recent_file_cmd(data);
4011 case(ESD_BTN_CANCEL):
4014 g_assert_not_reached();
4018 menu_open_recent_file_cmd_cb(GtkAction *action, gpointer data _U_) {
4022 if((cfile.state != FILE_CLOSED) && !cfile.user_saved && prefs.gui_ask_unsaved) {
4023 /* user didn't saved his current file, ask him */
4024 dialog = simple_dialog(ESD_TYPE_CONFIRMATION, ESD_BTNS_YES_NO_CANCEL,
4025 "%sSave capture file before opening a new one?%s\n\n"
4026 "If you open a new capture file without saving, your current capture data will be discarded.",
4027 simple_dialog_primary_start(), simple_dialog_primary_end());
4028 simple_dialog_set_cb(dialog, menu_open_recent_file_answered_cb, action);
4030 /* unchanged file */
4031 menu_open_recent_file_cmd(action);
4036 add_menu_recent_capture_file_absolute(gchar *cf_name) {
4037 GtkWidget *submenu_recent_files;
4039 gchar *widget_cf_name;
4040 gchar *normalized_cf_name;
4042 GList *recent_files_list;
4044 normalized_cf_name = g_strdup(cf_name);
4046 /* replace all slashes by backslashes */
4047 g_strdelimit(normalized_cf_name, "/", '\\');
4050 /* get the submenu container item */
4051 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
4052 if(!submenu_recent_files){
4053 g_warning("add_menu_recent_capture_file_absolute: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
4056 recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
4058 for (li = g_list_first(recent_files_list); li; li = li->next, cnt++) {
4059 widget_cf_name = li->data;
4062 /* do a case insensitive compare on win32 */
4063 g_ascii_strncasecmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
4065 /* do a case sensitive compare on unix */
4066 strncmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
4068 cnt >= prefs.gui_recent_files_count_max) {
4069 recent_files_list = g_list_remove(recent_files_list,widget_cf_name);
4073 recent_files_list = g_list_prepend(recent_files_list, normalized_cf_name);
4074 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
4075 recent_changed_cb( ui_manager_main_menubar, NULL);
4079 /* add the capture filename to the "Recent Files" menu */
4080 /* (will change nothing, if this filename is already in the menu) */
4082 * XXX - We might want to call SHAddToRecentDocs under Windows 7:
4083 * http://stackoverflow.com/questions/437212/how-do-you-register-a-most-recently-used-list-with-windows-in-preparation-for-win
4086 add_menu_recent_capture_file(gchar *cf_name) {
4091 /* if this filename is an absolute path, we can use it directly */
4092 if (g_path_is_absolute(cf_name)) {
4093 add_menu_recent_capture_file_absolute(cf_name);
4097 /* this filename is not an absolute path, prepend the current dir */
4098 curr = g_get_current_dir();
4099 absolute = g_strdup_printf("%s%s%s", curr, G_DIR_SEPARATOR_S, cf_name);
4100 add_menu_recent_capture_file_absolute(absolute);
4106 /* write all capture filenames of the menu to the user's recent file */
4108 menu_recent_file_write_all(FILE *rf) {
4109 GtkWidget *submenu_recent_files;
4113 GList *recent_files_list, *list;
4115 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
4116 if(!submenu_recent_files){
4117 g_warning("menu_recent_file_write_all: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
4119 recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
4120 list = g_list_last(recent_files_list);
4121 while(list != NULL) {
4122 cf_name = list->data;
4125 fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", u3_contract_device_path(cf_name));
4127 fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", cf_name);
4129 list = g_list_previous(list);
4131 g_list_free(recent_files_list);
4134 /* we have to iterate backwards through the children's list,
4135 * so we get the latest item last in the file.
4136 * (don't use gtk_container_foreach() here, it will return the wrong iteration order) */
4137 children = gtk_container_get_children(GTK_CONTAINER(submenu_recent_files));
4138 child = g_list_last(children);
4139 while(child != NULL) {
4140 /* get capture filename from the menu item label */
4141 cf_name = g_object_get_data(G_OBJECT(child->data), MENU_RECENT_FILES_KEY);
4144 fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", u3_contract_device_path(cf_name));
4146 fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", cf_name);
4149 child = g_list_previous(child);
4152 g_list_free(children);
4157 show_hide_cb(GtkWidget *w, gpointer data _U_, gint action)
4160 /* save current setting in recent */
4162 case(SHOW_HIDE_MAIN_TOOLBAR):
4163 recent.main_toolbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
4165 case(SHOW_HIDE_FILTER_TOOLBAR):
4166 recent.filter_toolbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
4169 case(SHOW_HIDE_AIRPCAP_TOOLBAR):
4170 recent.airpcap_toolbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
4173 case(SHOW_HIDE_STATUSBAR):
4174 recent.statusbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
4176 case(SHOW_HIDE_PACKET_LIST):
4177 recent.packet_list_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
4179 case(SHOW_HIDE_TREE_VIEW):
4180 recent.tree_view_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
4182 case(SHOW_HIDE_BYTE_VIEW):
4183 recent.byte_view_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
4186 g_assert_not_reached();
4189 main_widgets_show_or_hide();
4194 timestamp_seconds_time_cb(GtkWidget *w, gpointer d _U_, gint action _U_)
4196 if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w))) {
4197 recent.gui_seconds_format = TS_SECONDS_HOUR_MIN_SEC;
4199 recent.gui_seconds_format = TS_SECONDS_DEFAULT;
4201 timestamp_set_seconds_type (recent.gui_seconds_format);
4203 /* This call adjusts column width */
4204 cf_timestamp_auto_precision(&cfile);
4205 new_packet_list_queue_draw();
4209 menu_name_resolution_changed(void)
4211 GtkWidget *menu = NULL;
4212 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforMACLayer");
4214 g_warning("menu_name_resolution_changed: No menu found, path= /Menubar/ViewMenu/NameResolution/EnableforMACLayer");
4216 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags & RESOLV_MAC);
4218 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforNetworkLayer");
4220 g_warning("menu_name_resolution_changed: No menu found, path= /Menubar/ViewMenu/NameResolution/EnableforNetworkLayer");
4222 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags & RESOLV_NETWORK);
4224 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforTransportLayer");
4226 g_warning("menu_name_resolution_changed: No menu found, path= /Menubar/ViewMenu/NameResolution/EnableforTransportLayer");
4228 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags & RESOLV_TRANSPORT);
4233 name_resolution_cb(GtkWidget *w, gpointer d _U_, gint action)
4235 if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w))) {
4236 gbl_resolv_flags |= action;
4238 gbl_resolv_flags &= ~action;
4244 menu_auto_scroll_live_changed(gboolean auto_scroll_live_in) {
4248 /* tell menu about it */
4249 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/AutoScrollinLiveCapture");
4251 g_warning("menu_auto_scroll_live_changed: No menu found, path= /Menubar/ViewMenu/AutoScrollinLiveCapture");
4253 if( ((gboolean) gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu)) != auto_scroll_live_in) ) {
4254 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), auto_scroll_live_in);
4257 /* tell toolbar about it */
4258 toolbar_auto_scroll_live_changed(auto_scroll_live_in);
4260 /* change auto scroll */
4261 if(auto_scroll_live_in != auto_scroll_live) {
4262 auto_scroll_live = auto_scroll_live_in;
4267 #endif /*HAVE_LIBPCAP */
4271 menu_colorize_changed(gboolean packet_list_colorize) {
4275 /* tell menu about it */
4276 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizePacketList");
4278 g_warning("menu_colorize_changed: No menu found, path= /Menubar/ViewMenu/ColorizePacketList");
4280 if( (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu)) != packet_list_colorize) ) {
4281 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), packet_list_colorize);
4284 /* tell toolbar about it */
4285 toolbar_colorize_changed(packet_list_colorize);
4287 /* change colorization */
4288 if(packet_list_colorize != recent.packet_list_colorize) {
4289 recent.packet_list_colorize = packet_list_colorize;
4290 color_filters_enable(packet_list_colorize);
4291 new_packet_list_colorize_packets();
4296 colorize_cb(GtkWidget *w, gpointer d _U_)
4298 menu_colorize_changed(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w)));
4302 /* the recent file read has finished, update the menu corresponding */
4304 menu_recent_read_finished(void) {
4305 GtkWidget *menu = NULL;
4307 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/MainToolbar");
4309 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/MainToolbar");
4311 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.main_toolbar_show);
4313 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/FilterToolbar");
4315 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/FilterToolbar");
4317 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.filter_toolbar_show);
4320 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/WirelessToolbar");
4322 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/WirelessToolbar");
4324 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.airpcap_toolbar_show);
4326 #endif /* HAVE_AIRPCAP */
4329 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/Statusbar");
4331 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/Statusbar");
4333 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.statusbar_show);
4336 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketList");
4338 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/PacketList");
4340 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.packet_list_show);
4343 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketDetails");
4345 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/PacketDetails");
4347 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.tree_view_show);
4350 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketBytes");
4352 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/PacketBytes");
4354 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.byte_view_show);
4357 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizePacketList");
4359 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/ColorizePacketList");
4361 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.packet_list_colorize);
4364 menu_name_resolution_changed();
4367 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/AutoScrollinLiveCapture");
4369 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/AutoScrollinLiveCapture");
4371 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), auto_scroll_live);
4373 #endif /* HAVE_LIBPCAP */
4375 main_widgets_rearrange();
4377 /* don't change the time format, if we had a command line value */
4378 if (timestamp_get_type() != TS_NOT_SET) {
4379 recent.gui_time_format = timestamp_get_type();
4383 timestamp_set_type(recent.gui_time_format);
4384 /* This call adjusts column width */
4385 cf_timestamp_auto_precision(&cfile);
4386 new_packet_list_queue_draw();
4388 /* This should not be needed as we set the active radioItem when we crate the actiongroup */
4389 switch(recent.gui_time_format) {
4390 case(TS_ABSOLUTE_WITH_DATE):
4391 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/DateandTimeofDay");
4393 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/DateandTimeofDay");
4397 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/TimeofDay");
4399 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/TimeofDay");
4403 g_warning("TS_RELATIVE");
4404 action = gtk_ui_manager_get_action(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/SecondsSinceBeginningofCapture");
4405 gtk_action_activate(action);
4406 if(gtk_action_is_sensitive(action))
4407 g_warning("ACTION IS SENSIBLE");
4409 g_warning("NO ACTION");
4412 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/SecondsSinceBeginningofCapture");
4414 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/SecondsSinceBeginningofCapture");
4418 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/SecondsSincePreviousCapturedPacket");
4420 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/SecondsSincePreviousCapturedPacket");
4424 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/SecondsSincePreviousDisplayedPacket");
4426 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/SecondsSincePreviousDisplayedPacket");
4430 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/SecondsSinceEpoch");
4432 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/SecondsSinceEpoch");
4435 case(TS_UTC_WITH_DATE):
4436 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/UTCDateandTimeofDay");
4438 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/UTCDateandTimeofDay");
4442 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/UTCTimeofDay");
4444 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/UTCTimeofDay");
4448 g_assert_not_reached();
4450 /* set_active will not trigger the callback when activating an active item! */
4451 recent.gui_time_format = -1;
4452 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
4453 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
4455 /* the actual precision will be set in new_packet_list_queue_draw() below */
4456 if (recent.gui_time_precision == TS_PREC_AUTO) {
4457 timestamp_set_precision(TS_PREC_AUTO_SEC);
4459 timestamp_set_precision(recent.gui_time_precision);
4461 /* This call adjusts column width */
4462 cf_timestamp_auto_precision(&cfile);
4463 new_packet_list_queue_draw();
4465 /* don't change the seconds format, if we had a command line value */
4466 if (timestamp_get_seconds_type() != TS_SECONDS_NOT_SET) {
4467 recent.gui_seconds_format = timestamp_get_seconds_type();
4469 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes");
4471 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes");
4474 switch (recent.gui_seconds_format) {
4475 case TS_SECONDS_DEFAULT:
4476 recent.gui_seconds_format = -1;
4477 /* set_active will not trigger the callback when deactivating an inactive item! */
4478 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
4479 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
4481 case TS_SECONDS_HOUR_MIN_SEC:
4482 recent.gui_seconds_format = -1;
4483 /* set_active will not trigger the callback when activating an active item! */
4484 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
4485 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
4488 g_assert_not_reached();
4491 menu_colorize_changed(recent.packet_list_colorize);
4496 popup_menu_handler(GtkWidget *widget, GdkEvent *event, gpointer data)
4498 GtkWidget *menu = (GtkWidget *)data;
4499 GdkEventButton *event_button = NULL;
4502 if(widget == NULL || event == NULL || data == NULL) {
4507 * If we ever want to make the menu differ based on what row
4508 * and/or column we're above, we'd use "eth_clist_get_selection_info()"
4509 * to find the row and column number for the coordinates; a CTree is,
4510 * I guess, like a CList with one column(?) and the expander widget
4513 /* Check if we are on packet_list object */
4514 if (widget == g_object_get_data(G_OBJECT(popup_menu_object), E_MPACKET_LIST_KEY) &&
4515 ((GdkEventButton *)event)->button != 1) {
4517 if (new_packet_list_get_event_row_column((GdkEventButton *)event, &physical_row, &row, &column)) {
4518 g_object_set_data(G_OBJECT(popup_menu_object), E_MPACKET_LIST_ROW_KEY,
4519 GINT_TO_POINTER(row));
4520 g_object_set_data(G_OBJECT(popup_menu_object), E_MPACKET_LIST_COL_KEY,
4521 GINT_TO_POINTER(column));
4522 new_packet_list_set_selected_row(row);
4526 /* Check if we are on tree_view object */
4527 if (widget == tree_view_gbl) {
4528 tree_view_select(widget, (GdkEventButton *) event);
4531 /* context menu handler */
4532 if(event->type == GDK_BUTTON_PRESS) {
4533 event_button = (GdkEventButton *) event;
4535 /* To quote the "Gdk Event Structures" doc:
4536 * "Normally button 1 is the left mouse button, 2 is the middle button, and 3 is the right button" */
4537 if(event_button->button == 3) {
4538 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
4539 event_button->button,
4540 event_button->time);
4541 g_signal_stop_emission_by_name(widget, "button_press_event");
4546 /* Check if we are on byte_view object */
4547 if(widget == get_notebook_bv_ptr(byte_nb_ptr_gbl)) {
4548 byte_view_select(widget, (GdkEventButton *) event);
4551 /* GDK_2BUTTON_PRESS is a doubleclick -> expand/collapse tree row */
4552 /* GTK version 1 seems to be doing this automatically */
4553 if (widget == tree_view_gbl && event->type == GDK_2BUTTON_PRESS) {
4556 if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget),
4557 (gint) (((GdkEventButton *)event)->x),
4558 (gint) (((GdkEventButton *)event)->y),
4559 &path, NULL, NULL, NULL))
4561 if (gtk_tree_view_row_expanded(GTK_TREE_VIEW(widget), path))
4562 gtk_tree_view_collapse_row(GTK_TREE_VIEW(widget), path);
4564 gtk_tree_view_expand_row(GTK_TREE_VIEW(widget), path,
4566 gtk_tree_path_free(path);
4572 /* Enable or disable menu items based on whether you have a capture file
4573 you've finished reading and, if you have one, whether it's been saved
4574 and whether it could be saved except by copying the raw packet data. */
4576 set_menus_for_capture_file(capture_file *cf)
4579 /* We have no capture file */
4580 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Merge", FALSE);
4581 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Close", FALSE);
4582 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Save", FALSE);
4583 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/SaveAs", FALSE);
4584 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Export", FALSE);
4585 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/Reload", FALSE);
4586 set_toolbar_for_capture_file(FALSE);
4587 set_toolbar_for_unsaved_capture_file(FALSE);
4589 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Merge", TRUE);
4590 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Close", TRUE);
4591 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Save", !cf->user_saved);
4593 * "Save As..." works only if we can write the file out in at least
4594 * one format (so we can save the whole file or just a subset) or
4595 * if we have an unsaved capture (so writing the whole file out
4596 * with a raw data copy makes sense).
4598 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/SaveAs",
4599 cf_can_save_as(cf) || !cf->user_saved);
4600 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Export", TRUE);
4601 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/Reload", TRUE);
4602 set_toolbar_for_unsaved_capture_file(!cf->user_saved);
4603 set_toolbar_for_capture_file(TRUE);
4607 /* Enable or disable menu items based on whether there's a capture in
4610 set_menus_for_capture_in_progress(gboolean capture_in_progress)
4612 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Open",
4613 !capture_in_progress);
4614 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/OpenRecent",
4615 !capture_in_progress);
4616 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Export",
4617 capture_in_progress);
4618 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set",
4619 !capture_in_progress);
4620 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortAscending",
4621 !capture_in_progress);
4622 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortDescending",
4623 !capture_in_progress);
4624 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/NoSorting",
4625 !capture_in_progress);
4628 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Options",
4629 !capture_in_progress);
4630 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Start",
4631 !capture_in_progress);
4632 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Stop",
4633 capture_in_progress);
4634 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Restart",
4635 capture_in_progress);
4636 set_toolbar_for_capture_in_progress(capture_in_progress);
4638 set_capture_if_dialog_for_capture_in_progress(capture_in_progress);
4639 #endif /* HAVE_LIBPCAP */
4644 set_menus_for_captured_packets(gboolean have_captured_packets)
4646 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Print",
4647 have_captured_packets);
4648 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/Print",
4649 have_captured_packets);
4651 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPacket",
4652 have_captured_packets);
4653 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindNext",
4654 have_captured_packets);
4655 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPrevious",
4656 have_captured_packets);
4657 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ZoomIn",
4658 have_captured_packets);
4659 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ZoomOut",
4660 have_captured_packets);
4661 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/NormalSize",
4662 have_captured_packets);
4663 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/Goto",
4664 have_captured_packets);
4665 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/PreviousPacket",
4666 have_captured_packets);
4667 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/NextPacket",
4668 have_captured_packets);
4669 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/FirstPacket",
4670 have_captured_packets);
4671 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/LastPacket",
4672 have_captured_packets);
4673 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/PreviousPacketInConversation",
4674 have_captured_packets);
4675 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/NextPacketInConversation",
4676 have_captured_packets);
4677 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/StatisticsMenu/Summary",
4678 have_captured_packets);
4679 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/StatisticsMenu/ProtocolHierarchy",
4680 have_captured_packets);
4681 set_toolbar_for_captured_packets(have_captured_packets);
4686 packet_is_ssl(epan_dissect_t* edt)
4692 if (!edt || !edt->tree)
4694 ssl_id = proto_get_id_by_filter_name("ssl");
4697 array = proto_find_finfo(edt->tree, ssl_id);
4698 is_ssl = (array->len > 0) ? TRUE : FALSE;
4699 g_ptr_array_free(array, TRUE);
4704 set_menus_for_selected_packet(capture_file *cf)
4706 GList *list_entry = dissector_filter_list;
4708 /* Making the menu context-sensitive allows for easier selection of the
4709 desired item and has the added benefit, with large captures, of
4710 avoiding needless looping through huge lists for marked, ignored,
4711 or time-referenced packets. */
4712 gboolean is_ssl = packet_is_ssl(cf->edt);
4713 gboolean frame_selected = cf->current_frame != NULL;
4714 /* A frame is selected */
4715 gboolean have_marked = frame_selected && cf->marked_count > 0;
4716 /* We have marked frames. (XXX - why check frame_selected?) */
4717 gboolean another_is_marked = have_marked &&
4718 !(cf->marked_count == 1 && cf->current_frame->flags.marked);
4719 /* We have a marked frame other than the current frame (i.e.,
4720 we have at least one marked frame, and either there's more
4721 than one marked frame or the current frame isn't marked). */
4722 gboolean have_time_ref = cf->ref_time_count > 0;
4723 gboolean another_is_time_ref = frame_selected && have_time_ref &&
4724 !(cf->ref_time_count == 1 && cf->current_frame->flags.ref_time);
4725 /* We have a time reference frame other than the current frame (i.e.,
4726 we have at least one time reference frame, and either there's more
4727 than one time reference frame or the current frame isn't a
4728 time reference frame). (XXX - why check frame_selected?) */
4730 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/MarkPacket",
4732 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/MarkPacket",
4734 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/MarkAllDisplayedPackets",
4735 cf->displayed_count > 0);
4736 /* Unlike un-ignore, do not allow unmark of all frames when no frames are displayed */
4737 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/UnmarkAllDisplayedPackets",
4739 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindNextMark",
4741 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPreviousMark",
4744 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/IgnorePacket",
4746 #ifdef WANT_PACKET_EDITOR
4747 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/EditPacket",
4749 #endif /* WANT_PACKET_EDITOR */
4750 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/IgnorePacket",
4752 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/IgnoreAllDisplayedPackets",
4753 cf->displayed_count > 0 && cf->displayed_count != cf->count);
4754 /* Allow un-ignore of all frames even with no frames currently displayed */
4755 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Un-IgnoreAllPackets",
4756 cf->ignored_count > 0);
4758 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/SetTimeReference",
4760 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Un-TimeReferenceAllPackets",
4762 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/TimeShift",
4764 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/SetTimeReference",
4766 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindNextTimeReference",
4767 another_is_time_ref);
4768 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPreviousTimeReference",
4769 another_is_time_ref);
4771 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ResizeAllColumns",
4773 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/CollapseAll",
4775 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/CollapseAll",
4777 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ExpandAll",
4779 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ExpandAll",
4781 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizeConversation",
4783 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ResetColoring1-10",
4784 tmp_color_filters_used());
4785 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ShowPacketinNewWindow",
4787 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ShowPacketinNewWindow",
4789 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ManuallyResolveAddress",
4790 frame_selected ? ((cf->edt->pi.ethertype == ETHERTYPE_IP)||(cf->edt->pi.ethertype == ETHERTYPE_IPv6)) : FALSE);
4791 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/SCTP",
4792 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_SCTP) : FALSE);
4793 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/FollowTCPStream",
4794 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
4795 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FollowTCPStream",
4796 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
4797 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/FollowUDPStream",
4798 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
4799 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/FollowSSLStream",
4800 frame_selected ? is_ssl : FALSE);
4801 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FollowSSLStream",
4802 frame_selected ? is_ssl : FALSE);
4803 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter",
4805 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter/Ethernet",
4806 frame_selected ? (cf->edt->pi.dl_src.type == AT_ETHER) : FALSE);
4807 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter/IP",
4808 frame_selected ? ((cf->edt->pi.ethertype == ETHERTYPE_IP)||(cf->edt->pi.ethertype == ETHERTYPE_IPv6)) : FALSE);
4809 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter/TCP",
4810 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
4811 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter/UDP",
4812 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
4813 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FollowUDPStream",
4814 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
4815 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter/PN-CBA",
4816 frame_selected ? (cf->edt->pi.profinet_type != 0 && cf->edt->pi.profinet_type < 10) : FALSE);
4817 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation",
4819 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation/Ethernet",
4820 frame_selected ? (cf->edt->pi.dl_src.type == AT_ETHER) : FALSE);
4821 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation/IP",
4822 frame_selected ? ((cf->edt->pi.ethertype == ETHERTYPE_IP)||(cf->edt->pi.ethertype == ETHERTYPE_IPv6)) : FALSE);
4823 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation/TCP",
4824 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
4825 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation/UDP",
4826 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
4827 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation/PN-CBA",
4828 frame_selected ? (cf->edt->pi.profinet_type != 0 && cf->edt->pi.profinet_type < 10) : FALSE);
4829 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/DecodeAs",
4830 frame_selected && decode_as_ok());
4831 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/DecodeAs",
4832 frame_selected && decode_as_ok());
4833 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/Copy",
4835 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ApplyAsFilter",
4837 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/PrepareaFilter",
4839 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ResolveName",
4840 frame_selected && (gbl_resolv_flags & RESOLV_ALL_ADDRS) != RESOLV_ALL_ADDRS);
4841 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/FollowTCPStream",
4842 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
4843 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/FollowUDPStream",
4844 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
4845 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/FollowSSLStream",
4846 frame_selected ? is_ssl : FALSE);
4847 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/DecodeAs",
4848 frame_selected && decode_as_ok());
4849 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/ResolveName",
4850 frame_selected && (gbl_resolv_flags & RESOLV_ALL_ADDRS) != RESOLV_ALL_ADDRS);
4851 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ToolsMenu/FirewallACLRules",
4853 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/StatisticsMenu/TCPStreamGraphMenu",
4854 tcp_graph_selected_packet_enabled(cf->current_frame,cf->edt, NULL));
4856 while(list_entry != NULL) {
4857 dissector_filter_t *filter_entry;
4860 filter_entry = list_entry->data;
4861 path = g_strdup_printf("/Menubar/AnalyzeMenu/ConversationFilterMenu/filter-%u", i);
4863 set_menu_sensitivity(ui_manager_main_menubar, path,
4864 menu_dissector_filter_spe_cb(/* frame_data *fd _U_*/ NULL, cf->edt, filter_entry));
4866 list_entry = g_list_next(list_entry);
4872 menu_prefs_toggle_bool (GtkWidget *w, gpointer data)
4874 gboolean *value = data;
4875 module_t *module = g_object_get_data (G_OBJECT(w), "module");
4877 module->prefs_changed = TRUE;
4880 prefs_apply (module);
4881 if (!prefs.gui_use_pref_save) {
4884 redissect_packets();
4888 menu_prefs_change_enum (GtkWidget *w, gpointer data)
4891 module_t *module = g_object_get_data (G_OBJECT(w), "module");
4892 gint new_value = GPOINTER_TO_INT(g_object_get_data (G_OBJECT(w), "enumval"));
4894 if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM(w)))
4897 if (*value != new_value) {
4898 module->prefs_changed = TRUE;
4901 prefs_apply (module);
4902 if (!prefs.gui_use_pref_save) {
4905 redissect_packets();
4910 menu_prefs_reset(void)
4912 g_free (g_object_get_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev"));
4913 g_object_set_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev", NULL);
4917 menu_prefs_change_ok (GtkWidget *w, gpointer parent_w)
4919 GtkWidget *entry = g_object_get_data (G_OBJECT(w), "entry");
4920 module_t *module = g_object_get_data (G_OBJECT(w), "module");
4921 pref_t *pref = g_object_get_data (G_OBJECT(w), "pref");
4922 const gchar *new_value = gtk_entry_get_text(GTK_ENTRY(entry));
4927 switch (pref->type) {
4929 uval = strtoul(new_value, &p, pref->info.base);
4930 if (p == new_value || *p != '\0') {
4931 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
4932 "The value \"%s\" isn't a valid number.",
4936 if (*pref->varp.uint != uval) {
4937 module->prefs_changed = TRUE;
4938 *pref->varp.uint = uval;
4942 if (strcmp (*pref->varp.string, new_value) != 0) {
4943 module->prefs_changed = TRUE;
4944 g_free((void*)*pref->varp.string);
4945 *pref->varp.string = g_strdup(new_value);
4949 if (range_convert_str(&newrange, new_value, pref->info.max_value) != CVT_NO_ERROR) {
4950 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
4951 "The value \"%s\" isn't a valid range.",
4955 if (!ranges_are_equal(*pref->varp.range, newrange)) {
4956 module->prefs_changed = TRUE;
4957 g_free(*pref->varp.range);
4958 *pref->varp.range = newrange;
4964 g_assert_not_reached();
4968 if (module->prefs_changed) {
4969 /* Ensure we reload the sub menu */
4971 prefs_apply (module);
4972 if (!prefs.gui_use_pref_save) {
4975 redissect_packets();
4978 window_destroy(GTK_WIDGET(parent_w));
4982 menu_prefs_change_cancel (GtkWidget *w _U_, gpointer parent_w)
4984 window_destroy(GTK_WIDGET(parent_w));
4988 menu_prefs_edit_dlg (GtkWidget *w, gpointer data)
4990 pref_t *pref = data;
4991 module_t *module = g_object_get_data (G_OBJECT(w), "module");
4992 gchar *value = NULL;
4994 GtkWidget *win, *main_tb, *main_vb, *bbox, *cancel_bt, *ok_bt;
4995 GtkWidget *entry, *label;
4997 switch (pref->type) {
4999 switch (pref->info.base) {
5001 value = g_strdup_printf("%o", *pref->varp.uint);
5004 value = g_strdup_printf("%u", *pref->varp.uint);
5007 value = g_strdup_printf("%x", *pref->varp.uint);
5010 g_assert_not_reached();
5015 value = g_strdup(*pref->varp.string);
5018 value = g_strdup(range_convert_range (*pref->varp.range));
5021 g_assert_not_reached();
5025 win = dlg_window_new(module->description);
5027 gtk_window_set_resizable(GTK_WINDOW(win),FALSE);
5028 gtk_window_resize(GTK_WINDOW(win), 400, 100);
5030 main_vb = gtk_vbox_new(FALSE, 5);
5031 gtk_container_add(GTK_CONTAINER(win), main_vb);
5032 gtk_container_set_border_width(GTK_CONTAINER(main_vb), 6);
5034 main_tb = gtk_table_new(2, 2, FALSE);
5035 gtk_box_pack_start(GTK_BOX(main_vb), main_tb, FALSE, FALSE, 0);
5036 gtk_table_set_col_spacings(GTK_TABLE(main_tb), 10);
5038 label = gtk_label_new(ep_strdup_printf("%s:", pref->title));
5039 gtk_table_attach_defaults(GTK_TABLE(main_tb), label, 0, 1, 1, 2);
5040 gtk_misc_set_alignment(GTK_MISC(label), 1.0f, 0.5f);
5041 if (pref->description)
5042 gtk_widget_set_tooltip_text(label, pref->description);
5044 entry = gtk_entry_new();
5045 gtk_table_attach_defaults(GTK_TABLE(main_tb), entry, 1, 2, 1, 2);
5046 gtk_entry_set_text(GTK_ENTRY(entry), value);
5047 if (pref->description)
5048 gtk_widget_set_tooltip_text(entry, pref->description);
5050 bbox = dlg_button_row_new(GTK_STOCK_CANCEL,GTK_STOCK_OK, NULL);
5051 gtk_box_pack_end(GTK_BOX(main_vb), bbox, FALSE, FALSE, 0);
5053 ok_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_OK);
5054 g_object_set_data (G_OBJECT(ok_bt), "module", module);
5055 g_object_set_data (G_OBJECT(ok_bt), "entry", entry);
5056 g_object_set_data (G_OBJECT(ok_bt), "pref", pref);
5057 g_signal_connect(ok_bt, "clicked", G_CALLBACK(menu_prefs_change_ok), win);
5059 dlg_set_activate(entry, ok_bt);
5061 cancel_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CANCEL);
5062 g_signal_connect(cancel_bt, "clicked", G_CALLBACK(menu_prefs_change_cancel), win);
5063 window_set_cancel_button(win, cancel_bt, NULL);
5065 gtk_widget_grab_default(ok_bt);
5066 gtk_widget_show_all(win);
5071 add_protocol_prefs_menu (pref_t *pref, gpointer data)
5073 GtkWidget *menu_preferences;
5074 GtkWidget *menu_item, *menu_sub_item, *sub_menu;
5075 GSList *group = NULL;
5076 module_t *module = data;
5077 const enum_val_t *enum_valp;
5078 gchar *label = NULL;
5080 switch (pref->type) {
5082 switch (pref->info.base) {
5084 label = g_strdup_printf ("%s: %o", pref->title, *pref->varp.uint);
5087 label = g_strdup_printf ("%s: %u", pref->title, *pref->varp.uint);
5090 label = g_strdup_printf ("%s: %x", pref->title, *pref->varp.uint);
5093 g_assert_not_reached();
5096 menu_item = gtk_menu_item_new_with_label(label);
5097 g_object_set_data (G_OBJECT(menu_item), "module", module);
5098 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_edit_dlg), pref);
5102 menu_item = gtk_check_menu_item_new_with_label(pref->title);
5103 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(menu_item), *pref->varp.boolp);
5104 g_object_set_data (G_OBJECT(menu_item), "module", module);
5105 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_toggle_bool), pref->varp.boolp);
5108 menu_item = gtk_menu_item_new_with_label(pref->title);
5109 sub_menu = gtk_menu_new();
5110 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_item), sub_menu);
5111 enum_valp = pref->info.enum_info.enumvals;
5112 while (enum_valp->name != NULL) {
5113 menu_sub_item = gtk_radio_menu_item_new_with_label(group, enum_valp->description);
5114 group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_sub_item));
5115 if (enum_valp->value == *pref->varp.enump) {
5116 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(menu_sub_item), TRUE);
5118 g_object_set_data (G_OBJECT(menu_sub_item), "module", module);
5119 g_object_set_data (G_OBJECT(menu_sub_item), "enumval", GINT_TO_POINTER(enum_valp->value));
5120 g_signal_connect(menu_sub_item, "activate", G_CALLBACK(menu_prefs_change_enum), pref->varp.enump);
5121 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_sub_item);
5122 gtk_widget_show (menu_sub_item);
5127 label = g_strdup_printf ("%s: %s", pref->title, *pref->varp.string);
5128 menu_item = gtk_menu_item_new_with_label(label);
5129 g_object_set_data (G_OBJECT(menu_item), "module", module);
5130 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_edit_dlg), pref);
5134 label = g_strdup_printf ("%s: %s", pref->title, range_convert_range (*pref->varp.range));
5135 menu_item = gtk_menu_item_new_with_label(label);
5136 g_object_set_data (G_OBJECT(menu_item), "module", module);
5137 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_edit_dlg), pref);
5141 label = g_strdup_printf ("%s...", pref->title);
5142 menu_item = gtk_menu_item_new_with_label(label);
5143 g_signal_connect (menu_item, "activate", G_CALLBACK(uat_window_cb), pref->varp.uat);
5146 case PREF_STATIC_TEXT:
5149 /* Nothing to add */
5153 menu_preferences = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences");
5154 if(!menu_preferences)
5155 g_warning("menu_preferences Not found path:TreeViewPopup/ProtocolPreferences");
5156 sub_menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM(menu_preferences));
5157 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5158 gtk_widget_show (menu_item);
5164 rebuild_protocol_prefs_menu (module_t *prefs_module_p, gboolean preferences)
5166 GtkWidget *menu_preferences, *menu_item;
5167 GtkWidget *sub_menu;
5170 menu_preferences = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences");
5171 if (prefs_module_p && preferences) {
5172 sub_menu = gtk_menu_new();
5173 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_preferences), sub_menu);
5175 label = g_strdup_printf ("%s Preferences...", prefs_module_p->description);
5176 menu_item = gtk_image_menu_item_new_with_label (label);
5177 gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM(menu_item),
5178 gtk_image_new_from_stock(GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_MENU));
5179 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5180 g_signal_connect_swapped(G_OBJECT(menu_item), "activate",
5181 G_CALLBACK(properties_cb), (GObject *) menu_item);
5182 gtk_widget_show (menu_item);
5185 menu_item = gtk_menu_item_new();
5186 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5187 gtk_widget_show (menu_item);
5189 prefs_pref_foreach(prefs_module_p, add_protocol_prefs_menu, prefs_module_p);
5191 /* No preferences, remove sub menu */
5192 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_preferences), NULL);
5198 menu_visible_column_toggle (GtkWidget *w _U_, gpointer data)
5200 new_packet_list_toggle_visible_column (GPOINTER_TO_INT(data));
5204 rebuild_visible_columns_menu (void)
5206 GtkWidget *menu_columns[2], *menu_item;
5207 GtkWidget *sub_menu;
5211 gint i, col_id, cur_fmt;
5212 menu_columns[0] = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/DisplayedColumns");
5213 if(! menu_columns[0]){
5214 fprintf (stderr, "Warning: couldn't find menu_columns[0] path=/Menubar/ViewMenu/DisplayedColumns");
5216 menu_columns[1] = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/DisplayedColumns");
5218 if(! menu_columns[1]){
5219 fprintf (stderr, "Warning: couldn't find menu_columns[1] path=/PacketListHeadingPopup/DisplayedColumns");
5222 for (i = 0; i < 2; i++) {
5223 sub_menu = gtk_menu_new();
5224 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_columns[i]), sub_menu);
5226 clp = g_list_first (prefs.col_list);
5229 cfmt = (fmt_data *) clp->data;
5230 cur_fmt = get_column_format_from_str(cfmt->fmt);
5231 if (cfmt->title[0]) {
5232 if (cur_fmt == COL_CUSTOM) {
5233 title = g_strdup_printf ("%s (%s)", cfmt->title, cfmt->custom_field);
5235 title = g_strdup_printf ("%s (%s)", cfmt->title, col_format_desc (cur_fmt));
5238 if (cur_fmt == COL_CUSTOM) {
5239 title = g_strdup_printf ("(%s)", cfmt->custom_field);
5241 title = g_strdup_printf ("(%s)", col_format_desc (cur_fmt));
5244 menu_item = gtk_check_menu_item_new_with_label(title);
5246 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(menu_item), cfmt->visible);
5247 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_visible_column_toggle), GINT_TO_POINTER(col_id));
5248 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5249 gtk_widget_show (menu_item);
5250 clp = g_list_next (clp);
5254 menu_item = gtk_menu_item_new();
5255 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5256 gtk_widget_show (menu_item);
5258 menu_item = gtk_menu_item_new_with_label ("Display All");
5259 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5260 g_signal_connect(menu_item, "activate", G_CALLBACK(packet_list_heading_activate_all_columns_cb), NULL);
5261 gtk_widget_show (menu_item);
5266 menus_set_column_resolved (gboolean resolved, gboolean can_resolve)
5270 menu = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ShowResolved");
5272 fprintf (stderr, "Warning: couldn't find menu path=/PacketListHeadingPopup/ShowResolved");
5274 g_object_set_data(G_OBJECT(menu), "skip-update", (void *)1);
5275 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), resolved && can_resolve);
5276 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ShowResolved", can_resolve);
5277 g_object_set_data(G_OBJECT(menu), "skip-update", NULL);
5281 menus_set_column_align_default (gboolean right_justify)
5283 GtkWidget *submenu, *menu_item_child;
5284 GList *child_list, *child_list_item;
5285 const gchar *menu_item_name;
5286 size_t menu_item_len;
5288 /* get the submenu container item */
5289 submenu = gtk_ui_manager_get_widget (ui_manager_packet_list_heading, "/PacketListHeadingPopup");
5291 fprintf (stderr, "Warning: couldn't find submenu path=/PacketListHeadingPopup");
5294 /* find the corresponding menu items to update */
5295 child_list = gtk_container_get_children(GTK_CONTAINER(submenu));
5296 child_list_item = child_list;
5297 while(child_list_item) {
5298 menu_item_child = gtk_bin_get_child(GTK_BIN(child_list_item->data));
5299 if (menu_item_child != NULL) {
5300 menu_item_name = gtk_label_get_text(GTK_LABEL(menu_item_child));
5301 menu_item_len = strlen (menu_item_name);
5302 if(strncmp(menu_item_name, "Align Left", 10) == 0) {
5303 if (!right_justify && menu_item_len == 10) {
5304 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Left\t(default)");
5305 } else if (right_justify && menu_item_len > 10) {
5306 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Left");
5308 } else if (strncmp (menu_item_name, "Align Right", 11) == 0) {
5309 if (right_justify && menu_item_len == 11) {
5310 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Right\t(default)");
5311 } else if (!right_justify && menu_item_len > 11) {
5312 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Right");
5316 child_list_item = g_list_next(child_list_item);
5318 g_list_free(child_list);
5322 set_menus_for_selected_tree_row(capture_file *cf)
5324 gboolean properties;
5327 if (cf->finfo_selected != NULL) {
5328 header_field_info *hfinfo = cf->finfo_selected->hfinfo;
5332 if (hfinfo->parent == -1) {
5333 abbrev = hfinfo->abbrev;
5334 id = (hfinfo->type == FT_PROTOCOL) ? proto_get_id((protocol_t *)hfinfo->strings) : -1;
5336 abbrev = proto_registrar_get_abbrev(hfinfo->parent);
5337 id = hfinfo->parent;
5339 properties = prefs_is_registered_protocol(abbrev);
5340 set_menu_sensitivity(ui_manager_tree_view_menu,
5341 "/TreeViewPopup/GotoCorrespondingPacket", hfinfo->type == FT_FRAMENUM);
5342 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/Copy",
5344 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/Copy/AsFilter",
5345 proto_can_match_selected(cf->finfo_selected, cf->edt));
5346 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyasColumn",
5347 hfinfo->type != FT_NONE);
5348 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter",
5349 proto_can_match_selected(cf->finfo_selected, cf->edt));
5350 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter",
5351 proto_can_match_selected(cf->finfo_selected, cf->edt));
5352 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ColorizewithFilter",
5353 proto_can_match_selected(cf->finfo_selected, cf->edt));
5354 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences",
5356 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/DisableProtocol",
5357 (id == -1) ? FALSE : proto_can_toggle_protocol(id));
5358 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ExpandSubtrees",
5359 cf->finfo_selected->tree_type != -1);
5360 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/WikiProtocolPage",
5361 (id == -1) ? FALSE : TRUE);
5362 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FilterFieldReference",
5363 (id == -1) ? FALSE : TRUE);
5364 set_menu_sensitivity(ui_manager_main_menubar,
5365 "/Menubar/FileMenu/Export/SelectedPacketBytes", TRUE);
5366 set_menu_sensitivity(ui_manager_main_menubar,
5367 "/Menubar/GoMenu/GotoCorrespondingPacket", hfinfo->type == FT_FRAMENUM);
5368 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Description",
5369 proto_can_match_selected(cf->finfo_selected, cf->edt));
5370 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Fieldname",
5371 proto_can_match_selected(cf->finfo_selected, cf->edt));
5372 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Value",
5373 proto_can_match_selected(cf->finfo_selected, cf->edt));
5374 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/AsFilter",
5375 proto_can_match_selected(cf->finfo_selected, cf->edt));
5376 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ApplyasColumn",
5377 hfinfo->type != FT_NONE);
5378 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ApplyAsFilter",
5379 proto_can_match_selected(cf->finfo_selected, cf->edt));
5380 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/PrepareaFilter",
5381 proto_can_match_selected(cf->finfo_selected, cf->edt));
5382 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ExpandSubtrees",
5383 cf->finfo_selected->tree_type != -1);
5384 prev_abbrev = g_object_get_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev");
5385 if (!prev_abbrev || (strcmp (prev_abbrev, abbrev) != 0)) {
5386 /* No previous protocol or protocol changed - update Protocol Preferences menu */
5387 module_t *prefs_module_p = prefs_find_module(abbrev);
5388 rebuild_protocol_prefs_menu (prefs_module_p, properties);
5390 g_object_set_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev", g_strdup(abbrev));
5391 g_free (prev_abbrev);
5394 set_menu_sensitivity(ui_manager_tree_view_menu,
5395 "/TreeViewPopup/GotoCorrespondingPacket", FALSE);
5396 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/Copy", FALSE);
5397 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyasColumn", FALSE);
5398 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter", FALSE);
5399 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter", FALSE);
5400 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ColorizewithFilter", FALSE);
5401 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences",
5403 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/DisableProtocol", FALSE);
5404 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ExpandSubtrees", FALSE);
5405 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/WikiProtocolPage",
5407 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FilterFieldReference",
5409 set_menu_sensitivity(ui_manager_main_menubar,
5410 "/Menubar/FileMenu/Export/SelectedPacketBytes", FALSE);
5411 set_menu_sensitivity(ui_manager_main_menubar,
5412 "/Menubar/GoMenu/GotoCorrespondingPacket", FALSE);
5413 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Description", FALSE);
5414 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Fieldname", FALSE);
5415 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Value", FALSE);
5416 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/AsFilter", FALSE);
5417 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ApplyasColumn", FALSE);
5418 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ApplyAsFilter", FALSE);
5419 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/PrepareaFilter", FALSE);
5420 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ExpandSubtrees", FALSE);
5424 void set_menus_for_packet_history(gboolean back_history, gboolean forward_history) {
5425 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/Back", back_history);
5426 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/Forward", forward_history);
5427 set_toolbar_for_packet_history(back_history, forward_history);
5431 void set_menus_for_file_set(gboolean file_set, gboolean previous_file, gboolean next_file) {
5432 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set/ListFiles", file_set);
5433 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set/PreviousFile", previous_file);
5434 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set/NextFile", next_file);
5437 GtkWidget *menus_get_profiles_edit_menu (void)
5439 return gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Edit");
5442 GtkWidget *menus_get_profiles_delete_menu (void)
5444 return gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Delete");
5447 GtkWidget *menus_get_profiles_change_menu (void)
5449 return gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Change");
5452 void set_menus_for_profiles(gboolean default_profile)
5454 set_menu_sensitivity(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Edit", !default_profile);
5455 set_menu_sensitivity(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Delete", !default_profile);
5464 * indent-tabs-mode: nil
5467 * ex: set shiftwidth=4 tabstop=8 expandtab
5468 * :indentSize=4:tabSize=8:noTabs=true:
5470 #endif /* MAIN_MENU_USE_UIMANAGER */