4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 #include <epan/packet.h>
30 #include <epan/prefs.h>
31 #include <epan/prefs-int.h>
32 #include <epan/dissector_filters.h>
33 #include <epan/epan_dissect.h>
34 #include <epan/column.h>
35 #include <epan/stats_tree_priv.h>
36 #include <epan/plugin_if.h>
37 #include <epan/export_object.h>
40 #include <epan/color_filters.h>
42 #include "ui/commandline.h"
43 #include "ui/dissect_opts.h"
44 #include "ui/main_statusbar.h"
45 #include "ui/preference_utils.h"
46 #include "ui/recent.h"
47 #include "ui/recent_utils.h"
48 #include "ui/simple_dialog.h"
49 #include "ui/software_update.h"
50 #include <wsutil/utf8_entities.h>
52 #include "ui/gtk/gui_stat_menu.h"
53 #include "ui/gtk/about_dlg.h"
54 #include "ui/gtk/capture_dlg.h"
55 #include "ui/gtk/capture_if_dlg.h"
56 #include "ui/gtk/color_dlg.h"
57 #include "ui/gtk/export_object_dlg.h"
58 #include "ui/gtk/filter_dlg.h"
59 #include "ui/gtk/profile_dlg.h"
60 #include "ui/gtk/dlg_utils.h"
61 #include "ui/gtk/capture_file_dlg.h"
62 #include "ui/gtk/fileset_dlg.h"
63 #include "ui/gtk/file_import_dlg.h"
64 #include "ui/gtk/find_dlg.h"
65 #include "ui/gtk/goto_dlg.h"
66 #include "ui/gtk/summary_dlg.h"
67 #include "ui/gtk/prefs_dlg.h"
68 #include "ui/gtk/packet_win.h"
69 #include "ui/gtk/follow_stream.h"
70 #include "ui/gtk/decode_as_dlg.h"
71 #include "ui/gtk/help_dlg.h"
72 #include "ui/gtk/supported_protos_dlg.h"
73 #include "ui/gtk/proto_dlg.h"
74 #include "ui/gtk/proto_hier_stats_dlg.h"
75 #include "ui/gtk/keys.h"
76 #include "ui/gtk/stock_icons.h"
77 #include "ui/gtk/gtkglobals.h"
78 #include "ui/gtk/packet_panes.h"
79 #include "ui/gtk/conversations_table.h"
80 #include "ui/gtk/hostlist_table.h"
81 #include "ui/gtk/packet_history.h"
82 #include "ui/gtk/sctp_stat_gtk.h"
83 #include "ui/gtk/firewall_dlg.h"
84 #include "ui/gtk/macros_dlg.h"
85 #include "ui/gtk/export_sslkeys.h"
86 #include "ui/gtk/gui_stat_menu.h"
87 #include "ui/gtk/main.h"
88 #include "ui/gtk/menus.h"
89 #include "ui/gtk/main_menubar_private.h"
90 #include "ui/gtk/main_toolbar.h"
91 #include "ui/gtk/main_welcome.h"
92 #include "ui/gtk/uat_gui.h"
93 #include "ui/gtk/gui_utils.h"
94 #include "ui/gtk/manual_addr_resolv.h"
95 #include "ui/gtk/dissector_tables_dlg.h"
96 #include "ui/gtk/expert_comp_dlg.h"
97 #include "ui/gtk/time_shift_dlg.h"
98 #include "ui/gtk/edit_packet_comment_dlg.h"
99 #include "ui/gtk/addr_resolution_dlg.h"
100 #include "ui/gtk/export_pdu_dlg.h"
101 #include "ui/gtk/conversation_hastables_dlg.h"
102 #include "ui/gtk/webbrowser.h"
104 #include "ui/gtk/packet_list.h"
105 #include "ui/gtk/lbm_stream_dlg.h"
106 #include "ui/gtk/lbm_uimflow_dlg.h"
109 #include "capture_opts.h"
110 #include "ui/capture_globals.h"
112 #ifdef HAVE_IGE_MAC_INTEGRATION
113 #include <ige-mac-menu.h>
116 #ifdef HAVE_GTKOSXAPPLICATION
117 #include <gtkmacintegration/gtkosxapplication.h>
120 static int initialize = TRUE;
121 GtkActionGroup *main_menu_bar_action_group;
122 static GtkUIManager *ui_manager_main_menubar = NULL;
123 static GtkUIManager *ui_manager_packet_list_heading = NULL;
124 static GtkUIManager *ui_manager_packet_list_menu = NULL;
125 static GtkUIManager *ui_manager_tree_view_menu = NULL;
126 static GtkUIManager *ui_manager_bytes_menu = NULL;
127 static GtkUIManager *ui_manager_statusbar_profiles_menu = NULL;
128 static GSList *popup_menu_list = NULL;
130 static GtkAccelGroup *grp;
132 static GList *merge_menu_items_list = NULL;
133 static GList *build_menubar_items_callback_list = NULL;
135 GtkWidget *popup_menu_object;
137 static void menu_open_recent_file_cmd_cb(GtkAction *action, gpointer data _U_ );
138 static void add_recent_items (guint merge_id, GtkUIManager *ui_manager);
139 static void add_tap_plugins (guint merge_id, GtkUIManager *ui_manager);
141 static void menus_init(void);
142 static void merge_menu_items(GList *node);
143 static void ws_menubar_external_menus(void);
144 static void ws_menubar_build_external_menus(void);
145 static void set_menu_sensitivity (GtkUIManager *ui_manager, const gchar *, gint);
146 static void menu_name_resolution_update_cb(GtkAction *action, gpointer data);
147 static void name_resolution_cb(GtkWidget *w, gpointer d, gboolean* res_flag);
148 static void colorize_cb(GtkWidget *w, gpointer d);
149 static void rebuild_protocol_prefs_menu (module_t *prefs_module_p, gboolean preferences,
150 GtkUIManager *ui_menu, const char *path);
152 static void plugin_if_menubar_preference(gconstpointer user_data);
155 /* As a general GUI guideline, we try to follow the Gnome Human Interface Guidelines, which can be found at:
156 http://developer.gnome.org/projects/gup/hig/1.0/index.html
158 Please note: there are some differences between the Gnome HIG menu suggestions and our implementation:
160 File/Open Recent: the Gnome HIG suggests putting the list of recently used files as elements into the File menuitem.
161 As this is ok for only a few items, this will become unhandy for 10 or even more list entries.
162 For this reason, we use a submenu for this.
164 File/Close: the Gnome HIG suggests putting this item just above the Quit item.
165 This results in unintuitive behaviour as both Close and Quit items are very near together.
166 By putting the Close item near the open item(s), it better suggests that it will close the
167 currently opened/captured file only.
171 new_window_cb(GtkWidget *widget)
173 new_packet_window(widget, FALSE, FALSE);
177 new_window_cb_ref(GtkWidget *widget)
179 new_packet_window(widget, TRUE, FALSE);
182 #ifdef WANT_PACKET_EDITOR
184 edit_window_cb(GtkWidget *widget _U_)
186 new_packet_window(widget, FALSE, TRUE);
191 colorize_conversation_cb(conversation_filter_t* color_filter, int action_num)
193 gchar *filter = NULL;
194 packet_info *pi = &cfile.edt->pi;
195 gchar *err_msg = NULL;
197 if (action_num == 255) {
198 if (!color_filters_reset_tmp(&err_msg)) {
199 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
202 packet_list_colorize_packets();
203 } else if (cfile.current_frame) {
204 if (color_filter == NULL) {
205 /* colorize_conversation_cb was called from the window-menu
206 * or through an accelerator key. Try to build a conversation
207 * filter in the order TCP, UDP, IP, Ethernet and apply the
209 color_filter = find_conversation_filter("tcp");
210 if ((color_filter != NULL) && (color_filter->is_filter_valid(pi)))
211 filter = color_filter->build_filter_string(pi);
212 if (filter == NULL) {
213 color_filter = find_conversation_filter("udp");
214 if ((color_filter != NULL) && (color_filter->is_filter_valid(pi)))
215 filter = color_filter->build_filter_string(pi);
217 if (filter == NULL) {
218 color_filter = find_conversation_filter("ip");
219 if ((color_filter != NULL) && (color_filter->is_filter_valid(pi)))
220 filter = color_filter->build_filter_string(pi);
222 if (filter == NULL) {
223 color_filter = find_conversation_filter("ipv6");
224 if ((color_filter != NULL) && (color_filter->is_filter_valid(pi)))
225 filter = color_filter->build_filter_string(pi);
227 if (filter == NULL) {
228 color_filter = find_conversation_filter("eth");
229 if ((color_filter != NULL) && (color_filter->is_filter_valid(pi)))
230 filter = color_filter->build_filter_string(pi);
232 if( filter == NULL ) {
233 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Unable to build conversation filter.");
237 filter = color_filter->build_filter_string(pi);
240 if (action_num == 0) {
241 /* Open the "new coloring filter" dialog with the filter */
242 color_display_with_filter(filter);
244 /* Set one of the temporary coloring filters */
245 if (!color_filters_set_tmp(action_num, filter, FALSE, &err_msg)) {
246 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
249 packet_list_colorize_packets();
257 goto_conversation_frame(gboolean dir)
259 gchar *filter = NULL;
260 dfilter_t *dfcode = NULL;
261 gboolean found_packet = FALSE;
262 packet_info *pi = &cfile.edt->pi;
263 conversation_filter_t* conv_filter;
265 /* Try to build a conversation
266 * filter in the order TCP, UDP, IP, Ethernet and apply the
268 conv_filter = find_conversation_filter("tcp");
269 if ((conv_filter != NULL) && (conv_filter->is_filter_valid(pi)))
270 filter = conv_filter->build_filter_string(pi);
271 conv_filter = find_conversation_filter("udp");
272 if ((conv_filter != NULL) && (conv_filter->is_filter_valid(pi)))
273 filter = conv_filter->build_filter_string(pi);
274 conv_filter = find_conversation_filter("ip");
275 if ((conv_filter != NULL) && (conv_filter->is_filter_valid(pi)))
276 filter = conv_filter->build_filter_string(pi);
277 conv_filter = find_conversation_filter("ipv6");
278 if ((conv_filter != NULL) && (conv_filter->is_filter_valid(pi)))
279 filter = conv_filter->build_filter_string(pi);
281 if( filter == NULL ) {
282 statusbar_push_temporary_msg("Unable to build conversation filter.");
287 if (!dfilter_compile(filter, &dfcode, NULL)) {
288 /* The attempt failed; report an error. */
289 statusbar_push_temporary_msg("Error compiling filter for this conversation.");
294 found_packet = cf_find_packet_dfilter(&cfile, dfcode, dir?SD_BACKWARD:SD_FORWARD);
297 /* We didn't find a packet */
298 statusbar_push_temporary_msg("No previous/next packet in conversation.");
301 dfilter_free(dfcode);
306 goto_next_frame_conversation_cb(GtkAction *action _U_, gpointer user_data _U_)
308 goto_conversation_frame(FALSE);
312 goto_previous_frame_conversation_cb(GtkAction *action _U_, gpointer user_data _U_)
314 goto_conversation_frame(TRUE);
320 copy_description_cb(GtkAction *action _U_, gpointer user_data)
322 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_DESCRIPTION);
326 copy_fieldname_cb(GtkAction *action _U_, gpointer user_data)
328 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_FIELDNAME);
332 copy_value_cb(GtkAction *action _U_, gpointer user_data)
334 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_VALUE);
338 copy_as_filter_cb(GtkAction *action _U_, gpointer user_data _U_)
340 /* match_selected_ptree_cb needs the popup_menu_object to get the right object E_DFILTER_TE_KEY */
341 match_selected_ptree_cb( popup_menu_object, (MATCH_SELECTED_E)(MATCH_SELECTED_REPLACE|MATCH_SELECTED_COPY_ONLY));
345 set_reftime_cb(GtkAction *action _U_, gpointer user_data)
347 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_TOGGLE);
351 find_next_ref_time_cb(GtkAction *action _U_, gpointer user_data)
353 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_FIND_NEXT);
357 find_previous_ref_time_cb(GtkAction *action _U_, gpointer user_data)
359 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_FIND_PREV);
363 menus_prefs_cb(GtkAction *action _U_, gpointer user_data)
365 prefs_page_cb( NULL /* widget _U_ */ , user_data, PREFS_PAGE_USER_INTERFACE);
369 main_toolbar_show_hide_cb(GtkAction *action _U_, gpointer user_data _U_)
371 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/MainToolbar");
373 recent.main_toolbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
374 main_widgets_show_or_hide();
379 filter_toolbar_show_hide_cb(GtkAction * action _U_, gpointer user_data _U_)
381 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/FilterToolbar");
383 recent.filter_toolbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
384 main_widgets_show_or_hide();
388 wireless_toolbar_show_hide_cb(GtkAction *action _U_, gpointer user_data _U_)
390 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/WirelessToolbar");
393 recent.wireless_toolbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
395 recent.wireless_toolbar_show = FALSE;
397 main_widgets_show_or_hide();
401 status_bar_show_hide_cb(GtkAction *action _U_, gpointer user_data _U_)
403 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/StatusBar");
405 recent.statusbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
406 main_widgets_show_or_hide();
409 packet_list_show_hide_cb(GtkAction *action _U_, gpointer user_data _U_)
411 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketList");
413 recent.packet_list_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
414 main_widgets_show_or_hide();
417 packet_details_show_hide_cb(GtkAction *action _U_, gpointer user_data _U_)
419 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketDetails");
421 recent.tree_view_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
422 main_widgets_show_or_hide();
425 packet_bytes_show_hide_cb(GtkAction *action _U_, gpointer user_data _U_)
427 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketBytes");
429 recent.byte_view_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
430 main_widgets_show_or_hide();
434 timestamp_seconds_time_cb(GtkAction *action _U_, gpointer user_data _U_)
436 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes");
438 if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) {
439 recent.gui_seconds_format = TS_SECONDS_HOUR_MIN_SEC;
441 recent.gui_seconds_format = TS_SECONDS_DEFAULT;
443 timestamp_set_seconds_type (recent.gui_seconds_format);
445 /* This call adjusts column width */
446 cf_timestamp_auto_precision(&cfile);
447 packet_list_queue_draw();
451 timestamp_format_new_cb (GtkRadioAction *action, GtkRadioAction *current _U_, gpointer user_data _U_)
455 value = (ts_type) gtk_radio_action_get_current_value (action);
456 if (recent.gui_time_format != value) {
457 timestamp_set_type(value);
458 recent.gui_time_format = value;
459 /* This call adjusts column width */
460 cf_timestamp_auto_precision(&cfile);
461 packet_list_queue_draw();
467 timestamp_precision_new_cb (GtkRadioAction *action, GtkRadioAction *current _U_, gpointer user_data _U_)
471 value = gtk_radio_action_get_current_value (action);
472 if (recent.gui_time_precision != value) {
473 /* the actual precision will be set in packet_list_queue_draw() below */
474 timestamp_set_precision(value);
475 recent.gui_time_precision = value;
476 /* This call adjusts column width */
477 cf_timestamp_auto_precision(&cfile);
478 packet_list_queue_draw();
483 view_menu_en_for_MAC_cb(GtkAction *action _U_, gpointer user_data)
485 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforMACLayer");
488 g_warning("view_menu_en_for_MAC_cb: No widget found");
490 name_resolution_cb( widget , user_data, &gbl_resolv_flags.mac_name);
495 view_menu_en_for_network_cb(GtkAction *action _U_, gpointer user_data)
497 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforNetworkLayer");
500 g_warning("view_menu_en_for_network_cb: No widget found");
502 name_resolution_cb( widget , user_data, &gbl_resolv_flags.network_name);
507 view_menu_en_for_transport_cb(GtkAction *action _U_, gpointer user_data)
509 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforTransportLayer");
512 g_warning("view_menu_en_for_transport_cb: No widget found");
514 name_resolution_cb( widget , user_data, &gbl_resolv_flags.transport_name);
519 view_menu_en_use_external_resolver_cb(GtkAction *action _U_, gpointer user_data)
521 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/UseExternalNetworkNameResolver");
524 g_warning("view_menu_en_use_external_resolver_cb: No widget found");
526 name_resolution_cb( widget , user_data, &gbl_resolv_flags.use_external_net_name_resolver);
531 view_menu_colorize_pkt_lst_cb(GtkAction *action _U_, gpointer user_data)
533 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizePacketList");
536 g_warning("view_menu_colorize_pkt_lst_cb: No widget found");
538 colorize_cb( widget , user_data);
545 view_menu_auto_scroll_live_cb(GtkAction *action _U_, gpointer user_data _U_)
547 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/AutoScrollinLiveCapture");
550 g_warning("view_menu_auto_scroll_live_cb: No widget found");
552 main_auto_scroll_live_changed(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)));
558 view_menu_color_conv_color1_cb(GtkAction *action _U_, gpointer user_data _U_)
560 colorize_conversation_cb(NULL, 1);
564 view_menu_color_conv_color2_cb(GtkAction *action _U_, gpointer user_data _U_)
566 colorize_conversation_cb(NULL, 2);
570 view_menu_color_conv_color3_cb(GtkAction *action _U_, gpointer user_data _U_)
572 colorize_conversation_cb(NULL, 3);
576 view_menu_color_conv_color4_cb(GtkAction *action _U_, gpointer user_data _U_)
578 colorize_conversation_cb(NULL, 4);
582 view_menu_color_conv_color5_cb(GtkAction *action _U_, gpointer user_data _U_)
584 colorize_conversation_cb(NULL, 5);
588 view_menu_color_conv_color6_cb(GtkAction *action _U_, gpointer user_data _U_)
590 colorize_conversation_cb(NULL, 6);
594 view_menu_color_conv_color7_cb(GtkAction *action _U_, gpointer user_data _U_)
596 colorize_conversation_cb(NULL, 7);
600 view_menu_color_conv_color8_cb(GtkAction *action _U_, gpointer user_data _U_)
602 colorize_conversation_cb(NULL, 8);
606 view_menu_color_conv_color9_cb(GtkAction *action _U_, gpointer user_data _U_)
608 colorize_conversation_cb(NULL, 9);
612 view_menu_color_conv_color10_cb(GtkAction *action _U_, gpointer user_data _U_)
614 colorize_conversation_cb(NULL, 10);
618 view_menu_color_conv_new_rule_cb(GtkAction *action _U_, gpointer user_data _U_)
620 colorize_conversation_cb(NULL, 0);
624 view_menu_reset_coloring_cb(GtkAction *action _U_, gpointer user_data _U_)
626 colorize_conversation_cb(NULL, 255);
630 * TODO Move this menu to capture_if_dlg.c ?
634 capture_if_action_cb(GtkAction *action _U_, gpointer user_data)
636 capture_if_cb(NULL /* GtkWidget *w _U_ */, user_data);
640 capture_prep_action_cb(GtkAction *action _U_, gpointer user_data)
642 capture_prep_cb(NULL /* GtkWidget *w _U_ */, user_data);
646 capture_start_action_cb(GtkAction *action _U_, gpointer user_data)
648 capture_start_cb(NULL /* GtkWidget *w _U_ */, user_data);
652 capture_stop_action_cb(GtkAction *action _U_, gpointer user_data)
654 capture_stop_cb(NULL /* GtkWidget *w _U_ */, user_data);
658 capture_restart_action_cb(GtkAction *action _U_, gpointer user_data)
660 capture_restart_cb(NULL /* GtkWidget *w _U_ */, user_data);
664 capture_filters_action_cb(GtkAction *action _U_, gpointer user_data _U_)
666 cfilter_dialog_cb(NULL /* GtkWidget *w _U_ */);
670 * We've been asked to rescan the system looking for interfaces.
673 refresh_interfaces_action_cb(GtkAction *action _U_, gpointer user_data _U_)
675 refresh_local_interface_lists();
677 #endif /* HAVE_LIBPCAP */
680 help_menu_cont_cb(GtkAction *action _U_, gpointer user_data _U_)
682 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(HELP_CONTENT));
686 help_menu_faq_cb(GtkAction *action _U_, gpointer user_data _U_)
688 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_FAQ));
692 help_menu_ask_cb(GtkAction *action _U_, gpointer user_data _U_)
694 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_ASK));
698 help_menu_wireshark_cb(GtkAction *action _U_, gpointer user_data _U_)
700 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_WIRESHARK));
704 help_menu_wireshark_flt_cb(GtkAction *action _U_, gpointer user_data _U_)
706 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_WIRESHARK_FILTER));
710 help_menu_Capinfos_cb(GtkAction *action _U_, gpointer user_data _U_)
712 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_CAPINFOS));
716 help_menu_Dumpcap_cb(GtkAction *action _U_, gpointer user_data _U_)
718 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_DUMPCAP));
722 help_menu_Editcap_cb(GtkAction *action _U_, gpointer user_data _U_)
724 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_EDITCAP));
728 help_menu_Mergecap_cb(GtkAction *action _U_, gpointer user_data _U_)
730 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_MERGECAP));
734 help_menu_RawShark_cb(GtkAction *action _U_, gpointer user_data _U_)
736 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_RAWSHARK));
740 help_menu_Reorder_cb(GtkAction *action _U_, gpointer user_data _U_)
742 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_REORDERCAP));
746 help_menu_Text2pcap_cb(GtkAction *action _U_, gpointer user_data _U_)
748 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_TEXT2PCAP));
752 help_menu_TShark_cb(GtkAction *action _U_, gpointer user_data _U_)
754 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_TSHARK));
758 help_menu_Website_cb(GtkAction *action _U_, gpointer user_data _U_)
760 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_HOME));
764 help_menu_Wiki_cb(GtkAction *action _U_, gpointer user_data _U_)
766 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_WIKI));
770 help_menu_Downloads_cb(GtkAction *action _U_, gpointer user_data _U_)
772 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_DOWNLOAD));
776 help_menu_SampleCaptures_cb(GtkAction *action _U_, gpointer user_data _U_)
778 topic_menu_cb( NULL/* widget_U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_SAMPLE_FILES));
781 #ifdef HAVE_SOFTWARE_UPDATE
783 check_for_updates_cb(GtkAction *action _U_, gpointer user_data _U_)
785 software_update_check();
787 #endif /* HAVE_SOFTWARE_UPDATE */
789 static const char *ui_desc_menubar =
791 " <menubar name ='Menubar'>\n"
792 " <menu name= 'FileMenu' action='/File'>\n"
793 " <menuitem name='Open' action='/File/Open'/>\n"
794 " <menu name='OpenRecent' action='/File/OpenRecent'>\n"
795 " <placeholder name='RecentFiles'/>\n"
797 " <menuitem name='Merge' action='/File/Merge'/>\n"
798 " <menuitem name='ImportFromHexDump' action='/File/ImportFromHexDump'/>\n"
799 " <menuitem name='Close' action='/File/Close'/>\n"
801 " <menuitem name='Save' action='/File/Save'/>\n"
802 " <menuitem name='SaveAs' action='/File/SaveAs'/>\n"
804 " <menu name= 'Set' action='/File/Set'>\n"
805 " <menuitem name='ListFiles' action='/File/Set/ListFiles'/>\n"
806 " <menuitem name='NextFile' action='/File/Set/NextFile'/>\n"
807 " <menuitem name='PreviousFile' action='/File/Set/PreviousFile'/>\n"
810 " <menuitem name='ExportSpecifiedPackets' action='/File/ExportSpecifiedPackets'/>\n"
811 " <menu name= 'ExportPacketDissections' action='/File/ExportPacketDissections'>\n"
812 " <menuitem name='AsTxt' action='/File/ExportPacketDissections/Text'/>\n"
813 " <menuitem name='AsPostScript' action='/File/ExportPacketDissections/PostScript'/>\n"
814 " <menuitem name='AsCSV' action='/File/ExportPacketDissections/CSV'/>\n"
815 " <menuitem name='AsCArrays' action='/File/ExportPacketDissections/CArrays'/>\n"
817 " <menuitem name='AsPSML' action='/File/ExportPacketDissections/PSML'/>\n"
818 " <menuitem name='AsPDML' action='/File/ExportPacketDissections/PDML'/>\n"
819 " <menuitem name='AsJSON' action='/File/ExportPacketDissections/JSON'/>\n"
822 " <menuitem name='ExportSelectedPacketBytes' action='/File/ExportSelectedPacketBytes'/>\n"
823 " <menuitem name='ExportPDUs' action='/File/ExportPDUs'/>\n"
824 " <menuitem name='ExportSSLSessionKeys' action='/File/ExportSSLSessionKeys'/>\n"
825 " <menu name= 'ExportObjectsMenu' action='/File/ExportObjects'>\n"
826 " <placeholder name='ExportObjects'/>\n"
829 " <menuitem name='Print' action='/File/Print'/>\n"
831 " <menuitem name='Quit' action='/File/Quit'/>\n"
833 " <menu name= 'EditMenu' action='/Edit'>\n"
834 " <menu name= 'Copy' action='/Edit/Copy'>\n"
835 " <menuitem name='Description' action='/Edit/Copy/Description'/>\n"
836 " <menuitem name='Fieldname' action='/Edit/Copy/Fieldname'/>\n"
837 " <menuitem name='Value' action='/Edit/Copy/Value'/>\n"
839 " <menuitem name='AsFilter' action='/Edit/Copy/AsFilter'/>\n"
841 " <menuitem name='FindPacket' action='/Edit/FindPacket'/>\n"
842 " <menuitem name='FindNext' action='/Edit/FindNext'/>\n"
843 " <menuitem name='FindPrevious' action='/Edit/FindPrevious'/>\n"
845 " <menuitem name='MarkPacket' action='/Edit/MarkPacket'/>\n"
846 " <menuitem name='MarkAllDisplayedPackets' action='/Edit/MarkAllDisplayedPackets'/>\n"
847 " <menuitem name='UnmarkAllDisplayedPackets' action='/Edit/UnmarkAllDisplayedPackets'/>\n"
848 " <menuitem name='FindNextMark' action='/Edit/FindNextMark'/>\n"
849 " <menuitem name='FindPreviousMark' action='/Edit/FindPreviousMark'/>\n"
851 " <menuitem name='IgnorePacket' action='/Edit/IgnorePacket'/>\n"
852 " <menuitem name='IgnoreAllDisplayedPackets' action='/Edit/IgnoreAllDisplayedPackets'/>\n"
853 " <menuitem name='Un-IgnoreAllPackets' action='/Edit/Un-IgnoreAllPackets'/>\n"
855 " <menuitem name='SetTimeReference' action='/Edit/SetTimeReference'/>\n"
856 " <menuitem name='Un-TimeReferenceAllPackets' action='/Edit/Un-TimeReferenceAllPackets'/>\n"
857 " <menuitem name='FindNextTimeReference' action='/Edit/FindNextTimeReference'/>\n"
858 " <menuitem name='FindPreviousTimeReference' action='/Edit/FindPreviousTimeReference'/>\n"
860 " <menuitem name='TimeShift' action='/Edit/TimeShift'/>\n"
862 #ifdef WANT_PACKET_EDITOR
863 " <menuitem name='EditPacket' action='/Edit/EditPacket'/>\n"
865 " <menuitem name='AddEditPktComment' action='/Edit/AddEditPktComment'/>\n"
866 " <menuitem name='AddEditCaptureComment' action='/Edit/AddEditCaptureComment'/>\n"
868 " <menuitem name='ConfigurationProfiles' action='/Edit/ConfigurationProfiles'/>\n"
869 " <menuitem name='Preferences' action='/Edit/Preferences'/>\n"
871 " <menu name= 'ViewMenu' action='/View'>\n"
872 " <menuitem name='MainToolbar' action='/View/MainToolbar'/>\n"
873 " <menuitem name='FilterToolbar' action='/View/FilterToolbar'/>\n"
874 " <menuitem name='WirelessToolbar' action='/View/WirelessToolbar'/>\n"
875 " <menuitem name='StatusBar' action='/View/StatusBar'/>\n"
877 " <menuitem name='PacketList' action='/View/PacketList'/>\n"
878 " <menuitem name='PacketDetails' action='/View/PacketDetails'/>\n"
879 " <menuitem name='PacketBytes' action='/View/PacketBytes'/>\n"
881 " <menu name= 'TimeDisplayFormat' action='/View/TimeDisplayFormat'>\n"
882 " <menuitem name='DateYMDandTimeofDay' action='/View/TimeDisplayFormat/DateYMDandTimeofDay'/>\n"
883 " <menuitem name='DateYDOYandTimeofDay' action='/View/TimeDisplayFormat/DateYDOYandTimeofDay'/>\n"
884 " <menuitem name='TimeofDay' action='/View/TimeDisplayFormat/TimeofDay'/>\n"
885 " <menuitem name='SecondsSinceEpoch' action='/View/TimeDisplayFormat/SecondsSinceEpoch'/>\n"
886 " <menuitem name='SecondsSinceBeginningofCapture' action='/View/TimeDisplayFormat/SecondsSinceBeginningofCapture'/>\n"
887 " <menuitem name='SecondsSincePreviousCapturedPacket' action='/View/TimeDisplayFormat/SecondsSincePreviousCapturedPacket'/>\n"
888 " <menuitem name='SecondsSincePreviousDisplayedPacket' action='/View/TimeDisplayFormat/SecondsSincePreviousDisplayedPacket'/>\n"
889 " <menuitem name='UTCDateYMDandTimeofDay' action='/View/TimeDisplayFormat/UTCDateYMDandTimeofDay'/>\n"
890 " <menuitem name='UTCDateYDOYandTimeofDay' action='/View/TimeDisplayFormat/UTCDateYDOYandTimeofDay'/>\n"
891 " <menuitem name='UTCTimeofDay' action='/View/TimeDisplayFormat/UTCTimeofDay'/>\n"
893 " <menuitem name='FileFormatPrecision-Automatic' action='/View/TimeDisplayFormat/FileFormatPrecision-Automatic'/>\n"
894 " <menuitem name='FileFormatPrecision-Seconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Seconds'/>\n"
895 " <menuitem name='FileFormatPrecision-Deciseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Deciseconds'/>\n"
896 " <menuitem name='FileFormatPrecision-Centiseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Centiseconds'/>\n"
897 " <menuitem name='FileFormatPrecision-Milliseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Milliseconds'/>\n"
898 " <menuitem name='FileFormatPrecision-Microseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Microseconds'/>\n"
899 " <menuitem name='FileFormatPrecision-Nanoseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Nanoseconds'/>\n"
901 " <menuitem name='DisplaySecondsWithHoursAndMinutes' action='/View/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes'/>\n"
903 " <menu name= 'NameResolution' action='/View/NameResolution'>\n"
904 " <menuitem name='ResolveName' action='/View/NameResolution/ResolveName'/>\n"
905 " <menuitem name='ManuallyResolveName' action='/View/NameResolution/ManuallyResolveName'/>\n"
907 " <menuitem name='EnableforMACLayer' action='/View/NameResolution/EnableforMACLayer'/>\n"
908 " <menuitem name='EnableforTransportLayer' action='/View/NameResolution/EnableforTransportLayer'/>\n"
909 " <menuitem name='EnableforNetworkLayer' action='/View/NameResolution/EnableforNetworkLayer'/>\n"
910 " <menuitem name='UseExternalNetworkNameResolver' action='/View/NameResolution/UseExternalNetworkNameResolver'/>\n"
912 " <menuitem name='ColorizePacketList' action='/View/ColorizePacketList'/>\n"
914 " <menuitem name='AutoScrollinLiveCapture' action='/View/AutoScrollinLiveCapture'/>\n"
917 " <menuitem name='ZoomIn' action='/View/ZoomIn'/>\n"
918 " <menuitem name='ZoomOut' action='/View/ZoomOut'/>\n"
919 " <menuitem name='NormalSize' action='/View/NormalSize'/>\n"
921 " <menuitem name='ResizeAllColumns' action='/View/ResizeAllColumns'/>\n"
922 " <menuitem name='DisplayedColumns' action='/View/DisplayedColumns'/>\n"
924 " <menuitem name='ExpandSubtrees' action='/View/ExpandSubtrees'/>\n"
925 " <menuitem name='CollapseSubtrees' action='/View/CollapseSubtrees'/>\n"
926 " <menuitem name='ExpandAll' action='/View/ExpandAll'/>\n"
927 " <menuitem name='CollapseAll' action='/View/CollapseAll'/>\n"
929 " <menu name= 'ColorizeConversation' action='/View/ColorizeConversation'>\n"
930 " <menuitem name='Color1' action='/View/ColorizeConversation/Color 1'/>\n"
931 " <menuitem name='Color2' action='/View/ColorizeConversation/Color 2'/>\n"
932 " <menuitem name='Color3' action='/View/ColorizeConversation/Color 3'/>\n"
933 " <menuitem name='Color4' action='/View/ColorizeConversation/Color 4'/>\n"
934 " <menuitem name='Color5' action='/View/ColorizeConversation/Color 5'/>\n"
935 " <menuitem name='Color6' action='/View/ColorizeConversation/Color 6'/>\n"
936 " <menuitem name='Color7' action='/View/ColorizeConversation/Color 7'/>\n"
937 " <menuitem name='Color8' action='/View/ColorizeConversation/Color 8'/>\n"
938 " <menuitem name='Color9' action='/View/ColorizeConversation/Color 9'/>\n"
939 " <menuitem name='Color10' action='/View/ColorizeConversation/Color 10'/>\n"
940 " <menuitem name='NewColoringRule' action='/View/ColorizeConversation/NewColoringRule'/>\n"
943 " <menuitem name='ResetColoring1-10' action='/View/ResetColoring1-10'/>\n"
944 " <menuitem name='ColoringRules' action='/View/ColoringRules'/>\n"
946 " <menuitem name='ShowPacketinNewWindow' action='/View/ShowPacketinNewWindow'/>\n"
947 " <menuitem name='Reload' action='/View/Reload'/>\n"
949 " <menu name= 'GoMenu' action='/Go'>\n"
950 " <menuitem name='Back' action='/Go/Back'/>\n"
951 " <menuitem name='Forward' action='/Go/Forward'/>\n"
952 " <menuitem name='Goto' action='/Go/Goto'/>\n"
953 " <menuitem name='GotoCorrespondingPacket' action='/Go/GotoCorrespondingPacket'/>\n"
955 " <menuitem name='PreviousPacket' action='/Go/PreviousPacket'/>\n"
956 " <menuitem name='NextPacket' action='/Go/NextPacket'/>\n"
957 " <menuitem name='FirstPacket' action='/Go/FirstPacket'/>\n"
958 " <menuitem name='LastPacket' action='/Go/LastPacket'/>\n"
959 " <menuitem name='PreviousPacketInConversation' action='/Go/PreviousPacketInConversation'/>\n"
960 " <menuitem name='NextPacketInConversation' action='/Go/NextPacketInConversation'/>\n"
963 " <menu name= 'CaptureMenu' action='/Capture'>\n"
964 " <menuitem name='Interfaces' action='/Capture/Interfaces'/>\n"
965 " <menuitem name='Options' action='/Capture/Options'/>\n"
966 " <menuitem name='Start' action='/Capture/Start'/>\n"
967 " <menuitem name='Stop' action='/Capture/Stop'/>\n"
968 " <menuitem name='Restart' action='/Capture/Restart'/>\n"
969 " <menuitem name='CaptureFilters' action='/Capture/CaptureFilters'/>\n"
970 " <menuitem name='RefreshInterfaces' action='/Capture/RefreshInterfaces'/>\n"
973 " <menu name= 'AnalyzeMenu' action='/Analyze'>\n"
974 " <menuitem name='DisplayFilters' action='/Analyze/DisplayFilters'/>\n"
975 " <menuitem name='DisplayFilterMacros' action='/Analyze/DisplayFilterMacros'/>\n"
977 " <menuitem name='ApplyasColumn' action='/Analyze/ApplyasColumn'/>\n"
978 " <menu name= 'ApplyAsFilter' action='/ApplyasFilter'>\n"
979 " <menuitem name='Selected' action='/ApplyasFilter/Selected'/>\n"
980 " <menuitem name='NotSelected' action='/ApplyasFilter/Not Selected'/>\n"
981 " <menuitem name='AndSelected' action='/ApplyasFilter/AndSelected'/>\n"
982 " <menuitem name='OrSelected' action='/ApplyasFilter/OrSelected'/>\n"
983 " <menuitem name='AndNotSelected' action='/ApplyasFilter/AndNotSelected'/>\n"
984 " <menuitem name='OrNotSelected' action='/ApplyasFilter/OrNotSelected'/>\n"
986 " <menu name= 'PrepareaFilter' action='/PrepareaFilter'>\n"
987 " <menuitem name='Selected' action='/PrepareaFilter/Selected'/>\n"
988 " <menuitem name='NotSelected' action='/PrepareaFilter/Not Selected'/>\n"
989 " <menuitem name='AndSelected' action='/PrepareaFilter/AndSelected'/>\n"
990 " <menuitem name='OrSelected' action='/PrepareaFilter/OrSelected'/>\n"
991 " <menuitem name='AndNotSelected' action='/PrepareaFilter/AndNotSelected'/>\n"
992 " <menuitem name='OrNotSelected' action='/PrepareaFilter/OrNotSelected'/>\n"
995 " <menuitem name='EnabledProtocols' action='/Analyze/EnabledProtocols'/>\n"
996 " <menuitem name='DecodeAs' action='/Analyze/DecodeAs'/>\n"
997 " <menuitem name='UserSpecifiedDecodes' action='/Analyze/UserSpecifiedDecodes'/>\n"
999 " <menuitem name='FollowTCPStream' action='/Analyze/FollowTCPStream'/>\n"
1000 " <menuitem name='FollowUDPStream' action='/Analyze/FollowUDPStream'/>\n"
1001 " <menuitem name='FollowSSLStream' action='/Analyze/FollowSSLStream'/>\n"
1002 " <menuitem name='FollowHTTPStream' action='/Analyze/FollowHTTPStream'/>\n"
1003 " <menuitem name='ExpertInfo' action='/Analyze/ExpertInfo'/>\n"
1004 " <menu name= 'ConversationFilterMenu' action='/Analyze/ConversationFilter'>\n"
1005 " <placeholder name='Filters'/>\n"
1008 " <menu name= 'StatisticsMenu' action='/Statistics'>\n"
1009 " <menuitem name='Summary' action='/Statistics/Summary'/>\n"
1010 " <menuitem name='ShowCommentsSummary' action='/Statistics/CommentsSummary'/>\n"
1011 " <menuitem name='ShowAddreRes' action='/Statistics/ShowAddreRes'/>\n"
1012 " <menuitem name='ProtocolHierarchy' action='/Statistics/ProtocolHierarchy'/>\n"
1013 " <menuitem name='Conversations' action='/Statistics/Conversations'/>\n"
1014 " <menuitem name='Endpoints' action='/Statistics/Endpoints'/>\n"
1015 " <menuitem name='PacketLengths' action='/Statistics/plen'/>\n"
1016 " <menuitem name='IOGraphs' action='/Statistics/IOGraphs'/>\n"
1018 " <menu name= 'ConversationListMenu' action='/Statistics/ConversationList'>\n"
1019 " <placeholder name='Conversations'/>\n"
1021 " <menu name= 'EndpointListMenu' action='/Statistics/EndpointList'>\n"
1022 " <placeholder name='Endpoints'/>\n"
1024 " <menu name='ServiceResponseTimeMenu' action='/Statistics/ServiceResponseTime'>\n"
1025 " <menuitem name='DCE-RPC' action='/Statistics/ServiceResponseTime/DCE-RPC'/>\n"
1026 " <menuitem name='ONC-RPC' action='/Statistics/ServiceResponseTime/ONC-RPC'/>\n"
1029 " <menu name= '29West' action='/Statistics/29West'>\n"
1030 " <menu name= '29WestTopicMenu' action='/Statistics/29West/Topics'>\n"
1031 " <menuitem name='29WestTopicAdsTopic' action='/Statistics/29West/Topics/lbmr_topic_ads_topic'/>\n"
1032 " <menuitem name='29WestTopicAdsSource' action='/Statistics/29West/Topics/lbmr_topic_ads_source'/>\n"
1033 " <menuitem name='29WestTopicAdsTransport' action='/Statistics/29West/Topics/lbmr_topic_ads_transport'/>\n"
1034 " <menuitem name='29WestTopicQueriesTopic' action='/Statistics/29West/Topics/lbmr_topic_queries_topic'/>\n"
1035 " <menuitem name='29WestTopicQueriesReceiver' action='/Statistics/29West/Topics/lbmr_topic_queries_receiver'/>\n"
1036 " <menuitem name='29WestTopicQueriesPattern' action='/Statistics/29West/Topics/lbmr_topic_queries_pattern'/>\n"
1037 " <menuitem name='29WestTopicQueriesPatternReceiver' action='/Statistics/29West/Topics/lbmr_topic_queries_pattern_receiver'/>\n"
1039 " <menu name= '29WestQueueMenu' action='/Statistics/29West/Queues'>\n"
1040 " <menuitem name='29WestQueueAdsQueue' action='/Statistics/29West/Queues/lbmr_queue_ads_queue'/>\n"
1041 " <menuitem name='29WestQueueAdsSource' action='/Statistics/29West/Queues/lbmr_queue_ads_source'/>\n"
1042 " <menuitem name='29WestQueueQueriesQueue' action='/Statistics/29West/Queues/lbmr_queue_queries_queue'/>\n"
1043 " <menuitem name='29WestQueueQueriesReceiver' action='/Statistics/29West/Queues/lbmr_queue_queries_receiver'/>\n"
1045 " <menu name= '29WestUIMMenu' action='/Statistics/29West/UIM'>\n"
1046 " <menuitem name='29WestUIMStreams' action='/Statistics/29West/UIM/Streams' />\n"
1047 " <menuitem name='29WestUIMStreamFlowGraph' action='/Statistics/29West/UIM/StreamFlowGraph' />\n"
1050 " <menuitem name='ANCP' action='/Statistics/ancp'/>\n"
1051 " <menu name= 'BACnetMenu' action='/Statistics/BACnet'>\n"
1052 " <menuitem name='bacapp_instanceid' action='/Statistics/BACnet/bacapp_instanceid'/>\n"
1053 " <menuitem name='bacapp_ip' action='/Statistics/BACnet/bacapp_ip'/>\n"
1054 " <menuitem name='bacapp_objectid' action='/Statistics/BACnet/bacapp_objectid'/>\n"
1055 " <menuitem name='bacapp_service' action='/Statistics/BACnet/bacapp_service'/>\n"
1057 " <menuitem name='Collectd' action='/Statistics/collectd'/>\n"
1058 " <menuitem name='Compare' action='/Statistics/compare'/>\n"
1059 " <menuitem name= 'DNS' action='/Statistics/dns'/>\n"
1060 " <menuitem name='FlowGraph' action='/Statistics/FlowGraph'/>\n"
1061 " <menuitem name='HART-IP' action='/Statistics/hart_ip'/>\n"
1062 " <menuitem name= 'Hpfeeds' action='/Statistics/hpfeeds'/>\n"
1063 " <menu name= 'HTTPMenu' action='/Statistics/HTTP'>\n"
1064 " <menuitem name='http' action='/Statistics/HTTP/http'/>\n"
1065 " <menuitem name='http_req' action='/Statistics/HTTP/http_req'/>\n"
1066 " <menuitem name='http_srv' action='/Statistics/HTTP/http_srv'/>\n"
1068 " <menuitem name='HTTP2' action='/Statistics/http2'/>\n"
1069 " <menu name= 'SametimeMenu' action='/Statistics/Sametime'>\n"
1070 " <menuitem name='sametime' action='/Statistics/Sametime/sametime'/>\n"
1072 " <menu name= 'TCPStreamGraphMenu' action='/Statistics/TCPStreamGraphMenu'>\n"
1073 " <menuitem name='Sequence-Graph-Stevens' action='/Statistics/TCPStreamGraphMenu/Time-Sequence-Graph-Stevens'/>\n"
1074 " <menuitem name='Sequence-Graph-tcptrace' action='/Statistics/TCPStreamGraphMenu/Time-Sequence-Graph-tcptrace'/>\n"
1075 " <menuitem name='Throughput-Graph' action='/Statistics/TCPStreamGraphMenu/Throughput-Graph'/>\n"
1076 " <menuitem name='RTT-Graph' action='/Statistics/TCPStreamGraphMenu/RTT-Graph'/>\n"
1077 " <menuitem name='Window-Scaling-Graph' action='/Statistics/TCPStreamGraphMenu/Window-Scaling-Graph'/>\n"
1079 " <menuitem name='UDPMulticastStreams' action='/Statistics/UDPMulticastStreams'/>\n"
1080 " <menuitem name='WLANTraffic' action='/Statistics/WLANTraffic'/>\n"
1083 " <menu name= 'TelephonyMenu' action='/Telephony'>\n"
1084 " <menu name= 'ANSImenu' action='/Telephony/ANSI'>\n"
1086 " <menu name= 'GSM' action='/Telephony/GSM'>\n"
1087 " <menuitem name='MAP-Summary' action='/Telephony/GSM/MAPSummary'/>\n"
1089 " <menu name= 'IAX2menu' action='/Telephony/IAX2'>\n"
1090 " <menuitem name='StreamAnalysis' action='/Telephony/IAX2/StreamAnalysis'/>\n"
1092 " <menuitem name='ISUP' action='/Telephony/isup_msg'/>\n"
1093 " <menu name= 'LTEmenu' action='/Telephony/LTE'>\n"
1094 " <menuitem name='LTE_RLC_Graph' action='/Telephony/LTE/RLCGraph'/>\n"
1096 " <menu name= 'MTP3menu' action='/Telephony/MTP3'>\n"
1097 " <menuitem name='MSUSummary' action='/Telephony/MTP3/MSUSummary'/>\n"
1099 " <menu name= 'RTPmenu' action='/Telephony/RTP'>\n"
1100 " <menuitem name='ShowAllStreams' action='/Telephony/RTP/ShowAllStreams'/>\n"
1101 " <menuitem name='StreamAnalysis' action='/Telephony/RTP/StreamAnalysis'/>\n"
1103 " <menu name= 'RTSPmenu' action='/Telephony/RTSP'>\n"
1104 " <menuitem name='rtsp' action='/Telephony/RTSP/rtsp'/>\n"
1106 " <menu name= 'SCTPmenu' action='/Telephony/SCTP'>\n"
1107 " <menuitem name='AnalysethisAssociation' action='/Telephony/SCTP/AnalysethisAssociation'/>\n"
1108 " <menuitem name='ShowAllAssociations' action='/Telephony/SCTP/ShowAllAssociations'/>\n"
1110 " <menuitem name='SMPP' action='/Telephony/smpp_commands'/>\n"
1111 " <menuitem name='UCP' action='/Telephony/ucp_messages'/>\n"
1112 " <menuitem name='VoIPCalls' action='/Telephony/VoIPCalls'/>\n"
1113 " <menuitem name='VoIPFlows' action='/Telephony/VoIPFlows'/>\n"
1115 " <menu name= 'ToolsMenu' action='/Tools'>\n"
1116 " <menuitem name='FirewallACLRules' action='/Tools/FirewallACLRules'/>\n"
1118 " <menu name= 'InternalsMenu' action='/Internals'>\n"
1119 " <menuitem name='Dissectortables' action='/Internals/Dissectortables'/>\n"
1120 " <menuitem name='Conversations' action='/Internals/Conversations'/>\n"
1121 " <menuitem name='SupportedProtocols' action='/Internals/SupportedProtocols'/>\n"
1123 " <menu name= 'HelpMenu' action='/Help'>\n"
1124 " <menuitem name='Contents' action='/Help/Contents'/>\n"
1125 " <menu name= 'ManualPages' action='/Help/ManualPages'>\n"
1126 " <menuitem name='Wireshark' action='/Help/ManualPages/Wireshark'/>\n"
1127 " <menuitem name='WiresharkFilter' action='/Help/ManualPages/WiresharkFilter'/>\n"
1129 " <menuitem name='Capinfos' action='/Help/ManualPages/Capinfos'/>\n"
1130 " <menuitem name='Dumpcap' action='/Help/ManualPages/Dumpcap'/>\n"
1131 " <menuitem name='Editcap' action='/Help/ManualPages/Editcap'/>\n"
1132 " <menuitem name='Mergecap' action='/Help/ManualPages/Mergecap'/>\n"
1133 " <menuitem name='RawShark' action='/Help/ManualPages/RawShark'/>\n"
1134 " <menuitem name='Reordercap' action='/Help/ManualPages/Reordercap'/>\n"
1135 " <menuitem name='Text2pcap' action='/Help/ManualPages/Text2pcap'/>\n"
1136 " <menuitem name='TShark' action='/Help/ManualPages/TShark'/>\n"
1139 " <menuitem name='Website' action='/Help/Website'/>\n"
1140 " <menuitem name='FAQs' action='/Help/FAQs'/>\n"
1141 " <menuitem name='Ask' action='/Help/ASK'/>\n"
1142 " <menuitem name='Downloads' action='/Help/Downloads'/>\n"
1144 " <menuitem name='Wiki' action='/Help/Wiki'/>\n"
1145 " <menuitem name='SampleCaptures' action='/Help/SampleCaptures'/>\n"
1146 #ifdef HAVE_SOFTWARE_UPDATE
1148 " <menuitem name='CheckForUpdates' action='/Help/CheckForUpdates'/>\n"
1149 #endif /* HAVE_SOFTWARE_UPDATE */
1151 " <menuitem name='AboutWireshark' action='/Help/AboutWireshark'/>\n"
1161 * Please do not use keystrokes that are used as "universal" shortcuts in
1162 * various desktop environments:
1165 * http://support.microsoft.com/kb/126449
1168 * http://library.gnome.org/users/user-guide/nightly/keyboard-skills.html.en
1171 * http://developer.kde.org/documentation/standards/kde/style/keys/shortcuts.html
1173 * In particular, do not use the following <control> sequences for anything
1174 * other than their standard purposes:
1176 * <control>O File->Open
1177 * <control>S File->Save
1178 * <control>P File->Print
1179 * <control>W File->Close
1180 * <control>Q File->Quit
1181 * <control>Z Edit->Undo (which we don't currently have)
1182 * <control>X Edit->Cut (which we don't currently have)
1183 * <control>C Edit->Copy (which we don't currently have)
1184 * <control>V Edit->Paste (which we don't currently have)
1185 * <control>A Edit->Select All (which we don't currently have)
1187 * Note that some if not all of the Edit keys above already perform those
1188 * functions in text boxes, such as the Filter box. Do no, under any
1189 * circumstances, make a change that keeps them from doing so.
1195 * const gchar *name;
1196 * const gchar *stock_id;
1197 * const gchar *label;
1198 * const gchar *accelerator;
1199 * const gchar *tooltip;
1200 * GCallback callback;
1202 * const gchar *name; The name of the action.
1203 * const gchar *stock_id; The stock id for the action, or the name of an icon from the icon theme.
1204 * const gchar *label; The label for the action. This field should typically be marked for translation,
1205 * see gtk_action_group_set_translation_domain().
1206 * If label is NULL, the label of the stock item with id stock_id is used.
1207 * const gchar *accelerator; The accelerator for the action, in the format understood by gtk_accelerator_parse().
1208 * const gchar *tooltip; The tooltip for the action. This field should typically be marked for translation,
1209 * see gtk_action_group_set_translation_domain().
1210 * GCallback callback; The function to call when the action is activated.
1216 * TODO Move this menu to capture_if_dlg.c
1217 * eg put a "place holder" in the UI description and
1218 * make a call from main_menubar.c i.e build_capture_menu()
1219 * ad do the UI stuff there.
1221 static const GtkActionEntry capture_menu_entries[] = {
1222 { "/Capture", NULL, "_Capture", NULL, NULL, NULL },
1223 { "/Capture/Interfaces", WIRESHARK_STOCK_CAPTURE_INTERFACES, "_Interfaces...", "<control>I", NULL, G_CALLBACK(capture_if_action_cb) },
1224 { "/Capture/Options", WIRESHARK_STOCK_CAPTURE_OPTIONS, "_Options...", "<control>K", NULL, G_CALLBACK(capture_prep_action_cb) },
1225 { "/Capture/Start", WIRESHARK_STOCK_CAPTURE_START, "_Start", "<control>E", NULL, G_CALLBACK(capture_start_action_cb) },
1226 { "/Capture/Stop", WIRESHARK_STOCK_CAPTURE_STOP, "S_top", "<control>E", NULL, G_CALLBACK(capture_stop_action_cb) },
1227 { "/Capture/Restart", WIRESHARK_STOCK_CAPTURE_RESTART, "_Restart", "<control>R", NULL, G_CALLBACK(capture_restart_action_cb) },
1228 { "/Capture/CaptureFilters", WIRESHARK_STOCK_CAPTURE_FILTER, "Capture _Filters...", NULL, NULL, G_CALLBACK(capture_filters_action_cb) },
1229 { "/Capture/RefreshInterfaces", GTK_STOCK_REFRESH, "Refresh Interfaces", NULL, NULL, G_CALLBACK(refresh_interfaces_action_cb) },
1233 static const GtkActionEntry main_menu_bar_entries[] = {
1235 { "/File", NULL, "_File", NULL, NULL, NULL },
1236 { "/Edit", NULL, "_Edit", NULL, NULL, NULL },
1237 { "/View", NULL, "_View", NULL, NULL, NULL },
1238 { "/Go", NULL, "_Go", NULL, NULL, NULL },
1239 { "/Analyze", NULL, "_Analyze", NULL, NULL, NULL },
1240 { "/Statistics", NULL, "_Statistics", NULL, NULL, NULL },
1241 { "/Telephony", NULL, "Telephon_y", NULL, NULL, NULL },
1242 { "/Tools", NULL, "_Tools", NULL, NULL, NULL },
1243 { "/Internals", NULL, "_Internals", NULL, NULL, NULL },
1244 { "/Help", NULL, "_Help", NULL, NULL, NULL },
1246 { "/File/Open", GTK_STOCK_OPEN, "_Open...", "<control>O", "Open a file", G_CALLBACK(file_open_cmd_cb) },
1247 { "/File/OpenRecent", NULL, "Open _Recent", NULL, NULL, NULL },
1248 { "/File/Merge", NULL, "_Merge...", NULL, NULL, G_CALLBACK(file_merge_cmd_cb) },
1249 { "/File/ImportFromHexDump", NULL, "_Import from Hex Dump...", NULL, NULL, G_CALLBACK(file_import_cmd_cb) },
1250 { "/File/Close", GTK_STOCK_CLOSE, "_Close", "<control>W", NULL, G_CALLBACK(file_close_cmd_cb) },
1252 { "/File/Save", WIRESHARK_STOCK_SAVE, "_Save", "<control>S", NULL, G_CALLBACK(file_save_cmd_cb) },
1253 { "/File/SaveAs", WIRESHARK_STOCK_SAVE, "Save _As...", "<shift><control>S", NULL, G_CALLBACK(file_save_as_cmd_cb) },
1255 { "/File/Set", NULL, "File Set", NULL, NULL, NULL },
1256 { "/File/ExportSpecifiedPackets", NULL, "Export Specified Packets...", NULL, NULL, G_CALLBACK(file_export_specified_packets_cmd_cb) },
1257 { "/File/ExportPacketDissections", NULL, "Export Packet Dissections", NULL, NULL, NULL },
1258 { "/File/ExportSelectedPacketBytes", NULL, "Export Selected Packet _Bytes...", "<control>H", NULL, G_CALLBACK(savehex_cb) },
1259 { "/File/ExportPDUs", NULL, "Export PDUs to File...", NULL, NULL, G_CALLBACK(export_pdu_show_cb) },
1260 { "/File/ExportSSLSessionKeys", NULL, "Export SSL Session Keys...", NULL, NULL, G_CALLBACK(savesslkeys_cb) },
1261 { "/File/ExportObjects", NULL, "Export Objects", NULL, NULL, NULL },
1262 { "/File/Print", GTK_STOCK_PRINT, "_Print...", "<control>P", NULL, G_CALLBACK(file_print_cmd_cb) },
1263 { "/File/Quit", GTK_STOCK_QUIT, "_Quit", "<control>Q", NULL, G_CALLBACK(file_quit_cmd_cb) },
1265 { "/File/Set/ListFiles", WIRESHARK_STOCK_FILE_SET_LIST, "List Files", NULL, NULL, G_CALLBACK(fileset_cb) },
1266 { "/File/Set/NextFile", WIRESHARK_STOCK_FILE_SET_NEXT, "Next File", NULL, NULL, G_CALLBACK(fileset_next_cb) },
1267 { "/File/Set/PreviousFile", WIRESHARK_STOCK_FILE_SET_PREVIOUS, "Previous File", NULL, NULL, G_CALLBACK(fileset_previous_cb) },
1269 { "/File/ExportPacketDissections/Text", NULL, "as \"Plain _Text\" file...", NULL, NULL, G_CALLBACK(export_text_cmd_cb) },
1270 { "/File/ExportPacketDissections/PostScript", NULL, "as \"_PostScript\" file...", NULL, NULL, G_CALLBACK(export_ps_cmd_cb) },
1271 { "/File/ExportPacketDissections/CSV", NULL, "as \"_CSV\" (Comma Separated Values packet summary) file...",
1272 NULL, NULL, G_CALLBACK(export_csv_cmd_cb) },
1273 { "/File/ExportPacketDissections/CArrays", NULL, "as \"C _Arrays\" (packet bytes) file...",
1274 NULL, NULL, G_CALLBACK(export_carrays_cmd_cb) },
1275 { "/File/ExportPacketDissections/PSML", NULL, "as XML - \"P_SML\" (packet summary) file...",
1276 NULL, NULL, G_CALLBACK(export_psml_cmd_cb) },
1277 { "/File/ExportPacketDissections/PDML", NULL, "as XML - \"P_DML\" (packet details) file...",
1278 NULL, NULL, G_CALLBACK(export_pdml_cmd_cb) },
1279 { "/File/ExportPacketDissections/JSON", NULL, "as \"_JSON\" file...",
1280 NULL, NULL, G_CALLBACK(export_json_cmd_cb) },
1282 { "/Edit/Copy", NULL, "Copy", NULL, NULL, NULL },
1284 { "/Edit/Copy/Description", NULL, "Description", "<shift><control>D", NULL, G_CALLBACK(copy_description_cb) },
1285 { "/Edit/Copy/Fieldname", NULL, "Fieldname", "<shift><control>F", NULL, G_CALLBACK(copy_fieldname_cb) },
1286 { "/Edit/Copy/Value", NULL, "Value", "<shift><control>V", NULL, G_CALLBACK(copy_value_cb) },
1287 { "/Edit/Copy/AsFilter", NULL, "As Filter", "<shift><control>C", NULL, G_CALLBACK(copy_as_filter_cb) },
1291 * Un-#if this when we actually implement Cut/Copy/Paste for the
1292 * packet list and packet detail windows.
1294 * Note: when we implement Cut/Copy/Paste in those windows, we
1295 * will almost certainly want to allow multiple packets to be
1296 * selected in the packet list pane and multiple packet detail
1297 * items to be selected in the packet detail pane, so that
1298 * the user can, for example, copy the summaries of multiple
1299 * packets to the clipboard from the packet list pane and multiple
1300 * packet detail items - perhaps *all* packet detail items - from
1301 * the packet detail pane. Given that, we'll also want to
1302 * implement Select All.
1304 * If multiple packets are selected, we would probably display nothing
1305 * in the packet detail pane, just as we do if no packet is selected,
1306 * and any menu items etc. that would pertain only to a single packet
1307 * would be disabled.
1309 * If multiple packet detail items are selected, we would probably
1310 * disable all items that pertain only to a single packet detail
1311 * item, such as some items in the status bar.
1313 * XXX - the actions for these will be different depending on what
1314 * widget we're in; ^C should copy from the filter text widget if
1315 * we're in that widget, the packet list if we're in that widget
1316 * (presumably copying the summaries of selected packets to the
1317 * clipboard, e.g. the text copy would be the text of the columns),
1318 * the packet detail if we're in that widget (presumably copying
1319 * the contents of selected protocol tree items to the clipboard,
1320 * e.g. the text copy would be the text displayed for those items),
1323 * Given that those menu items should also affect text widgets
1324 * such as the filter box, we would again want Select All, and,
1325 * at least for the filter box, we would also want Undo and Redo.
1326 * We would only want Cut, Paste, Undo, and Redo for the packet
1327 * list and packet detail panes if we support modifying them.
1329 {"/Edit/_Undo", "<control>Z", NULL,
1330 0, "<StockItem>", GTK_STOCK_UNDO,},
1331 {"/Edit/_Redo", "<shift><control>Z", NULL,
1332 0, "<StockItem>", GTK_STOCK_REDO,},
1333 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1334 {"/Edit/Cu_t", "<control>X", NULL,
1335 0, "<StockItem>", GTK_STOCK_CUT,},
1336 {"/Edit/_Copy", "<control>C", NULL,
1337 0, "<StockItem>", GTK_STOCK_COPY,},
1338 {"/Edit/_Paste", "<control>V", NULL,
1339 0, "<StockItem>", GTK_STOCK_PASTE,},
1340 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1341 {"/Edit/Select _All", "<control>A", NULL, 0,
1342 "<StockItem>", GTK_STOCK_SELECT_ALL,},
1344 { "/Edit/FindPacket", GTK_STOCK_FIND, "_Find Packet...", "<control>F", NULL, G_CALLBACK(find_frame_cb) },
1345 { "/Edit/FindNext", NULL, "Find Ne_xt", "<control>N", NULL, G_CALLBACK(find_next_cb) },
1346 { "/Edit/FindPrevious", NULL, "Find Pre_vious", "<control>B", NULL, G_CALLBACK(find_previous_cb) },
1348 { "/Edit/MarkPacket", NULL, "_Mark/Unmark Packet", "<control>M", NULL, G_CALLBACK(packet_list_mark_frame_cb) },
1349 /* XXX - Unused. Should this and its associated code be removed? */
1350 { "/Edit/ToggleMarkingOfAllDisplayedPackets", NULL, "Toggle Marking of All Displayed Packets", "<shift><alt><control>M", NULL, G_CALLBACK(packet_list_toggle_mark_all_displayed_frames_cb) },
1351 { "/Edit/MarkAllDisplayedPackets", NULL, "Mark All Displayed Packets", "<shift><control>M", NULL, G_CALLBACK(packet_list_mark_all_displayed_frames_cb) },
1352 { "/Edit/UnmarkAllDisplayedPackets", NULL, "_Unmark All Displayed Packets", "<alt><control>M", NULL, G_CALLBACK(packet_list_unmark_all_displayed_frames_cb) },
1353 { "/Edit/FindNextMark", NULL, "Next Mark", "<shift><control>N", NULL, G_CALLBACK(find_next_mark_cb) },
1354 { "/Edit/FindPreviousMark", NULL, "Previous Mark", "<shift><control>B", NULL, G_CALLBACK(find_prev_mark_cb) },
1356 { "/Edit/IgnorePacket", NULL, "_Ignore/Unignore Packet", "<control>D", NULL, G_CALLBACK(packet_list_ignore_frame_cb) },
1358 * XXX - this next one overrides /Edit/Copy/Description
1360 { "/Edit/IgnoreAllDisplayedPackets", NULL, "Ignore All Displayed Packets", "<shift><control>D", NULL, G_CALLBACK(packet_list_ignore_all_displayed_frames_cb) },
1361 { "/Edit/Un-IgnoreAllPackets", NULL, "U_nignore All Packets", "<alt><control>D", NULL, G_CALLBACK(packet_list_unignore_all_frames_cb) },
1362 { "/Edit/SetTimeReference", WIRESHARK_STOCK_TIME, "Set/Unset Time Reference", "<control>T", NULL, G_CALLBACK(set_reftime_cb) },
1363 { "/Edit/Un-TimeReferenceAllPackets",NULL, "Unset All Time References", "<alt><control>T", NULL, G_CALLBACK(packet_list_untime_reference_all_frames_cb) },
1364 { "/Edit/FindNextTimeReference", NULL, "Next Time Reference", "<alt><control>N", NULL, G_CALLBACK(find_next_ref_time_cb) },
1365 { "/Edit/FindPreviousTimeReference", NULL, "Previous Time Reference", "<alt><control>B", NULL, G_CALLBACK(find_previous_ref_time_cb) },
1366 { "/Edit/TimeShift", WIRESHARK_STOCK_TIME, "Time Shift...", "<shift><control>T", NULL, G_CALLBACK(time_shift_cb) },
1368 { "/Edit/ConfigurationProfiles", NULL, "_Configuration Profiles...", "<shift><control>A", NULL, G_CALLBACK(profile_dialog_cb) },
1369 { "/Edit/Preferences", GTK_STOCK_PREFERENCES, "_Preferences...", "<shift><control>P", NULL, G_CALLBACK(menus_prefs_cb) },
1370 #ifdef WANT_PACKET_EDITOR
1371 { "/Edit/EditPacket", NULL, "_Edit Packet", NULL, NULL, G_CALLBACK(edit_window_cb) },
1373 { "/Edit/AddEditPktComment", WIRESHARK_STOCK_EDIT, "Packet Comment...", "<alt><control>C", NULL, G_CALLBACK(edit_packet_comment_dlg) },
1374 { "/Edit/AddEditCaptureComment", NULL, "Capture Comment...", "<shift><alt><control>C", NULL, G_CALLBACK(edit_capture_comment_dlg_launch) },
1376 { "/View/TimeDisplayFormat", NULL, "_Time Display Format", NULL, NULL, NULL },
1378 { "/View/NameResolution", NULL, "Name Resol_ution", NULL, NULL, NULL },
1379 { "/View/NameResolution/ResolveName", NULL, "_Resolve Name", NULL, NULL, G_CALLBACK(resolve_name_cb) },
1380 { "/View/NameResolution/ManuallyResolveName",NULL, "Manually Resolve Name", NULL, NULL, G_CALLBACK(manual_addr_resolv_dlg) },
1382 { "/View/ZoomIn", GTK_STOCK_ZOOM_IN, "_Zoom In", "<control>plus", NULL, G_CALLBACK(view_zoom_in_cb) },
1383 { "/View/ZoomOut", GTK_STOCK_ZOOM_OUT, "Zoom _Out", "<control>minus", NULL, G_CALLBACK(view_zoom_out_cb) },
1384 { "/View/NormalSize", GTK_STOCK_ZOOM_100, "_Normal Size", "<control>equal", NULL, G_CALLBACK(view_zoom_100_cb) },
1385 { "/View/ResizeAllColumns", WIRESHARK_STOCK_RESIZE_COLUMNS, "Resize All Columns", "<shift><control>R", NULL, G_CALLBACK(packet_list_resize_columns_cb) },
1386 { "/View/DisplayedColumns", NULL, "Displayed Columns", NULL, NULL, NULL },
1387 { "/View/ExpandSubtrees", NULL, "E_xpand Subtrees", "<shift>Right", NULL, G_CALLBACK(expand_tree_cb) },
1388 { "/View/CollapseSubtrees", NULL, "Collapse Subtrees", "<shift>Left", NULL, G_CALLBACK(collapse_tree_cb) },
1389 { "/View/ExpandAll", NULL, "_Expand All", "<control>Right", NULL, G_CALLBACK(expand_all_cb) },
1390 { "/View/CollapseAll", NULL, "Collapse _All", "<control>Left", NULL, G_CALLBACK(collapse_all_cb) },
1391 { "/View/ColorizeConversation", NULL, "Colorize Conversation",NULL, NULL, NULL },
1393 { "/View/ColorizeConversation/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", "<control>1", NULL, G_CALLBACK(view_menu_color_conv_color1_cb) },
1394 { "/View/ColorizeConversation/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", "<control>2", NULL, G_CALLBACK(view_menu_color_conv_color2_cb) },
1395 { "/View/ColorizeConversation/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", "<control>3", NULL, G_CALLBACK(view_menu_color_conv_color3_cb) },
1396 { "/View/ColorizeConversation/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", "<control>4", NULL, G_CALLBACK(view_menu_color_conv_color4_cb) },
1397 { "/View/ColorizeConversation/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", "<control>5", NULL, G_CALLBACK(view_menu_color_conv_color5_cb) },
1398 { "/View/ColorizeConversation/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", "<control>6", NULL, G_CALLBACK(view_menu_color_conv_color6_cb) },
1399 { "/View/ColorizeConversation/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", "<control>7", NULL, G_CALLBACK(view_menu_color_conv_color7_cb) },
1400 { "/View/ColorizeConversation/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", "<control>8", NULL, G_CALLBACK(view_menu_color_conv_color8_cb) },
1401 { "/View/ColorizeConversation/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", "<control>9", NULL, G_CALLBACK(view_menu_color_conv_color9_cb) },
1402 { "/View/ColorizeConversation/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", "<control>0", NULL, G_CALLBACK(view_menu_color_conv_color10_cb) },
1403 { "/View/ColorizeConversation/NewColoringRule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(view_menu_color_conv_new_rule_cb) },
1405 { "/View/ResetColoring1-10", NULL, "Reset Coloring 1-10", "<control>space", NULL, G_CALLBACK(view_menu_reset_coloring_cb) },
1406 { "/View/ColoringRules", GTK_STOCK_SELECT_COLOR, "_Coloring Rules...", NULL, NULL, G_CALLBACK(color_display_cb) },
1407 { "/View/ShowPacketinNewWindow", NULL, "Show Packet in New _Window", NULL, NULL, G_CALLBACK(new_window_cb) },
1408 { "/View/Reload", GTK_STOCK_REFRESH, "_Reload", "<control>R", NULL, G_CALLBACK(file_reload_cmd_cb) },
1411 { "/Go/Back", GTK_STOCK_GO_BACK, "_Back", "<alt>Left", NULL, G_CALLBACK(history_back_cb) },
1412 { "/Go/Forward", GTK_STOCK_GO_FORWARD, "_Forward", "<alt>Right", NULL, G_CALLBACK(history_forward_cb) },
1413 { "/Go/Goto", GTK_STOCK_JUMP_TO, "_Go to Packet...", "<control>G", NULL, G_CALLBACK(goto_frame_cb) },
1414 { "/Go/GotoCorrespondingPacket", NULL, "Go to _Corresponding Packet", NULL, NULL, G_CALLBACK(goto_framenum_cb) },
1415 { "/Go/PreviousPacket", GTK_STOCK_GO_UP, "Previous Packet", "<control>Up", NULL, G_CALLBACK(goto_previous_frame_cb) },
1416 { "/Go/NextPacket", GTK_STOCK_GO_DOWN, "Next Packet", "<control>Down", NULL, G_CALLBACK(goto_next_frame_cb) },
1417 { "/Go/FirstPacket", GTK_STOCK_GOTO_TOP, "F_irst Packet", "<control>Home", NULL, G_CALLBACK(goto_top_frame_cb) },
1418 { "/Go/LastPacket", GTK_STOCK_GOTO_BOTTOM, "_Last Packet", "<control>End", NULL, G_CALLBACK(goto_bottom_frame_cb) },
1419 { "/Go/PreviousPacketInConversation", GTK_STOCK_GO_UP, "Previous Packet In Conversation", "<control>comma", NULL, G_CALLBACK(goto_previous_frame_conversation_cb) },
1420 { "/Go/NextPacketInConversation", GTK_STOCK_GO_DOWN, "Next Packet In Conversation", "<control>period", NULL, G_CALLBACK(goto_next_frame_conversation_cb) },
1423 { "/Analyze/DisplayFilters", WIRESHARK_STOCK_DISPLAY_FILTER, "_Display Filters...", NULL, NULL, G_CALLBACK(dfilter_dialog_cb) },
1425 { "/Analyze/DisplayFilterMacros", NULL, "Display Filter _Macros...", NULL, NULL, G_CALLBACK(macros_dialog_cb) },
1426 { "/Analyze/ApplyasColumn", NULL, "Apply as Column", NULL, NULL, G_CALLBACK(apply_as_custom_column_cb) },
1428 { "/Analyze/EnabledProtocols", WIRESHARK_STOCK_CHECKBOX, "_Enabled Protocols...", "<shift><control>E", NULL, G_CALLBACK(proto_cb) },
1429 { "/Analyze/DecodeAs", WIRESHARK_STOCK_DECODE_AS, "Decode _As...", NULL, NULL, G_CALLBACK(decode_as_cb) },
1430 { "/Analyze/UserSpecifiedDecodes", WIRESHARK_STOCK_DECODE_AS, "_User Specified Decodes...", NULL, NULL, G_CALLBACK(decode_show_cb) },
1432 { "/Analyze/FollowTCPStream", NULL, "Follow TCP Stream", NULL, NULL, G_CALLBACK(follow_tcp_stream_cb) },
1433 { "/Analyze/FollowUDPStream", NULL, "Follow UDP Stream", NULL, NULL, G_CALLBACK(follow_udp_stream_cb) },
1434 { "/Analyze/FollowSSLStream", NULL, "Follow SSL Stream", NULL, NULL, G_CALLBACK(follow_ssl_stream_cb) },
1435 { "/Analyze/FollowHTTPStream", NULL, "Follow HTTP Stream", NULL, NULL, G_CALLBACK(follow_http_stream_cb) },
1437 { "/Analyze/ExpertInfo", WIRESHARK_STOCK_EXPERT_INFO, "Expert _Info", NULL, NULL, G_CALLBACK(expert_comp_dlg_launch) },
1439 { "/Analyze/ConversationFilter", NULL, "Conversation Filter", NULL, NULL, NULL },
1442 { "/Statistics/ConversationList", NULL, "_Conversation List", NULL, NULL, NULL },
1444 { "/Statistics/EndpointList", NULL, "_Endpoint List", NULL, NULL, NULL },
1446 { "/Statistics/ServiceResponseTime", NULL, "Service _Response Time", NULL, NULL, NULL },
1447 { "/Statistics/ServiceResponseTime/DCE-RPC", WIRESHARK_STOCK_TIME, "DCE-RPC...", NULL, NULL, G_CALLBACK(gtk_dcerpcstat_cb) },
1448 { "/Statistics/ServiceResponseTime/ONC-RPC", WIRESHARK_STOCK_TIME, "ONC-RPC...", NULL, NULL, G_CALLBACK(gtk_rpcstat_cb) },
1450 { "/Statistics/29West", NULL, "29West", NULL, NULL, NULL },
1451 { "/Statistics/29West/Topics", NULL, "Topics", NULL, NULL, NULL },
1452 { "/Statistics/29West/Topics/lbmr_topic_ads_topic", NULL, "Advertisements by Topic", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1453 { "/Statistics/29West/Topics/lbmr_topic_ads_source", NULL, "Advertisements by Source", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1454 { "/Statistics/29West/Topics/lbmr_topic_ads_transport", NULL, "Advertisements by Transport", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1455 { "/Statistics/29West/Topics/lbmr_topic_queries_topic", NULL, "Queries by Topic", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1456 { "/Statistics/29West/Topics/lbmr_topic_queries_receiver", NULL, "Queries by Receiver", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1457 { "/Statistics/29West/Topics/lbmr_topic_queries_pattern", NULL, "Wildcard Queries by Pattern", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1458 { "/Statistics/29West/Topics/lbmr_topic_queries_pattern_receiver", NULL, "Wildcard Queries by Receiver", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1459 { "/Statistics/29West/Queues", NULL, "Queues", NULL, NULL, NULL },
1460 { "/Statistics/29West/Queues/lbmr_queue_ads_queue", NULL, "Advertisements by Queue", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1461 { "/Statistics/29West/Queues/lbmr_queue_ads_source", NULL, "Advertisements by Source", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1462 { "/Statistics/29West/Queues/lbmr_queue_queries_queue", NULL, "Queries by Queue", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1463 { "/Statistics/29West/Queues/lbmr_queue_queries_receiver", NULL, "Queries by Receiver", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1464 { "/Statistics/29West/UIM", NULL, "UIM", NULL, NULL, NULL },
1465 { "/Statistics/29West/UIM/Streams", NULL, "Streams", NULL, NULL, G_CALLBACK(lbmc_stream_dlg_stream_menu_cb) },
1466 { "/Statistics/29West/UIM/StreamFlowGraph", WIRESHARK_STOCK_FLOW_GRAPH, "Stream Flow Graph", NULL, NULL, G_CALLBACK(lbmc_uim_flow_menu_cb) },
1468 { "/Statistics/ancp", NULL, "ANCP", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1469 { "/Statistics/BACnet", NULL, "BACnet", NULL, NULL, NULL },
1470 { "/Statistics/BACnet/bacapp_instanceid", NULL, "Packets sorted by Instance ID", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1471 { "/Statistics/BACnet/bacapp_ip", NULL, "Packets sorted by IP", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1472 { "/Statistics/BACnet/bacapp_objectid", NULL, "Packets sorted by Object Type", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1473 { "/Statistics/BACnet/bacapp_service", NULL, "Packets sorted by Service", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1474 { "/Statistics/collectd", NULL, "Collectd...", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1475 { "/Statistics/compare", NULL, "Compare...", NULL, NULL, G_CALLBACK(gtk_comparestat_cb) },
1476 { "/Statistics/dns", NULL, "DNS", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1477 { "/Statistics/FlowGraph", WIRESHARK_STOCK_FLOW_GRAPH, "Flo_w Graph...", NULL, NULL, G_CALLBACK(flow_graph_launch) },
1478 { "/Statistics/hart_ip", NULL, "HART-IP", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1479 { "/Statistics/hpfeeds", NULL, "HPFEEDS", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1480 { "/Statistics/HTTP", NULL, "HTTP", NULL, NULL, NULL },
1481 { "/Statistics/HTTP/http", NULL, "Packet Counter", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1482 { "/Statistics/HTTP/http_req", NULL, "Requests", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1483 { "/Statistics/HTTP/http_srv", NULL, "Load Distribution", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1484 { "/Statistics/http2", NULL, "HTTP2", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1485 { "/Statistics/Sametime", NULL, "Sametime", NULL, NULL, NULL },
1486 { "/Statistics/Sametime/sametime", NULL, "Messages", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1487 { "/Statistics/TCPStreamGraphMenu", NULL, "TCP StreamGraph", NULL, NULL, NULL },
1488 { "/Statistics/TCPStreamGraphMenu/Time-Sequence-Graph-Stevens", NULL, "Time-Sequence Graph (Stevens)", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1489 { "/Statistics/TCPStreamGraphMenu/Time-Sequence-Graph-tcptrace", NULL, "Time-Sequence Graph (tcptrace)", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1490 { "/Statistics/TCPStreamGraphMenu/Throughput-Graph", NULL, "Throughput Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1491 { "/Statistics/TCPStreamGraphMenu/RTT-Graph", NULL, "Round Trip Time Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1492 { "/Statistics/TCPStreamGraphMenu/Window-Scaling-Graph", NULL, "Window Scaling Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1494 { "/Statistics/UDPMulticastStreams", NULL, "UDP Multicast Streams", NULL, NULL, G_CALLBACK(mcaststream_launch) },
1495 { "/Statistics/WLANTraffic", NULL, "WLAN Traffic", NULL, NULL, G_CALLBACK(wlanstat_launch) },
1497 { "/Statistics/Summary", GTK_STOCK_PROPERTIES, "_Summary", NULL, NULL, G_CALLBACK(summary_open_cb) },
1498 { "/Statistics/CommentsSummary", NULL, "Comments Summary", NULL, NULL, G_CALLBACK(show_packet_comment_summary_dlg) },
1499 { "/Statistics/ShowAddreRes", NULL, "Show address resolution", NULL, NULL, G_CALLBACK(addr_resolution_dlg) },
1500 { "/Statistics/ProtocolHierarchy", NULL, "_Protocol Hierarchy", NULL, NULL, G_CALLBACK(proto_hier_stats_cb) },
1501 { "/Statistics/Conversations", WIRESHARK_STOCK_CONVERSATIONS, "Conversations", NULL, NULL, G_CALLBACK(init_conversation_notebook_cb) },
1502 { "/Statistics/Endpoints", WIRESHARK_STOCK_ENDPOINTS, "Endpoints", NULL, NULL, G_CALLBACK(init_hostlist_notebook_cb) },
1503 { "/Statistics/IOGraphs", WIRESHARK_STOCK_GRAPHS, "_IO Graph", NULL, NULL, G_CALLBACK(gui_iostat_cb) },
1504 { "/Statistics/plen", NULL, "Packet Lengths...", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1506 { "/Telephony/ANSI", NULL, "_ANSI", NULL, NULL, NULL },
1507 { "/Telephony/GSM", NULL, "_GSM", NULL, NULL, NULL },
1508 { "/Telephony/GSM/MAPSummary", NULL, "MAP Summary", NULL, NULL, G_CALLBACK(gsm_map_stat_gtk_sum_cb) },
1510 { "/Telephony/IAX2", NULL, "IA_X2", NULL, NULL, NULL },
1511 { "/Telephony/IAX2/StreamAnalysis", NULL, "Stream Analysis...", NULL, NULL, G_CALLBACK(iax2_analysis_cb) },
1513 { "/Telephony/isup_msg", NULL, "_ISUP Messages", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1515 { "/Telephony/LTE", NULL, "_LTE", NULL, NULL, NULL },
1516 { "/Telephony/LTE/RLCGraph", NULL, "RLC _Graph...", NULL, NULL, G_CALLBACK(rlc_lte_graph_cb) },
1517 { "/Telephony/MTP3", NULL, "_MTP3", NULL, NULL, NULL },
1518 { "/Telephony/MTP3/MSUSummary", NULL, "MSU Summary", NULL, NULL, G_CALLBACK(mtp3_sum_gtk_sum_cb) },
1519 { "/Telephony/RTP", NULL, "_RTP", NULL, NULL, NULL },
1520 { "/Telephony/RTP/StreamAnalysis", NULL, "Stream Analysis...", NULL, NULL, G_CALLBACK(rtp_analysis_cb) },
1521 { "/Telephony/RTP/ShowAllStreams", NULL, "Show All Streams", NULL, NULL, G_CALLBACK(rtpstream_launch) },
1522 { "/Telephony/RTSP", NULL, "RTSP", NULL, NULL, NULL },
1523 { "/Telephony/RTSP/rtsp", NULL, "Packet Counter", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1524 { "/Telephony/SCTP", NULL, "S_CTP", NULL, NULL, NULL },
1525 { "/Telephony/SCTP/AnalysethisAssociation", NULL, "Analyse this Association", NULL, NULL, G_CALLBACK(sctp_analyse_start) },
1526 { "/Telephony/SCTP/ShowAllAssociations", NULL, "Show All Associations...", NULL, NULL, G_CALLBACK(sctp_stat_start) },
1527 { "/Telephony/smpp_commands", NULL, "SM_PPOperations", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1528 { "/Telephony/ucp_messages", NULL, "_UCP Messages", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1529 { "/Telephony/VoIPCalls", WIRESHARK_STOCK_TELEPHONE, "_VoIP Calls", NULL, NULL, G_CALLBACK(voip_calls_launch) },
1530 { "/Telephony/VoIPFlows", WIRESHARK_STOCK_TELEPHONE, "SIP _Flows", NULL, NULL, G_CALLBACK(voip_flows_launch) },
1532 { "/Tools/FirewallACLRules", NULL, "Firewall ACL Rules", NULL, NULL, G_CALLBACK(firewall_rule_cb) },
1534 { "/Internals/Dissectortables", NULL, "_Dissector tables", NULL, NULL, G_CALLBACK(dissector_tables_dlg_cb) },
1535 { "/Internals/Conversations", NULL, "_Conversation hash tables",NULL, NULL, G_CALLBACK(conversation_hastables_dlg) },
1536 { "/Internals/SupportedProtocols", NULL, "_Supported Protocols (slow!)", NULL, NULL, G_CALLBACK(supported_cb) },
1538 { "/Help/Contents", GTK_STOCK_HELP, "_Contents", "F1", NULL, G_CALLBACK(help_menu_cont_cb) },
1539 { "/Help/ManualPages", NULL, "ManualPages", NULL, NULL, NULL },
1540 { "/Help/ManualPages/Wireshark", NULL, "Wireshark", NULL, NULL, G_CALLBACK(help_menu_wireshark_cb) },
1541 { "/Help/ManualPages/WiresharkFilter", NULL, "Wireshark Filter", NULL, NULL, G_CALLBACK(help_menu_wireshark_flt_cb) },
1542 { "/Help/ManualPages/Capinfos", NULL, "Capinfos", NULL, NULL, G_CALLBACK(help_menu_Capinfos_cb) },
1543 { "/Help/ManualPages/Dumpcap", NULL, "Dumpcap", NULL, NULL, G_CALLBACK(help_menu_Dumpcap_cb) },
1544 { "/Help/ManualPages/Editcap", NULL, "Editcap", NULL, NULL, G_CALLBACK(help_menu_Editcap_cb) },
1545 { "/Help/ManualPages/Mergecap", NULL, "Mergecap", NULL, NULL, G_CALLBACK(help_menu_Mergecap_cb) },
1546 { "/Help/ManualPages/RawShark", NULL, "RawShark", NULL, NULL, G_CALLBACK(help_menu_RawShark_cb) },
1547 { "/Help/ManualPages/Reordercap", NULL, "Reordercap", NULL, NULL, G_CALLBACK(help_menu_Reorder_cb) },
1548 { "/Help/ManualPages/Text2pcap", NULL, "Text2pcap", NULL, NULL, G_CALLBACK(help_menu_Text2pcap_cb) },
1549 { "/Help/ManualPages/TShark", NULL, "TShark", NULL, NULL, G_CALLBACK(help_menu_TShark_cb) },
1551 { "/Help/Website", GTK_STOCK_HOME, "Website", NULL, NULL, G_CALLBACK(help_menu_Website_cb) },
1552 { "/Help/FAQs", NULL, "FAQ's", NULL, NULL, G_CALLBACK(help_menu_faq_cb) },
1553 { "/Help/ASK", NULL, "Ask (Q&A)", NULL, NULL, G_CALLBACK(help_menu_ask_cb) },
1554 { "/Help/Downloads", NULL, "Downloads", NULL, NULL, G_CALLBACK(help_menu_Downloads_cb) },
1555 { "/Help/Wiki", WIRESHARK_STOCK_WIKI, "Wiki", NULL, NULL, G_CALLBACK(help_menu_Wiki_cb) },
1556 { "/Help/SampleCaptures", NULL, "Sample Captures", NULL, NULL, G_CALLBACK(help_menu_SampleCaptures_cb) },
1557 #ifdef HAVE_SOFTWARE_UPDATE
1558 { "/Help/CheckForUpdates", NULL, "Check for Updates...", NULL, NULL, G_CALLBACK(check_for_updates_cb) },
1559 #endif /* HAVE_SOFTWARE_UPDATE */
1560 { "/Help/AboutWireshark", WIRESHARK_STOCK_ABOUT, "_About Wireshark", NULL, NULL, G_CALLBACK(about_wireshark_cb) },
1563 static const GtkToggleActionEntry main_menu_bar_toggle_action_entries[] =
1565 /* name, stock id, label, accel, tooltip, callback, is_active */
1566 {"/View/MainToolbar", NULL, "_Main Toolbar", NULL, NULL, G_CALLBACK(main_toolbar_show_hide_cb), TRUE},
1567 {"/View/FilterToolbar", NULL, "_Filter Toolbar", NULL, NULL, G_CALLBACK(filter_toolbar_show_hide_cb), TRUE},
1568 {"/View/WirelessToolbar", NULL, "Wire_less Toolbar", NULL, NULL, G_CALLBACK(wireless_toolbar_show_hide_cb), FALSE},
1569 {"/View/StatusBar", NULL, "_Status Bar", NULL, NULL, G_CALLBACK(status_bar_show_hide_cb), TRUE},
1570 {"/View/PacketList", NULL, "Packet _List", NULL, NULL, G_CALLBACK(packet_list_show_hide_cb), TRUE},
1571 {"/View/PacketDetails", NULL, "Packet _Details", NULL, NULL, G_CALLBACK(packet_details_show_hide_cb), TRUE},
1572 {"/View/PacketBytes", NULL, "Packet _Bytes", NULL, NULL, G_CALLBACK(packet_bytes_show_hide_cb), TRUE},
1573 {"/View/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes", NULL, "Display Seconds with hours and minutes", NULL, NULL, G_CALLBACK(timestamp_seconds_time_cb), FALSE},
1574 {"/View/NameResolution/EnableforMACLayer", NULL, "Enable for _MAC Layer", NULL, NULL, G_CALLBACK(view_menu_en_for_MAC_cb), TRUE},
1575 {"/View/NameResolution/EnableforTransportLayer", NULL, "Enable for _Transport Layer", NULL, NULL, G_CALLBACK(view_menu_en_for_transport_cb), TRUE },
1576 {"/View/NameResolution/EnableforNetworkLayer", NULL, "Enable for _Network Layer", NULL, NULL, G_CALLBACK(view_menu_en_for_network_cb), TRUE },
1577 {"/View/NameResolution/UseExternalNetworkNameResolver", NULL, "Use _External Network Name Resolver", NULL, NULL, G_CALLBACK(view_menu_en_use_external_resolver_cb), TRUE },
1578 {"/View/ColorizePacketList", NULL, "Colorize Packet List", NULL, NULL, G_CALLBACK(view_menu_colorize_pkt_lst_cb), TRUE },
1580 {"/View/AutoScrollinLiveCapture", NULL, "Auto Scroll in Li_ve Capture", NULL, NULL, G_CALLBACK(view_menu_auto_scroll_live_cb), TRUE },
1584 static const GtkRadioActionEntry main_menu_bar_radio_view_time_entries [] =
1586 /* name, stock id, label, accel, tooltip, value */
1587 { "/View/TimeDisplayFormat/DateYMDandTimeofDay", NULL, "Date and Time of Day: 1970-01-01 01:02:03.123456", "<alt><control>1", NULL, TS_ABSOLUTE_WITH_YMD },
1588 { "/View/TimeDisplayFormat/DateYDOYandTimeofDay", NULL, "Date (with day of year) and Time of Day: 1970/001 01:02:03.123456", NULL, NULL, TS_ABSOLUTE_WITH_YDOY },
1589 { "/View/TimeDisplayFormat/TimeofDay", NULL, "Time of Day: 01:02:03.123456", "<alt><control>2", NULL, TS_ABSOLUTE },
1590 { "/View/TimeDisplayFormat/SecondsSinceEpoch", NULL, "Seconds Since Epoch (1970-01-01): 1234567890.123456", "<alt><control>3", NULL, TS_EPOCH },
1591 { "/View/TimeDisplayFormat/SecondsSinceBeginningofCapture", NULL, "Seconds Since Beginning of Capture: 123.123456", "<alt><control>4", NULL, TS_RELATIVE },
1592 { "/View/TimeDisplayFormat/SecondsSincePreviousCapturedPacket", NULL, "Seconds Since Previous Captured Packet: 1.123456", "<alt><control>5", NULL, TS_DELTA },
1593 { "/View/TimeDisplayFormat/SecondsSincePreviousDisplayedPacket",NULL, "Seconds Since Previous Displayed Packet: 1.123456", "<alt><control>6", NULL, TS_DELTA_DIS },
1594 { "/View/TimeDisplayFormat/UTCDateYMDandTimeofDay", NULL, "UTC Date and Time of Day: 1970-01-01 01:02:03.123456", "<alt><control>7", NULL, TS_UTC_WITH_YMD },
1595 { "/View/TimeDisplayFormat/UTCDateYDOYandTimeofDay", NULL, "UTC Date (with day of year) and Time of Day: 1970/001 01:02:03.123456", NULL, NULL, TS_UTC_WITH_YDOY },
1596 { "/View/TimeDisplayFormat/UTCTimeofDay", NULL, "UTC Time of Day: 01:02:03.123456", "<alt><control>8", NULL, TS_UTC },
1599 static const GtkRadioActionEntry main_menu_bar_radio_view_time_fileformat_prec_entries [] =
1601 /* name, stock id, label, accel, tooltip, value */
1602 { "/View/TimeDisplayFormat/FileFormatPrecision-Automatic", NULL, "Automatic (use precision indicated in the file)", NULL, NULL, TS_PREC_AUTO },
1603 { "/View/TimeDisplayFormat/FileFormatPrecision-Seconds", NULL, "Seconds: 0", NULL, NULL, TS_PREC_FIXED_SEC },
1604 { "/View/TimeDisplayFormat/FileFormatPrecision-Deciseconds", NULL, "Deciseconds: 0.1", NULL, NULL, TS_PREC_FIXED_DSEC },
1605 { "/View/TimeDisplayFormat/FileFormatPrecision-Centiseconds", NULL, "Centiseconds: 0.12", NULL, NULL, TS_PREC_FIXED_CSEC },
1606 { "/View/TimeDisplayFormat/FileFormatPrecision-Milliseconds", NULL, "Milliseconds: 0.123", NULL, NULL, TS_PREC_FIXED_MSEC },
1607 { "/View/TimeDisplayFormat/FileFormatPrecision-Microseconds", NULL, "Microseconds: 0.123456", NULL, NULL, TS_PREC_FIXED_USEC },
1608 { "/View/TimeDisplayFormat/FileFormatPrecision-Nanoseconds", NULL, "Nanoseconds: 0.123456789", NULL, NULL, TS_PREC_FIXED_NSEC },
1613 select_bytes_view_cb (GtkRadioAction *action, GtkRadioAction *current _U_, gpointer user_data _U_)
1615 bytes_view_type value;
1617 value = (bytes_view_type)gtk_radio_action_get_current_value (action);
1619 select_bytes_view( NULL, NULL, value);
1623 sort_ascending_cb(GtkAction *action _U_, gpointer user_data)
1625 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortAscending");
1626 packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_SORT_ASCENDING);
1630 sort_descending_cb(GtkAction *action _U_, gpointer user_data)
1632 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortDescending");
1633 packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_SORT_DESCENDING);
1637 no_sorting_cb(GtkAction *action _U_, gpointer user_data)
1639 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/NoSorting");
1640 packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_SORT_NONE);
1644 packet_list_heading_show_resolved_cb(GtkAction *action _U_, gpointer user_data _U_)
1646 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ShowResolved");
1648 packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_TOGGLE_RESOLVED);
1652 packet_list_heading_align_left_cb(GtkAction *action _U_, gpointer user_data)
1654 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/AlignLeft");
1655 packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_ALIGN_LEFT);
1659 packet_list_heading_align_center_cb(GtkAction *action _U_, gpointer user_data)
1661 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/AlignCenter");
1662 packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_ALIGN_CENTER);
1666 packet_list_heading_align_right_cb(GtkAction *action _U_, gpointer user_data)
1668 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/AlignRight");
1669 packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_ALIGN_RIGHT);
1673 packet_list_heading_col_pref_cb(GtkAction *action _U_, gpointer user_data)
1675 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ColumnPreferences");
1676 prefs_page_cb( widget , user_data, PREFS_PAGE_COLUMNS);
1680 packet_list_heading_resize_col_cb(GtkAction *action _U_, gpointer user_data)
1682 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ResizeColumn");
1683 packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_RESIZE);
1687 packet_list_heading_change_col_cb(GtkAction *action _U_, gpointer user_data)
1689 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/EditColumnDetails");
1690 packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_CHANGE);
1694 packet_list_heading_activate_all_columns_cb(GtkAction *action _U_, gpointer user_data _U_)
1696 packet_list_set_all_columns_visible ();
1700 packet_list_heading_hide_col_cb(GtkAction *action _U_, gpointer user_data)
1702 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/HideColumn");
1703 packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_HIDE);
1707 packet_list_heading_remove_col_cb(GtkAction *action _U_, gpointer user_data)
1709 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/RemoveColumn");
1710 packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_REMOVE);
1714 packet_list_menu_set_ref_time_cb(GtkAction *action _U_, gpointer user_data)
1716 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_TOGGLE);
1721 apply_selected_filter_cb(GtkAction *action, gpointer user_data)
1723 const gchar *path = gtk_action_get_accel_path(action);
1724 /*g_warning("Accelerator path %s",path+9);*/
1726 /* path starts with "<Actions>" */
1727 if (strncmp (path+9,"/PacketListPopUpMenuActionGroup",31) == 0){
1728 /* Use different callbacks depending action path */
1729 match_selected_plist_cb(user_data, (MATCH_SELECTED_E)(MATCH_SELECTED_REPLACE|MATCH_SELECTED_APPLY_NOW));
1731 match_selected_ptree_cb(user_data, (MATCH_SELECTED_E)(MATCH_SELECTED_REPLACE|MATCH_SELECTED_APPLY_NOW));
1736 apply_not_selected_cb(GtkAction *action, gpointer user_data)
1738 const gchar *path = gtk_action_get_accel_path(action);
1740 /* path starts with "<Actions>" */
1741 if (strncmp (path+9,"/PacketListPopUpMenuActionGroup",31) == 0){
1742 /* Use different callbacks depending action path */
1743 match_selected_plist_cb(user_data, (MATCH_SELECTED_E)(MATCH_SELECTED_NOT|MATCH_SELECTED_APPLY_NOW));
1745 match_selected_ptree_cb(user_data, (MATCH_SELECTED_E)(MATCH_SELECTED_NOT|MATCH_SELECTED_APPLY_NOW));
1750 apply_and_selected_cb(GtkAction *action, gpointer user_data)
1752 const gchar *path = gtk_action_get_accel_path(action);
1754 /* path starts with "<Actions>" */
1755 if (strncmp (path+9,"/PacketListPopUpMenuActionGroup",31) == 0){
1756 /* Use different callbacks depending action path */
1757 match_selected_plist_cb(user_data, (MATCH_SELECTED_E)(MATCH_SELECTED_AND|MATCH_SELECTED_APPLY_NOW));
1759 match_selected_ptree_cb(user_data, (MATCH_SELECTED_E)(MATCH_SELECTED_AND|MATCH_SELECTED_APPLY_NOW));
1764 apply_or_selected_cb(GtkAction *action, gpointer user_data)
1766 const gchar *path = gtk_action_get_accel_path(action);
1768 /* path starts with "<Actions>" */
1769 if (strncmp (path+9,"/PacketListPopUpMenuActionGroup",31) == 0){
1770 /* Use different callbacks depending action path */
1771 match_selected_plist_cb(user_data, (MATCH_SELECTED_E)(MATCH_SELECTED_OR|MATCH_SELECTED_APPLY_NOW));
1773 match_selected_ptree_cb(user_data, (MATCH_SELECTED_E)(MATCH_SELECTED_OR|MATCH_SELECTED_APPLY_NOW));
1778 apply_and_not_selected_cb(GtkAction *action, gpointer user_data)
1780 const gchar *path = gtk_action_get_accel_path(action);
1782 /* path starts with "<Actions>" */
1783 if (strncmp (path+9,"/PacketListPopUpMenuActionGroup",31) == 0){
1784 /* Use different callbacks depending action path */
1785 match_selected_plist_cb(user_data, (MATCH_SELECTED_E)(MATCH_SELECTED_AND_NOT|MATCH_SELECTED_APPLY_NOW));
1787 match_selected_ptree_cb(user_data, (MATCH_SELECTED_E)(MATCH_SELECTED_AND_NOT|MATCH_SELECTED_APPLY_NOW));
1792 apply_or_not_selected_cb(GtkAction *action, gpointer user_data)
1794 const gchar *path = gtk_action_get_accel_path(action);
1796 /* path starts with "<Actions>" */
1797 if (strncmp (path+9,"/PacketListPopUpMenuActionGroup",31) == 0){
1798 /* Use different callbacks depending action path */
1799 match_selected_plist_cb(user_data,(MATCH_SELECTED_E)(MATCH_SELECTED_OR_NOT|MATCH_SELECTED_APPLY_NOW));
1801 match_selected_ptree_cb(user_data, (MATCH_SELECTED_E)(MATCH_SELECTED_OR_NOT|MATCH_SELECTED_APPLY_NOW));
1805 /* Prepare a filter */
1807 prepare_selected_cb(GtkAction *action, gpointer user_data)
1809 const gchar *path = gtk_action_get_accel_path(action);
1811 /* path starts with "<Actions>" */
1812 if (strncmp (path+9,"/PacketListPopUpMenuActionGroup",31) == 0){
1813 /* Use different callbacks depending action path */
1814 match_selected_plist_cb(user_data, MATCH_SELECTED_REPLACE);
1816 match_selected_ptree_cb(user_data, MATCH_SELECTED_REPLACE);
1821 prepare_not_selected_cb(GtkAction *action, gpointer user_data)
1823 const gchar *path = gtk_action_get_accel_path(action);
1825 /* path starts with "<Actions>" */
1826 if (strncmp (path+9,"/PacketListPopUpMenuActionGroup",31) == 0){
1827 /* Use different callbacks depending action path */
1828 match_selected_plist_cb(user_data, MATCH_SELECTED_NOT);
1830 match_selected_ptree_cb(user_data, MATCH_SELECTED_NOT);
1835 prepare_and_selected_cb(GtkAction *action, gpointer user_data)
1837 const gchar *path = gtk_action_get_accel_path(action);
1839 /* path starts with "<Actions>" */
1840 if (strncmp (path+9,"/PacketListPopUpMenuActionGroup",31) == 0){
1841 /* Use different callbacks depending action path */
1842 match_selected_plist_cb(user_data, MATCH_SELECTED_AND);
1844 match_selected_ptree_cb(user_data, MATCH_SELECTED_AND);
1849 prepare_or_selected_cb(GtkAction *action, gpointer user_data)
1851 const gchar *path = gtk_action_get_accel_path(action);
1853 /* path starts with "<Actions>" */
1854 if (strncmp (path+9,"/PacketListPopUpMenuActionGroup",31) == 0){
1855 /* Use different callbacks depending action path */
1856 match_selected_plist_cb(user_data, MATCH_SELECTED_OR);
1858 match_selected_ptree_cb(user_data, MATCH_SELECTED_OR);
1863 prepare_and_not_selected_cb(GtkAction *action, gpointer user_data)
1865 const gchar *path = gtk_action_get_accel_path(action);
1867 /* path starts with "<Actions>" */
1868 if (strncmp (path+9,"/PacketListPopUpMenuActionGroup",31) == 0){
1869 /* Use different callbacks depending action path */
1870 match_selected_plist_cb(user_data, MATCH_SELECTED_AND_NOT);
1872 match_selected_ptree_cb(user_data, MATCH_SELECTED_AND_NOT);
1877 prepare_or_not_selected_cb(GtkAction *action, gpointer user_data)
1879 const gchar *path = gtk_action_get_accel_path(action);
1881 /* path starts with "<Actions>" */
1882 if (strncmp (path+9,"/PacketListPopUpMenuActionGroup",31) == 0){
1883 /* Use different callbacks depending action path */
1884 match_selected_plist_cb(user_data, MATCH_SELECTED_OR_NOT);
1886 match_selected_ptree_cb(user_data, MATCH_SELECTED_OR_NOT);
1890 typedef void (*packet_list_menu_color_conv_color_cb_t)(GtkAction *action, gpointer user_data);
1893 packet_list_menu_color_conv_color1_cb(GtkAction *action _U_, gpointer user_data)
1895 conversation_filter_t* color_filter = (conversation_filter_t*)user_data;
1896 colorize_conversation_cb(color_filter, 1);
1900 packet_list_menu_color_conv_color2_cb(GtkAction *action _U_, gpointer user_data)
1902 conversation_filter_t* color_filter = (conversation_filter_t*)user_data;
1903 colorize_conversation_cb(color_filter, 2);
1907 packet_list_menu_color_conv_color3_cb(GtkAction *action _U_, gpointer user_data)
1909 conversation_filter_t* color_filter = (conversation_filter_t*)user_data;
1910 colorize_conversation_cb(color_filter, 3);
1914 packet_list_menu_color_conv_color4_cb(GtkAction *action _U_, gpointer user_data)
1916 conversation_filter_t* color_filter = (conversation_filter_t*)user_data;
1917 colorize_conversation_cb(color_filter, 4);
1921 packet_list_menu_color_conv_color5_cb(GtkAction *action _U_, gpointer user_data)
1923 conversation_filter_t* color_filter = (conversation_filter_t*)user_data;
1924 colorize_conversation_cb(color_filter, 5);
1928 packet_list_menu_color_conv_color6_cb(GtkAction *action _U_, gpointer user_data)
1930 conversation_filter_t* color_filter = (conversation_filter_t*)user_data;
1931 colorize_conversation_cb(color_filter, 6);
1935 packet_list_menu_color_conv_color7_cb(GtkAction *action _U_, gpointer user_data)
1937 conversation_filter_t* color_filter = (conversation_filter_t*)user_data;
1938 colorize_conversation_cb(color_filter, 7);
1942 packet_list_menu_color_conv_color8_cb(GtkAction *action _U_, gpointer user_data)
1944 conversation_filter_t* color_filter = (conversation_filter_t*)user_data;
1945 colorize_conversation_cb(color_filter, 8);
1949 packet_list_menu_color_conv_color9_cb(GtkAction *action _U_, gpointer user_data)
1951 conversation_filter_t* color_filter = (conversation_filter_t*)user_data;
1952 colorize_conversation_cb(color_filter, 9);
1956 packet_list_menu_color_conv_color10_cb(GtkAction *action _U_, gpointer user_data)
1958 conversation_filter_t* color_filter = (conversation_filter_t*)user_data;
1959 colorize_conversation_cb(color_filter, 10);
1963 packet_list_menu_color_conv_new_rule_cb(GtkAction *action _U_, gpointer user_data)
1965 conversation_filter_t* color_filter = (conversation_filter_t*)user_data;
1966 colorize_conversation_cb(color_filter, 0);
1970 packet_list_menu_copy_sum_txt(GtkAction *action _U_, gpointer user_data)
1972 packet_list_copy_summary_cb(user_data, CS_TEXT);
1976 packet_list_menu_copy_sum_csv(GtkAction *action _U_, gpointer user_data)
1978 packet_list_copy_summary_cb(user_data, CS_CSV);
1982 packet_list_menu_copy_as_flt(GtkAction *action _U_, gpointer user_data)
1984 match_selected_plist_cb(user_data, (MATCH_SELECTED_E)(MATCH_SELECTED_REPLACE|MATCH_SELECTED_COPY_ONLY));
1988 packet_list_menu_copy_bytes_oht_cb(GtkAction *action _U_, gpointer user_data)
1990 copy_hex_cb( NULL /* widget _U_ */ , user_data, (copy_data_type)(CD_ALLINFO | CD_FLAGS_SELECTEDONLY));
1994 packet_list_menu_copy_bytes_oh_cb(GtkAction *action _U_, gpointer user_data)
1996 copy_hex_cb( NULL /* widget _U_ */ , user_data, (copy_data_type)(CD_HEXCOLUMNS | CD_FLAGS_SELECTEDONLY));
2000 packet_list_menu_copy_bytes_text_cb(GtkAction *action _U_, gpointer user_data)
2002 copy_hex_cb( NULL /* widget _U_ */ , user_data, (copy_data_type)(CD_TEXTONLY | CD_FLAGS_SELECTEDONLY));
2006 packet_list_menu_copy_bytes_hex_strm_cb(GtkAction *action _U_, gpointer user_data)
2008 copy_hex_cb( NULL /* widget _U_ */ , user_data, (copy_data_type)(CD_HEX | CD_FLAGS_SELECTEDONLY));
2012 packet_list_menu_copy_bytes_bin_strm_cb(GtkAction *action _U_, gpointer user_data)
2014 copy_hex_cb( NULL /* widget _U_ */ , user_data, (copy_data_type)(CD_BINARY | CD_FLAGS_SELECTEDONLY));
2020 tree_view_menu_color_with_flt_color1_cb(GtkAction *action _U_, gpointer user_data)
2022 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 1);
2026 tree_view_menu_color_with_flt_color2_cb(GtkAction *action _U_, gpointer user_data)
2028 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 2);
2032 tree_view_menu_color_with_flt_color3_cb(GtkAction *action _U_, gpointer user_data)
2034 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 3);
2038 tree_view_menu_color_with_flt_color4_cb(GtkAction *action _U_, gpointer user_data)
2040 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 4);
2044 tree_view_menu_color_with_flt_color5_cb(GtkAction *action _U_, gpointer user_data)
2046 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 5);
2050 tree_view_menu_color_with_flt_color6_cb(GtkAction *action _U_, gpointer user_data)
2052 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 6);
2056 tree_view_menu_color_with_flt_color7_cb(GtkAction *action _U_, gpointer user_data)
2058 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 7);
2062 tree_view_menu_color_with_flt_color8_cb(GtkAction *action _U_, gpointer user_data)
2064 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 8);
2068 tree_view_menu_color_with_flt_color9_cb(GtkAction *action _U_, gpointer user_data)
2070 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 9);
2074 tree_view_menu_color_with_flt_color10_cb(GtkAction *action _U_, gpointer user_data)
2076 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 10);
2080 tree_view_menu_color_with_flt_new_rule_cb(GtkAction *action _U_, gpointer user_data)
2082 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 0);
2087 tree_view_menu_copy_desc(GtkAction *action _U_, gpointer user_data)
2089 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_DESCRIPTION);
2093 tree_view_menu_copy_field(GtkAction *action _U_, gpointer user_data)
2095 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_FIELDNAME);
2099 tree_view_menu_copy_value(GtkAction *action _U_, gpointer user_data)
2101 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_VALUE);
2105 tree_view_menu_copy_as_flt(GtkAction *action _U_, gpointer user_data _U_)
2107 /* match_selected_ptree_cb needs the popup_menu_object to get the right object E_DFILTER_TE_KEY */
2108 match_selected_ptree_cb( popup_menu_object, (MATCH_SELECTED_E)(MATCH_SELECTED_REPLACE|MATCH_SELECTED_COPY_ONLY));
2111 static const char *ui_desc_packet_list_heading_menu_popup =
2113 " <popup name='PacketListHeadingPopup' action='PopupAction'>\n"
2114 " <menuitem name='SortAscending' action='/Sort Ascending'/>\n"
2115 " <menuitem name='SortDescending' action='/Sort Descending'/>\n"
2116 " <menuitem name='NoSorting' action='/No Sorting'/>\n"
2118 " <menuitem name='ShowResolved' action='/Show Resolved'/>\n"
2120 " <menuitem name='AlignLeft' action='/Align Left'/>\n"
2121 " <menuitem name='AlignCenter' action='/Align Center'/>\n"
2122 " <menuitem name='AlignRight' action='/Align Right'/>\n"
2124 " <menuitem name='ColumnPreferences' action='/Column Preferences'/>\n"
2125 " <menuitem name='EditColumnDetails' action='/Edit Column Details'/>\n"
2126 " <menuitem name='ResizeColumn' action='/Resize Column'/>\n"
2128 " <menu name='DisplayedColumns' action='/Displayed Columns'>\n"
2129 " <menuitem name='Display All' action='/Displayed Columns/Display All'/>\n"
2131 " <menuitem name='HideColumn' action='/Hide Column'/>\n"
2132 " <menuitem name='RemoveColumn' action='/Remove Column'/>\n"
2136 static const GtkActionEntry packet_list_heading_menu_popup_action_entries[] = {
2137 { "/Sort Ascending", GTK_STOCK_SORT_ASCENDING, "Sort Ascending", NULL, NULL, G_CALLBACK(sort_ascending_cb) },
2138 { "/Sort Descending", GTK_STOCK_SORT_DESCENDING, "Sort Descending", NULL, NULL, G_CALLBACK(sort_descending_cb) },
2139 { "/No Sorting", NULL, "No Sorting", NULL, NULL, G_CALLBACK(no_sorting_cb) },
2140 { "/Align Left", GTK_STOCK_JUSTIFY_LEFT, "Align Left", NULL, NULL, G_CALLBACK(packet_list_heading_align_left_cb) },
2141 { "/Align Center", GTK_STOCK_JUSTIFY_CENTER, "Align Center", NULL, NULL, G_CALLBACK(packet_list_heading_align_center_cb) },
2142 { "/Align Right", GTK_STOCK_JUSTIFY_RIGHT, "Align Right", NULL, NULL, G_CALLBACK(packet_list_heading_align_right_cb) },
2143 { "/Column Preferences", GTK_STOCK_PREFERENCES, "Column Preferences...", NULL, NULL, G_CALLBACK(packet_list_heading_col_pref_cb) },
2144 { "/Edit Column Details", WIRESHARK_STOCK_EDIT, "Edit Column Details...", NULL, NULL, G_CALLBACK(packet_list_heading_change_col_cb) },
2145 { "/Resize Column", WIRESHARK_STOCK_RESIZE_COLUMNS, "Resize Column", NULL, NULL, G_CALLBACK(packet_list_heading_resize_col_cb) },
2146 { "/Displayed Columns", NULL, "Displayed Columns", NULL, NULL, NULL },
2147 { "/Displayed Columns/Display All", NULL, "Display All", NULL, NULL, G_CALLBACK(packet_list_heading_activate_all_columns_cb) },
2148 { "/Hide Column", NULL, "Hide Column", NULL, NULL, G_CALLBACK(packet_list_heading_hide_col_cb) },
2149 { "/Remove Column", GTK_STOCK_DELETE, "Remove Column", NULL, NULL, G_CALLBACK(packet_list_heading_remove_col_cb) },
2152 static const GtkToggleActionEntry packet_list_heading_menu_toggle_action_entries[] =
2154 /* name, stock id, label, accel, tooltip, callback, is_active */
2155 {"/Show Resolved", NULL, "Show Resolved", NULL, NULL, G_CALLBACK(packet_list_heading_show_resolved_cb), FALSE},
2158 static const char *ui_desc_packet_list_menu_popup =
2160 " <popup name='PacketListMenuPopup' action='PopupAction'>\n"
2161 " <menuitem name='MarkPacket' action='/MarkPacket'/>\n"
2162 " <menuitem name='IgnorePacket' action='/IgnorePacket'/>\n"
2163 " <menuitem name='SetTimeReference' action='/Set Time Reference'/>\n"
2164 " <menuitem name='TimeShift' action='/TimeShift'/>\n"
2165 #ifdef WANT_PACKET_EDITOR
2166 " <menuitem name='EditPacket' action='/Edit/EditPacket'/>\n"
2168 " <menuitem name='AddEditPktComment' action='/Edit/AddEditPktComment'/>\n"
2170 " <menuitem name='ManuallyResolveAddress' action='/ManuallyResolveAddress'/>\n"
2172 " <menu name= 'ApplyAsFilter' action='/ApplyasFilter'>\n"
2173 " <menuitem name='Selected' action='/ApplyasFilter/Selected'/>\n"
2174 " <menuitem name='NotSelected' action='/ApplyasFilter/Not Selected'/>\n"
2175 " <menuitem name='AndSelected' action='/ApplyasFilter/AndSelected'/>\n"
2176 " <menuitem name='OrSelected' action='/ApplyasFilter/OrSelected'/>\n"
2177 " <menuitem name='AndNotSelected' action='/ApplyasFilter/AndNotSelected'/>\n"
2178 " <menuitem name='OrNotSelected' action='/ApplyasFilter/OrNotSelected'/>\n"
2180 " <menu name= 'PrepareaFilter' action='/PrepareaFilter'>\n"
2181 " <menuitem name='Selected' action='/PrepareaFilter/Selected'/>\n"
2182 " <menuitem name='NotSelected' action='/PrepareaFilter/Not Selected'/>\n"
2183 " <menuitem name='AndSelected' action='/PrepareaFilter/AndSelected'/>\n"
2184 " <menuitem name='OrSelected' action='/PrepareaFilter/OrSelected'/>\n"
2185 " <menuitem name='AndNotSelected' action='/PrepareaFilter/AndNotSelected'/>\n"
2186 " <menuitem name='OrNotSelected' action='/PrepareaFilter/OrNotSelected'/>\n"
2188 " <menu name= 'ConversationFilter' action='/Conversation Filter'>\n"
2189 " <placeholder name='Conversations'/>\n"
2191 " <menu name= 'ColorizeConversation' action='/Colorize Conversation'>\n"
2192 " <placeholder name='Colorize'/>\n"
2194 " <menu name= 'SCTP' action='/SCTP'>\n"
2195 " <menuitem name='AnalysethisAssociation' action='/SCTP/Analyse this Association'/>\n"
2196 " <menuitem name='PrepareFilterforthisAssociation' action='/SCTP/Prepare Filter for this Association'/>\n"
2198 " <menuitem name='FollowTCPStream' action='/Follow TCP Stream'/>\n"
2199 " <menuitem name='FollowUDPStream' action='/Follow UDP Stream'/>\n"
2200 " <menuitem name='FollowSSLStream' action='/Follow SSL Stream'/>\n"
2201 " <menuitem name='FollowHTTPStream' action='/Follow HTTP Stream'/>\n"
2203 " <menu name= 'Copy' action='/Copy'>\n"
2204 " <menuitem name='SummaryTxt' action='/Copy/SummaryTxt'/>\n"
2205 " <menuitem name='SummaryCSV' action='/Copy/SummaryCSV'/>\n"
2206 " <menuitem name='AsFilter' action='/Copy/AsFilter'/>\n"
2208 " <menu name= 'Bytes' action='/Copy/Bytes'>\n"
2209 " <menuitem name='OffsetHexText' action='/Copy/Bytes/OffsetHexText'/>\n"
2210 " <menuitem name='OffsetHex' action='/Copy/Bytes/OffsetHex'/>\n"
2211 " <menuitem name='PrintableTextOnly' action='/Copy/Bytes/PrintableTextOnly'/>\n"
2213 " <menuitem name='HexStream' action='/Copy/Bytes/HexStream'/>\n"
2214 " <menuitem name='BinaryStream' action='/Copy/Bytes/BinaryStream'/>\n"
2218 " <menuitem name='ProtocolPreferences' action='/ProtocolPreferences'/>\n"
2219 " <menuitem name='DecodeAs' action='/DecodeAs'/>\n"
2220 " <menuitem name='Print' action='/Print'/>\n"
2221 " <menuitem name='ShowPacketinNewWindow' action='/ShowPacketinNewWindow'/>\n"
2225 static const GtkActionEntry apply_prepare_filter_action_entries[] = {
2226 { "/ApplyasFilter", NULL, "Apply as Filter", NULL, NULL, NULL },
2227 { "/ApplyasFilter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(apply_selected_filter_cb) },
2228 { "/ApplyasFilter/Not Selected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(apply_not_selected_cb) },
2229 { "/ApplyasFilter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(apply_and_selected_cb) },
2230 { "/ApplyasFilter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(apply_or_selected_cb) },
2231 { "/ApplyasFilter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(apply_and_not_selected_cb) },
2232 { "/ApplyasFilter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(apply_or_not_selected_cb) },
2234 { "/PrepareaFilter", NULL, "Prepare a Filter", NULL, NULL, NULL },
2235 { "/PrepareaFilter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(prepare_selected_cb) },
2236 { "/PrepareaFilter/Not Selected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(prepare_not_selected_cb) },
2237 { "/PrepareaFilter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(prepare_and_selected_cb) },
2238 { "/PrepareaFilter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(prepare_or_selected_cb) },
2239 { "/PrepareaFilter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(prepare_and_not_selected_cb) },
2240 { "/PrepareaFilter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(prepare_or_not_selected_cb) },
2244 static const GtkActionEntry packet_list_menu_popup_action_entries[] = {
2245 { "/MarkPacket", NULL, "Mark Packet (toggle)", NULL, NULL, G_CALLBACK(packet_list_mark_frame_cb) },
2246 { "/IgnorePacket", NULL, "Ignore Packet (toggle)", NULL, NULL, G_CALLBACK(packet_list_ignore_frame_cb) },
2247 { "/Set Time Reference", WIRESHARK_STOCK_TIME, "Set Time Reference (toggle)", NULL, NULL, G_CALLBACK(packet_list_menu_set_ref_time_cb) },
2248 { "/TimeShift", WIRESHARK_STOCK_TIME, "Time Shift...", NULL, NULL, G_CALLBACK(time_shift_cb) },
2249 { "/ManuallyResolveAddress", NULL, "Manually Resolve Address", NULL, NULL, G_CALLBACK(manual_addr_resolv_dlg) },
2250 #ifdef WANT_PACKET_EDITOR
2251 { "/Edit/EditPacket", NULL, "_Edit Packet", NULL, NULL, G_CALLBACK(edit_window_cb) },
2253 { "/Edit/AddEditPktComment", WIRESHARK_STOCK_EDIT, "Packet Comment...", NULL, NULL, G_CALLBACK(edit_packet_comment_dlg) },
2255 { "/Conversation Filter", NULL, "Conversation Filter", NULL, NULL, NULL },
2256 { "/Colorize Conversation", NULL, "Colorize Conversation", NULL, NULL, NULL },
2258 { "/SCTP", NULL, "SCTP", NULL, NULL, NULL },
2259 { "/SCTP/Analyse this Association", NULL, "Analyse this Association", NULL, NULL, G_CALLBACK(sctp_analyse_start) },
2260 { "/SCTP/Prepare Filter for this Association", NULL, "Prepare Filter for this Association", NULL, NULL, G_CALLBACK(sctp_set_assoc_filter) },
2263 { "/Follow TCP Stream", NULL, "Follow TCP Stream", NULL, NULL, G_CALLBACK(follow_tcp_stream_cb) },
2264 { "/Follow UDP Stream", NULL, "Follow UDP Stream", NULL, NULL, G_CALLBACK(follow_udp_stream_cb) },
2265 { "/Follow SSL Stream", NULL, "Follow SSL Stream", NULL, NULL, G_CALLBACK(follow_ssl_stream_cb) },
2266 { "/Follow HTTP Stream", NULL, "Follow HTTP Stream", NULL, NULL, G_CALLBACK(follow_http_stream_cb) },
2268 { "/Copy", NULL, "Copy", NULL, NULL, NULL },
2269 { "/Copy/SummaryTxt", NULL, "Summary (Text)", NULL, NULL, G_CALLBACK(packet_list_menu_copy_sum_txt) },
2270 { "/Copy/SummaryCSV", NULL, "Summary (CSV)", NULL, NULL, G_CALLBACK(packet_list_menu_copy_sum_csv) },
2271 { "/Copy/AsFilter", NULL, "As Filter", NULL, NULL, G_CALLBACK(packet_list_menu_copy_as_flt) },
2274 { "/Copy/Bytes", NULL, "Bytes", NULL, NULL, NULL },
2275 { "/Copy/Bytes/OffsetHexText", NULL, "Offset Hex Text", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oht_cb) },
2276 { "/Copy/Bytes/OffsetHex", NULL, "Offset Hex", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oh_cb) },
2277 { "/Copy/Bytes/PrintableTextOnly", NULL, "Printable Text Only", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_text_cb) },
2279 { "/Copy/Bytes/HexStream", NULL, "Hex Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_hex_strm_cb) },
2280 { "/Copy/Bytes/BinaryStream", NULL, "Binary Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_bin_strm_cb) },
2282 { "/ProtocolPreferences", NULL, "Protocol Preferences", NULL, NULL, NULL },
2283 { "/DecodeAs", WIRESHARK_STOCK_DECODE_AS, "Decode As...", NULL, NULL, G_CALLBACK(decode_as_cb) },
2284 { "/Print", GTK_STOCK_PRINT, "Print...", NULL, NULL, G_CALLBACK(file_print_selected_cmd_cb) },
2285 { "/ShowPacketinNewWindow", NULL, "Show Packet in New Window", NULL, NULL, G_CALLBACK(new_window_cb) },
2289 static const char *ui_desc_tree_view_menu_popup =
2291 " <popup name='TreeViewPopup' action='PopupAction'>\n"
2292 " <menuitem name='ExpandSubtrees' action='/ExpandSubtrees'/>\n"
2293 " <menuitem name='CollapseSubtrees' action='/CollapseSubtrees'/>\n"
2294 " <menuitem name='ExpandAll' action='/ExpandAll'/>\n"
2295 " <menuitem name='CollapseAll' action='/CollapseAll'/>\n"
2297 " <menuitem name='ApplyasColumn' action='/Apply as Column'/>\n"
2299 " <menu name= 'ApplyAsFilter' action='/ApplyasFilter'>\n"
2300 " <menuitem name='Selected' action='/ApplyasFilter/Selected'/>\n"
2301 " <menuitem name='NotSelected' action='/ApplyasFilter/Not Selected'/>\n"
2302 " <menuitem name='AndSelected' action='/ApplyasFilter/AndSelected'/>\n"
2303 " <menuitem name='OrSelected' action='/ApplyasFilter/OrSelected'/>\n"
2304 " <menuitem name='AndNotSelected' action='/ApplyasFilter/AndNotSelected'/>\n"
2305 " <menuitem name='OrNotSelected' action='/ApplyasFilter/OrNotSelected'/>\n"
2307 " <menu name= 'PrepareaFilter' action='/PrepareaFilter'>\n"
2308 " <menuitem name='Selected' action='/PrepareaFilter/Selected'/>\n"
2309 " <menuitem name='NotSelected' action='/PrepareaFilter/Not Selected'/>\n"
2310 " <menuitem name='AndSelected' action='/PrepareaFilter/AndSelected'/>\n"
2311 " <menuitem name='OrSelected' action='/PrepareaFilter/OrSelected'/>\n"
2312 " <menuitem name='AndNotSelected' action='/PrepareaFilter/AndNotSelected'/>\n"
2313 " <menuitem name='OrNotSelected' action='/PrepareaFilter/OrNotSelected'/>\n"
2315 " <menu name= 'ColorizewithFilter' action='/Colorize with Filter'>\n"
2316 " <menuitem name='Color1' action='/Colorize with Filter/Color 1'/>\n"
2317 " <menuitem name='Color2' action='/Colorize with Filter/Color 2'/>\n"
2318 " <menuitem name='Color3' action='/Colorize with Filter/Color 3'/>\n"
2319 " <menuitem name='Color4' action='/Colorize with Filter/Color 4'/>\n"
2320 " <menuitem name='Color5' action='/Colorize with Filter/Color 5'/>\n"
2321 " <menuitem name='Color6' action='/Colorize with Filter/Color 6'/>\n"
2322 " <menuitem name='Color7' action='/Colorize with Filter/Color 7'/>\n"
2323 " <menuitem name='Color8' action='/Colorize with Filter/Color 8'/>\n"
2324 " <menuitem name='Color9' action='/Colorize with Filter/Color 9'/>\n"
2325 " <menuitem name='Color10' action='/Colorize with Filter/Color 10'/>\n"
2326 " <menuitem name='NewColoringRule' action='/Colorize with Filter/New Coloring Rule'/>\n"
2328 " <menuitem name='FollowTCPStream' action='/Follow TCP Stream'/>\n"
2329 " <menuitem name='FollowUDPStream' action='/Follow UDP Stream'/>\n"
2330 " <menuitem name='FollowSSLStream' action='/Follow SSL Stream'/>\n"
2331 " <menuitem name='FollowHTTPStream' action='/Follow HTTP Stream'/>\n"
2333 " <menu name= 'Copy' action='/Copy'>\n"
2334 " <menuitem name='Description' action='/Copy/Description'/>\n"
2335 " <menuitem name='Fieldname' action='/Copy/Fieldname'/>\n"
2336 " <menuitem name='Value' action='/Copy/Value'/>\n"
2338 " <menuitem name='AsFilter' action='/Copy/AsFilter'/>\n"
2340 " <menu name= 'Bytes' action='/Copy/Bytes'>\n"
2341 " <menuitem name='OffsetHexText' action='/Copy/Bytes/OffsetHexText'/>\n"
2342 " <menuitem name='OffsetHex' action='/Copy/Bytes/OffsetHex'/>\n"
2343 " <menuitem name='PrintableTextOnly' action='/Copy/Bytes/PrintableTextOnly'/>\n"
2345 " <menuitem name='HexStream' action='/Copy/Bytes/HexStream'/>\n"
2346 " <menuitem name='BinaryStream' action='/Copy/Bytes/BinaryStream'/>\n"
2349 " <menuitem name='ExportSelectedPacketBytes' action='/ExportSelectedPacketBytes'/>\n"
2350 #ifdef WANT_PACKET_EDITOR
2351 " <menuitem name='EditPacket' action='/Edit/EditPacket'/>\n"
2354 " <menuitem name='WikiProtocolPage' action='/WikiProtocolPage'/>\n"
2355 " <menuitem name='FilterFieldReference' action='/FilterFieldReference'/>\n"
2356 " <menuitem name='ProtocolHelp' action='/ProtocolHelp'/>\n"
2357 " <menuitem name='ProtocolPreferences' action='/ProtocolPreferences'/>\n"
2359 " <menuitem name='DecodeAs' action='/DecodeAs'/>\n"
2360 " <menuitem name='DisableProtocol' action='/DisableProtocol'/>\n"
2361 " <menuitem name='ResolveName' action='/ResolveName'/>\n"
2362 " <menuitem name='GotoCorrespondingPacket' action='/GotoCorrespondingPacket'/>\n"
2363 " <menuitem name='ShowPacketRefinNewWindow' action='/ShowPacketRefinNewWindow'/>\n"
2367 static const GtkActionEntry tree_view_menu_popup_action_entries[] = {
2368 { "/ExpandSubtrees", NULL, "Expand Subtrees", NULL, NULL, G_CALLBACK(expand_tree_cb) },
2369 { "/CollapseSubtrees", NULL, "Collapse Subtrees", NULL, NULL, G_CALLBACK(collapse_tree_cb) },
2370 { "/ExpandAll", NULL, "Expand All", NULL, NULL, G_CALLBACK(expand_all_cb) },
2371 { "/CollapseAll", NULL, "Collapse All", NULL, NULL, G_CALLBACK(collapse_all_cb) },
2372 { "/Apply as Column", NULL, "Apply as Column", NULL, NULL, G_CALLBACK(apply_as_custom_column_cb) },
2374 { "/Colorize with Filter", NULL, "Colorize with Filter", NULL, NULL, NULL },
2375 { "/Colorize with Filter/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color1_cb) },
2376 { "/Colorize with Filter/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color2_cb) },
2377 { "/Colorize with Filter/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color3_cb) },
2378 { "/Colorize with Filter/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color4_cb) },
2379 { "/Colorize with Filter/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color5_cb) },
2380 { "/Colorize with Filter/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color6_cb) },
2381 { "/Colorize with Filter/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color7_cb) },
2382 { "/Colorize with Filter/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color8_cb) },
2383 { "/Colorize with Filter/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color9_cb) },
2384 { "/Colorize with Filter/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color10_cb) },
2385 { "/Colorize with Filter/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_new_rule_cb) },
2387 { "/Follow TCP Stream", NULL, "Follow TCP Stream", NULL, NULL, G_CALLBACK(follow_tcp_stream_cb) },
2388 { "/Follow UDP Stream", NULL, "Follow UDP Stream", NULL, NULL, G_CALLBACK(follow_udp_stream_cb) },
2389 { "/Follow SSL Stream", NULL, "Follow SSL Stream", NULL, NULL, G_CALLBACK(follow_ssl_stream_cb) },
2390 { "/Follow HTTP Stream", NULL, "Follow HTTP Stream", NULL, NULL, G_CALLBACK(follow_http_stream_cb) },
2392 { "/Copy", NULL, "Copy", NULL, NULL, NULL },
2393 { "/Copy/Description", NULL, "Description", NULL, NULL, G_CALLBACK(tree_view_menu_copy_desc) },
2394 { "/Copy/Fieldname", NULL, "Fieldname", NULL, NULL, G_CALLBACK(tree_view_menu_copy_field) },
2395 { "/Copy/Value", NULL, "Value", NULL, NULL, G_CALLBACK(tree_view_menu_copy_value) },
2397 { "/Copy/AsFilter", NULL, "As Filter", NULL, NULL, G_CALLBACK(tree_view_menu_copy_as_flt) },
2399 { "/Copy/Bytes", NULL, "Bytes", NULL, NULL, NULL },
2400 { "/Copy/Bytes/OffsetHexText", NULL, "Offset Hex Text", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oht_cb) },
2401 { "/Copy/Bytes/OffsetHex", NULL, "Offset Hex", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oh_cb) },
2402 { "/Copy/Bytes/PrintableTextOnly", NULL, "Printable Text Only", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_text_cb) },
2404 { "/Copy/Bytes/HexStream", NULL, "Hex Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_hex_strm_cb) },
2405 { "/Copy/Bytes/BinaryStream", NULL, "Binary Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_bin_strm_cb) },
2407 { "/ExportSelectedPacketBytes", NULL, "Export Selected Packet Bytes...", NULL, NULL, G_CALLBACK(savehex_cb) },
2408 #ifdef WANT_PACKET_EDITOR
2409 { "/Edit/EditPacket", NULL, "_Edit Packet", NULL, NULL, G_CALLBACK(edit_window_cb) },
2411 { "/WikiProtocolPage", WIRESHARK_STOCK_WIKI, "Wiki Protocol Page", NULL, NULL, G_CALLBACK(selected_ptree_info_cb) },
2412 { "/FilterFieldReference", WIRESHARK_STOCK_INTERNET, "Filter Field Reference", NULL, NULL, G_CALLBACK(selected_ptree_ref_cb) },
2413 { "/ProtocolHelp", NULL, "Protocol Help", NULL, NULL, NULL },
2414 { "/ProtocolPreferences", NULL, "Protocol Preferences", NULL, NULL, NULL },
2415 { "/DecodeAs", WIRESHARK_STOCK_DECODE_AS, "Decode As...", NULL, NULL, G_CALLBACK(decode_as_cb) },
2416 { "/DisableProtocol", WIRESHARK_STOCK_CHECKBOX, "Disable Protocol...", NULL, NULL, G_CALLBACK(proto_disable_cb) },
2417 { "/ResolveName", NULL, "_Resolve Name", NULL, NULL, G_CALLBACK(resolve_name_cb) },
2418 { "/GotoCorrespondingPacket", NULL, "_Go to Corresponding Packet", NULL, NULL, G_CALLBACK(goto_framenum_cb) },
2419 { "/ShowPacketRefinNewWindow", NULL, "Show Packet Reference in New Window", NULL, NULL, G_CALLBACK(new_window_cb_ref) },
2422 static const char *ui_desc_bytes_menu_popup =
2424 " <popup name='BytesMenuPopup' action='PopupAction'>\n"
2425 " <menuitem name='HexView' action='/HexView'/>\n"
2426 " <menuitem name='BitsView' action='/BitsView'/>\n"
2430 static const GtkRadioActionEntry bytes_menu_radio_action_entries [] =
2432 /* name, stock id, label, accel, tooltip, value */
2433 { "/HexView", NULL, "Hex View", NULL, NULL, BYTES_HEX },
2434 { "/BitsView", NULL, "Bits View", NULL, NULL, BYTES_BITS },
2437 static const char *ui_statusbar_profiles_menu_popup =
2439 " <popup name='ProfilesMenuPopup' action='PopupAction'>\n"
2440 " <menuitem name='Profiles' action='/Profiles'/>\n"
2442 " <menuitem name='New' action='/New'/>\n"
2443 " <menuitem name='Rename' action='/Rename'/>\n"
2444 " <menuitem name='Delete' action='/Delete'/>\n"
2446 " <menu name='Change' action='/Change'>\n"
2447 " <menuitem name='Default' action='/Change/Default'/>\n"
2451 static const GtkActionEntry statusbar_profiles_menu_action_entries [] =
2453 { "/Profiles", GTK_STOCK_INDEX, "Manage Profiles...", NULL, NULL, G_CALLBACK(profile_dialog_cb) },
2454 { "/New", GTK_STOCK_NEW, "New...", NULL, NULL, G_CALLBACK(profile_new_cb) },
2455 { "/Rename", GTK_STOCK_EDIT, "Rename...", NULL, NULL, G_CALLBACK(profile_rename_cb) },
2456 { "/Delete", GTK_STOCK_DELETE, "Delete", NULL, NULL, G_CALLBACK(profile_delete_cb) },
2457 { "/Change", GTK_STOCK_JUMP_TO, "Switch to", NULL, NULL, NULL },
2458 { "/Change/Default", NULL, "Default", NULL, NULL, NULL },
2462 main_menu_new(GtkAccelGroup ** table)
2465 #ifdef HAVE_IGE_MAC_INTEGRATION
2466 GtkWidget *quit_item, *about_item, *preferences_item;
2467 IgeMacMenuGroup *group;
2469 #ifdef HAVE_GTKOSXAPPLICATION
2470 GtkosxApplication *theApp;
2472 GtkWidget * dock_menu;
2475 grp = gtk_accel_group_new();
2480 menubar = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar");
2481 #ifdef HAVE_IGE_MAC_INTEGRATION
2482 if(prefs.gui_macosx_style) {
2483 ige_mac_menu_set_menu_bar(GTK_MENU_SHELL(menubar));
2484 ige_mac_menu_set_global_key_handler_enabled(TRUE);
2486 /* Create menu items to populate the application menu with. We have to
2487 * do this because we are still using the old GtkItemFactory API for
2489 group = ige_mac_menu_add_app_menu_group();
2490 about_item = gtk_menu_item_new_with_label("About");
2491 g_signal_connect(about_item, "activate", G_CALLBACK(about_wireshark_cb),
2493 ige_mac_menu_add_app_menu_item(group, GTK_MENU_ITEM(about_item), NULL);
2495 group = ige_mac_menu_add_app_menu_group();
2496 preferences_item = gtk_menu_item_new_with_label("Preferences");
2497 g_signal_connect(preferences_item, "activate", G_CALLBACK(prefs_cb),
2499 ige_mac_menu_add_app_menu_item(group, GTK_MENU_ITEM(preferences_item),
2503 /* The quit item in the application menu shows up whenever ige mac
2504 * integration is enabled, even if the OS X UI style in Wireshark isn't
2506 quit_item = gtk_menu_item_new_with_label("Quit");
2507 g_signal_connect(quit_item, "activate", G_CALLBACK(file_quit_cmd_cb), NULL);
2508 ige_mac_menu_set_quit_menu_item(GTK_MENU_ITEM(quit_item));
2511 #ifdef HAVE_GTKOSXAPPLICATION
2512 theApp = (GtkosxApplication *)g_object_new(GTKOSX_TYPE_APPLICATION, NULL);
2514 if(prefs.gui_macosx_style) {
2515 gtk_widget_hide(menubar);
2517 gtkosx_application_set_menu_bar(theApp, GTK_MENU_SHELL(menubar));
2518 gtkosx_application_set_use_quartz_accelerators(theApp, TRUE);
2520 /* Construct a conventional looking OSX App menu */
2522 item = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/HelpMenu/AboutWireshark");
2523 gtkosx_application_insert_app_menu_item(theApp, item, 0);
2525 gtkosx_application_insert_app_menu_item(theApp, gtk_separator_menu_item_new(), 1);
2527 item = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/EditMenu/Preferences");
2528 gtkosx_application_insert_app_menu_item(theApp, item, 2);
2530 /* Set OSX help menu */
2532 item = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/HelpMenu");
2533 gtkosx_application_set_help_menu(theApp,GTK_MENU_ITEM(item));
2535 /* Hide the File menu Quit item (a Quit item is automagically placed within the OSX App menu) */
2537 item = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/FileMenu/Quit");
2538 gtk_widget_hide(item);
2541 /* generate dock menu */
2542 dock_menu = gtk_menu_new();
2544 item = gtk_menu_item_new_with_label("Start");
2545 g_signal_connect(item, "activate", G_CALLBACK (capture_start_cb), NULL);
2546 gtk_menu_shell_append(GTK_MENU_SHELL(dock_menu), item);
2548 item = gtk_menu_item_new_with_label("Stop");
2549 g_signal_connect(item, "activate", G_CALLBACK (capture_stop_cb), NULL);
2550 gtk_menu_shell_append(GTK_MENU_SHELL(dock_menu), item);
2552 item = gtk_menu_item_new_with_label("Restart");
2553 g_signal_connect(item, "activate", G_CALLBACK (capture_restart_cb), NULL);
2554 gtk_menu_shell_append(GTK_MENU_SHELL(dock_menu), item);
2556 gtkosx_application_set_dock_menu(theApp, GTK_MENU_SHELL(dock_menu));
2562 plugin_if_register_gui_cb(PLUGIN_IF_PREFERENCE_SAVE, plugin_if_menubar_preference);
2568 menu_dissector_filter_cb(GtkAction *action _U_, gpointer callback_data)
2570 conversation_filter_t *filter_entry = (conversation_filter_t *)callback_data;
2571 GtkWidget *filter_te;
2574 filter_te = gtk_bin_get_child(GTK_BIN(g_object_get_data(G_OBJECT(top_level), E_DFILTER_CM_KEY)));
2576 /* XXX - this gets the packet_info of the last dissected packet, */
2577 /* which is not necessarily the last selected packet */
2578 /* e.g. "Update list of packets in real time" won't work correct */
2579 buf = filter_entry->build_filter_string(&cfile.edt->pi);
2581 gtk_entry_set_text(GTK_ENTRY(filter_te), buf);
2583 /* Run the display filter so it goes in effect - even if it's the
2584 same as the previous display filter. */
2585 main_filter_packets(&cfile, buf, TRUE);
2587 g_free( (void *) buf);
2591 menu_dissector_filter_spe_cb(frame_data *fd _U_, epan_dissect_t *edt, gpointer callback_data)
2593 conversation_filter_t *filter_entry = (conversation_filter_t*)callback_data;
2595 /* XXX - this gets the packet_info of the last dissected packet, */
2596 /* which is not necessarily the last selected packet */
2597 /* e.g. "Update list of packets in real time" won't work correct */
2598 return (edt != NULL) ? filter_entry->is_filter_valid(&edt->pi) : FALSE;
2602 menu_dissector_filter(capture_file *cf)
2604 GList *list_entry = conv_filter_list;
2605 conversation_filter_t *filter_entry;
2608 GtkActionGroup *action_group;
2610 GtkWidget *submenu_dissector_filters;
2615 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
2617 action_group = gtk_action_group_new ("dissector-filters-group");
2619 submenu_dissector_filters = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ConversationFilterMenu");
2620 if(!submenu_dissector_filters){
2621 g_warning("menu_dissector_filter: No submenu_dissector_filters found, path= /Menubar/AnalyzeMenu/ConversationFilterMenu");
2624 gtk_ui_manager_insert_action_group (ui_manager_main_menubar, action_group, 0);
2625 g_object_set_data (G_OBJECT (ui_manager_main_menubar),
2626 "dissector-filters-merge-id", GUINT_TO_POINTER (merge_id));
2631 action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
2632 "name", "filter-list-empty",
2633 "label", "No filters",
2636 gtk_action_group_add_action (action_group, action);
2637 gtk_action_set_sensitive(action, FALSE);
2638 g_object_unref (action);
2640 gtk_ui_manager_add_ui (ui_manager_main_menubar, merge_id,
2641 "/Menubar/AnalyzeMenu/ConversationFilterMenu/Filters",
2642 "filter-list-empty",
2643 "filter-list-empty",
2644 GTK_UI_MANAGER_MENUITEM,
2650 while (list_entry != NULL) {
2651 filter_entry = (conversation_filter_t *)list_entry->data;
2652 action_name = g_strdup_printf ("filter-%u", i);
2653 /*g_warning("action_name %s, filter_entry->name %s",action_name,filter_entry->name);*/
2654 action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
2655 "name", action_name,
2656 "label", filter_entry->display_name,
2657 "sensitive", menu_dissector_filter_spe_cb(/* frame_data *fd _U_*/ NULL, cf->edt, filter_entry),
2659 g_signal_connect (action, "activate",
2660 G_CALLBACK (menu_dissector_filter_cb), filter_entry);
2661 gtk_action_group_add_action (action_group, action);
2662 g_object_unref (action);
2664 gtk_ui_manager_add_ui (ui_manager_main_menubar, merge_id,
2665 "/Menubar/AnalyzeMenu/ConversationFilterMenu/Filters",
2668 GTK_UI_MANAGER_MENUITEM,
2670 g_free(action_name);
2672 list_entry = g_list_next(list_entry);
2677 menu_endpoints_cb(GtkAction *action _U_, gpointer user_data)
2679 register_ct_t *table = (register_ct_t*)user_data;
2681 conversation_endpoint_cb(table);
2687 GtkActionGroup *action_group;
2692 add_conversation_menuitem(gpointer data, gpointer user_data)
2694 register_ct_t *table = (register_ct_t*)data;
2695 conv_menu_t *conv = (conv_menu_t*)user_data;
2699 action_name = g_strdup_printf ("conversation-%u", conv->counter);
2700 /*g_warning("action_name %s, filter_entry->name %s",action_name,filter_entry->name);*/
2701 action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
2702 "name", action_name,
2703 "label", proto_get_protocol_short_name(find_protocol_by_id(get_conversation_proto_id(table))),
2706 g_signal_connect (action, "activate",
2707 G_CALLBACK (menu_endpoints_cb), table);
2708 gtk_action_group_add_action (conv->action_group, action);
2709 g_object_unref (action);
2711 gtk_ui_manager_add_ui (ui_manager_main_menubar, conv->merge_id,
2712 "/Menubar/StatisticsMenu/ConversationListMenu/Conversations",
2715 GTK_UI_MANAGER_MENUITEM,
2717 g_free(action_name);
2722 menu_conversation_list(capture_file *cf)
2724 GtkWidget *submenu_conversation_list;
2725 conv_menu_t conv_data;
2727 conv_data.merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
2729 conv_data.action_group = gtk_action_group_new ("conversation-list-group");
2731 submenu_conversation_list = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/StatisticsMenu/ConversationListMenu");
2732 if(!submenu_conversation_list){
2733 g_warning("menu_conversation_list: No submenu_conversation_list found, path= /Menubar/StatisticsMenu/ConversationListMenu");
2736 gtk_ui_manager_insert_action_group (ui_manager_main_menubar, conv_data.action_group, 0);
2737 g_object_set_data (G_OBJECT (ui_manager_main_menubar),
2738 "conversation-list-merge-id", GUINT_TO_POINTER (conv_data.merge_id));
2741 conv_data.counter = 0;
2742 conversation_table_iterate_tables(add_conversation_menuitem, &conv_data);
2746 menu_hostlist_cb(GtkAction *action _U_, gpointer user_data)
2748 register_ct_t *table = (register_ct_t*)user_data;
2750 hostlist_endpoint_cb(table);
2754 add_hostlist_menuitem(gpointer data, gpointer user_data)
2756 register_ct_t *table = (register_ct_t*)data;
2757 conv_menu_t *conv = (conv_menu_t*)user_data;
2761 action_name = g_strdup_printf ("hostlist-%u", conv->counter);
2762 /*g_warning("action_name %s, filter_entry->name %s",action_name,filter_entry->name);*/
2763 action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
2764 "name", action_name,
2765 "label", proto_get_protocol_short_name(find_protocol_by_id(get_conversation_proto_id(table))),
2768 g_signal_connect (action, "activate",
2769 G_CALLBACK (menu_hostlist_cb), table);
2770 gtk_action_group_add_action (conv->action_group, action);
2771 g_object_unref (action);
2773 gtk_ui_manager_add_ui (ui_manager_main_menubar, conv->merge_id,
2774 "/Menubar/StatisticsMenu/EndpointListMenu/Endpoints",
2777 GTK_UI_MANAGER_MENUITEM,
2779 g_free(action_name);
2784 menu_hostlist_list(capture_file *cf)
2786 GtkWidget *submenu_hostlist;
2787 conv_menu_t conv_data;
2789 conv_data.merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
2791 conv_data.action_group = gtk_action_group_new ("endpoint-list-group");
2793 submenu_hostlist = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/StatisticsMenu/EndpointListMenu");
2794 if(!submenu_hostlist){
2795 g_warning("menu_hostlist_list: No submenu_conversation_list found, path= /Menubar/StatisticsMenu/EndpointListMenu");
2798 gtk_ui_manager_insert_action_group (ui_manager_main_menubar, conv_data.action_group, 0);
2799 g_object_set_data (G_OBJECT (ui_manager_main_menubar),
2800 "endpoint-list-merge-id", GUINT_TO_POINTER (conv_data.merge_id));
2803 conv_data.counter = 0;
2804 conversation_table_iterate_tables(add_hostlist_menuitem, &conv_data);
2809 GtkActionGroup *action_group;
2814 menu_exportobject_cb(GtkAction *action _U_, gpointer user_data)
2816 register_eo_t *eo = (register_eo_t*)user_data;
2818 exportobject_cb(eo);
2822 add_export_object_menuitem(gpointer data, gpointer user_data)
2824 register_eo_t *eo = (register_eo_t*)data;
2825 eo_menu_t *eo_menu_data = (eo_menu_t*)user_data;
2829 action_name = g_strdup_printf ("exportobject-%u", eo_menu_data->counter);
2830 /*g_warning("action_name %s, filter_entry->name %s",action_name,filter_entry->name);*/
2831 action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
2832 "name", action_name,
2833 "label", proto_get_protocol_short_name(find_protocol_by_id(get_eo_proto_id(eo))),
2836 g_signal_connect (action, "activate",
2837 G_CALLBACK (menu_exportobject_cb), eo);
2838 gtk_action_group_add_action (eo_menu_data->action_group, action);
2839 g_object_unref (action);
2841 gtk_ui_manager_add_ui (ui_manager_main_menubar, eo_menu_data->merge_id,
2842 "/Menubar/FileMenu/ExportObjectsMenu/ExportObjects",
2845 GTK_UI_MANAGER_MENUITEM,
2847 g_free(action_name);
2848 eo_menu_data->counter++;
2852 menu_export_object_list(void)
2854 GtkWidget *submenu_export_object;
2857 eo_data.merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
2859 eo_data.action_group = gtk_action_group_new ("exportobject-list-group");
2861 submenu_export_object = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/FileMenu/ExportObjectsMenu");
2862 if(!submenu_export_object){
2863 g_warning("menu_export_object_list: No submenu_exportobject_list found, path= /Menubar/FileMenu/ExportObjectsMenu");
2866 gtk_ui_manager_insert_action_group (ui_manager_main_menubar, eo_data.action_group, 0);
2867 g_object_set_data (G_OBJECT (ui_manager_main_menubar),
2868 "exportobject-list-merge-id", GUINT_TO_POINTER (eo_data.merge_id));
2870 eo_data.counter = 0;
2871 eo_iterate_tables(add_export_object_menuitem, &eo_data);
2875 menu_conversation_display_filter_cb(GtkAction *action _U_, gpointer data)
2877 conversation_filter_t *filter_entry = (conversation_filter_t *)data;
2880 GtkWidget *filter_te;
2882 if (cfile.current_frame) {
2883 /* create a filter-string based on the selected packet and action */
2884 filter = filter_entry->build_filter_string(&cfile.edt->pi);
2886 /* Run the display filter so it goes in effect - even if it's the
2887 same as the previous display filter. */
2888 filter_te = gtk_bin_get_child(GTK_BIN(g_object_get_data(G_OBJECT(top_level), E_DFILTER_CM_KEY)));
2890 gtk_entry_set_text(GTK_ENTRY(filter_te), filter);
2891 main_filter_packets(&cfile, filter, TRUE);
2898 menu_color_dissector_filter_spe_cb(frame_data *fd _U_, epan_dissect_t *edt, gpointer callback_data)
2900 conversation_filter_t *filter_entry = (conversation_filter_t *)callback_data;
2902 /* XXX - this gets the packet_info of the last dissected packet, */
2903 /* which is not necessarily the last selected packet */
2904 /* e.g. "Update list of packets in real time" won't work correct */
2905 return (edt != NULL) ? filter_entry->is_filter_valid(&edt->pi) : FALSE;
2908 #define MAX_NUM_COLOR_CONVERSATION_COLORS 10
2911 menu_color_conversation_filter(capture_file *cf)
2913 GtkWidget *submenu_conv_filters, *submenu_color_conv_filters;
2914 guint merge_id, color_merge_id;
2915 GtkActionGroup *action_group, *color_action_group;
2916 GList *list_entry = conv_filter_list;
2917 conversation_filter_t* color_filter;
2918 int conv_counter = 0;
2920 static packet_list_menu_color_conv_color_cb_t callbacks[MAX_NUM_COLOR_CONVERSATION_COLORS] = {
2921 packet_list_menu_color_conv_color1_cb,
2922 packet_list_menu_color_conv_color2_cb,
2923 packet_list_menu_color_conv_color3_cb,
2924 packet_list_menu_color_conv_color4_cb,
2925 packet_list_menu_color_conv_color5_cb,
2926 packet_list_menu_color_conv_color6_cb,
2927 packet_list_menu_color_conv_color7_cb,
2928 packet_list_menu_color_conv_color8_cb,
2929 packet_list_menu_color_conv_color9_cb,
2930 packet_list_menu_color_conv_color10_cb,
2933 static const gchar *icons[MAX_NUM_COLOR_CONVERSATION_COLORS] = {
2934 WIRESHARK_STOCK_COLOR1,
2935 WIRESHARK_STOCK_COLOR2,
2936 WIRESHARK_STOCK_COLOR3,
2937 WIRESHARK_STOCK_COLOR4,
2938 WIRESHARK_STOCK_COLOR5,
2939 WIRESHARK_STOCK_COLOR6,
2940 WIRESHARK_STOCK_COLOR7,
2941 WIRESHARK_STOCK_COLOR8,
2942 WIRESHARK_STOCK_COLOR9,
2943 WIRESHARK_STOCK_COLOR0,
2946 merge_id = gtk_ui_manager_new_merge_id (ui_manager_packet_list_menu);
2947 action_group = gtk_action_group_new ("popup-conversation-filters-group");
2948 color_merge_id = gtk_ui_manager_new_merge_id (ui_manager_packet_list_menu);
2949 color_action_group = gtk_action_group_new ("popup-conv-color-filters-group");
2951 submenu_conv_filters = gtk_ui_manager_get_widget(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter");
2952 if(!submenu_conv_filters){
2953 g_warning("menu_color_conversation_filter: No submenu_conversation_filters found, path= /PacketListMenuPopup/ConversationFilter");
2956 submenu_color_conv_filters = gtk_ui_manager_get_widget(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation");
2957 if(!submenu_color_conv_filters){
2958 g_warning("menu_color_conversation_filter: No submenu_color_conversation_filters found, path= /PacketListMenuPopup/ColorizeConversation");
2961 gtk_ui_manager_insert_action_group (ui_manager_packet_list_menu, action_group, 0);
2962 g_object_set_data (G_OBJECT (ui_manager_packet_list_menu),
2963 "popup-conversation-filters-merge-id", GUINT_TO_POINTER (merge_id));
2964 gtk_ui_manager_insert_action_group (ui_manager_packet_list_menu, color_action_group, 0);
2965 g_object_set_data (G_OBJECT (ui_manager_packet_list_menu),
2966 "popup-conv-color-filters-merge-id", GUINT_TO_POINTER (color_merge_id));
2968 while (list_entry != NULL) {
2969 gchar *action_name, *color_num_path_name;
2970 GtkAction *action, *color_action;
2971 GtkWidget *color_conv_filter_menuitem, *color_conv_filter_submenu, *color_conv_widget;
2973 color_filter = (conversation_filter_t*)list_entry->data;
2975 /* Create conversation filter menu item for each registered protocol */
2976 action_name = g_strdup_printf ("color_conversation-%u", conv_counter);
2978 action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
2979 "name", action_name,
2980 "label", color_filter->display_name,
2981 "sensitive", menu_color_dissector_filter_spe_cb(NULL, cf->edt, color_filter),
2983 g_signal_connect (action, "activate", G_CALLBACK (menu_conversation_display_filter_cb), color_filter);
2984 gtk_action_group_add_action (action_group, action);
2985 g_object_unref (action);
2987 gtk_ui_manager_add_ui (ui_manager_packet_list_menu, merge_id,
2988 "/PacketListMenuPopup/ConversationFilter/Conversations",
2991 GTK_UI_MANAGER_MENUITEM,
2993 g_free(action_name);
2995 /* Create color filter menu item for each registered protocol */
2996 color_action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
2997 "name", color_filter->display_name,
2998 "label", color_filter->display_name,
2999 "sensitive", menu_color_dissector_filter_spe_cb(NULL, cf->edt, color_filter),
3001 gtk_action_group_add_action (color_action_group, color_action);
3002 g_object_unref (color_action);
3004 gtk_ui_manager_add_ui (ui_manager_packet_list_menu, color_merge_id,
3005 "/PacketListMenuPopup/ColorizeConversation/Colorize",
3006 color_filter->display_name,
3007 color_filter->display_name,
3008 GTK_UI_MANAGER_MENUITEM,
3012 /* Create each "numbered" color filter menu item for each registered protocol */
3013 color_num_path_name = g_strdup_printf ("/PacketListMenuPopup/ColorizeConversation/Colorize/%s", color_filter->display_name);
3014 color_conv_widget = gtk_ui_manager_get_widget(ui_manager_packet_list_menu, color_num_path_name);
3015 if (color_conv_widget != NULL) {
3017 gchar *color_num_name;
3019 color_conv_filter_submenu = gtk_menu_new();
3020 for (i = 0; i < MAX_NUM_COLOR_CONVERSATION_COLORS; i++) {
3021 color_num_name = g_strdup_printf ("Color %d", i+1);
3022 color_conv_filter_menuitem = gtk_image_menu_item_new_with_label(color_num_name);
3023 gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM(color_conv_filter_menuitem),
3024 ws_gtk_image_new_from_stock(icons[i], GTK_ICON_SIZE_MENU));
3025 g_signal_connect(color_conv_filter_menuitem, "activate", G_CALLBACK(callbacks[i]), color_filter);
3026 gtk_menu_shell_append(GTK_MENU_SHELL(color_conv_filter_submenu), color_conv_filter_menuitem);
3028 gtk_widget_show (color_conv_filter_menuitem);
3029 g_free(color_num_name);
3032 /* Create New Coloring Rule... menu item */
3033 color_conv_filter_menuitem = gtk_menu_item_new_with_label("New Coloring Rule...");
3034 g_signal_connect(color_conv_filter_menuitem, "activate", G_CALLBACK(packet_list_menu_color_conv_new_rule_cb), color_filter);
3035 gtk_menu_shell_append(GTK_MENU_SHELL(color_conv_filter_submenu), color_conv_filter_menuitem);
3036 gtk_widget_show (color_conv_filter_menuitem);
3038 gtk_menu_item_set_submenu (GTK_MENU_ITEM(color_conv_widget), color_conv_filter_submenu);
3040 g_warning("menu_color_conversation_filter: No submenu_color_conv_filters found, path= %s", color_num_path_name);
3042 g_free(color_num_path_name);
3044 list_entry = g_list_next(list_entry);
3051 GtkActionGroup *packet_list_heading_action_group, *packet_list_action_group,
3052 *packet_list_details_action_group, *packet_list_byte_menu_action_group,
3053 *statusbar_profiles_action_group;
3054 GtkAction *name_res_action;
3055 GError *error = NULL;
3061 popup_menu_object = gtk_menu_new();
3063 /* packet list heading pop-up menu */
3064 packet_list_heading_action_group = gtk_action_group_new ("PacketListHeadingPopUpMenuActionGroup");
3066 gtk_action_group_add_actions (packet_list_heading_action_group, /* the action group */
3067 packet_list_heading_menu_popup_action_entries, /* an array of action descriptions */
3068 G_N_ELEMENTS(packet_list_heading_menu_popup_action_entries), /* the number of entries */
3069 popup_menu_object); /* data to pass to the action callbacks */
3071 gtk_action_group_add_toggle_actions(packet_list_heading_action_group, /* the action group */
3072 (GtkToggleActionEntry *)packet_list_heading_menu_toggle_action_entries, /* an array of action descriptions */
3073 G_N_ELEMENTS(packet_list_heading_menu_toggle_action_entries), /* the number of entries */
3074 NULL); /* data to pass to the action callbacks */
3076 ui_manager_packet_list_heading = gtk_ui_manager_new ();
3077 gtk_ui_manager_insert_action_group (ui_manager_packet_list_heading,
3078 packet_list_heading_action_group,
3079 0); /* the position at which the group will be inserted. */
3081 gtk_ui_manager_add_ui_from_string (ui_manager_packet_list_heading,ui_desc_packet_list_heading_menu_popup, -1, &error);
3084 fprintf (stderr, "Warning: building Packet List Heading Pop-Up failed: %s\n",
3086 g_error_free (error);
3090 g_object_set_data(G_OBJECT(popup_menu_object), PM_PACKET_LIST_COL_KEY,
3091 gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup"));
3093 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_packet_list_heading);
3095 /* packet list pop-up menu */
3096 packet_list_action_group = gtk_action_group_new ("PacketListPopUpMenuActionGroup");
3098 gtk_action_group_add_actions (packet_list_action_group, /* the action group */
3099 (GtkActionEntry *)packet_list_menu_popup_action_entries, /* an array of action descriptions */
3100 G_N_ELEMENTS(packet_list_menu_popup_action_entries), /* the number of entries */
3101 popup_menu_object); /* data to pass to the action callbacks */
3103 /* Add the filter menu items */
3104 gtk_action_group_add_actions (packet_list_action_group, /* the action group */
3105 (GtkActionEntry *)apply_prepare_filter_action_entries, /* an array of action descriptions */
3106 G_N_ELEMENTS(apply_prepare_filter_action_entries), /* the number of entries */
3107 popup_menu_object); /* data to pass to the action callbacks */
3109 ui_manager_packet_list_menu = gtk_ui_manager_new ();
3111 gtk_ui_manager_insert_action_group (ui_manager_packet_list_menu,
3112 packet_list_action_group,
3113 0); /* the position at which the group will be inserted. */
3115 gtk_ui_manager_add_ui_from_string (ui_manager_packet_list_menu, ui_desc_packet_list_menu_popup, -1, &error);
3118 fprintf (stderr, "Warning: building Packet List Pop-Up menu failed: %s\n",
3120 g_error_free (error);
3124 g_object_set_data(G_OBJECT(popup_menu_object), PM_PACKET_LIST_KEY,
3125 gtk_ui_manager_get_widget(ui_manager_packet_list_menu, "/PacketListMenuPopup"));
3127 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_packet_list_menu);
3129 menu_color_conversation_filter(&cfile);
3131 /* packet detail pop-up menu */
3132 packet_list_details_action_group = gtk_action_group_new ("PacketListDetailsMenuPopUpActionGroup");
3134 gtk_action_group_add_actions (packet_list_details_action_group, /* the action group */
3135 (GtkActionEntry *)tree_view_menu_popup_action_entries, /* an array of action descriptions */
3136 G_N_ELEMENTS(tree_view_menu_popup_action_entries), /* the number of entries */
3137 popup_menu_object); /* data to pass to the action callbacks */
3139 /* Add the filter menu items */
3140 gtk_action_group_add_actions (packet_list_details_action_group, /* the action group */
3141 (GtkActionEntry *)apply_prepare_filter_action_entries, /* an array of action descriptions */
3142 G_N_ELEMENTS(apply_prepare_filter_action_entries), /* the number of entries */
3143 popup_menu_object); /* data to pass to the action callbacks */
3146 ui_manager_tree_view_menu = gtk_ui_manager_new ();
3148 gtk_ui_manager_insert_action_group (ui_manager_tree_view_menu,
3149 packet_list_details_action_group,
3150 0); /* the position at which the group will be inserted. */
3151 gtk_ui_manager_add_ui_from_string (ui_manager_tree_view_menu, ui_desc_tree_view_menu_popup, -1, &error);
3153 /* If we want to load the treewiew popup UI description from file */
3154 gui_desc_file_name_and_path = get_ui_file_path("tree-view-ui.xml");
3155 gtk_ui_manager_add_ui_from_file ( ui_manager_tree_view_menu, gui_desc_file_name_and_path, &error);
3156 g_free (gui_desc_file_name_and_path);
3160 fprintf (stderr, "Warning: building TreeView Pop-Up menu failed: %s\n",
3162 g_error_free (error);
3166 g_object_set_data(G_OBJECT(popup_menu_object), PM_TREE_VIEW_KEY,
3167 gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup"));
3169 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_tree_view_menu);
3172 * Hex dump pop-up menu.
3173 * We provide our own empty menu to suppress the default pop-up menu
3176 packet_list_byte_menu_action_group = gtk_action_group_new ("PacketListByteMenuPopUpActionGroup");
3179 gtk_action_group_add_radio_actions (packet_list_byte_menu_action_group, /* the action group */
3180 (GtkRadioActionEntry *)bytes_menu_radio_action_entries, /* an array of radio action descriptions */
3181 G_N_ELEMENTS(bytes_menu_radio_action_entries), /* the number of entries */
3182 recent.gui_bytes_view, /* the value of the action to activate initially, or -1 if no action should be activated */
3183 G_CALLBACK(select_bytes_view_cb), /* the callback to connect to the changed signal */
3184 popup_menu_object); /* data to pass to the action callbacks */
3186 ui_manager_bytes_menu = gtk_ui_manager_new ();
3188 gtk_ui_manager_insert_action_group (ui_manager_bytes_menu,
3189 packet_list_byte_menu_action_group,
3190 0); /* the position at which the group will be inserted. */
3191 gtk_ui_manager_add_ui_from_string (ui_manager_bytes_menu, ui_desc_bytes_menu_popup, -1, &error);
3193 /* If we want to load the bytesview poupup UI description from file */
3194 gui_desc_file_name_and_path = get_ui_file_path("bytes-view-ui.xml");
3195 gtk_ui_manager_add_ui_from_file ( ui_manager_bytes_menu, gui_desc_file_name_and_path, &error);
3196 g_free (gui_desc_file_name_and_path);
3200 fprintf (stderr, "Warning: building Bytes Pop-Up menu failed: %s\n",
3202 g_error_free (error);
3205 g_object_unref(packet_list_byte_menu_action_group);
3207 g_object_set_data(G_OBJECT(popup_menu_object), PM_BYTES_VIEW_KEY,
3208 gtk_ui_manager_get_widget(ui_manager_bytes_menu, "/BytesMenuPopup"));
3210 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_bytes_menu);
3213 main_menu_bar_action_group = gtk_action_group_new ("MenuActionGroup");
3215 gtk_action_group_add_actions (main_menu_bar_action_group, /* the action group */
3216 main_menu_bar_entries, /* an array of action descriptions */
3217 G_N_ELEMENTS(main_menu_bar_entries), /* the number of entries */
3218 NULL); /* data to pass to the action callbacks */
3221 /* Add the capture menu actions */
3222 gtk_action_group_add_actions (main_menu_bar_action_group, /* the action group */
3223 capture_menu_entries, /* an array of action descriptions */
3224 G_N_ELEMENTS(capture_menu_entries), /* the number of entries */
3225 NULL); /* data to pass to the action callbacks */
3228 /* Add the filter menu actions */
3229 gtk_action_group_add_actions (main_menu_bar_action_group, /* the action group */
3230 (GtkActionEntry *)apply_prepare_filter_action_entries, /* an array of action descriptions */
3231 G_N_ELEMENTS(apply_prepare_filter_action_entries), /* the number of entries */
3232 popup_menu_object); /* data to pass to the action callbacks */
3234 gtk_action_group_add_toggle_actions(main_menu_bar_action_group, /* the action group */
3235 main_menu_bar_toggle_action_entries, /* an array of action descriptions */
3236 G_N_ELEMENTS(main_menu_bar_toggle_action_entries), /* the number of entries */
3237 NULL); /* data to pass to the action callbacks */
3239 if (global_dissect_options.time_format != TS_NOT_SET) {
3240 recent.gui_time_format = global_dissect_options.time_format;
3242 gtk_action_group_add_radio_actions (main_menu_bar_action_group, /* the action group */
3243 main_menu_bar_radio_view_time_entries, /* an array of radio action descriptions */
3244 G_N_ELEMENTS(main_menu_bar_radio_view_time_entries), /* the number of entries */
3245 recent.gui_time_format, /* the value of the action to activate initially, or -1 if no action should be activated */
3246 G_CALLBACK(timestamp_format_new_cb), /* the callback to connect to the changed signal */
3247 NULL); /* data to pass to the action callbacks */
3249 gtk_action_group_add_radio_actions (main_menu_bar_action_group, /* the action group */
3250 main_menu_bar_radio_view_time_fileformat_prec_entries, /* an array of radio action descriptions */
3251 G_N_ELEMENTS(main_menu_bar_radio_view_time_fileformat_prec_entries), /* the number of entries */
3252 recent.gui_time_precision, /* the value of the action to activate initially, or -1 if no action should be activated */
3253 G_CALLBACK(timestamp_precision_new_cb), /* the callback to connect to the changed signal */
3254 NULL); /* data to pass to the action callbacks */
3258 ui_manager_main_menubar = gtk_ui_manager_new ();
3259 gtk_ui_manager_insert_action_group (ui_manager_main_menubar, main_menu_bar_action_group, 0);
3261 gtk_ui_manager_add_ui_from_string (ui_manager_main_menubar,ui_desc_menubar, -1, &error);
3264 fprintf (stderr, "Warning: building main menubar failed: %s\n",
3266 g_error_free (error);
3269 g_object_unref(main_menu_bar_action_group);
3270 gtk_window_add_accel_group (GTK_WINDOW(top_level),
3271 gtk_ui_manager_get_accel_group(ui_manager_main_menubar));
3274 /* Add the recent files items to the menu
3275 * use place holders and
3276 * gtk_ui_manager_add_ui().
3278 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
3279 add_recent_items (merge_id, ui_manager_main_menubar);
3281 /* Add statistics tap plug-in to the menu
3283 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
3284 add_tap_plugins (merge_id, ui_manager_main_menubar);
3286 statusbar_profiles_action_group = gtk_action_group_new ("StatusBarProfilesPopUpMenuActionGroup");
3288 gtk_action_group_add_actions (statusbar_profiles_action_group, /* the action group */
3289 (GtkActionEntry *)statusbar_profiles_menu_action_entries, /* an array of action descriptions */
3290 G_N_ELEMENTS(statusbar_profiles_menu_action_entries), /* the number of entries */
3291 popup_menu_object); /* data to pass to the action callbacks */
3293 ui_manager_statusbar_profiles_menu = gtk_ui_manager_new ();
3294 gtk_ui_manager_insert_action_group (ui_manager_statusbar_profiles_menu,
3295 statusbar_profiles_action_group,
3296 0); /* the position at which the group will be inserted. */
3298 gtk_ui_manager_add_ui_from_string (ui_manager_statusbar_profiles_menu,ui_statusbar_profiles_menu_popup, -1, &error);
3301 fprintf (stderr, "Warning: building StatusBar Profiles Pop-Up failed: %s\n",
3303 g_error_free (error);
3307 g_object_unref(statusbar_profiles_action_group);
3309 g_object_set_data(G_OBJECT(popup_menu_object), PM_STATUSBAR_PROFILES_KEY,
3310 gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup"));
3312 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_statusbar_profiles_menu);
3314 menu_dissector_filter(&cfile);
3315 menu_conversation_list(&cfile);
3316 menu_hostlist_list(&cfile);
3317 menu_export_object_list();
3319 /* Add additional entries which may have been introduced by dissectors and/or plugins */
3320 ws_menubar_external_menus();
3322 merge_menu_items(merge_menu_items_list);
3324 /* Add external menus and items */
3325 ws_menubar_build_external_menus();
3327 /* Initialize enabled/disabled state of menu items */
3328 set_menus_for_capture_file(NULL);
3330 /* Un-#if this when we actually implement Cut/Copy/Paste.
3331 Then make sure you enable them when they can be done. */
3332 set_menu_sensitivity_old("/Edit/Cut", FALSE);
3333 set_menu_sensitivity_old("/Edit/Copy", FALSE);
3334 set_menu_sensitivity_old("/Edit/Paste", FALSE);
3336 /* Hide not usable menus */
3338 set_menus_for_captured_packets(FALSE);
3339 set_menus_for_selected_packet(&cfile);
3340 set_menus_for_selected_tree_row(&cfile);
3341 set_menus_for_capture_in_progress(FALSE);
3342 set_menus_for_file_set(/* dialog */TRUE, /* previous file */ FALSE, /* next_file */ FALSE);
3344 /* Set callback to update name resolution settings when activated */
3345 name_res_action = gtk_action_group_get_action(main_menu_bar_action_group, "/View/NameResolution");
3346 g_signal_connect (name_res_action, "activate", G_CALLBACK (menu_name_resolution_update_cb), NULL);
3350 /* Get a merge id for the menubar */
3352 ws_add_build_menubar_items_callback(gpointer callback)
3354 build_menubar_items_callback_list = g_list_append(build_menubar_items_callback_list, callback);
3359 ws_menubar_build_external_menus(void)
3361 void (*callback)(gpointer);
3363 while (build_menubar_items_callback_list != NULL) {
3364 callback = (void (*)(gpointer))build_menubar_items_callback_list->data;
3365 callback(ui_manager_main_menubar);
3366 build_menubar_items_callback_list = g_list_next(build_menubar_items_callback_list);
3372 typedef struct _menu_item {
3373 const char *gui_path;
3375 const char *stock_id;
3377 const char *accelerator;
3378 const gchar *tooltip;
3380 gpointer callback_data;
3382 gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data);
3383 gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data);
3387 insert_sorted_by_label(gconstpointer aparam, gconstpointer bparam)
3389 const menu_item_t *a = (menu_item_t *)aparam;
3390 const menu_item_t *b = (menu_item_t *)bparam;
3392 return g_ascii_strcasecmp(a->label, b->label);
3395 void register_menu_bar_menu_items(
3396 const char *gui_path,
3398 const gchar *stock_id,
3400 const char *accelerator,
3401 const gchar *tooltip,
3403 gpointer callback_data,
3405 gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data),
3406 gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data))
3408 menu_item_t *menu_item_data;
3410 menu_item_data = g_new0(menu_item_t,1);
3411 menu_item_data->gui_path = gui_path;
3412 menu_item_data->name = name;
3413 menu_item_data->label = label;
3414 menu_item_data->stock_id = stock_id;
3415 menu_item_data->accelerator = accelerator;
3416 menu_item_data->tooltip = tooltip;
3417 menu_item_data->callback = (GCallback)callback;
3418 menu_item_data->callback_data = callback_data;
3419 menu_item_data->enabled = enabled;
3420 menu_item_data->selected_packet_enabled = selected_packet_enabled;
3421 menu_item_data->selected_tree_row_enabled = selected_tree_row_enabled;
3423 merge_menu_items_list = g_list_insert_sorted(merge_menu_items_list,
3425 insert_sorted_by_label);
3428 #define XMENU_MAX_DEPTH (1 + 32) /* max number of menus in an xpath (+1 for Menubar) */
3431 add_menu_item_to_main_menubar(const gchar *path, const gchar *name, const menu_item_t *menu_item_data)
3437 char **tokens, **name_action_tokens;
3438 char *tok, *item_name, *action_name;
3443 /* no need to specify menu bar...skip it */
3444 len = strlen("/Menubar");
3445 if (g_ascii_strncasecmp(path, "/Menubar", len) == 0) {
3449 xpath = g_strdup_printf("%s/%s", path, name);
3450 item_path = g_string_new("/Menubar");
3452 merge_id = gtk_ui_manager_new_merge_id(ui_manager_main_menubar);
3455 * The last item in the path is treated as the menu item; all preceding path
3456 * elements are the names of parent menus. Path elements are stripped of
3457 * leading/trailing spaces.
3459 * |'s separate an existing menu's name from its action.
3460 * If the action has a / in it, it must have been "escaped" into a # before
3461 * entering this function; this function will translate it back to a /.
3462 * There must be an easier way!
3466 * "/Foo/Bar|/BarAction/I_tem" creates a hierarchy of:
3468 * A menu with an action of "Foo"
3469 * A menu with a name of "Bar" and an action of "/BarAction"
3470 * A menu item with an action of "I_tem", which puts
3471 * the shortcut on "t".
3473 * "/Foo/Bar|BarAction/-/Baz|BarAction#BazAction/Item" creates
3476 * A menu with an action of "Foo"
3477 * A menu with a name of "Bar" and an action of "/BarAction"
3479 * A menu with a name of "Baz" and an action of
3480 * "BarAction/BazAction"
3481 * A menu item with an action of "Item"
3483 tokens = g_strsplit(xpath, "/", XMENU_MAX_DEPTH);
3484 for (p = tokens; (p != NULL) && (*p != NULL); p++) {
3485 tok = g_strstrip(*p);
3486 if (g_strcmp0(tok, "-") == 0) {
3487 /* Just a separator. */
3488 gtk_ui_manager_add_ui(ui_manager_main_menubar, merge_id,
3492 GTK_UI_MANAGER_SEPARATOR,
3495 if (*(p+1) == NULL) {
3497 * This is the last token; it's the name of a menu item,
3500 * Allow a blank menu item name or else the item is hidden
3501 * (and thus useless). Showing a blank menu item allows the
3502 * developer to see the problem and fix it.
3505 action_name = g_strconcat("/", tok, NULL);
3506 if (menu_item_data != NULL) {
3507 action = (GtkAction *)g_object_new (
3509 "name", action_name,
3510 "label", menu_item_data->label,
3511 "stock-id", menu_item_data->stock_id,
3512 "tooltip", menu_item_data->tooltip,
3513 "sensitive", menu_item_data->enabled,
3516 if (menu_item_data->callback != NULL) {
3520 G_CALLBACK (menu_item_data->callback),
3521 menu_item_data->callback_data
3524 gtk_action_group_add_action (main_menu_bar_action_group, action);
3525 g_object_unref (action);
3527 gtk_ui_manager_add_ui(ui_manager_main_menubar, merge_id,
3531 GTK_UI_MANAGER_MENUITEM,
3533 g_free(action_name);
3536 * This is not the last token; it's the name of an
3537 * intermediate menu.
3539 * If it's empty, just skip it.
3544 /* Split the name of the menu from its action (if any) */
3545 name_action_tokens = g_strsplit(tok, "|", 2);
3546 if (name_action_tokens[1]) {
3548 /* Replace #'s with /'s.
3549 * Necessary for menus whose action includes a "/".
3550 * There MUST be an easier way...
3552 while (name_action_tokens[1][++i])
3553 if (name_action_tokens[1][i] == '#')
3554 name_action_tokens[1][i] = '/';
3555 item_name = name_action_tokens[0];
3556 action_name = g_strconcat("/", name_action_tokens[1], NULL);
3559 action_name = g_strconcat("/", tok, NULL);
3562 if (menu_item_data != NULL) {
3564 * Add an action for this menu if it doesn't already
3567 if (gtk_action_group_get_action(main_menu_bar_action_group, action_name) == NULL) {
3568 action = (GtkAction *)g_object_new (
3570 "name", action_name,
3574 gtk_action_group_add_action (main_menu_bar_action_group, action);
3575 g_object_unref (action);
3578 gtk_ui_manager_add_ui(ui_manager_main_menubar, merge_id,
3582 GTK_UI_MANAGER_MENU,
3584 g_free(action_name);
3586 g_string_append_printf(item_path, "/%s", item_name);
3587 g_strfreev(name_action_tokens);
3592 /* we're finished processing the tokens so free the list */
3595 g_string_free(item_path, TRUE);
3600 merge_menu_items(GList *lcl_merge_menu_items_list)
3602 menu_item_t *menu_item_data;
3604 while (lcl_merge_menu_items_list != NULL) {
3605 menu_item_data = (menu_item_t *)lcl_merge_menu_items_list->data;
3606 add_menu_item_to_main_menubar(menu_item_data->gui_path, menu_item_data->name, menu_item_data);
3607 lcl_merge_menu_items_list = g_list_next(lcl_merge_menu_items_list);
3612 stat_group_name(register_stat_group_t group)
3614 /* See add_menu_item_to_main_menubar() for an explanation of the string format */
3615 static const value_string group_name_vals[] = {
3616 {REGISTER_ANALYZE_GROUP_UNSORTED, "/Menubar/AnalyzeMenu|Analyze"}, /* unsorted analyze stuff */
3617 {REGISTER_ANALYZE_GROUP_CONVERSATION_FILTER, "/Menubar/AnalyzeMenu|Analyze/ConversationFilterMenu|Analyze#ConversationFilter"}, /* conversation filters */
3618 {REGISTER_STAT_GROUP_UNSORTED, "/Menubar/StatisticsMenu|Statistics"}, /* unsorted statistic function */
3619 {REGISTER_STAT_GROUP_GENERIC, "/Menubar/StatisticsMenu|Statistics"}, /* generic statistic function, not specific to a protocol */
3620 {REGISTER_STAT_GROUP_CONVERSATION_LIST, "/Menubar/StatisticsMenu|Statistics/ConversationListMenu|Statistics#ConversationList"}, /* member of the conversation list */
3621 {REGISTER_STAT_GROUP_ENDPOINT_LIST, "/Menubar/StatisticsMenu|Statistics/EndpointListMenu|Statistics#EndpointList"}, /* member of the endpoint list */
3622 {REGISTER_STAT_GROUP_RESPONSE_TIME, "/Menubar/StatisticsMenu|Statistics/ServiceResponseTimeMenu|Statistics#ServiceResponseTime"}, /* member of the service response time list */
3623 {REGISTER_STAT_GROUP_TELEPHONY, "/Menubar/TelephonyMenu|Telephony"}, /* telephony specific */
3624 {REGISTER_STAT_GROUP_TELEPHONY_ANSI, "/Menubar/TelephonyMenu|Telephony/ANSI|Telephony#ANSI"}, /* ANSI-specific */
3625 {REGISTER_STAT_GROUP_TELEPHONY_GSM, "/Menubar/TelephonyMenu|Telephony/GSM|Telephony#GSM"}, /* GSM-specific */
3626 {REGISTER_STAT_GROUP_TELEPHONY_LTE, "/Menubar/TelephonyMenu|Telephony/LTEmenu|Telephony#LTE"}, /* LTE-specific */
3627 {REGISTER_STAT_GROUP_TELEPHONY_MTP3, "/Menubar/TelephonyMenu|Telephony/MTP3menu|Telephony#MTP3"}, /* MTP3-specific */
3628 {REGISTER_STAT_GROUP_TELEPHONY_SCTP, "/Menubar/TelephonyMenu|Telephony/SCTPmenu|Telephony#SCTP"}, /* SCTP-specific */
3629 {REGISTER_TOOLS_GROUP_UNSORTED, "/Menubar/ToolsMenu|Tools"}, /* unsorted tools */
3632 return val_to_str_const(group, group_name_vals, "/Menubar/ToolsMenu|Tools");
3636 * Enable/disable menu sensitivity.
3639 set_menu_sensitivity(GtkUIManager *ui_manager, const gchar *path, gint val)
3643 action = gtk_ui_manager_get_action(ui_manager, path);
3645 fprintf (stderr, "Warning: set_menu_sensitivity couldn't find action path= %s\n",
3649 gtk_action_set_sensitive (action, val); /* TRUE to make the action sensitive */
3653 set_menu_object_data_meat(GtkUIManager *ui_manager, const gchar *path, const gchar *key, gpointer data)
3655 GtkWidget *menu = NULL;
3657 if ((menu = gtk_ui_manager_get_widget(ui_manager, path)) != NULL){
3658 g_object_set_data(G_OBJECT(menu), key, data);
3661 g_warning("set_menu_object_data_meat: no menu, path: %s",path);
3667 set_menu_object_data (const gchar *path, const gchar *key, gpointer data)
3669 if (strncmp (path,"/Menubar",8) == 0){
3670 set_menu_object_data_meat(ui_manager_main_menubar, path, key, data);
3671 }else if (strncmp (path,"/PacketListMenuPopup",20) == 0){
3672 set_menu_object_data_meat(ui_manager_packet_list_menu, path, key, data);
3673 }else if (strncmp (path,"/TreeViewPopup",14) == 0){
3674 set_menu_object_data_meat(ui_manager_tree_view_menu, path, key, data);
3675 }else if (strncmp (path,"/BytesMenuPopup",15) == 0){
3676 set_menu_object_data_meat(ui_manager_bytes_menu, path, key, data);
3677 }else if (strncmp (path,"/ProfilesMenuPopup",18) == 0){
3678 set_menu_object_data_meat(ui_manager_statusbar_profiles_menu, path, key, data);
3683 /* Recently used capture files submenu:
3684 * Submenu containing the recently used capture files.
3685 * The capture filenames are always kept with the absolute path to be independent
3686 * of the current path.
3687 * They are only stored inside the labels of the submenu (no separate list). */
3689 #define MENU_RECENT_FILES_PATH "/Menubar/FileMenu/OpenRecent"
3690 #define MENU_RECENT_FILES_KEY "Recent File Name"
3692 /* Add a file name to the top of the list; if it's already present remove it first */
3694 remove_present_file_name(GList *recent_files_list, const gchar *cf_name)
3697 gchar *widget_cf_name;
3699 for (li = g_list_first(recent_files_list); li; li = next) {
3700 widget_cf_name = (gchar *)li->data;
3704 /* do a case insensitive compare on win32 */
3705 g_ascii_strncasecmp(widget_cf_name, cf_name, 1000) == 0){
3707 /* do a case sensitive compare on unix */
3708 strncmp(widget_cf_name, cf_name, 1000) == 0 ){
3710 recent_files_list = g_list_remove(recent_files_list,widget_cf_name);
3714 return recent_files_list;
3718 recent_changed_cb (GtkUIManager *ui_manager,
3719 gpointer user_data _U_)
3722 GList *action_groups, *l;
3725 merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (ui_manager),
3726 "recent-files-merge-id"));
3729 gtk_ui_manager_remove_ui (ui_manager, merge_id);
3731 /* remove the action group; gtk_ui_manager_remove_action_group()
3732 * should really take the action group's name instead of its
3735 action_groups = gtk_ui_manager_get_action_groups (ui_manager);
3736 for (l = action_groups; l != NULL; l = l->next)
3738 GtkActionGroup *group = (GtkActionGroup *)l->data;
3740 if (strcmp (gtk_action_group_get_name (group), "recent-files-group") == 0){
3741 /* this unrefs the action group and all of its actions */
3742 gtk_ui_manager_remove_action_group (ui_manager, group);
3747 /* generate a new merge id and re-add everything */
3748 merge_id = gtk_ui_manager_new_merge_id (ui_manager);
3749 add_recent_items (merge_id, ui_manager);
3753 recent_clear_cb(GtkAction *action _U_, gpointer user_data _U_)
3755 GtkWidget *submenu_recent_files;
3756 GList *recent_files_list;
3758 /* Get the list of recent files, free the list and store the empty list with the widget */
3759 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
3760 recent_files_list = (GList *)g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
3761 /* Free the name strings ?? */
3762 g_list_free(recent_files_list);
3763 recent_files_list = NULL;
3764 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
3765 /* Calling recent_changed_cb will rebuild the GUI call add_recent_items which will in turn call
3766 * main_welcome_reset_recent_capture_files
3768 recent_changed_cb(ui_manager_main_menubar, NULL);
3772 add_recent_items (guint merge_id, GtkUIManager *ui_manager)
3774 GtkActionGroup *action_group;
3776 GtkWidget *submenu_recent_files;
3777 GtkWidget *submenu_recent_file;
3783 /* Reset the recent files list in the welcome screen */
3784 main_welcome_reset_recent_capture_files();
3786 action_group = gtk_action_group_new ("recent-files-group");
3788 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager, MENU_RECENT_FILES_PATH);
3789 if(!submenu_recent_files){
3790 g_warning("add_recent_items: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
3792 items = (GList *)g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
3794 gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
3795 g_object_set_data (G_OBJECT (ui_manager),
3796 "recent-files-merge-id", GUINT_TO_POINTER (merge_id));
3801 action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
3802 "name", "recent-info-empty",
3803 "label", "No recently used files",
3806 gtk_action_group_add_action (action_group, action);
3807 gtk_action_set_sensitive(action, FALSE);
3808 g_object_unref (action);
3810 gtk_ui_manager_add_ui (ui_manager, merge_id,
3811 "/Menubar/FileMenu/OpenRecent/RecentFiles",
3812 "recent-info-empty",
3813 "recent-info-empty",
3814 GTK_UI_MANAGER_MENUITEM,
3820 for (i = 0, l = items;
3821 i < prefs.gui_recent_files_count_max && l != NULL;
3824 gchar *item_name = (gchar *)l->data;
3825 action_name = g_strdup_printf ("recent-info-%u", i);
3827 action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
3828 "name", action_name,
3830 "stock_id", WIRESHARK_STOCK_SAVE,
3832 g_signal_connect (action, "activate",
3833 G_CALLBACK (menu_open_recent_file_cmd_cb), NULL);
3834 #if !GTK_CHECK_VERSION(2,16,0)
3835 g_object_set_data (G_OBJECT (action), "FileName", item_name);
3837 gtk_action_group_add_action (action_group, action);
3838 g_object_unref (action);
3840 gtk_ui_manager_add_ui (ui_manager, merge_id,
3841 "/Menubar/FileMenu/OpenRecent/RecentFiles",
3844 GTK_UI_MANAGER_MENUITEM,
3847 /* Disable mnemonic accelerator key for recent file name */
3848 recent_path = g_strdup_printf ("/Menubar/FileMenu/OpenRecent/RecentFiles/recent-info-%u", i);
3849 submenu_recent_file = gtk_ui_manager_get_widget(ui_manager, recent_path);
3850 g_object_set(G_OBJECT (submenu_recent_file), "use-underline", 0, NULL);
3852 /* Add the file name to the recent files list on the Welcome screen */
3853 main_welcome_add_recent_capture_file(item_name, G_OBJECT(action));
3855 g_free (recent_path);
3856 g_free (action_name);
3858 /* Add a Separator */
3859 gtk_ui_manager_add_ui (ui_manager, merge_id,
3860 "/Menubar/FileMenu/OpenRecent/RecentFiles",
3861 "separator-recent-info",
3863 GTK_UI_MANAGER_SEPARATOR,
3866 /* Add a clear Icon */
3867 action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
3868 "name", "clear-recent-info",
3869 "label", "Clear the recent files list",
3870 "stock_id", GTK_STOCK_CLEAR,
3873 g_signal_connect (action, "activate",
3874 G_CALLBACK (recent_clear_cb), NULL);
3876 gtk_action_group_add_action (action_group, action);
3877 g_object_unref (action);
3879 gtk_ui_manager_add_ui (ui_manager, merge_id,
3880 "/Menubar/FileMenu/OpenRecent/RecentFiles",
3881 "clear-recent-info",
3882 "clear-recent-info",
3883 GTK_UI_MANAGER_MENUITEM,
3888 #define MENU_STATISTICS_PATH "/Menubar/StatisticsMenu"
3891 add_tap_plugins (guint merge_id, GtkUIManager *ui_manager)
3893 GtkActionGroup *action_group;
3895 GtkWidget *submenu_statistics;
3900 gchar *submenu_path;
3901 gsize submenu_path_size;
3902 gchar *stat_name_buf;
3906 action_group = gtk_action_group_new ("tap-plugins-group");
3908 submenu_statistics = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_STATISTICS_PATH);
3909 if(!submenu_statistics){
3910 g_warning("add_tap_plugins: No submenu_statistics found, path= MENU_STATISTICS_PATH");
3913 gtk_ui_manager_insert_action_group (ui_manager_main_menubar, action_group, 0);
3914 g_object_set_data (G_OBJECT (ui_manager_main_menubar),
3915 "tap-plugins-merge-id", GUINT_TO_POINTER (merge_id));
3917 cfg_list = stats_tree_get_cfg_list();
3918 iter = g_list_first(cfg_list);
3920 stats_tree_cfg *cfg = (stats_tree_cfg*)iter->data;
3922 stat_name_buf = g_strdup(cfg->name);
3923 submenu_path_size = (gsize)(strlen(MENU_STATISTICS_PATH)+strlen(cfg->name)+strlen(cfg->abbr)+1); /* worst case length */
3924 submenu_path = (gchar *)g_malloc(submenu_path_size);
3925 g_strlcpy(submenu_path, MENU_STATISTICS_PATH, submenu_path_size);
3927 sep = stat_name= stat_name_buf;
3928 while ((sep = strchr(sep,'/')) != NULL) {
3929 if (*(++sep)=='/') { /* escapeded slash - two slash characters after each other */
3930 memmove(sep,sep+1,strlen(sep));
3933 /* we got a new submenu name - ignore the edge case where there is no text following this slash */
3935 action_name = g_strdup_printf("%s/%s", submenu_path,stat_name);
3936 if (!gtk_ui_manager_get_widget(ui_manager, action_name)) {
3937 action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
3938 "name", action_name,
3941 gtk_action_group_add_action (action_group, action);
3942 g_object_unref (action);
3944 gtk_ui_manager_add_ui (ui_manager, merge_id,
3948 GTK_UI_MANAGER_MENU,
3951 g_free (action_name);
3953 g_strlcat(submenu_path,"/",submenu_path_size);
3954 g_strlcat(submenu_path,stat_name,submenu_path_size);
3959 action_name = g_strdup_printf("%s/%s", submenu_path, cfg->abbr);
3960 action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
3961 "name", action_name,
3964 g_signal_connect (action, "activate", G_CALLBACK (gtk_stats_tree_cb), NULL);
3965 gtk_action_group_add_action (action_group, action);
3966 g_object_unref (action);
3968 gtk_ui_manager_add_ui (ui_manager, merge_id,
3972 GTK_UI_MANAGER_MENUITEM,
3975 g_free (action_name);
3976 g_free (stat_name_buf);
3977 g_free (submenu_path);
3979 iter = g_list_next(iter);
3981 g_list_free(cfg_list);
3984 /* Open a file by its name
3985 (Beware: will not ask to close existing capture file!) */
3987 menu_open_filename(gchar *cf_name)
3989 GtkWidget *submenu_recent_files;
3991 GList *recent_files_list;
3994 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
3995 if(!submenu_recent_files){
3996 g_warning("menu_open_filename: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
3998 recent_files_list = (GList *)g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
3999 /* XXX: ask user to remove item, it's maybe only a temporary problem */
4000 /* open and read the capture file (this will close an existing file) */
4001 if (cf_open(&cfile, cf_name, WTAP_TYPE_AUTO, FALSE, &err) == CF_OK) {
4002 cf_read(&cfile, FALSE);
4004 recent_files_list = remove_present_file_name(recent_files_list, cf_name);
4005 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
4006 /* Calling recent_changed_cb will rebuild the GUI call add_recent_items which will in turn call
4007 * main_welcome_reset_recent_capture_files
4009 recent_changed_cb(ui_manager_main_menubar, NULL);
4013 /* callback, if the user pushed a recent file submenu item */
4015 menu_open_recent_file_cmd(GtkAction *action)
4017 GtkWidget *submenu_recent_files;
4018 GList *recent_files_list;
4019 const gchar *cf_name;
4022 #if GTK_CHECK_VERSION(2,16,0)
4023 cf_name = gtk_action_get_label(action);
4025 cf_name = (const gchar *)g_object_get_data(G_OBJECT(action), "FileName");
4028 /* open and read the capture file (this will close an existing file) */
4029 if (cf_open(&cfile, cf_name, WTAP_TYPE_AUTO, FALSE, &err) == CF_OK) {
4030 cf_read(&cfile, FALSE);
4032 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
4033 recent_files_list = (GList *)g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
4035 recent_files_list = remove_present_file_name(recent_files_list, cf_name);
4036 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
4037 /* Calling recent_changed_cb will rebuild the GUI call add_recent_items which will in turn call
4038 * main_welcome_reset_recent_capture_files
4040 recent_changed_cb(ui_manager_main_menubar, NULL);
4045 menu_open_recent_file_cmd_cb(GtkAction *action, gpointer data _U_)
4047 /* If there's unsaved data, let the user save it first.
4048 If they cancel out of it, don't open the file. */
4049 if (do_file_close(&cfile, FALSE, " before opening a new capture file"))
4050 menu_open_recent_file_cmd(action);
4054 add_menu_recent_capture_file_absolute(const gchar *cf_name)
4056 GtkWidget *submenu_recent_files;
4058 gchar *widget_cf_name;
4059 gchar *normalized_cf_name;
4061 GList *recent_files_list;
4063 normalized_cf_name = g_strdup(cf_name);
4065 /* replace all slashes by backslashes */
4066 g_strdelimit(normalized_cf_name, "/", '\\');
4069 /* get the submenu container item */
4070 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
4071 if(!submenu_recent_files){
4072 g_warning("add_menu_recent_capture_file_absolute: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
4073 g_free(normalized_cf_name);
4076 recent_files_list = (GList *)g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
4078 for (li = g_list_first(recent_files_list); li; cnt++) {
4079 widget_cf_name = (gchar *)li->data;
4081 /* Find the next element BEFORE we (possibly) free the current one below */
4086 /* do a case insensitive compare on win32 */
4087 g_ascii_strncasecmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
4089 /* do a case sensitive compare on unix */
4090 strncmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
4092 cnt >= prefs.gui_recent_files_count_max) {
4093 recent_files_list = g_list_remove(recent_files_list,widget_cf_name);
4097 recent_files_list = g_list_prepend(recent_files_list, normalized_cf_name);
4098 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
4099 recent_changed_cb( ui_manager_main_menubar, NULL);
4103 /* add the capture filename to the "Recent Files" menu */
4104 /* (will change nothing, if this filename is already in the menu) */
4106 * XXX - We might want to call SHAddToRecentDocs under Windows 7:
4107 * http: //stackoverflow.com/questions/437212/how-do-you-register-a-most-recently-used-list-with-windows-in-preparation-for-win
4110 add_menu_recent_capture_file(const gchar *cf_name)
4115 /* if this filename is an absolute path, we can use it directly */
4116 if (g_path_is_absolute(cf_name)) {
4117 add_menu_recent_capture_file_absolute(cf_name);
4121 /* this filename is not an absolute path, prepend the current dir */
4122 curr = g_get_current_dir();
4123 absolute = g_strdup_printf("%s%s%s", curr, G_DIR_SEPARATOR_S, cf_name);
4124 add_menu_recent_capture_file_absolute(absolute);
4130 /* write all capture filenames of the menu to the user's recent file */
4132 menu_recent_file_write_all(FILE *rf)
4134 GtkWidget *submenu_recent_files;
4136 GList *recent_files_list, *list;
4138 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
4139 if(!submenu_recent_files){
4140 g_warning("menu_recent_file_write_all: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
4142 recent_files_list = (GList *)g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
4143 list = g_list_last(recent_files_list);
4144 while (list != NULL) {
4145 cf_name = (gchar *)list->data;
4147 fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", cf_name);
4149 list = g_list_previous(list);
4151 g_list_free(recent_files_list);
4155 menu_name_resolution_changed(void)
4159 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforMACLayer");
4161 g_warning("menu_name_resolution_changed: No menu found, path= /Menubar/ViewMenu/NameResolution/EnableforMACLayer");
4163 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags.mac_name);
4165 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforNetworkLayer");
4167 g_warning("menu_name_resolution_changed: No menu found, path= /Menubar/ViewMenu/NameResolution/EnableforNetworkLayer");
4169 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags.network_name);
4171 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforTransportLayer");
4173 g_warning("menu_name_resolution_changed: No menu found, path= /Menubar/ViewMenu/NameResolution/EnableforTransportLayer");
4175 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags.transport_name);
4177 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/UseExternalNetworkNameResolver");
4179 g_warning("menu_name_resolution_changed: No menu found, path= /Menubar/ViewMenu/NameResolution/UseExternalNetworkNameResolver");
4181 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags.use_external_net_name_resolver);
4185 menu_name_resolution_update_cb(GtkAction *action _U_, gpointer data _U_)
4187 menu_name_resolution_changed();
4191 name_resolution_cb(GtkWidget *w, gpointer d _U_, gboolean* res_flag)
4193 if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w))) {
4199 packet_list_recreate();
4200 redraw_packet_bytes_all();
4205 menu_auto_scroll_live_changed(gboolean auto_scroll_live_in)
4209 /* tell menu about it */
4210 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/AutoScrollinLiveCapture");
4212 g_warning("menu_auto_scroll_live_changed: No menu found, path= /Menubar/ViewMenu/AutoScrollinLiveCapture");
4214 if( ((gboolean) gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu)) != auto_scroll_live_in) ) {
4215 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), auto_scroll_live_in);
4218 #endif /*HAVE_LIBPCAP */
4224 menu_colorize_changed(gboolean packet_list_colorize)
4228 /* tell menu about it */
4229 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizePacketList");
4231 g_warning("menu_colorize_changed: No menu found, path= /Menubar/ViewMenu/ColorizePacketList");
4233 if( (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu)) != packet_list_colorize) ) {
4234 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), packet_list_colorize);
4239 colorize_cb(GtkWidget *w, gpointer d _U_)
4241 main_colorize_changed(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w)));
4245 /* the recent file read has finished, update the menu corresponding */
4247 menu_recent_read_finished(void)
4251 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/MainToolbar");
4253 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/MainToolbar");
4255 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.main_toolbar_show);
4257 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/FilterToolbar");
4259 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/FilterToolbar");
4261 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.filter_toolbar_show);
4263 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/WirelessToolbar");
4265 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/WirelessToolbar");
4267 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.wireless_toolbar_show);
4271 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/StatusBar");
4273 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/StatusBar");
4275 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.statusbar_show);
4278 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketList");
4280 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/PacketList");
4282 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.packet_list_show);
4285 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketDetails");
4287 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/PacketDetails");
4289 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.tree_view_show);
4292 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketBytes");
4294 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/PacketBytes");
4296 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.byte_view_show);
4299 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizePacketList");
4301 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/ColorizePacketList");
4303 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.packet_list_colorize);
4306 menu_name_resolution_changed();
4309 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/AutoScrollinLiveCapture");
4311 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/AutoScrollinLiveCapture");
4313 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), auto_scroll_live);
4316 main_widgets_rearrange();
4318 /* Update the time format if we had a command line value. */
4319 if (global_dissect_options.time_format != TS_NOT_SET) {
4320 recent.gui_time_format = global_dissect_options.time_format;
4324 timestamp_set_type(recent.gui_time_format);
4325 /* This call adjusts column width */
4326 cf_timestamp_auto_precision(&cfile);
4327 packet_list_queue_draw();
4328 /* the actual precision will be set in packet_list_queue_draw() below */
4329 if (recent.gui_time_precision > TS_PREC_FIXED_NSEC) {
4330 timestamp_set_precision(TS_PREC_AUTO);
4332 timestamp_set_precision(recent.gui_time_precision);
4334 /* This call adjusts column width */
4335 cf_timestamp_auto_precision(&cfile);
4336 packet_list_queue_draw();
4338 /* don't change the seconds format, if we had a command line value */
4339 if (timestamp_get_seconds_type() != TS_SECONDS_NOT_SET) {
4340 recent.gui_seconds_format = timestamp_get_seconds_type();
4342 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes");
4344 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes");
4347 switch (recent.gui_seconds_format) {
4348 case TS_SECONDS_DEFAULT:
4349 recent.gui_seconds_format = (ts_seconds_type)-1;
4350 /* set_active will not trigger the callback when deactivating an inactive item! */
4351 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
4352 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
4354 case TS_SECONDS_HOUR_MIN_SEC:
4355 recent.gui_seconds_format = (ts_seconds_type)-1;
4356 /* set_active will not trigger the callback when activating an active item! */
4357 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
4358 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
4361 g_assert_not_reached();
4364 main_colorize_changed(recent.packet_list_colorize);
4369 popup_menu_handler(GtkWidget *widget, GdkEvent *event, gpointer data)
4371 GtkWidget *menu = (GtkWidget *)data;
4372 GdkEventButton *event_button = NULL;
4375 if(widget == NULL || event == NULL || data == NULL) {
4380 * If we ever want to make the menu differ based on what row
4381 * and/or column we're above, we'd use "eth_clist_get_selection_info()"
4382 * to find the row and column number for the coordinates; a CTree is,
4383 * I guess, like a CList with one column(?) and the expander widget
4386 /* Check if we are on packet_list object */
4387 if (widget == g_object_get_data(G_OBJECT(popup_menu_object), E_MPACKET_LIST_KEY) &&
4388 ((GdkEventButton *)event)->button != 1) {
4390 if (packet_list_get_event_row_column((GdkEventButton *)event, &physical_row, &row, &column)) {
4391 g_object_set_data(G_OBJECT(popup_menu_object), E_MPACKET_LIST_ROW_KEY,
4392 GINT_TO_POINTER(row));
4393 g_object_set_data(G_OBJECT(popup_menu_object), E_MPACKET_LIST_COL_KEY,
4394 GINT_TO_POINTER(column));
4395 packet_list_set_selected_row(row);
4399 /* Check if we are on tree_view object */
4400 if (widget == tree_view_gbl) {
4401 tree_view_select(widget, (GdkEventButton *) event);
4404 /* context menu handler */
4405 if(event->type == GDK_BUTTON_PRESS) {
4406 event_button = (GdkEventButton *) event;
4408 /* To quote the "Gdk Event Structures" doc:
4409 * "Normally button 1 is the left mouse button, 2 is the middle button, and 3 is the right button" */
4410 if(event_button->button == 3) {
4411 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
4412 event_button->button,
4413 event_button->time);
4414 g_signal_stop_emission_by_name(widget, "button_press_event");
4419 /* Check if we are on byte_view object */
4420 if(widget == get_notebook_bv_ptr(byte_nb_ptr_gbl)) {
4421 byte_view_select(widget, (GdkEventButton *) event);
4424 /* GDK_2BUTTON_PRESS is a doubleclick -> expand/collapse tree row */
4425 /* GTK version 1 seems to be doing this automatically */
4426 if (widget == tree_view_gbl && event->type == GDK_2BUTTON_PRESS) {
4429 if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget),
4430 (gint) (((GdkEventButton *)event)->x),
4431 (gint) (((GdkEventButton *)event)->y),
4432 &path, NULL, NULL, NULL))
4434 if (gtk_tree_view_row_expanded(GTK_TREE_VIEW(widget), path))
4435 gtk_tree_view_collapse_row(GTK_TREE_VIEW(widget), path);
4437 gtk_tree_view_expand_row(GTK_TREE_VIEW(widget), path,
4439 gtk_tree_path_free(path);
4445 /* Enable or disable menu items based on whether you have a capture file
4446 you've finished reading and, if you have one, whether it's been saved
4447 and whether it could be saved except by copying the raw packet data. */
4449 set_menus_for_capture_file(capture_file *cf)
4451 if (cf == NULL || cf->state == FILE_READ_IN_PROGRESS) {
4452 /* We have no capture file or we're currently reading a file */
4453 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Merge", FALSE);
4454 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Close", FALSE);
4455 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Save", FALSE);
4456 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/SaveAs", FALSE);
4457 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportSpecifiedPackets", FALSE);
4458 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportPacketDissections", FALSE);
4459 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportSelectedPacketBytes", FALSE);
4460 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportSSLSessionKeys", FALSE);
4461 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportObjectsMenu", FALSE);
4462 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportPDUs", FALSE);
4463 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/Reload", FALSE);
4465 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Merge", cf_can_write_with_wiretap(cf));
4466 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Close", TRUE);
4467 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Save",
4469 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/SaveAs",
4470 cf_can_save_as(cf));
4472 * "Export Specified Packets..." should be available only if
4473 * we can write the file out in at least one format.
4475 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportSpecifiedPackets",
4476 cf_can_write_with_wiretap(cf));
4477 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportPacketDissections", TRUE);
4478 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportSelectedPacketBytes", TRUE);
4479 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportSSLSessionKeys", TRUE);
4480 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportObjectsMenu", TRUE);
4481 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportPDUs", TRUE);
4482 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/Reload", TRUE);
4486 /* Enable or disable menu items based on whether there's a capture in
4489 set_menus_for_capture_in_progress(gboolean capture_in_progress)
4491 /* Either a capture was started or stopped; in either case, it's not
4492 in the process of stopping, so allow quitting. */
4493 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Quit",
4496 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Open",
4497 !capture_in_progress);
4498 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/OpenRecent",
4499 !capture_in_progress);
4500 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportPacketDissections",
4501 capture_in_progress);
4502 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportSelectedPacketBytes",
4503 capture_in_progress);
4504 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportSSLSessionKeys",
4505 capture_in_progress);
4506 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/ExportObjectsMenu",
4507 capture_in_progress);
4508 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set",
4509 !capture_in_progress);
4510 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortAscending",
4511 !capture_in_progress);
4512 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortDescending",
4513 !capture_in_progress);
4514 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/NoSorting",
4515 !capture_in_progress);
4518 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Options",
4519 !capture_in_progress);
4520 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Start",
4521 !capture_in_progress && global_capture_opts.num_selected > 0);
4522 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Stop",
4523 capture_in_progress);
4524 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Restart",
4525 capture_in_progress);
4526 #endif /* HAVE_LIBPCAP */
4531 set_menus_capture_start_sensitivity(gboolean enable)
4533 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Start",
4538 /* Disable menu items while we're waiting for the capture child to
4539 finish. We disallow quitting until it finishes, and also disallow
4540 stopping or restarting the capture. */
4542 set_menus_for_capture_stopping(void)
4544 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Quit",
4547 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Stop",
4549 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Restart",
4551 #endif /* HAVE_LIBPCAP */
4556 set_menus_for_captured_packets(gboolean have_captured_packets)
4558 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Print",
4559 have_captured_packets);
4560 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/Print",
4561 have_captured_packets);
4563 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPacket",
4564 have_captured_packets);
4565 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindNext",
4566 have_captured_packets);
4567 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPrevious",
4568 have_captured_packets);
4569 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ZoomIn",
4570 have_captured_packets);
4571 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ZoomOut",
4572 have_captured_packets);
4573 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/NormalSize",
4574 have_captured_packets);
4575 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/Goto",
4576 have_captured_packets);
4577 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/PreviousPacket",
4578 have_captured_packets);
4579 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/NextPacket",
4580 have_captured_packets);
4581 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/FirstPacket",
4582 have_captured_packets);
4583 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/LastPacket",
4584 have_captured_packets);
4585 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/PreviousPacketInConversation",
4586 have_captured_packets);
4587 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/NextPacketInConversation",
4588 have_captured_packets);
4589 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/StatisticsMenu/Summary",
4590 have_captured_packets);
4591 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/StatisticsMenu/ShowCommentsSummary",
4592 have_captured_packets);
4593 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/StatisticsMenu/ProtocolHierarchy",
4594 have_captured_packets);
4598 set_menus_for_selected_packet(capture_file *cf)
4600 GList *conv_filter_list_entry;
4602 gboolean properties = FALSE;
4603 const char *abbrev = NULL;
4605 gboolean is_ip = FALSE, is_tcp = FALSE, is_udp = FALSE, is_sctp = FALSE, is_ssl = FALSE, is_lte_rlc = FALSE, is_http = FALSE;
4607 /* Making the menu context-sensitive allows for easier selection of the
4608 desired item and has the added benefit, with large captures, of
4609 avoiding needless looping through huge lists for marked, ignored,
4610 or time-referenced packets. */
4611 gboolean frame_selected = cf->current_frame != NULL;
4612 /* A frame is selected */
4613 gboolean have_marked = frame_selected && cf->marked_count > 0;
4614 /* We have marked frames. (XXX - why check frame_selected?) */
4615 gboolean another_is_marked = have_marked &&
4616 !(cf->marked_count == 1 && cf->current_frame->flags.marked);
4617 /* We have a marked frame other than the current frame (i.e.,
4618 we have at least one marked frame, and either there's more
4619 than one marked frame or the current frame isn't marked). */
4620 gboolean have_time_ref = cf->ref_time_count > 0;
4621 gboolean another_is_time_ref = frame_selected && have_time_ref &&
4622 !(cf->ref_time_count == 1 && cf->current_frame->flags.ref_time);
4623 /* We have a time reference frame other than the current frame (i.e.,
4624 we have at least one time reference frame, and either there's more
4625 than one time reference frame or the current frame isn't a
4626 time reference frame). (XXX - why check frame_selected?) */
4629 proto_get_frame_protocols(cf->edt->pi.layers, &is_ip, &is_tcp, &is_udp, &is_sctp, &is_ssl, NULL, &is_lte_rlc);
4630 is_http = proto_is_frame_protocol(cf->edt->pi.layers, "http");
4632 if (cf->edt && cf->edt->tree) {
4634 header_field_info *hfinfo;
4638 ga = proto_all_finfos(cf->edt->tree);
4640 for (ii = ga->len - 1; ii > 0 ; ii -= 1) {
4642 v = (field_info *)g_ptr_array_index (ga, ii);
4645 if (!g_str_has_prefix(hfinfo->abbrev, "text") &&
4646 !g_str_has_prefix(hfinfo->abbrev, "_ws.expert") &&
4647 !g_str_has_prefix(hfinfo->abbrev, "_ws.malformed")) {
4649 if (hfinfo->parent == -1) {
4650 abbrev = hfinfo->abbrev;
4652 abbrev = proto_registrar_get_abbrev(hfinfo->parent);
4654 properties = prefs_is_registered_protocol(abbrev);
4660 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/MarkPacket",
4662 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/MarkPacket",
4664 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/MarkAllDisplayedPackets",
4665 cf->displayed_count > 0);
4666 /* Unlike un-ignore, do not allow unmark of all frames when no frames are displayed */
4667 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/UnmarkAllDisplayedPackets",
4669 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindNextMark",
4671 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPreviousMark",
4674 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/IgnorePacket",
4676 #ifdef WANT_PACKET_EDITOR
4677 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/EditPacket",
4678 prefs.gui_packet_editor ? frame_selected : FALSE);
4679 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/EditPacket",
4680 prefs.gui_packet_editor ? frame_selected : FALSE);
4681 #endif /* WANT_PACKET_EDITOR */
4682 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/AddEditPktComment",
4683 frame_selected && wtap_dump_can_write(cf->linktypes, WTAP_COMMENT_PER_PACKET));
4684 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/AddEditCaptureComment",
4685 frame_selected && wtap_dump_can_write(cf->linktypes, WTAP_COMMENT_PER_PACKET));
4686 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/IgnorePacket",
4688 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/IgnoreAllDisplayedPackets",
4689 cf->displayed_count > 0 && cf->displayed_count != cf->count);
4690 /* Allow un-ignore of all frames even with no frames currently displayed */
4691 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Un-IgnoreAllPackets",
4692 cf->ignored_count > 0);
4694 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/SetTimeReference",
4696 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Un-TimeReferenceAllPackets",
4698 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/TimeShift",
4700 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/SetTimeReference",
4702 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindNextTimeReference",
4703 another_is_time_ref);
4704 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPreviousTimeReference",
4705 another_is_time_ref);
4707 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ResizeAllColumns",
4709 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/CollapseAll",
4711 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/CollapseAll",
4713 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ExpandAll",
4715 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ExpandAll",
4717 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizeConversation",
4719 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ResetColoring1-10",
4720 tmp_color_filters_used());
4721 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ShowPacketinNewWindow",
4723 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ShowPacketinNewWindow",
4725 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ManuallyResolveAddress",
4726 frame_selected ? is_ip : FALSE);
4727 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/SCTP",
4728 frame_selected ? is_sctp : FALSE);
4729 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/FollowTCPStream",
4731 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FollowTCPStream",
4733 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/FollowUDPStream",
4734 frame_selected ? is_udp : FALSE);
4735 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/FollowSSLStream",
4736 frame_selected ? is_ssl : FALSE);
4737 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/FollowHTTPStream",
4738 frame_selected ? is_http : FALSE);
4740 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FollowSSLStream",
4741 frame_selected ? is_ssl : FALSE);
4742 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FollowUDPStream",
4743 frame_selected ? is_udp : FALSE);
4744 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FollowHTTPStream",
4745 frame_selected ? is_http : FALSE);
4747 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation",
4749 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/DecodeAs",
4750 frame_selected && decode_as_ok());
4753 prev_abbrev = (char *)g_object_get_data(G_OBJECT(ui_manager_packet_list_menu), "menu_abbrev");
4754 if (!prev_abbrev || (strcmp(prev_abbrev, abbrev) != 0)) {
4755 /*No previous protocol or protocol changed - update Protocol Preferences menu*/
4756 module_t *prefs_module_p = prefs_find_module(abbrev);
4757 rebuild_protocol_prefs_menu(prefs_module_p, properties, ui_manager_packet_list_menu, "/PacketListMenuPopup/ProtocolPreferences");
4759 g_object_set_data(G_OBJECT(ui_manager_packet_list_menu), "menu_abbrev", g_strdup(abbrev));
4760 g_free (prev_abbrev);
4764 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ProtocolPreferences",
4766 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/DecodeAs",
4767 frame_selected && decode_as_ok());
4768 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/Copy",
4770 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ApplyAsFilter",
4772 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/PrepareaFilter",
4774 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ResolveName",
4775 frame_selected && (gbl_resolv_flags.mac_name || gbl_resolv_flags.network_name ||
4776 gbl_resolv_flags.transport_name));
4777 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/FollowTCPStream",
4779 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/FollowUDPStream",
4780 frame_selected ? is_udp : FALSE);
4781 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/FollowSSLStream",
4782 frame_selected ? is_ssl : FALSE);
4783 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/FollowHTTPStream",
4784 frame_selected ? is_http : FALSE);
4785 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/DecodeAs",
4786 frame_selected && decode_as_ok());
4787 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/ResolveName",
4788 frame_selected && (gbl_resolv_flags.mac_name || gbl_resolv_flags.network_name ||
4789 gbl_resolv_flags.transport_name));
4790 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ToolsMenu/FirewallACLRules",
4792 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/StatisticsMenu/TCPStreamGraphMenu",
4794 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/TelephonyMenu/LTEmenu/LTE_RLC_Graph",
4797 for (i = 0, conv_filter_list_entry = conv_filter_list;
4798 conv_filter_list_entry != NULL;
4799 conv_filter_list_entry = g_list_next(conv_filter_list_entry), i++) {
4800 conversation_filter_t *filter_entry;
4803 filter_entry = (conversation_filter_t *)conv_filter_list_entry->data;
4804 path = g_strdup_printf("/Menubar/AnalyzeMenu/ConversationFilterMenu/Filters/filter-%u", i);
4805 set_menu_sensitivity(ui_manager_main_menubar, path,
4806 menu_dissector_filter_spe_cb(/* frame_data *fd _U_*/ NULL, cf->edt, filter_entry));
4809 path = g_strdup_printf("/PacketListMenuPopup/ConversationFilter/Conversations/color_conversation-%d", i);
4810 set_menu_sensitivity(ui_manager_packet_list_menu, path,
4811 menu_color_dissector_filter_spe_cb(NULL, cf->edt, filter_entry));
4814 path = g_strdup_printf("/PacketListMenuPopup/ColorizeConversation/Colorize/%s", filter_entry->display_name);
4815 set_menu_sensitivity(ui_manager_packet_list_menu, path,
4816 menu_color_dissector_filter_spe_cb(NULL, cf->edt, filter_entry));
4823 menu_prefs_toggle_bool (GtkWidget *w, gpointer data)
4825 pref_t *pref = (pref_t*)data;
4826 module_t *module = (module_t *)g_object_get_data (G_OBJECT(w), "module");
4828 module->prefs_changed = TRUE;
4829 prefs_invert_bool_value(pref, pref_current);
4831 prefs_apply (module);
4832 if (!prefs.gui_use_pref_save) {
4835 redissect_packets();
4836 redissect_all_packet_windows();
4840 menu_prefs_change_enum (GtkWidget *w, gpointer data)
4842 pref_t *pref = (pref_t*)data;
4843 module_t *module = (module_t *)g_object_get_data (G_OBJECT(w), "module");
4844 gint new_value = GPOINTER_TO_INT(g_object_get_data (G_OBJECT(w), "enumval"));
4846 if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM(w)))
4849 if (prefs_set_enum_value(pref, new_value, pref_current)) {
4850 module->prefs_changed = TRUE;
4852 prefs_apply (module);
4853 if (!prefs.gui_use_pref_save) {
4856 redissect_packets();
4857 redissect_all_packet_windows();
4862 menu_prefs_reset(void)
4864 g_free (g_object_get_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev"));
4865 g_object_set_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev", NULL);
4869 menu_prefs_change_ok (GtkWidget *w, gpointer parent_w)
4871 GtkWidget *entry = (GtkWidget *)g_object_get_data (G_OBJECT(w), "entry");
4872 module_t *module = (module_t *)g_object_get_data (G_OBJECT(w), "module");
4873 pref_t *pref = (pref_t *)g_object_get_data (G_OBJECT(w), "pref");
4874 const gchar *new_value = gtk_entry_get_text(GTK_ENTRY(entry));
4878 switch (prefs_get_type(pref)) {
4880 uval = (guint)strtoul(new_value, &p, prefs_get_uint_base(pref));
4881 if (p == new_value || *p != '\0') {
4882 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
4883 "The value \"%s\" isn't a valid number.",
4887 module->prefs_changed |= prefs_set_uint_value(pref, uval, pref_current);
4890 module->prefs_changed |= prefs_set_string_value(pref, new_value, pref_current);
4893 if (!prefs_set_range_value_work(pref, new_value, TRUE, &module->prefs_changed)) {
4894 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
4895 "The value \"%s\" isn't a valid range.",
4901 g_assert_not_reached();
4905 if (module->prefs_changed) {
4906 /* Ensure we reload the sub menu */
4908 prefs_apply (module);
4909 if (!prefs.gui_use_pref_save) {
4912 redissect_packets();
4913 redissect_all_packet_windows();
4916 window_destroy(GTK_WIDGET(parent_w));
4920 menu_prefs_change_cancel (GtkWidget *w _U_, gpointer parent_w)
4922 window_destroy(GTK_WIDGET(parent_w));
4926 menu_prefs_edit_dlg (GtkWidget *w, gpointer data)
4928 pref_t *pref = (pref_t *)data;
4929 module_t *module = (module_t *)g_object_get_data (G_OBJECT(w), "module");
4930 gchar *value = NULL, *label_str;
4932 GtkWidget *win, *main_grid, *main_vb, *bbox, *cancel_bt, *ok_bt;
4933 GtkWidget *entry, *label;
4935 value = prefs_pref_to_str(pref, pref_current);
4937 win = dlg_window_new(module->description);
4939 gtk_window_set_resizable(GTK_WINDOW(win),FALSE);
4940 gtk_window_resize(GTK_WINDOW(win), 400, 100);
4942 main_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 5, FALSE);
4943 gtk_container_add(GTK_CONTAINER(win), main_vb);
4944 gtk_container_set_border_width(GTK_CONTAINER(main_vb), 6);
4946 main_grid = ws_gtk_grid_new();
4947 gtk_box_pack_start(GTK_BOX(main_vb), main_grid, FALSE, FALSE, 0);
4948 ws_gtk_grid_set_column_spacing(GTK_GRID(main_grid), 10);
4950 label_str = g_strdup_printf("%s:", prefs_get_title(pref));
4951 label = gtk_label_new(label_str);
4953 ws_gtk_grid_attach_defaults(GTK_GRID(main_grid), label, 0, 1, 1, 1);
4954 gtk_misc_set_alignment(GTK_MISC(label), 1.0f, 0.5f);
4955 if (prefs_get_description(pref))
4956 gtk_widget_set_tooltip_text(label, prefs_get_description(pref));
4958 entry = gtk_entry_new();
4959 ws_gtk_grid_attach_defaults(GTK_GRID(main_grid), entry, 1, 1, 1, 1);
4960 gtk_entry_set_text(GTK_ENTRY(entry), value);
4961 if (prefs_get_description(pref))
4962 gtk_widget_set_tooltip_text(entry, prefs_get_description(pref));
4964 bbox = dlg_button_row_new(GTK_STOCK_CANCEL,GTK_STOCK_OK, NULL);
4965 gtk_box_pack_end(GTK_BOX(main_vb), bbox, FALSE, FALSE, 0);
4967 ok_bt = (GtkWidget *)g_object_get_data(G_OBJECT(bbox), GTK_STOCK_OK);
4968 g_object_set_data (G_OBJECT(ok_bt), "module", module);
4969 g_object_set_data (G_OBJECT(ok_bt), "entry", entry);
4970 g_object_set_data (G_OBJECT(ok_bt), "pref", pref);
4971 g_signal_connect(ok_bt, "clicked", G_CALLBACK(menu_prefs_change_ok), win);
4973 dlg_set_activate(entry, ok_bt);
4975 cancel_bt = (GtkWidget *)g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CANCEL);
4976 g_signal_connect(cancel_bt, "clicked", G_CALLBACK(menu_prefs_change_cancel), win);
4977 window_set_cancel_button(win, cancel_bt, NULL);
4979 gtk_widget_grab_default(ok_bt);
4980 gtk_widget_show_all(win);
4985 add_protocol_prefs_generic_menu(pref_t *pref, gpointer data, GtkUIManager *ui_menu, const char *path)
4987 GtkWidget *menu_preferences;
4988 GtkWidget *menu_item, *menu_sub_item, *sub_menu;
4989 GSList *group = NULL;
4990 module_t *module = (module_t *)data;
4991 const enum_val_t *enum_valp;
4992 gchar *label = NULL, *tmp_str;
4994 switch (prefs_get_type(pref)) {
4996 switch (prefs_get_uint_base(pref)) {
4998 label = g_strdup_printf ("%s: %o", prefs_get_title(pref), prefs_get_uint_value_real(pref, pref_current));
5001 label = g_strdup_printf ("%s: %u", prefs_get_title(pref), prefs_get_uint_value_real(pref, pref_current));
5004 label = g_strdup_printf ("%s: %x", prefs_get_title(pref), prefs_get_uint_value_real(pref, pref_current));
5007 g_assert_not_reached();
5010 menu_item = gtk_menu_item_new_with_label(label);
5011 g_object_set_data (G_OBJECT(menu_item), "module", module);
5012 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_edit_dlg), pref);
5016 menu_item = gtk_check_menu_item_new_with_label(prefs_get_title(pref));
5017 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(menu_item), prefs_get_bool_value(pref, pref_current));
5018 g_object_set_data (G_OBJECT(menu_item), "module", module);
5019 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_toggle_bool), pref);
5022 menu_item = gtk_menu_item_new_with_label(prefs_get_title(pref));
5023 sub_menu = gtk_menu_new();
5024 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_item), sub_menu);
5025 enum_valp = prefs_get_enumvals(pref);
5026 while (enum_valp->name != NULL) {
5027 menu_sub_item = gtk_radio_menu_item_new_with_label(group, enum_valp->description);
5028 group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_sub_item));
5029 if (enum_valp->value == prefs_get_enum_value(pref, pref_current)) {
5030 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(menu_sub_item), TRUE);
5032 g_object_set_data (G_OBJECT(menu_sub_item), "module", module);
5033 g_object_set_data (G_OBJECT(menu_sub_item), "enumval", GINT_TO_POINTER(enum_valp->value));
5034 g_signal_connect(menu_sub_item, "activate", G_CALLBACK(menu_prefs_change_enum), pref);
5035 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_sub_item);
5036 gtk_widget_show (menu_sub_item);
5041 label = g_strdup_printf ("%s: %s", prefs_get_title(pref), prefs_get_string_value(pref, pref_current));
5042 menu_item = gtk_menu_item_new_with_label(label);
5043 g_object_set_data (G_OBJECT(menu_item), "module", module);
5044 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_edit_dlg), pref);
5048 tmp_str = range_convert_range (NULL, prefs_get_range_value_real(pref, pref_current));
5049 label = g_strdup_printf ("%s: %s", prefs_get_title(pref), tmp_str);
5050 wmem_free(NULL, tmp_str);
5051 menu_item = gtk_menu_item_new_with_label(label);
5052 g_object_set_data (G_OBJECT(menu_item), "module", module);
5053 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_edit_dlg), pref);
5057 label = g_strdup_printf ("%s...", prefs_get_title(pref));
5058 menu_item = gtk_menu_item_new_with_label(label);
5059 g_signal_connect (menu_item, "activate", G_CALLBACK(uat_window_cb), prefs_get_uat_value(pref));
5065 /* currently not supported */
5067 case PREF_STATIC_TEXT:
5070 /* Nothing to add */
5074 menu_preferences = gtk_ui_manager_get_widget(ui_menu, path);
5075 if(!menu_preferences)
5076 g_warning("menu_preferences Not found path");
5077 sub_menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM(menu_preferences));
5078 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5079 gtk_widget_show (menu_item);
5085 add_protocol_prefs_menu(pref_t *pref, gpointer data)
5087 return add_protocol_prefs_generic_menu(pref, data, ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences");
5091 add_protocol_prefs_packet_list_menu(pref_t *pref, gpointer data)
5093 return add_protocol_prefs_generic_menu(pref, data, ui_manager_packet_list_menu, "/PacketListMenuPopup/ProtocolPreferences");
5098 rebuild_protocol_prefs_menu(module_t *prefs_module_p, gboolean preferences,
5099 GtkUIManager *ui_menu, const char *path)
5101 GtkWidget *menu_preferences, *menu_item;
5102 GtkWidget *sub_menu;
5105 menu_preferences = gtk_ui_manager_get_widget(ui_menu, path);
5106 if (prefs_module_p && preferences) {
5107 sub_menu = gtk_menu_new();
5108 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_preferences), sub_menu);
5110 label = g_strdup_printf ("%s Preferences...", prefs_module_p->description);
5111 menu_item = gtk_image_menu_item_new_with_label(label);
5112 gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM(menu_item),
5113 ws_gtk_image_new_from_stock(GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_MENU));
5114 gtk_menu_shell_append(GTK_MENU_SHELL(sub_menu), menu_item);
5115 g_signal_connect_swapped(G_OBJECT(menu_item), "activate",
5116 G_CALLBACK(properties_cb), (GObject *) menu_item);
5117 gtk_widget_show(menu_item);
5120 menu_item = gtk_menu_item_new();
5121 gtk_menu_shell_append(GTK_MENU_SHELL(sub_menu), menu_item);
5122 gtk_widget_show(menu_item);
5124 if (ui_menu == ui_manager_tree_view_menu) {
5125 prefs_pref_foreach(prefs_module_p, add_protocol_prefs_menu, prefs_module_p);
5127 prefs_pref_foreach(prefs_module_p, add_protocol_prefs_packet_list_menu, prefs_module_p);
5130 /* No preferences, remove sub menu */
5131 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_preferences), NULL);
5137 menu_visible_column_toggle (GtkWidget *w _U_, gpointer data)
5139 packet_list_toggle_visible_column (GPOINTER_TO_INT(data));
5143 rebuild_visible_columns_menu (void)
5145 GtkWidget *menu_columns[2], *menu_item;
5146 GtkWidget *sub_menu;
5152 menu_columns[0] = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/DisplayedColumns");
5153 if(! menu_columns[0]){
5154 fprintf (stderr, "Warning: couldn't find menu_columns[0] path=/Menubar/ViewMenu/DisplayedColumns");
5156 menu_columns[1] = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/DisplayedColumns");
5158 if(! menu_columns[1]){
5159 fprintf (stderr, "Warning: couldn't find menu_columns[1] path=/PacketListHeadingPopup/DisplayedColumns");
5162 for (i = 0; i < 2; i++) {
5163 sub_menu = gtk_menu_new();
5164 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_columns[i]), sub_menu);
5166 clp = g_list_first (prefs.col_list);
5169 cfmt = (fmt_data *) clp->data;
5170 if (cfmt->title[0]) {
5171 if (cfmt->fmt == COL_CUSTOM) {
5172 title = g_strdup_printf ("%s (%s)", cfmt->title, cfmt->custom_fields);
5174 title = g_strdup_printf ("%s (%s)", cfmt->title, col_format_desc (cfmt->fmt));
5177 if (cfmt->fmt == COL_CUSTOM) {
5178 title = g_strdup_printf ("(%s)", cfmt->custom_fields);
5180 title = g_strdup_printf ("(%s)", col_format_desc (cfmt->fmt));
5183 menu_item = gtk_check_menu_item_new_with_label(title);
5185 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(menu_item), cfmt->visible);
5186 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_visible_column_toggle), GINT_TO_POINTER(col_id));
5187 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5188 gtk_widget_show (menu_item);
5189 clp = g_list_next (clp);
5193 menu_item = gtk_separator_menu_item_new();
5194 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5195 gtk_widget_show (menu_item);
5197 menu_item = gtk_menu_item_new_with_label ("Display All");
5198 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5199 g_signal_connect(menu_item, "activate", G_CALLBACK(packet_list_heading_activate_all_columns_cb), NULL);
5200 gtk_widget_show (menu_item);
5205 menus_set_column_resolved (gboolean resolved, gboolean can_resolve)
5209 menu = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ShowResolved");
5211 fprintf (stderr, "Warning: couldn't find menu path=/PacketListHeadingPopup/ShowResolved");
5213 g_object_set_data(G_OBJECT(menu), "skip-update", (void *)1);
5214 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), resolved && can_resolve);
5215 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ShowResolved", can_resolve);
5216 g_object_set_data(G_OBJECT(menu), "skip-update", NULL);
5220 menus_set_column_align_default (gboolean right_justify)
5222 GtkWidget *submenu, *menu_item_child;
5223 GList *child_list, *child_list_item;
5224 const gchar *menu_item_name;
5225 size_t menu_item_len;
5227 /* get the submenu container item */
5228 submenu = gtk_ui_manager_get_widget (ui_manager_packet_list_heading, "/PacketListHeadingPopup");
5230 fprintf (stderr, "Warning: couldn't find submenu path=/PacketListHeadingPopup");
5233 /* find the corresponding menu items to update */
5234 child_list = gtk_container_get_children(GTK_CONTAINER(submenu));
5235 child_list_item = child_list;
5236 while (child_list_item) {
5237 menu_item_child = gtk_bin_get_child(GTK_BIN(child_list_item->data));
5238 if (menu_item_child != NULL) {
5239 menu_item_name = gtk_label_get_text(GTK_LABEL(menu_item_child));
5240 menu_item_len = strlen(menu_item_name);
5241 if(strncmp(menu_item_name, "Align Left", 10) == 0) {
5242 if (!right_justify && menu_item_len == 10) {
5243 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Left\t(default)");
5244 } else if (right_justify && menu_item_len > 10) {
5245 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Left");
5247 } else if (strncmp (menu_item_name, "Align Right", 11) == 0) {
5248 if (right_justify && menu_item_len == 11) {
5249 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Right\t(default)");
5250 } else if (!right_justify && menu_item_len > 11) {
5251 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Right");
5255 child_list_item = g_list_next(child_list_item);
5257 g_list_free(child_list);
5261 set_menus_for_selected_tree_row(capture_file *cf)
5263 gboolean properties;
5266 if (cf->finfo_selected != NULL) {
5267 header_field_info *hfinfo = cf->finfo_selected->hfinfo;
5271 if (hfinfo->parent == -1) {
5272 abbrev = hfinfo->abbrev;
5273 id = (hfinfo->type == FT_PROTOCOL) ? proto_get_id((protocol_t *)hfinfo->strings) : -1;
5275 abbrev = proto_registrar_get_abbrev(hfinfo->parent);
5276 id = hfinfo->parent;
5278 properties = prefs_is_registered_protocol(abbrev);
5279 set_menu_sensitivity(ui_manager_tree_view_menu,
5280 "/TreeViewPopup/GotoCorrespondingPacket", hfinfo->type == FT_FRAMENUM);
5281 set_menu_sensitivity(ui_manager_tree_view_menu,
5282 "/TreeViewPopup/ShowPacketRefinNewWindow", hfinfo->type == FT_FRAMENUM);
5283 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/Copy",
5285 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/Copy/AsFilter",
5286 proto_can_match_selected(cf->finfo_selected, cf->edt));
5287 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyasColumn",
5288 hfinfo->type != FT_NONE);
5289 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter",
5290 proto_can_match_selected(cf->finfo_selected, cf->edt));
5291 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter",
5292 proto_can_match_selected(cf->finfo_selected, cf->edt));
5293 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ColorizewithFilter",
5294 proto_can_match_selected(cf->finfo_selected, cf->edt));
5295 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences",
5297 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/DisableProtocol",
5298 (id == -1) ? FALSE : proto_can_toggle_protocol(id));
5299 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ExpandSubtrees",
5300 cf->finfo_selected->tree_type != -1);
5301 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/CollapseSubtrees",
5302 cf->finfo_selected->tree_type != -1);
5303 #ifdef WANT_PACKET_EDITOR
5304 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/EditPacket",
5305 prefs.gui_packet_editor ? TRUE : FALSE);
5307 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/WikiProtocolPage",
5308 (id == -1) ? FALSE : TRUE);
5309 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FilterFieldReference",
5310 (id == -1) ? FALSE : TRUE);
5311 set_menu_sensitivity(ui_manager_main_menubar,
5312 "/Menubar/FileMenu/ExportSelectedPacketBytes", TRUE);
5313 set_menu_sensitivity(ui_manager_main_menubar,
5314 "/Menubar/GoMenu/GotoCorrespondingPacket", hfinfo->type == FT_FRAMENUM);
5315 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Description",
5316 proto_can_match_selected(cf->finfo_selected, cf->edt));
5317 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Fieldname",
5318 proto_can_match_selected(cf->finfo_selected, cf->edt));
5319 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Value",
5320 proto_can_match_selected(cf->finfo_selected, cf->edt));
5321 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/AsFilter",
5322 proto_can_match_selected(cf->finfo_selected, cf->edt));
5323 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ApplyasColumn",
5324 hfinfo->type != FT_NONE);
5325 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ApplyAsFilter",
5326 proto_can_match_selected(cf->finfo_selected, cf->edt));
5327 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/PrepareaFilter",
5328 proto_can_match_selected(cf->finfo_selected, cf->edt));
5329 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ExpandSubtrees",
5330 cf->finfo_selected->tree_type != -1);
5331 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/CollapseSubtrees",
5332 cf->finfo_selected->tree_type != -1);
5333 prev_abbrev = (char *)g_object_get_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev");
5334 if (!prev_abbrev || (strcmp (prev_abbrev, abbrev) != 0)) {
5335 /* No previous protocol or protocol changed - update Protocol Preferences menu */
5336 module_t *prefs_module_p = prefs_find_module(abbrev);
5337 rebuild_protocol_prefs_menu(prefs_module_p, properties, ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences");
5339 g_object_set_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev", g_strdup(abbrev));
5340 g_free (prev_abbrev);
5343 set_menu_sensitivity(ui_manager_tree_view_menu,
5344 "/TreeViewPopup/GotoCorrespondingPacket", FALSE);
5345 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/Copy", FALSE);
5346 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyasColumn", FALSE);
5347 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter", FALSE);
5348 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter", FALSE);
5349 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ColorizewithFilter", FALSE);
5350 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences",
5352 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/DisableProtocol", FALSE);
5353 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ExpandSubtrees", FALSE);
5354 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/CollapseSubtrees", FALSE);
5355 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/WikiProtocolPage",
5357 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FilterFieldReference",
5359 set_menu_sensitivity(ui_manager_main_menubar,
5360 "/Menubar/FileMenu/ExportSelectedPacketBytes", FALSE);
5361 set_menu_sensitivity(ui_manager_main_menubar,
5362 "/Menubar/GoMenu/GotoCorrespondingPacket", FALSE);
5363 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Description", FALSE);
5364 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Fieldname", FALSE);
5365 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Value", FALSE);
5366 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/AsFilter", FALSE);
5367 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ApplyasColumn", FALSE);
5368 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ApplyAsFilter", FALSE);
5369 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/PrepareaFilter", FALSE);
5370 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ExpandSubtrees", FALSE);
5371 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/CollapseSubtrees", FALSE);
5375 void set_menus_for_packet_history(gboolean back_history, gboolean forward_history)
5377 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/Back", back_history);
5378 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/Forward", forward_history);
5382 void set_menus_for_file_set(gboolean file_set, gboolean previous_file, gboolean next_file)
5384 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set/ListFiles", file_set);
5385 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set/PreviousFile", previous_file);
5386 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set/NextFile", next_file);
5389 GtkWidget *menus_get_profiles_rename_menu (void)
5391 return gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Rename");
5394 GtkWidget *menus_get_profiles_delete_menu (void)
5396 return gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Delete");
5399 GtkWidget *menus_get_profiles_change_menu (void)
5401 return gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Change");
5404 void set_menus_for_profiles(gboolean default_profile)
5406 set_menu_sensitivity(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Rename", !default_profile);
5407 set_menu_sensitivity(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Delete", !default_profile);
5411 ws_menubar_external_cb(GtkAction *action _U_, gpointer data _U_)
5413 ext_menubar_t *entry = NULL;
5418 entry = (ext_menubar_t *)data;
5419 if ( entry->type == EXT_MENUBAR_ITEM )
5421 entry->callback(EXT_MENUBAR_GTK_GUI, (gpointer) ((void *)GTK_WINDOW(top_level)), entry->user_data);
5423 else if ( entry->type == EXT_MENUBAR_URL )
5425 url = (gchar *)entry->user_data;
5428 browser_open_url(url);
5434 ws_menubar_create_ui(ext_menu_t * menu, const char * xpath_parent, GtkActionGroup * action_group, gint depth)
5436 ext_menubar_t * item = NULL;
5437 GList * children = NULL;
5438 gchar * xpath, * submenu_xpath;
5439 GtkAction * menu_action;
5441 gchar ** paths = NULL;
5443 /* There must exists an xpath parent */
5444 g_assert(xpath_parent != NULL && strlen(xpath_parent) > 0);
5446 /* If the depth counter exceeds, something must have gone wrong */
5447 g_assert(depth < EXT_MENUBAR_MAX_DEPTH);
5449 /* Create a correct xpath, and just keep the necessary action ref [which will be paths [1]] */
5450 xpath = g_strconcat(xpath_parent, menu->name, NULL);
5452 /* Create the action for the menu item and add it to the action group */
5453 action_name = g_strconcat("/", menu->name, NULL);
5454 menu_action = (GtkAction *)g_object_new ( GTK_TYPE_ACTION,
5455 "name", action_name, "label", menu->label, NULL );
5456 g_free(action_name);
5458 gtk_action_group_add_action(action_group, menu_action);
5459 g_object_unref(menu_action);
5461 children = menu->children;
5463 /* Iterate children to create submenus */
5464 while ( children != NULL && children->data != NULL )
5466 item = (ext_menubar_t *) children->data;
5468 if ( item->type == EXT_MENUBAR_MENU )
5470 /* Handle Submenu entry */
5471 submenu_xpath = g_strconcat(xpath, "/", NULL);
5472 ws_menubar_create_ui(item, submenu_xpath, action_group, depth++);
5473 g_free(submenu_xpath);
5475 else if ( item->type != EXT_MENUBAR_SEPARATOR )
5477 action_name = g_strconcat("/", item->name, NULL);
5478 menu_action = (GtkAction*) g_object_new( GTK_TYPE_ACTION,
5479 "name", action_name,
5480 "label", item->label,
5481 "tooltip", item->tooltip,
5483 g_signal_connect(menu_action, "activate", G_CALLBACK(ws_menubar_external_cb), item );
5484 gtk_action_group_add_action(action_group, menu_action);
5485 g_object_unref(menu_action);
5486 g_free(action_name);
5488 /* Create the correct action path */
5489 paths = g_strsplit(xpath, "|", -1);
5491 /* Ensures that the above operation has not failed. If this fails, it is a major issue,
5492 * so an assertion is appropriate here */
5493 g_assert(paths != NULL && paths[1] != NULL && strlen(paths[1]) > 0);
5495 /* Handle a menu bar item. This cannot be done by register_menu_bar_menu_items, as it
5496 * will create it's own action group, assuming that the menu actions and submenu actions
5497 * have been pre-registered and globally defined names. This is not the case here. Also
5498 * register_menu_bar_menu_items adds a sorted list, completely destroying any sorting,
5499 * a plugin might have intended */
5501 /* Left here as a reminder, that the code below does basically the same */
5502 register_menu_bar_menu_items( g_strdup(paths[1]), item->name, NULL, item->label,
5503 NULL, item->tooltip, ws_menubar_external_cb, item, TRUE, NULL, NULL);
5506 /* Creating menu from entry */
5507 add_menu_item_to_main_menubar(g_strdup(paths[1]), item->name, NULL);
5512 children = g_list_next(children);
5520 ws_menubar_external_menus(void)
5522 GList * user_menu = NULL;
5523 ext_menu_t * menu = NULL;
5524 GtkActionGroup *action_group = NULL;
5525 gchar groupdef[20], * xpath;
5528 user_menu = ext_menubar_get_entries();
5530 while ( ( user_menu != NULL ) && ( user_menu->data != NULL ) )
5532 menu = (ext_menu_t *) user_menu->data;
5534 /* On this level only menu items should exist. Not doing an assert here,
5535 * as it could be an honest mistake */
5536 if ( menu->type != EXT_MENUBAR_MENU )
5538 user_menu = g_list_next(user_menu);
5542 /* Create unique main actiongroup name */
5543 g_snprintf(groupdef, 20, "UserDefined%02d", cnt);
5544 xpath = g_strconcat( "/MenuBar/", groupdef, "Menu|", NULL );
5546 /* Create an action group per menu */
5547 action_group = gtk_action_group_new(groupdef);
5549 /* Register action structure for each menu */
5550 gtk_ui_manager_insert_action_group(ui_manager_main_menubar, action_group, 0);
5552 /* Now we iterate over the items and add them to the UI. This has to be done after the action
5553 * group for this menu has been added, otherwise the actions will not be found */
5554 ws_menubar_create_ui(menu, xpath, action_group, 0 );
5558 g_object_unref(action_group);
5561 user_menu = g_list_next (user_menu);
5566 void plugin_if_menubar_preference(gconstpointer user_data)
5568 if ( user_data != NULL )
5570 GHashTable * dataSet = (GHashTable *) user_data;
5571 const char * module_name;
5572 const char * pref_name;
5573 const char * pref_value;
5574 if ( g_hash_table_lookup_extended(dataSet, "pref_module", NULL, (void**)&module_name ) &&
5575 g_hash_table_lookup_extended(dataSet, "pref_key", NULL, (void**)&pref_name ) &&
5576 g_hash_table_lookup_extended(dataSet, "pref_value", NULL, (void**)&pref_value ) )
5578 if ( prefs_store_ext(module_name, pref_name, pref_value) )
5580 redissect_packets();
5581 redissect_all_packet_windows();
5593 * indent-tabs-mode: nil
5596 * ex: set shiftwidth=4 tabstop=8 expandtab:
5597 * :indentSize=4:tabSize=8:noTabs=true: