6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 #ifdef MAIN_MENU_USE_UIMANAGER
35 #include <epan/packet.h>
36 #include <epan/addr_resolv.h>
37 #include <epan/prefs.h>
38 #include <epan/prefs-int.h>
40 #include <epan/timestamp.h>
41 #include <epan/etypes.h>
42 #include <epan/ipproto.h>
43 #include <epan/dissector_filters.h>
44 #include <epan/strutil.h>
45 #include <epan/plugins.h>
46 #include <epan/epan_dissect.h>
47 #include <epan/column.h>
50 #include "../ui_util.h"
51 #include "../simple_dialog.h"
52 #include "../main_statusbar.h"
53 #include "../color_filters.h"
54 #include "../stat_menu.h"
57 #include "gtk/about_dlg.h"
58 #include "gtk/capture_dlg.h"
59 #include "gtk/capture_if_dlg.h"
60 #include "gtk/color_dlg.h"
61 #include "gtk/filter_dlg.h"
62 #include "gtk/profile_dlg.h"
63 #include "gtk/dlg_utils.h"
64 #include "gtk/capture_file_dlg.h"
65 #include "gtk/fileset_dlg.h"
66 #include "gtk/file_import_dlg.h"
67 #include "gtk/find_dlg.h"
68 #include "gtk/goto_dlg.h"
69 #include "gtk/summary_dlg.h"
70 #include "gtk/prefs_dlg.h"
71 #include "gtk/packet_win.h"
72 #include "gtk/follow_tcp.h"
73 #include "gtk/follow_udp.h"
74 #include "gtk/follow_ssl.h"
75 #include "gtk/decode_as_dlg.h"
76 #include "gtk/help_dlg.h"
77 #include "gtk/supported_protos_dlg.h"
78 #include "gtk/proto_dlg.h"
79 #include "gtk/proto_hier_stats_dlg.h"
81 #include "gtk/stock_icons.h"
82 #include "gtk/gtkglobals.h"
83 #include "gtk/recent.h"
84 #include "gtk/main_proto_draw.h"
85 #include "gtk/conversations_table.h"
86 #include "gtk/hostlist_table.h"
87 #include "gtk/packet_history.h"
88 #include "gtk/sctp_stat.h"
89 #include "gtk/firewall_dlg.h"
90 #include "gtk/macros_dlg.h"
91 #include "gtk/export_object.h"
92 #include "epan/dissectors/packet-ssl-utils.h"
93 #include "gtk/export_sslkeys.h"
94 #include "gtk/gui_stat_menu.h"
96 #include "gtk/menus.h"
97 #include "gtk/main_toolbar.h"
98 #include "gtk/main_welcome.h"
99 #include "gtk/uat_gui.h"
100 #include "gtk/gui_utils.h"
101 #include "gtk/manual_addr_resolv.h"
102 #include "gtk/proto_help.h"
103 #include "gtk/dissector_tables_dlg.h"
104 #include "gtk/utf8_entities.h"
105 #include "gtk/expert_comp_dlg.h"
106 #include "gtk/time_shift_dlg.h"
108 #include "gtk/new_packet_list.h"
111 #include "capture_opts.h"
112 #include "gtk/capture_globals.h"
114 #ifdef HAVE_IGE_MAC_INTEGRATION
115 #include <ige-mac-menu.h>
118 #ifdef HAVE_GTKOSXAPPLICATION
119 #include <igemacintegration/gtkosxapplication.h>
122 static int initialize = TRUE;
123 GtkActionGroup *main_menu_bar_action_group;
124 static GtkUIManager *ui_manager_main_menubar = NULL;
125 static GtkUIManager *ui_manager_packet_list_heading = NULL;
126 static GtkUIManager *ui_manager_packet_list_menu = NULL;
127 static GtkUIManager *ui_manager_tree_view_menu = NULL;
128 static GtkUIManager *ui_manager_bytes_menu = NULL;
129 static GtkUIManager *ui_manager_statusbar_profiles_menu = NULL;
130 static GSList *popup_menu_list = NULL;
132 static GtkAccelGroup *grp;
134 static GList *merge_lua_menu_items_list = NULL;
136 GtkWidget *popup_menu_object;
138 static void menu_open_recent_file_cmd_cb(GtkAction *action, gpointer data _U_ );
139 static void add_recent_items (guint merge_id, GtkUIManager *ui_manager);
141 static void menus_init(void);
142 static void merge_lua_menu_items(GList *node);
143 static void set_menu_sensitivity (GtkUIManager *ui_manager, const gchar *, gint);
144 static void show_hide_cb(GtkWidget *w, gpointer data, gint action);
145 static void timestamp_seconds_time_cb(GtkWidget *w, gpointer d, gint action);
146 static void name_resolution_cb(GtkWidget *w, gpointer d, gint action);
147 static void colorize_cb(GtkWidget *w, gpointer d);
150 /* As a general GUI guideline, we try to follow the Gnome Human Interface Guidelines, which can be found at:
151 http://developer.gnome.org/projects/gup/hig/1.0/index.html
153 Please note: there are some differences between the Gnome HIG menu suggestions and our implementation:
155 File/Open Recent: the Gnome HIG suggests putting the list of recently used files as elements into the File menuitem.
156 As this is ok for only a few items, this will become unhandy for 10 or even more list entries.
157 For this reason, we use a submenu for this.
159 File/Close: the Gnome HIG suggests putting this item just above the Quit item.
160 This results in unintuitive behaviour as both Close and Quit items are very near together.
161 By putting the Close item near the open item(s), it better suggests that it will close the
162 currently opened/captured file only.
166 SHOW_HIDE_MAIN_TOOLBAR = 1,
167 SHOW_HIDE_FILTER_TOOLBAR,
168 SHOW_HIDE_AIRPCAP_TOOLBAR,
170 SHOW_HIDE_PACKET_LIST,
173 } show_hide_values_e;
184 build_conversation_filter(int action, gboolean show_dialog)
186 packet_info *pi = &cfile.edt->pi;
192 if (pi->profinet_type == 0) {
194 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
195 "Error filtering conversation. Please make\n"
196 "sure you have a PROFINET CBA packet selected.");
201 if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4
202 && pi->ipproto == IP_PROTO_TCP ) {
204 switch(pi->profinet_type) {
206 buf = g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 0)",
207 ip_to_str( pi->net_dst.data),
208 ip_to_str( pi->net_src.data),
209 ip_to_str( pi->net_src.data),
210 ip_to_str( pi->net_dst.data));
213 buf = g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 0)",
214 ip_to_str( pi->net_src.data),
215 ip_to_str( pi->net_dst.data),
216 ip_to_str( pi->net_dst.data),
217 ip_to_str( pi->net_src.data));
220 buf = g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.srt == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.srt == 0)",
221 ip_to_str( pi->net_dst.data),
222 ip_to_str( pi->net_src.data),
223 ip_to_str( pi->net_src.data),
224 ip_to_str( pi->net_dst.data));
227 buf = g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.srt == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.srt == 0)",
228 ip_to_str( pi->net_src.data),
229 ip_to_str( pi->net_dst.data),
230 ip_to_str( pi->net_dst.data),
231 ip_to_str( pi->net_src.data));
241 if (pi->ipproto != IP_PROTO_TCP) {
243 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
244 "Error filtering conversation. Please make\n"
245 "sure you have a TCP packet selected.");
250 if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4 ) {
252 buf = g_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
253 ip_to_str( pi->net_src.data),
254 ip_to_str( pi->net_dst.data),
255 pi->srcport, pi->destport );
256 } else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6 ) {
258 buf = g_strdup_printf("(ipv6.addr eq %s and ipv6.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
259 ip6_to_str((const struct e_in6_addr *)pi->net_src.data),
260 ip6_to_str((const struct e_in6_addr *)pi->net_dst.data),
261 pi->srcport, pi->destport );
267 if (pi->ipproto != IP_PROTO_UDP) {
269 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
270 "Error filtering conversation. Please make\n"
271 "sure you have a UDP packet selected.");
276 if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4 ) {
278 buf = g_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (udp.port eq %d and udp.port eq %d)",
279 ip_to_str( pi->net_src.data),
280 ip_to_str( pi->net_dst.data),
281 pi->srcport, pi->destport );
282 } else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6 ) {
284 buf = g_strdup_printf("(ipv6.addr eq %s and ipv6.addr eq %s) and (udp.port eq %d and udp.port eq %d)",
285 ip6_to_str((const struct e_in6_addr *)pi->net_src.data),
286 ip6_to_str((const struct e_in6_addr *)pi->net_dst.data),
287 pi->srcport, pi->destport );
293 if ((pi->ethertype != ETHERTYPE_IP) && (pi->ethertype != ETHERTYPE_IPv6)) {
295 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
296 "Error filtering conversation. Please make\n"
297 "sure you have a IP packet selected.");
302 if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4 ) {
304 buf = g_strdup_printf("ip.addr eq %s and ip.addr eq %s",
305 ip_to_str( pi->net_src.data),
306 ip_to_str( pi->net_dst.data));
307 } else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6 ) {
309 buf = g_strdup_printf("ipv6.addr eq %s and ipv6.addr eq %s",
310 ip6_to_str((const struct e_in6_addr *)pi->net_src.data),
311 ip6_to_str((const struct e_in6_addr *)pi->net_dst.data));
317 /* XXX - is this the right way to check for Ethernet? */
318 /* check for the data link address type */
319 /* (ethertype will be 0 when used as length field) */
320 if (pi->dl_src.type != AT_ETHER) {
322 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
323 "Error filtering conversation. Please make\n"
324 "sure you have a Ethernet packet selected.");
329 if( pi->dl_src.type == AT_ETHER && pi->dl_dst.type == AT_ETHER ) {
331 buf = g_strdup_printf("eth.addr eq %s and eth.addr eq %s",
332 ether_to_str( pi->dl_src.data),
333 ether_to_str( pi->dl_dst.data));
346 new_window_cb(GtkWidget *widget)
348 new_packet_window(widget, FALSE);
351 #ifdef WANT_PACKET_EDITOR
353 edit_window_cb(GtkWidget *widget)
355 new_packet_window(widget, TRUE);
360 conversation_cb(GtkAction *a _U_, gpointer data _U_, int action)
363 GtkWidget *filter_te;
365 if (cfile.current_frame) {
366 /* create a filter-string based on the selected packet and action */
367 filter = build_conversation_filter(action, TRUE);
369 /* Run the display filter so it goes in effect - even if it's the
370 same as the previous display filter. */
371 filter_te = gtk_bin_get_child(GTK_BIN(g_object_get_data(G_OBJECT(top_level), E_DFILTER_CM_KEY)));
373 gtk_entry_set_text(GTK_ENTRY(filter_te), filter);
374 main_filter_packets(&cfile, filter, TRUE);
381 colorize_conversation_cb(GtkAction *action _U_, gpointer data _U_, int action_num)
383 gchar *filter = NULL;
385 if( (action_num>>8) == 255 ) {
386 color_filters_reset_tmp();
387 new_packet_list_colorize_packets();
388 } else if (cfile.current_frame) {
389 if( (action_num&0xff) == 0 ) {
390 /* colorize_conversation_cb was called from the window-menu
391 * or through an accelerator key. Try to build a conversation
392 * filter in the order TCP, UDP, IP, Ethernet and apply the
394 filter = build_conversation_filter(CONV_TCP,FALSE);
396 filter = build_conversation_filter(CONV_UDP,FALSE);
398 filter = build_conversation_filter(CONV_IP,FALSE);
400 filter = build_conversation_filter(CONV_ETHER,FALSE);
401 if( filter == NULL ) {
402 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Unable to build conversation filter.");
406 /* create a filter-string based on the selected packet and action_num */
407 filter = build_conversation_filter(action_num&0xff, TRUE);
410 if( (action_num>>8) == 0) {
411 /* Open the "new coloring filter" dialog with the filter */
412 color_display_with_filter(filter);
414 /* Set one of the temporary coloring filters */
415 color_filters_set_tmp((guint8)(action_num>>8),filter,FALSE);
416 new_packet_list_colorize_packets();
424 goto_conversation_frame(gboolean dir)
427 dfilter_t *dfcode = NULL;
428 gboolean found_packet=FALSE;
430 filter = build_conversation_filter(CONV_TCP,FALSE);
432 filter = build_conversation_filter(CONV_UDP,FALSE);
434 filter = build_conversation_filter(CONV_IP,FALSE);
435 if( filter == NULL ) {
436 statusbar_push_temporary_msg("Unable to build conversation filter.");
441 if (!dfilter_compile(filter, &dfcode)) {
442 /* The attempt failed; report an error. */
443 statusbar_push_temporary_msg("Error compiling filter for this conversation.");
448 found_packet = cf_find_packet_dfilter(&cfile, dfcode, dir);
451 /* We didn't find a packet */
452 statusbar_push_temporary_msg("No previous/next packet in conversation.");
455 dfilter_free(dfcode);
460 goto_next_frame_conversation_cb(GtkAction *action _U_, gpointer user_data _U_)
462 goto_conversation_frame(FALSE);
466 goto_previous_frame_conversation_cb(GtkAction *action _U_, gpointer user_data _U_)
468 goto_conversation_frame(TRUE);
475 tree_view_menu_apply_selected_cb(GtkAction *action _U_, gpointer user_data)
477 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/Selected");
478 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_REPLACE|MATCH_SELECTED_APPLY_NOW);
482 tree_view_menu_apply_not_selected_cb(GtkAction *action _U_, gpointer user_data)
484 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/NotSelected");
485 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_NOT|MATCH_SELECTED_APPLY_NOW);
489 tree_view_menu_apply_and_selected_cb(GtkAction *action _U_, gpointer user_data)
491 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/AndSelected");
492 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_AND|MATCH_SELECTED_APPLY_NOW);
496 tree_view_menu_apply_or_selected_cb(GtkAction *action _U_, gpointer user_data)
498 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/OrSelected");
499 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_OR|MATCH_SELECTED_APPLY_NOW);
503 tree_view_menu_apply_and_not_selected_cb(GtkAction *action _U_, gpointer user_data)
505 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/AndNotSelected");
506 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_AND_NOT|MATCH_SELECTED_APPLY_NOW);
510 tree_view_menu_apply_or_not_selected_cb(GtkAction *action _U_, gpointer user_data)
512 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/OrNotSelected");
513 match_selected_ptree_cb( widget , user_data,MATCH_SELECTED_OR_NOT|MATCH_SELECTED_APPLY_NOW);
515 /* Prepare a filter */
517 tree_view_menu_prepare_selected_cb(GtkAction *action _U_, gpointer user_data)
519 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/Selected");
520 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_REPLACE);
524 tree_view_menu_prepare_not_selected_cb(GtkAction *action _U_, gpointer user_data)
526 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/NotSelected");
527 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_NOT);
531 tree_view_menu_prepare_and_selected_cb(GtkAction *action _U_, gpointer user_data)
533 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/AndSelected");
534 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_AND);
538 tree_view_menu_prepare_or_selected_cb(GtkAction *action _U_, gpointer user_data)
540 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/OrSelected");
541 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_OR);
545 tree_view_menu_prepare_and_not_selected_cb(GtkAction *action _U_, gpointer user_data)
547 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/AndNotSelected");
548 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_AND_NOT);
552 tree_view_menu_prepare_or_not_selected_cb(GtkAction *action _U_, gpointer user_data)
554 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/OrNotSelected");
555 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_OR_NOT);
559 copy_description_cb(GtkAction *action _U_, gpointer user_data)
561 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_DESCRIPTION);
565 copy_fieldname_cb(GtkAction *action _U_, gpointer user_data)
567 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_FIELDNAME);
571 copy_value_cb(GtkAction *action _U_, gpointer user_data)
573 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_VALUE);
577 copy_as_filter_cb(GtkAction *action _U_, gpointer user_data)
579 match_selected_ptree_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_REPLACE|MATCH_SELECTED_COPY_ONLY);
583 set_reftime_cb(GtkAction *action _U_, gpointer user_data)
585 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_TOGGLE);
589 find_next_ref_time_cb(GtkAction *action _U_, gpointer user_data)
591 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_FIND_NEXT);
595 find_previous_ref_time_cb(GtkAction *action _U_, gpointer user_data)
597 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_FIND_PREV);
601 menus_prefs_cb(GtkAction *action _U_, gpointer user_data)
603 prefs_page_cb( NULL /* widget _U_ */ , user_data, PREFS_PAGE_USER_INTERFACE);
607 main_toolbar_show_hide_cb(GtkAction *action _U_, gpointer user_data)
609 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/MainToolbar");
612 g_warning("main_toolbar_show_hide_cb: No widget found");
614 show_hide_cb( widget, user_data, SHOW_HIDE_MAIN_TOOLBAR);
619 filter_toolbar_show_hide_cb(GtkAction * action _U_, gpointer user_data)
621 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/FilterToolbar");
623 g_warning("filter_toolbar_show_hide_cb: No widget found");
625 show_hide_cb( widget, user_data, SHOW_HIDE_FILTER_TOOLBAR);
631 wireless_toolbar_show_hide_cb(GtkAction *action _U_, gpointer user_data)
633 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/WirelessToolbar");
635 g_warning("wireless_toolbar_show_hide_cb: No widget found");
637 show_hide_cb( widget, user_data, SHOW_HIDE_AIRPCAP_TOOLBAR);
640 #endif /* HAVE_AIRPCAP */
643 status_bar_show_hide_cb(GtkAction *action _U_, gpointer user_data)
645 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/Statusbar");
647 g_warning("status_bar_show_hide_cb: No widget found");
649 show_hide_cb( widget, user_data, SHOW_HIDE_STATUSBAR);
653 packet_list_show_hide_cb(GtkAction *action _U_, gpointer user_data)
655 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketList");
657 g_warning("packet_list_show_hide_cb: No widget found");
659 show_hide_cb( widget, user_data, SHOW_HIDE_PACKET_LIST);
663 packet_details_show_hide_cb(GtkAction *action _U_, gpointer user_data)
665 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketDetails");
667 g_warning("packet_details_show_hide_cb: No widget found");
669 show_hide_cb( widget, user_data, SHOW_HIDE_TREE_VIEW);
673 packet_bytes_show_hide_cb(GtkAction *action _U_, gpointer user_data)
675 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketBytes");
677 g_warning("packet_bytes_show_hide_cb: No widget found");
679 show_hide_cb( widget, user_data, SHOW_HIDE_BYTE_VIEW);
684 timestamp_format_new_cb (GtkRadioAction *action, GtkRadioAction *current _U_, gpointer user_data _U_)
688 value = gtk_radio_action_get_current_value (action);
689 g_warning("timestamp_format_new_cb, value %u, recent.gui_time_format %u",value, recent.gui_time_format);
690 if (recent.gui_time_format != value) {
691 timestamp_set_type(value);
692 recent.gui_time_format = value;
693 /* This call adjusts column width */
694 cf_timestamp_auto_precision(&cfile);
695 new_packet_list_queue_draw();
701 timestamp_precision_new_cb (GtkRadioAction *action, GtkRadioAction *current _U_, gpointer user_data _U_)
705 value = gtk_radio_action_get_current_value (action);
706 g_warning("timestamp_precision_new_cb, value %u, recent.gui_time_precision %u",value, recent.gui_time_precision);
707 if (recent.gui_time_precision != value) {
708 /* the actual precision will be set in new_packet_list_queue_draw() below */
709 if (value == TS_PREC_AUTO) {
710 timestamp_set_precision(TS_PREC_AUTO_SEC);
712 timestamp_set_precision(value);
714 recent.gui_time_precision = value;
715 /* This call adjusts column width */
716 cf_timestamp_auto_precision(&cfile);
717 new_packet_list_queue_draw();
723 view_menu_seconds_time_cb(GtkAction *action _U_, gpointer user_data)
725 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes");
727 g_warning("view_menu_seconds_time_cb: No widget found");
729 timestamp_seconds_time_cb(widget, user_data, 0);
734 view_menu_en_for_MAC_cb(GtkAction *action _U_, gpointer user_data)
736 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforMACLayer");
738 g_warning("view_menu_en_for_MAC_cb: No widget found");
740 name_resolution_cb( widget , user_data, RESOLV_MAC);
745 view_menu_en_for_network_cb(GtkAction *action _U_, gpointer user_data)
747 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforNetworkLayer");
749 g_warning("view_menu_en_for_network_cb: No widget found");
751 name_resolution_cb( widget , user_data, RESOLV_NETWORK);
756 view_menu_en_for_transport_cb(GtkAction *action _U_, gpointer user_data)
758 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforTransportLayer");
760 g_warning("view_menu_en_for_transport_cb: No widget found");
762 name_resolution_cb( widget , user_data, RESOLV_TRANSPORT);
767 view_menu_colorize_pkt_lst_cb(GtkAction *action _U_, gpointer user_data)
769 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizePacketList");
771 g_warning("view_menu_colorize_pkt_lst_cb: No widget found");
773 colorize_cb( widget , user_data);
780 view_menu_auto_scroll_live_cb(GtkAction *action _U_, gpointer user_data _U_)
782 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/AutoScrollinLiveCapture");
785 g_warning("view_menu_auto_scroll_live_cb: No widget found");
787 menu_auto_scroll_live_changed(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)));
793 view_menu_color_conv_color1_cb(GtkAction *action, gpointer user_data)
795 colorize_conversation_cb(action, user_data, 1*256);
799 view_menu_color_conv_color2_cb(GtkAction *action, gpointer user_data)
801 colorize_conversation_cb(action, user_data, 2*256);
805 view_menu_color_conv_color3_cb(GtkAction *action, gpointer user_data)
807 colorize_conversation_cb(action, user_data, 3*256);
811 view_menu_color_conv_color4_cb(GtkAction *action, gpointer user_data)
813 colorize_conversation_cb(action, user_data, 4*256);
817 view_menu_color_conv_color5_cb(GtkAction *action, gpointer user_data)
819 colorize_conversation_cb(action, user_data, 5*256);
823 view_menu_color_conv_color6_cb(GtkAction *action, gpointer user_data)
825 colorize_conversation_cb(action, user_data, 6*256);
829 view_menu_color_conv_color7_cb(GtkAction *action, gpointer user_data)
831 colorize_conversation_cb(action, user_data, 7*256);
835 view_menu_color_conv_color8_cb(GtkAction *action, gpointer user_data)
837 colorize_conversation_cb(action, user_data, 8*256);
841 view_menu_color_conv_color9_cb(GtkAction *action, gpointer user_data)
843 colorize_conversation_cb(action, user_data, 9*256);
847 view_menu_color_conv_color10_cb(GtkAction *action, gpointer user_data)
849 colorize_conversation_cb(action, user_data, 10*256);
853 view_menu_color_conv_new_rule_cb(GtkAction *action, gpointer user_data)
855 colorize_conversation_cb(action, user_data, 0);
859 view_menu_reset_coloring_cb(GtkAction *action, gpointer user_data)
861 colorize_conversation_cb(action, user_data, 255*256);
865 help_menu_cont_cb(GtkAction *action _U_, gpointer user_data _U_)
867 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(HELP_CONTENT));
871 help_menu_faq_cb(GtkAction *action _U_, gpointer user_data _U_)
873 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_FAQ));
877 help_menu_wireshark_cb(GtkAction *action _U_, gpointer user_data _U_)
879 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_WIRESHARK));
883 help_menu_wireshark_flt_cb(GtkAction *action _U_, gpointer user_data _U_)
885 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_WIRESHARK_FILTER));
889 help_menu_Tshark_cb(GtkAction *action _U_, gpointer user_data _U_)
891 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_TSHARK));
895 help_menu_RawShark_cb(GtkAction *action _U_, gpointer user_data _U_)
897 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_RAWSHARK));
901 help_menu_Dumpcap_cb(GtkAction *action _U_, gpointer user_data _U_)
903 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_DUMPCAP));
907 help_menu_Mergecap_cb(GtkAction *action _U_, gpointer user_data _U_)
909 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_MERGECAP));
913 help_menu_Editcap_cb(GtkAction *action _U_, gpointer user_data _U_)
915 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_EDITCAP));
919 help_menu_Text2pcap_cb(GtkAction *action _U_, gpointer user_data _U_)
921 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_TEXT2PCAP));
925 help_menu_Website_cb(GtkAction *action _U_, gpointer user_data _U_)
927 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_HOME));
931 help_menu_Wiki_cb(GtkAction *action _U_, gpointer user_data _U_)
933 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_WIKI));
937 help_menu_Downloads_cb(GtkAction *action _U_, gpointer user_data _U_)
939 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_DOWNLOAD));
943 help_menu_SampleCaptures_cb(GtkAction *action _U_, gpointer user_data _U_)
945 topic_menu_cb( NULL/* widget_U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_SAMPLE_FILES));
948 static const char *ui_desc_menubar =
950 " <menubar name ='Menubar'>\n"
951 " <menu name= 'FileMenu' action='/File'>\n"
952 " <menuitem name='Open' action='/File/Open'/>\n"
953 " <menu name='OpenRecent' action='/File/OpenRecent'>\n"
954 " <placeholder name='RecentFiles'/>\n"
956 " <menuitem name='Merge' action='/File/Merge'/>\n"
957 " <menuitem name='Import' action='/File/Import'/>\n"
958 " <menuitem name='Close' action='/File/Close'/>\n"
960 " <menuitem name='Save' action='/File/Save'/>\n"
961 " <menuitem name='SaveAs' action='/File/SaveAs'/>\n"
963 " <menu name= 'Set' action='/File/Set'>\n"
964 " <menuitem name='ListFiles' action='/File/Set/ListFiles'/>\n"
965 " <menuitem name='NextFile' action='/File/Set/NextFile'/>\n"
966 " <menuitem name='PreviousFile' action='/File/Set/PreviousFile'/>\n"
969 " <menu name= 'Export' action='/File/Export'>\n"
971 " <menuitem name='File' action='/File/Export/File'/>\n"
973 " <menu name= 'File' action='/File/Export/File'>\n"
974 " <menuitem name='AsTxt' action='/File/Export/File/Text'/>\n"
975 " <menuitem name='AsPostScript' action='/File/Export/File/PostScript'/>\n"
976 " <menuitem name='AsCSV' action='/File/Export/File/CSV'/>\n"
977 " <menuitem name='AsCArrays' action='/File/Export/File/CArrays'/>\n"
979 " <menuitem name='AsPSML' action='/File/Export/File/PSML'/>\n"
980 " <menuitem name='AsPDML' action='/File/Export/File/PDML'/>\n"
984 " <menuitem name='SelectedPacketBytes' action='/File/Export/SelectedPacketBytes'/>\n"
985 " <menu name= 'Objects' action='/File/Export/Objects'>\n"
986 " <menuitem name='HTTP' action='/File/Export/Objects/HTTP'/>\n"
987 " <menuitem name='DICOM' action='/File/Export/Objects/DICOM'/>\n"
988 " <menuitem name='SMB' action='/File/Export/Objects/SMB'/>\n"
992 " <menuitem name='Print' action='/File/Print'/>\n"
994 " <menuitem name='Quit' action='/File/Quit'/>\n"
996 " <menu name= 'EditMenu' action='/Edit'>\n"
997 " <menu name= 'Copy' action='/Edit/Copy'>\n"
998 " <menuitem name='Description' action='/Edit/Copy/Description'/>\n"
999 " <menuitem name='Fieldname' action='/Edit/Copy/Fieldname'/>\n"
1000 " <menuitem name='Value' action='/Edit/Copy/Value'/>\n"
1002 " <menuitem name='AsFilter' action='/Edit/Copy/AsFilter'/>\n"
1004 " <menuitem name='FindPacket' action='/Edit/FindPacket'/>\n"
1005 " <menuitem name='FindNext' action='/Edit/FindNext'/>\n"
1006 " <menuitem name='FindPrevious' action='/Edit/FindPrevious'/>\n"
1008 " <menuitem name='MarkPacket' action='/Edit/MarkPacket'/>\n"
1009 " <menuitem name='MarkAllDisplayedPackets' action='/Edit/MarkAllDisplayedPackets'/>\n"
1010 " <menuitem name='UnmarkAllDisplayedPackets' action='/Edit/UnmarkAllDisplayedPackets'/>\n"
1011 " <menuitem name='FindNextMark' action='/Edit/FindNextMark'/>\n"
1012 " <menuitem name='FindPreviousMark' action='/Edit/FindPreviousMark'/>\n"
1014 " <menuitem name='IgnorePacket' action='/Edit/IgnorePacket'/>\n"
1015 " <menuitem name='IgnoreAllDisplayedPackets' action='/Edit/IgnoreAllDisplayedPackets'/>\n"
1016 " <menuitem name='Un-IgnoreAllPackets' action='/Edit/Un-IgnoreAllPackets'/>\n"
1018 " <menuitem name='SetTimeReference' action='/Edit/SetTimeReference'/>\n"
1019 " <menuitem name='Un-TimeReferenceAllPackets' action='/Edit/Un-TimeReferenceAllPackets'/>\n"
1020 " <menuitem name='FindNextTimeReference' action='/Edit/FindNextTimeReference'/>\n"
1021 " <menuitem name='FindPreviousTimeReference' action='/Edit/FindPreviousTimeReference'/>\n"
1022 " <menuitem name='TimeShift' action='/Edit/TimeShift'/>\n"
1024 #ifdef WANT_PACKET_EDITOR
1025 " <menuitem name='EditPacket' action='/Edit/EditPacket'/>\n"
1028 " <menuitem name='ConfigurationProfiles' action='/Edit/ConfigurationProfiles'/>\n"
1029 " <menuitem name='Preferences' action='/Edit/Preferences'/>\n"
1031 " <menu name= 'ViewMenu' action='/View'>\n"
1032 " <menuitem name='MainToolbar' action='/View/MainToolbar'/>\n"
1033 " <menuitem name='FilterToolbar' action='/View/FilterToolbar'/>\n"
1035 " <menuitem name='WirelessToolbar' action='/View/WirelessToolbar'/>\n"
1037 " <menuitem name='Statusbar' action='/View/Statusbar'/>\n"
1039 " <menuitem name='PacketList' action='/View/PacketList'/>\n"
1040 " <menuitem name='PacketDetails' action='/View/PacketDetails'/>\n"
1041 " <menuitem name='PacketBytes' action='/View/PacketBytes'/>\n"
1043 " <menu name= 'TimeDisplayFormat' action='/View/TimeDisplayFormat'>\n"
1044 " <menuitem name='DateandTimeofDay' action='/View/TimeDisplayFormat/DateandTimeofDay'/>\n"
1045 " <menuitem name='TimeofDay' action='/View/TimeDisplayFormat/TimeofDay'/>\n"
1046 " <menuitem name='SecondsSinceEpoch' action='/View/TimeDisplayFormat/SecondsSinceEpoch'/>\n"
1047 " <menuitem name='SecondsSinceBeginningofCapture' action='/View/TimeDisplayFormat/SecondsSinceBeginningofCapture'/>\n"
1048 " <menuitem name='SecondsSincePreviousCapturedPacket' action='/View/TimeDisplayFormat/SecondsSincePreviousCapturedPacket'/>\n"
1049 " <menuitem name='SecondsSincePreviousDisplayedPacket' action='/View/TimeDisplayFormat/SecondsSincePreviousDisplayedPacket'/>\n"
1050 " <menuitem name='UTCDateandTimeofDay' action='/View/TimeDisplayFormat/UTCDateandTimeofDay'/>\n"
1051 " <menuitem name='UTCTimeofDay' action='/View/TimeDisplayFormat/UTCTimeofDay'/>\n"
1053 " <menuitem name='FileFormatPrecision-Automatic' action='/View/TimeDisplayFormat/FileFormatPrecision-Automatic'/>\n"
1054 " <menuitem name='FileFormatPrecision-Seconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Seconds'/>\n"
1055 " <menuitem name='FileFormatPrecision-Deciseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Deciseconds'/>\n"
1056 " <menuitem name='FileFormatPrecision-Centiseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Centiseconds'/>\n"
1057 " <menuitem name='FileFormatPrecision-Milliseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Milliseconds'/>\n"
1058 " <menuitem name='FileFormatPrecision-Microseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Microseconds'/>\n"
1059 " <menuitem name='FileFormatPrecision-Nanoseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Nanoseconds'/>\n"
1061 " <menuitem name='DisplaySecondsWithHoursAndMinutes' action='/View/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes'/>\n"
1063 " <menu name= 'NameResolution' action='/View/NameResolution'>\n"
1064 " <menuitem name='ResolveName' action='/View/NameResolution/ResolveName'/>\n"
1066 " <menuitem name='EnableforMACLayer' action='/View/NameResolution/EnableforMACLayer'/>\n"
1067 " <menuitem name='EnableforNetworkLayer' action='/View/NameResolution/EnableforNetworkLayer'/>\n"
1068 " <menuitem name='EnableforTransportLayer' action='/View/NameResolution/EnableforTransportLayer'/>\n"
1070 " <menuitem name='ColorizePacketList' action='/View/ColorizePacketList'/>\n"
1071 " <menuitem name='AutoScrollinLiveCapture' action='/View/AutoScrollinLiveCapture'/>\n"
1073 " <menuitem name='ZoomIn' action='/View/ZoomIn'/>\n"
1074 " <menuitem name='ZoomOut' action='/View/ZoomOut'/>\n"
1075 " <menuitem name='NormalSize' action='/View/NormalSize'/>\n"
1077 " <menuitem name='ResizeAllColumns' action='/View/ResizeAllColumns'/>\n"
1078 " <menuitem name='DisplayedColumns' action='/View/DisplayedColumns'/>\n"
1080 " <menuitem name='ExpandSubtrees' action='/View/ExpandSubtrees'/>\n"
1081 " <menuitem name='ExpandAll' action='/View/ExpandAll'/>\n"
1082 " <menuitem name='CollapseAll' action='/View/CollapseAll'/>\n"
1084 " <menu name= 'ColorizeConversation' action='/View/ColorizeConversation'>\n"
1085 " <menuitem name='Color1' action='/View/ColorizeConversation/Color 1'/>\n"
1086 " <menuitem name='Color2' action='/View/ColorizeConversation/Color 2'/>\n"
1087 " <menuitem name='Color3' action='/View/ColorizeConversation/Color 3'/>\n"
1088 " <menuitem name='Color4' action='/View/ColorizeConversation/Color 4'/>\n"
1089 " <menuitem name='Color5' action='/View/ColorizeConversation/Color 5'/>\n"
1090 " <menuitem name='Color6' action='/View/ColorizeConversation/Color 6'/>\n"
1091 " <menuitem name='Color7' action='/View/ColorizeConversation/Color 7'/>\n"
1092 " <menuitem name='Color8' action='/View/ColorizeConversation/Color 8'/>\n"
1093 " <menuitem name='Color9' action='/View/ColorizeConversation/Color 9'/>\n"
1094 " <menuitem name='Color10' action='/View/ColorizeConversation/Color 10'/>\n"
1095 " <menuitem name='NewColoringRule' action='/View/ColorizeConversation/NewColoringRule'/>\n"
1098 " <menuitem name='ResetColoring1-10' action='/View/ResetColoring1-10'/>\n"
1099 " <menuitem name='ColoringRules' action='/View/ColoringRules'/>\n"
1101 " <menuitem name='ShowPacketinNewWindow' action='/View/ShowPacketinNewWindow'/>\n"
1102 " <menuitem name='Reload' action='/View/Reload'/>\n"
1104 " <menu name= 'GoMenu' action='/Go'>\n"
1105 " <menuitem name='Back' action='/Go/Back'/>\n"
1106 " <menuitem name='Forward' action='/Go/Forward'/>\n"
1107 " <menuitem name='Goto' action='/Go/Goto'/>\n"
1108 " <menuitem name='GotoCorrespondingPacket' action='/Go/GotoCorrespondingPacket'/>\n"
1110 " <menuitem name='PreviousPacket' action='/Go/PreviousPacket'/>\n"
1111 " <menuitem name='NextPacket' action='/Go/NextPacket'/>\n"
1112 " <menuitem name='FirstPacket' action='/Go/FirstPacket'/>\n"
1113 " <menuitem name='LastPacket' action='/Go/LastPacket'/>\n"
1114 " <menuitem name='PreviousPacketInConversation' action='/Go/PreviousPacketInConversation'/>\n"
1115 " <menuitem name='NextPacketInConversation' action='/Go/NextPacketInConversation'/>\n"
1118 " <menu name= 'CaptureMenu' action='/Capture'>\n"
1119 " <menuitem name='Interfaces' action='/Capture/Interfaces'/>\n"
1120 " <menuitem name='Options' action='/Capture/Options'/>\n"
1121 " <menuitem name='Start' action='/Capture/Start'/>\n"
1122 " <menuitem name='Stop' action='/Capture/Stop'/>\n"
1123 " <menuitem name='Restart' action='/Capture/Restart'/>\n"
1124 " <menuitem name='CaptureFilters' action='/Capture/CaptureFilters'/>\n"
1126 #endif /* HAVE_LIBPCAP */
1127 " <menu name= 'AnalyzeMenu' action='/Analyze'>\n"
1128 " <menuitem name='DisplayFilters' action='/Analyze/DisplayFilters'/>\n"
1129 " <menuitem name='DisplayFilterMacros' action='/Analyze/DisplayFilterMacros'/>\n"
1131 " <menuitem name='ApplyasColumn' action='/Analyze/ApplyasColumn'/>\n"
1132 " <menu name= 'ApplyAsFilter' action='/Analyze/ApplyasFilter'>\n"
1133 " <menuitem name='Selected' action='/Analyze/ApplyasFilter/Selected'/>\n"
1134 " <menuitem name='NotSelected' action='/Analyze/ApplyasFilter/NotSelected'/>\n"
1135 " <menuitem name='AndSelected' action='/Analyze/ApplyasFilter/AndSelected'/>\n"
1136 " <menuitem name='OrSelected' action='/Analyze/ApplyasFilter/OrSelected'/>\n"
1137 " <menuitem name='AndNotSelected' action='/Analyze/ApplyasFilter/AndNotSelected'/>\n"
1138 " <menuitem name='OrNotSelected' action='/Analyze/ApplyasFilter/OrNotSelected'/>\n"
1140 " <menu name= 'PrepareaFilter' action='/Analyze/PrepareaFilter'>\n"
1141 " <menuitem name='Selected' action='/Analyze/PrepareaFilter/Selected'/>\n"
1142 " <menuitem name='NotSelected' action='/Analyze/PrepareaFilter/NotSelected'/>\n"
1143 " <menuitem name='AndSelected' action='/Analyze/PrepareaFilter/AndSelected'/>\n"
1144 " <menuitem name='OrSelected' action='/Analyze/PrepareaFilter/OrSelected'/>\n"
1145 " <menuitem name='AndNotSelected' action='/Analyze/PrepareaFilter/AndNotSelected'/>\n"
1146 " <menuitem name='OrNotSelected' action='/Analyze/PrepareaFilter/OrNotSelected'/>\n"
1149 " <menuitem name='EnabledProtocols' action='/Analyze/EnabledProtocols'/>\n"
1150 " <menuitem name='DecodeAs' action='/Analyze/DecodeAs'/>\n"
1151 " <menuitem name='UserSpecifiedDecodes' action='/Analyze/UserSpecifiedDecodes'/>\n"
1153 " <menuitem name='FollowTCPStream' action='/Analyze/FollowTCPStream'/>\n"
1154 " <menuitem name='FollowUDPStream' action='/Analyze/FollowUDPStream'/>\n"
1155 " <menuitem name='FollowSSLStream' action='/Analyze/FollowSSLStream'/>\n"
1156 " <menuitem name='ExpertInfoComposite' action='/Analyze/ExpertInfoComposite'/>\n"
1157 " <menu name= 'ConversationFilterMenu' action='/Analyze/ConversationFilter'>\n"
1158 " <placeholder name='Filters'/>\n"
1161 " <menu name= 'StatisticsMenu' action='/Statistics'>\n"
1162 " <menuitem name='Summary' action='/Statistics/Summary'/>\n"
1163 " <menuitem name='ProtocolHierarchy' action='/Statistics/ProtocolHierarchy'/>\n"
1164 " <menuitem name='Conversations' action='/Statistics/Conversations'/>\n"
1165 " <menuitem name='Endpoints' action='/Statistics/Endpoints'/>\n"
1166 " <menuitem name='PacketLengths' action='/Statistics/plen'/>\n"
1167 " <menuitem name='IOGraphs' action='/Statistics/IOGraphs'/>\n"
1169 " <menu name= 'ConversationListMenu' action='/Stataistics/ConversationList'>\n"
1170 " <menuitem name='Ethernet' action='/Stataistics/ConversationList/Ethernet'/>\n"
1171 " <menuitem name='FibreChannel' action='/Stataistics/ConversationList/FibreChannel'/>\n"
1172 " <menuitem name='FDDI' action='/Stataistics/ConversationList/FDDI'/>\n"
1173 " <menuitem name='IP' action='/Stataistics/ConversationList/IP'/>\n"
1174 " <menuitem name='IPv6' action='/Stataistics/ConversationList/IPv6'/>\n"
1175 " <menuitem name='JXTA' action='/Stataistics/ConversationList/JXTA'/>\n"
1176 " <menuitem name='NCP' action='/Stataistics/ConversationList/NCP'/>\n"
1177 " <menuitem name='RSVP' action='/Stataistics/ConversationList/RSVP'/>\n"
1178 " <menuitem name='SCTP' action='/Stataistics/ConversationList/SCTP'/>\n"
1179 " <menuitem name='TCPIP' action='/Stataistics/ConversationList/TCPIP'/>\n"
1180 " <menuitem name='TR' action='/Stataistics/ConversationList/TR'/>\n"
1181 " <menuitem name='UDPIP' action='/Stataistics/ConversationList/UDPIP'/>\n"
1182 " <menuitem name='USB' action='/Stataistics/ConversationList/USB'/>\n"
1183 " <menuitem name='WLAN' action='/Stataistics/ConversationList/WLAN'/>\n"
1185 " <menu name= 'EndpointListMenu' action='/Statistics/EndpointList'>\n"
1186 " <menuitem name='Ethernet' action='/Statistics/EndpointList/Ethernet'/>\n"
1187 " <menuitem name='FibreChannel' action='/Statistics/EndpointList/FibreChannel'/>\n"
1188 " <menuitem name='FDDI' action='/Statistics/EndpointList/FDDI'/>\n"
1189 " <menuitem name='IP' action='/Statistics/EndpointList/IP'/>\n"
1190 " <menuitem name='IPv6' action='/Statistics/EndpointList/IPv6'/>\n"
1191 " <menuitem name='JXTA' action='/Statistics/EndpointList/JXTA'/>\n"
1192 " <menuitem name='RSVP' action='/Statistics/EndpointList/RSVP'/>\n"
1193 " <menuitem name='SCTP' action='/Statistics/EndpointList/SCTP'/>\n"
1194 " <menuitem name='TCPIP' action='/Statistics/EndpointList/TCPIP'/>\n"
1195 " <menuitem name='TR' action='/Statistics/EndpointList/TR'/>\n"
1196 " <menuitem name='UDPIP' action='/Statistics/EndpointList/UDPIP'/>\n"
1197 " <menuitem name='USB' action='/Statistics/EndpointList/USB'/>\n"
1198 " <menuitem name='WLAN' action='/Statistics/EndpointList/WLAN'/>\n"
1200 " <menu name='ServiceResponseTimeMenu' action='/Statistics/ServiceResponseTime'>\n"
1201 " <menuitem name='AFP' action='/Statistics/ServiceResponseTime/AFP'/>\n"
1202 " <menuitem name='ONC-RPC' action='/Statistics/ServiceResponseTime/ONC-RPC'/>\n"
1203 " <menuitem name='Camel' action='/Statistics/ServiceResponseTime/Camel'/>\n"
1204 " <menuitem name='DCE-RPC' action='/Statistics/ServiceResponseTime/DCE-RPC'/>\n"
1205 " <menuitem name='Diameter' action='/Statistics/ServiceResponseTime/Diameter'/>\n"
1206 " <menuitem name='FibreChannel' action='/Statistics/ServiceResponseTime/FibreChannel'/>\n"
1207 " <menuitem name='GTP' action='/Statistics/ServiceResponseTime/GTP'/>\n"
1208 " <menuitem name='H225' action='/Statistics/ServiceResponseTime/H225'/>\n"
1209 " <menuitem name='LDAP' action='/Statistics/ServiceResponseTime/LDAP'/>\n"
1210 " <menuitem name='MEGACO' action='/Statistics/ServiceResponseTime/MEGACO'/>\n"
1211 " <menuitem name='MGCP' action='/Statistics/ServiceResponseTime/MGCP'/>\n"
1212 " <menuitem name='NCP' action='/Statistics/ServiceResponseTime/NCP'/>\n"
1213 " <menuitem name='RADIUS' action='/Statistics/ServiceResponseTime/RADIUS'/>\n"
1214 " <menuitem name='SCSI' action='/Statistics/ServiceResponseTime/SCSI'/>\n"
1215 " <menuitem name='SMB2' action='/Statistics/ServiceResponseTime/SMB2'/>\n"
1218 " <menuitem name='ANCP' action='/StatisticsMenu/ancp'/>\n"
1219 " <menu name= 'BACnetMenu' action='/StatisticsMenu/BACnet'>\n"
1220 " <menuitem name='bacapp_instanceid' action='/StatisticsMenu/BACnet/bacapp_instanceid'/>\n"
1221 " <menuitem name='bacapp_ip' action='/StatisticsMenu/BACnet/bacapp_ip'/>\n"
1222 " <menuitem name='bacapp_objectid' action='/StatisticsMenu/BACnet/bacapp_objectid'/>\n"
1223 " <menuitem name='bacapp_service' action='/StatisticsMenu/BACnet/bacapp_service'/>\n"
1225 " <menuitem name='BOOTP-DHCP' action='/StatisticsMenu/BOOTP-DHCP'/>\n"
1226 " <menuitem name='Collectd' action='/StatisticsMenu/collectd'/>\n"
1227 " <menuitem name='Compare' action='/StatisticsMenu/compare'/>\n"
1228 " <menuitem name='FlowGraph' action='/StatisticsMenu/FlowGraph'/>\n"
1229 " <menu name= 'HTTPMenu' action='/StatisticsMenu/HTTP'>\n"
1230 " <menuitem name='http' action='/StatisticsMenu/HTTP/http'/>\n"
1231 " <menuitem name='http_req' action='/StatisticsMenu/HTTP/http_req'/>\n"
1232 " <menuitem name='http_srv' action='/StatisticsMenu/HTTP/http_srv'/>\n"
1234 " <menuitem name='IPAddresses' action='/StatisticsMenu/ip_hosts'/>\n"
1235 " <menuitem name='IPDestinations' action='/StatisticsMenu/dests'/>\n"
1236 " <menuitem name='IPptype' action='/StatisticsMenu/ptype'/>\n"
1237 " <menuitem name='ONC-RPC-Programs' action='/StatisticsMenu/ONC-RPC-Programs'/>\n"
1238 " <menu name= 'SametimeMenu' action='/StatisticsMenu/Sametime'>\n"
1239 " <menuitem name='sametime' action='/StatisticsMenu/Sametime/sametime'/>\n"
1241 " <menu name= 'TCPStreamGraphMenu' action='/StatisticsMenu/TCPStreamGraphMenu'>\n"
1242 " <menuitem name='Sequence-Graph-Stevens' action='/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-Stevens'/>\n"
1243 " <menuitem name='Sequence-Graph-tcptrace' action='/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-tcptrace'/>\n"
1244 " <menuitem name='Throughput-Graph' action='/StatisticsMenu/TCPStreamGraphMenu/Throughput-Graph'/>\n"
1245 " <menuitem name='RTT-Graph' action='/StatisticsMenu/TCPStreamGraphMenu/RTT-Graph'/>\n"
1246 " <menuitem name='Window-Scaling-Graph' action='/StatisticsMenu/TCPStreamGraphMenu/Window-Scaling-Graph'/>\n"
1248 " <menuitem name='UDPMulticastStreams' action='/StatisticsMenu/UDPMulticastStreams'/>\n"
1249 " <menuitem name='WLANTraffic' action='/StatisticsMenu/WLANTraffic'/>\n"
1251 " <menu name= 'TelephonyMenu' action='/Telephony'>\n"
1252 " <menu name= 'ANSI' action='/Telephony/ANSI'>\n"
1253 " <menuitem name='BSMAP' action='/Telephony/ANSI/BSMAP'/>\n"
1254 " <menuitem name='DTAP' action='/Telephony/ANSI/DTAP'/>\n"
1255 " <menuitem name='MAP-OP' action='/Telephony/ANSI/MAP-OP'/>\n"
1257 " <menu name= 'GSM' action='/Telephony/GSM'>\n"
1258 " <menuitem name='BSSMAP' action='/Telephony/GSM/BSSMAP'/>\n"
1259 " <menu name='GSM-DTAP' action='/Telephony/GSM/DTAP'>\n"
1260 " <menuitem name='CallControl' action='/Telephony/GSM/DTAP/CC'/>\n"
1261 " <menuitem name='GPRS-MM' action='/Telephony/GSM/DTAP/GMM'/>\n"
1262 " <menuitem name='GPRS-SM' action='/Telephony/GSM/DTAP/SM'/>\n"
1263 " <menuitem name='MM' action='/Telephony/GSM/DTAP/MM'/>\n"
1264 " <menuitem name='RR' action='/Telephony/GSM/DTAP/RR'/>\n"
1265 " <menuitem name='SMS' action='/Telephony/GSM/DTAP/SMS'/>\n"
1266 " <menuitem name='TP' action='/Telephony/GSM/DTAP/TP'/>\n"
1267 " <menuitem name='SS' action='/Telephony/GSM/DTAP/SS'/>\n"
1269 " <menuitem name='SACCH' action='/Telephony/GSM/SACCH'/>\n"
1270 " <menuitem name='MAP-OP' action='/Telephony/GSM/MAP-OP'/>\n"
1271 " <menuitem name='MAP-Summary' action='/Telephony/GSM/MAPSummary'/>\n"
1273 " <menuitem name='H225' action='/Telephony/H225'/>\n"
1274 " <menu name= 'IAX2menu' action='/Telephony/IAX2'>\n"
1275 " <menuitem name='StreamAnalysis' action='/Telephony/IAX2/StreamAnalysis'/>\n"
1277 " <menuitem name='ISUP' action='/Telephony/isup_msg'/>\n"
1278 " <menu name= 'LTEmenu' action='/Telephony/LTE'>\n"
1279 " <menuitem name='LTE_MAC' action='/Telephony/LTE/MAC'/>\n"
1280 " <menuitem name='LTE_RLC' action='/Telephony/LTE/RLC'/>\n"
1282 " <menu name= 'MTP3menu' action='/Telephony/MTP3'>\n"
1283 " <menuitem name='MSUs' action='/Telephony/MTP3/MSUs'/>\n"
1284 " <menuitem name='MSUSummary' action='/Telephony/MTP3/MSUSummary'/>\n"
1286 " <menu name= 'RTPmenu' action='/Telephony/RTP'>\n"
1287 " <menuitem name='ShowAllStreams' action='/Telephony/RTP/ShowAllStreams'/>\n"
1288 " <menuitem name='StreamAnalysis' action='/Telephony/RTP/StreamAnalysis'/>\n"
1290 " <menu name= 'RTSPmenu' action='/Telephony/RTSP'>\n"
1291 " <menuitem name='rtsp' action='/Telephony/RTSP/rtsp'/>\n"
1293 " <menu name= 'SCTPmenu' action='/Telephony/SCTP'>\n"
1294 " <menuitem name='AnalysethisAssociation' action='/Telephony/SCTP/AnalysethisAssociation'/>\n"
1295 " <menuitem name='ShowAllAssociations' action='/Telephony/SCTP/ShowAllAssociations'/>\n"
1296 " <menuitem name='ChunkCounter' action='/Telephony/SCTP/ChunkCounter'/>\n"
1298 " <menuitem name='SIP' action='/Telephony/SIP'/>\n"
1299 " <menuitem name='SMPP' action='/Telephony/smpp_commands'/>\n"
1300 " <menuitem name='UCP' action='/Telephony/ucp_messages'/>\n"
1301 " <menuitem name='VoIPCalls' action='/Telephony/VoIPCalls'/>\n"
1302 " <menuitem name='WSP' action='/Telephony/WSP'/>\n"
1304 " <menu name= 'ToolsMenu' action='/Tools'>\n"
1305 " <menuitem name='FirewallACLRules' action='/Tools/FirewallACLRules'/>\n"
1306 " <menu name='LUA' action='/Tools/LUA'>\n"
1307 " <placeholder name='LUA-menu-items'/>\n"
1310 " <menu name= 'InternalsMenu' action='/Internals'>\n"
1311 " <menuitem name='Dissectortables' action='/Internals/Dissectortables'/>\n"
1312 " <menuitem name='SupportedProtocols' action='/Internals/SupportedProtocols'/>\n"
1314 " <menu name= 'HelpMenu' action='/Help'>\n"
1315 " <menuitem name='Contents' action='/Help/Contents'/>\n"
1316 " <menu name= 'ManualPages' action='/Help/ManualPages'>\n"
1317 " <menuitem name='Wireshark' action='/Help/ManualPages/Wireshark'/>\n"
1318 " <menuitem name='WiresharkFilter' action='/Help/ManualPages/WiresharkFilter'/>\n"
1320 " <menuitem name='TShark' action='/Help/ManualPages/TShark'/>\n"
1321 " <menuitem name='RawShark' action='/Help/ManualPages/RawShark'/>\n"
1322 " <menuitem name='Dumpcap' action='/Help/ManualPages/Dumpcap'/>\n"
1323 " <menuitem name='Mergecap' action='/Help/ManualPages/Mergecap'/>\n"
1324 " <menuitem name='Editcap' action='/Help/ManualPages/Editcap'/>\n"
1325 " <menuitem name='Text2pcap' action='/Help/ManualPages/Text2pcap'/>\n"
1328 " <menuitem name='Website' action='/Help/Website'/>\n"
1329 " <menuitem name='FAQs' action='/Help/FAQs'/>\n"
1330 " <menuitem name='Downloads' action='/Help/Downloads'/>\n"
1332 " <menuitem name='Wiki' action='/Help/Wiki'/>\n"
1333 " <menuitem name='SampleCaptures' action='/Help/SampleCaptures'/>\n"
1335 " <menuitem name='AboutWireshark' action='/Help/AboutWireshark'/>\n"
1344 * Please do not use keystrokes that are used as "universal" shortcuts in
1345 * various desktop environments:
1348 * http://support.microsoft.com/kb/126449
1351 * http://library.gnome.org/users/user-guide/nightly/keyboard-skills.html.en
1354 * http://developer.kde.org/documentation/standards/kde/style/keys/shortcuts.html
1356 * In particular, do not use the following <control> sequences for anything
1357 * other than their standard purposes:
1359 * <control>O File->Open
1360 * <control>S File->Save
1361 * <control>P File->Print
1362 * <control>W File->Close
1363 * <control>Q File->Quit
1364 * <control>Z Edit->Undo (which we don't currently have)
1365 * <control>X Edit->Cut (which we don't currently have)
1366 * <control>C Edit->Copy (which we don't currently have)
1367 * <control>V Edit->Paste (which we don't currently have)
1368 * <control>A Edit->Select All (which we don't currently have)
1370 * Note that some if not all of the Edit keys above already perform those
1371 * functions in text boxes, such as the Filter box. Do no, under any
1372 * circumstances, make a change that keeps them from doing so.
1378 * const gchar *name;
1379 * const gchar *stock_id;
1380 * const gchar *label;
1381 * const gchar *accelerator;
1382 * const gchar *tooltip;
1383 * GCallback callback;
1385 * const gchar *name; The name of the action.
1386 * const gchar *stock_id; The stock id for the action, or the name of an icon from the icon theme.
1387 * const gchar *label; The label for the action. This field should typically be marked for translation,
1388 * see gtk_action_group_set_translation_domain().
1389 * If label is NULL, the label of the stock item with id stock_id is used.
1390 * const gchar *accelerator; The accelerator for the action, in the format understood by gtk_accelerator_parse().
1391 * const gchar *tooltip; The tooltip for the action. This field should typically be marked for translation,
1392 * see gtk_action_group_set_translation_domain().
1393 * GCallback callback; The function to call when the action is activated.
1396 static const GtkActionEntry main_menu_bar_entries[] = {
1398 { "/File", NULL, "_File", NULL, NULL, NULL },
1399 { "/Edit", NULL, "_Edit", NULL, NULL, NULL },
1400 { "/View", NULL, "_View", NULL, NULL, NULL },
1401 { "/Go", NULL, "_Go", NULL, NULL, NULL },
1403 { "/Capture", NULL, "_Capture", NULL, NULL, NULL },
1405 { "/Analyze", NULL, "_Analyze", NULL, NULL, NULL },
1406 { "/Statistics", NULL, "_Statistics", NULL, NULL, NULL },
1407 { "/Telephony", NULL, "Telephon_y", NULL, NULL, NULL },
1408 { "/Tools", NULL, "_Tools", NULL, NULL, NULL },
1409 { "/Internals", NULL, "_Internals", NULL, NULL, NULL },
1410 { "/Help", NULL, "_Help", NULL, NULL, NULL },
1412 { "/File/Open", GTK_STOCK_OPEN, "_Open...", "<control>O", "Open a file", G_CALLBACK(file_open_cmd_cb) },
1413 { "/File/OpenRecent", NULL, "Open _Recent", NULL, NULL, NULL },
1414 { "/File/Merge", NULL, "_Merge...", NULL, NULL, G_CALLBACK(file_merge_cmd_cb) },
1415 { "/File/Import", NULL, "_Import...", NULL, NULL, G_CALLBACK(file_import_cmd_cb) },
1416 { "/File/Close", GTK_STOCK_CLOSE, "_Close", "<control>W", NULL, G_CALLBACK(file_close_cmd_cb) },
1418 { "/File/Save", GTK_STOCK_SAVE, "_Save", "<control>S", NULL, G_CALLBACK(file_save_cmd_cb) },
1419 { "/File/SaveAs", GTK_STOCK_SAVE_AS, "Save _As...", "<shift><control>S", NULL, G_CALLBACK(file_save_as_cmd_cb) },
1421 { "/File/Set", NULL, "File Set", NULL, NULL, NULL },
1422 { "/File/Export", NULL, "Export", NULL, NULL, NULL },
1423 { "/File/Print", GTK_STOCK_PRINT, "_Print...", "<control>P", NULL, G_CALLBACK(file_print_cmd_cb) },
1424 { "/File/Quit", GTK_STOCK_QUIT, "_Quit", "<control>Q", NULL, G_CALLBACK(file_quit_cmd_cb) },
1426 { "/File/Set/ListFiles", WIRESHARK_STOCK_FILE_SET_LIST, "List Files", NULL, NULL, G_CALLBACK(fileset_cb) },
1427 { "/File/Set/NextFile", WIRESHARK_STOCK_FILE_SET_NEXT, "Next File", NULL, NULL, G_CALLBACK(fileset_next_cb) },
1428 { "/File/Set/PreviousFile",WIRESHARK_STOCK_FILE_SET_PREVIOUS, "Previous File", NULL, NULL, G_CALLBACK(fileset_previous_cb) },
1431 { "/File/Export/File", NULL, "File...", NULL, NULL, G_CALLBACK(export_text_cmd_cb) },
1433 { "/File/Export/File", NULL, "File...", NULL, NULL, NULL },
1434 { "/File/Export/File/Text", NULL, "as \"Plain _Text\" file...", NULL, NULL, G_CALLBACK(export_text_cmd_cb) },
1435 { "/File/Export/File/PostScript", NULL, "as \"_PostScript\" file...", NULL, NULL, G_CALLBACK(export_ps_cmd_cb) },
1436 { "/File/Export/File/CSV", NULL, "as \"_CSV\" (Comma Separated Values packet summary) file...",
1437 NULL, NULL, G_CALLBACK(export_csv_cmd_cb) },
1438 { "/File/Export/File/CArrays", NULL, "as \"C _Arrays\" (packet bytes) file...",
1439 NULL, NULL, G_CALLBACK(export_carrays_cmd_cb) },
1440 { "/File/Export/File/PSML", NULL, "as XML - \"P_SML\" (packet summary) file...",
1441 NULL, NULL, G_CALLBACK(export_psml_cmd_cb) },
1442 { "/File/Export/File/PDML", NULL, "as XML - \"P_DML\" (packet details) file...",
1443 NULL, NULL, G_CALLBACK(export_pdml_cmd_cb) },
1445 { "/File/Export/SelectedPacketBytes", NULL, "Selected Packet _Bytes...", "<control>H", NULL, G_CALLBACK(savehex_cb) },
1446 { "/File/Export/SslSessionKeys", NULL, "SSL Session Keys...", NULL, NULL, G_CALLBACK(savesslkeys_cb) },
1447 { "/File/Export/Objects", NULL, "Objects", NULL, NULL, NULL },
1448 { "/File/Export/Objects/HTTP", NULL, "_HTTP", NULL, NULL, G_CALLBACK(eo_http_cb) },
1449 { "/File/Export/Objects/DICOM", NULL, "_DICOM", NULL, NULL, G_CALLBACK(eo_dicom_cb) },
1450 { "/File/Export/Objects/SMB", NULL, "_SMB", NULL, NULL, G_CALLBACK(eo_smb_cb) },
1453 { "/Edit/Copy", NULL, "Copy", NULL, NULL, NULL },
1455 { "/Edit/Copy/Description", NULL, "Description", "<shift><control>D", NULL, G_CALLBACK(copy_description_cb) },
1456 { "/Edit/Copy/Fieldname", NULL, "Fieldname", "<shift><control>F", NULL, G_CALLBACK(copy_fieldname_cb) },
1457 { "/Edit/Copy/Value", NULL, "Value", "<shift><control>V", NULL, G_CALLBACK(copy_value_cb) },
1458 { "/Edit/Copy/AsFilter", NULL, "As Filter", "<shift><control>C", NULL, G_CALLBACK(copy_as_filter_cb) },
1462 * Un-#if this when we actually implement Cut/Copy/Paste for the
1463 * packet list and packet detail windows.
1465 * Note: when we implement Cut/Copy/Paste in those windows, we
1466 * will almost certainly want to allow multiple packets to be
1467 * selected in the packet list pane and multiple packet detail
1468 * items to be selected in the packet detail pane, so that
1469 * the user can, for example, copy the summaries of multiple
1470 * packets to the clipboard from the packet list pane and multiple
1471 * packet detail items - perhaps *all* packet detail items - from
1472 * the packet detail pane. Given that, we'll also want to
1473 * implement Select All.
1475 * If multiple packets are selected, we would probably display nothing
1476 * in the packet detail pane, just as we do if no packet is selected,
1477 * and any menu items etc. that would pertain only to a single packet
1478 * would be disabled.
1480 * If multiple packet detail items are selected, we would probably
1481 * disable all items that pertain only to a single packet detail
1482 * item, such as some items in the status bar.
1484 * XXX - the actions for these will be different depending on what
1485 * widget we're in; ^C should copy from the filter text widget if
1486 * we're in that widget, the packet list if we're in that widget
1487 * (presumably copying the summaries of selected packets to the
1488 * clipboard, e.g. the text copy would be the text of the columns),
1489 * the packet detail if we're in that widget (presumably copying
1490 * the contents of selected protocol tree items to the clipboard,
1491 * e.g. the text copy would be the text displayed for those items),
1494 * Given that those menu items should also affect text widgets
1495 * such as the filter box, we would again want Select All, and,
1496 * at least for the filter box, we would also want Undo and Redo.
1497 * We would only want Cut, Paste, Undo, and Redo for the packet
1498 * list and packet detail panes if we support modifying them.
1500 {"/Edit/_Undo", "<control>Z", NULL,
1501 0, "<StockItem>", GTK_STOCK_UNDO,},
1502 {"/Edit/_Redo", "<shift><control>Z", NULL,
1503 0, "<StockItem>", GTK_STOCK_REDO,},
1504 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1505 {"/Edit/Cu_t", "<control>X", NULL,
1506 0, "<StockItem>", GTK_STOCK_CUT,},
1507 {"/Edit/_Copy", "<control>C", NULL,
1508 0, "<StockItem>", GTK_STOCK_COPY,},
1509 {"/Edit/_Paste", "<control>V", NULL,
1510 0, "<StockItem>", GTK_STOCK_PASTE,},
1511 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1512 {"/Edit/Select _All", "<control>A", NULL, 0,
1513 #ifdef GTK_STOCK_SELECT_ALL /* first appeared in 2.10 */
1514 "<StockItem>", GTK_STOCK_SELECT_ALL,
1517 #endif /* GTK_STOCK_SELECT_ALL */
1519 { "/Edit/FindPacket", GTK_STOCK_FIND, "_Find Packet...", "<control>F", NULL, G_CALLBACK(find_frame_cb) },
1520 { "/Edit/FindNext", NULL, "Find Ne_xt", "<control>N", NULL, G_CALLBACK(find_next_cb) },
1521 { "/Edit/FindPrevious", NULL, "Find Pre_vious", "<control>B", NULL, G_CALLBACK(find_previous_cb) },
1523 { "/Edit/MarkPacket", NULL, "_Mark Packet (toggle)", "<control>M", NULL, G_CALLBACK(new_packet_list_mark_frame_cb) },
1524 { "/Edit/ToggleMarkingOfAllDisplayedPackets", NULL, "Toggle Marking Of All Displayed Packets", "<shift><alt><control>M", NULL, G_CALLBACK(new_packet_list_toggle_mark_all_displayed_frames_cb) },
1525 { "/Edit/MarkAllDisplayedPackets", NULL, "Mark All Displayed Packets", "<shift><control>M", NULL, G_CALLBACK(new_packet_list_mark_all_displayed_frames_cb) },
1526 { "/Edit/UnmarkAllDisplayedPackets", NULL, "_Unmark All Displayed Packets", "<alt><control>M", NULL, G_CALLBACK(new_packet_list_unmark_all_displayed_frames_cb) },
1527 { "/Edit/FindNextMark", NULL, "Find Next Mark", "<shift><control>N", NULL, G_CALLBACK(find_next_mark_cb) },
1528 { "/Edit/FindPreviousMark", NULL, "Find Next Mark", "<shift><control>B", NULL, G_CALLBACK(find_prev_mark_cb) },
1530 { "/Edit/IgnorePacket", NULL, "_Ignore Packet (toggle)", "<control>X", NULL, G_CALLBACK(new_packet_list_ignore_frame_cb) },
1532 * XXX - this next one overrides /Edit/Copy/Description
1534 { "/Edit/IgnoreAllDisplayedPackets", NULL, "_Ignore All Displayed Packets (toggle)","<alt><shift><control>X", NULL, G_CALLBACK(new_packet_list_ignore_all_displayed_frames_cb) },
1535 { "/Edit/Un-IgnoreAllPackets", NULL, "U_n-Ignore All Packets", "<shift><control>X", NULL, G_CALLBACK(new_packet_list_unignore_all_frames_cb) },
1536 { "/Edit/SetTimeReference", WIRESHARK_STOCK_TIME, "Set Time Reference (toggle)", "<control>T", NULL, G_CALLBACK(set_reftime_cb) },
1537 { "/Edit/Un-TimeReferenceAllPackets",NULL, "Un-Time Reference All Packets", "<alt><control>T", NULL, G_CALLBACK(new_packet_list_untime_reference_all_frames_cb) },
1538 { "/Edit/FindNextTimeReference", NULL, "Find Next Time Reference", "<alt><control>N", NULL, G_CALLBACK(find_next_ref_time_cb) },
1539 { "/Edit/FindPreviousTimeReference", NULL, "Find Previous Time Reference", "<alt><control>B", NULL, G_CALLBACK(find_previous_ref_time_cb) },
1540 { "/Edit/TimeShift", WIRESHARK_STOCK_TIME, "Time Shift...", "<shift><control>T", NULL, G_CALLBACK(time_shift_cb) },
1542 { "/Edit/ConfigurationProfiles", NULL, "_Configuration Profiles...", "<shift><control>A", NULL, G_CALLBACK(profile_dialog_cb) },
1543 { "/Edit/Preferences", GTK_STOCK_PREFERENCES, "_Preferences...", "<shift><control>P", NULL, G_CALLBACK(menus_prefs_cb) },
1544 #ifdef WANT_PACKET_EDITOR
1545 { "/Edit/EditPacket", NULL, "_Edit Packet", NULL, NULL, G_CALLBACK(edit_window_cb) },
1549 { "/View/TimeDisplayFormat", NULL, "_Time Display Format", NULL, NULL, NULL },
1551 { "/View/NameResolution", NULL, "Name Resol_ution", NULL, NULL, NULL },
1552 { "/View/ZoomIn", GTK_STOCK_ZOOM_IN, "_Zoom In", "<control>plus", NULL, G_CALLBACK(view_zoom_in_cb) },
1553 { "/View/ZoomOut", GTK_STOCK_ZOOM_OUT, "Zoom _Out", "<control>minus", NULL, G_CALLBACK(view_zoom_out_cb) },
1554 { "/View/NormalSize", GTK_STOCK_ZOOM_100, "_Normal Size", "<control>equal", NULL, G_CALLBACK(view_zoom_100_cb) },
1555 { "/View/ResizeAllColumns", WIRESHARK_STOCK_RESIZE_COLUMNS, "Resize All Columns", "<shift><control>R", NULL, G_CALLBACK(new_packet_list_resize_columns_cb) },
1556 { "/View/DisplayedColumns", NULL, "Displayed Columns", NULL, NULL, NULL },
1557 { "/View/ExpandSubtrees", NULL, "Expand Subtrees", NULL, NULL, G_CALLBACK(expand_tree_cb) },
1558 { "/View/ExpandAll", NULL, "Expand All", NULL, NULL, G_CALLBACK(expand_all_cb) },
1559 { "/View/CollapseAll", NULL, "Collapse All", NULL, NULL, G_CALLBACK(collapse_all_cb) },
1560 { "/View/ColorizeConversation", NULL, "Colorize Conversation",NULL, NULL, NULL },
1562 { "/View/ColorizeConversation/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(view_menu_color_conv_color1_cb) },
1563 { "/View/ColorizeConversation/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(view_menu_color_conv_color2_cb) },
1564 { "/View/ColorizeConversation/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(view_menu_color_conv_color3_cb) },
1565 { "/View/ColorizeConversation/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(view_menu_color_conv_color4_cb) },
1566 { "/View/ColorizeConversation/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(view_menu_color_conv_color5_cb) },
1567 { "/View/ColorizeConversation/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(view_menu_color_conv_color6_cb) },
1568 { "/View/ColorizeConversation/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(view_menu_color_conv_color7_cb) },
1569 { "/View/ColorizeConversation/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(view_menu_color_conv_color8_cb) },
1570 { "/View/ColorizeConversation/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(view_menu_color_conv_color9_cb) },
1571 { "/View/ColorizeConversation/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(view_menu_color_conv_color10_cb) },
1572 { "/View/ColorizeConversation/NewColoringRule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(view_menu_color_conv_new_rule_cb) },
1574 { "/View/ResetColoring1-10", NULL, "Reset Coloring 1-10", "<control>space", NULL, G_CALLBACK(view_menu_reset_coloring_cb) },
1575 { "/View/ColoringRules", GTK_STOCK_SELECT_COLOR, "_Coloring Rules...", NULL, NULL, G_CALLBACK(color_display_cb) },
1576 { "/View/ShowPacketinNewWindow", NULL, "Show Packet in New _Window", NULL, NULL, G_CALLBACK(new_window_cb) },
1577 { "/View/Reload", GTK_STOCK_REFRESH, "_Reload", "<control>R", NULL, G_CALLBACK(file_reload_cmd_cb) },
1580 { "/Go/Back", GTK_STOCK_GO_BACK, "_Back", "<alt>Left", NULL, G_CALLBACK(history_back_cb) },
1581 { "/Go/Forward", GTK_STOCK_GO_FORWARD, "_Forward", "<alt>Right", NULL, G_CALLBACK(history_forward_cb) },
1582 { "/Go/Goto", GTK_STOCK_JUMP_TO, "_Go to Packet...", "<control>G", NULL, G_CALLBACK(goto_frame_cb) },
1583 { "/Go/GotoCorrespondingPacket", NULL, "Go to _Corresponding Packet", NULL, NULL, G_CALLBACK(goto_framenum_cb) },
1584 { "/Go/PreviousPacket", GTK_STOCK_GO_UP, "Previous Packet", "<control>Up", NULL, G_CALLBACK(goto_previous_frame_cb) },
1585 { "/Go/NextPacket", GTK_STOCK_GO_DOWN, "Next Packet", "<control>Down", NULL, G_CALLBACK(goto_next_frame_cb) },
1586 { "/Go/FirstPacket", GTK_STOCK_GOTO_TOP, "F_irst Packet", "<control>Home", NULL, G_CALLBACK(goto_top_frame_cb) },
1587 { "/Go/LastPacket", GTK_STOCK_GOTO_BOTTOM, "_Last Packet", "<control>End", NULL, G_CALLBACK(goto_bottom_frame_cb) },
1588 { "/Go/PreviousPacketInConversation", GTK_STOCK_GO_UP, "Previous Packet In Conversation", "<control>comma", NULL, G_CALLBACK(goto_previous_frame_conversation_cb) },
1589 { "/Go/NextPacketInConversation", GTK_STOCK_GO_DOWN, "Next Packet In Conversation", "<control>period", NULL, G_CALLBACK(goto_next_frame_conversation_cb) },
1592 { "/Capture/Interfaces", WIRESHARK_STOCK_CAPTURE_INTERFACES, "_Interfaces...", "<control>I", NULL, G_CALLBACK(capture_if_cb) },
1593 { "/Capture/Options", WIRESHARK_STOCK_CAPTURE_OPTIONS, "_Options...", "<control>K", NULL, G_CALLBACK(capture_prep_cb) },
1594 { "/Capture/Start", WIRESHARK_STOCK_CAPTURE_START, "_Start", "<control>E", NULL, G_CALLBACK(capture_start_cb) },
1595 { "/Capture/Stop", WIRESHARK_STOCK_CAPTURE_STOP, "S_top", "<control>E", NULL, G_CALLBACK(capture_stop_cb) },
1596 { "/Capture/Restart", WIRESHARK_STOCK_CAPTURE_RESTART, "_Restart", "<control>R", NULL, G_CALLBACK(capture_restart_cb) },
1597 { "/Capture/CaptureFilters", WIRESHARK_STOCK_CAPTURE_FILTER, "Capture _Filters...", NULL, NULL, G_CALLBACK(cfilter_dialog_cb) },
1599 #endif /* HAVE_LIBPCAP */
1600 { "/Analyze/DisplayFilters", WIRESHARK_STOCK_DISPLAY_FILTER, "_Display Filters...", NULL, NULL, G_CALLBACK(dfilter_dialog_cb) },
1602 { "/Analyze/DisplayFilterMacros", NULL, "Display Filter _Macros...", NULL, NULL, G_CALLBACK(macros_dialog_cb) },
1603 { "/Analyze/ApplyasColumn", NULL, "Apply as Column", NULL, NULL, G_CALLBACK(apply_as_custom_column_cb) },
1604 { "/Analyze/ApplyasFilter", NULL, "Apply as Filter", NULL, NULL, NULL },
1606 { "/Analyze/ApplyasFilter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(tree_view_menu_apply_selected_cb) },
1607 { "/Analyze/ApplyasFilter/NotSelected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_not_selected_cb) },
1608 { "/Analyze/ApplyasFilter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_and_selected_cb) },
1609 { "/Analyze/ApplyasFilter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_or_selected_cb) },
1610 { "/Analyze/ApplyasFilter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_and_not_selected_cb) },
1611 { "/Analyze/ApplyasFilter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_or_not_selected_cb) },
1613 { "/Analyze/PrepareaFilter", NULL, "Prepare a Filter", NULL, NULL, NULL },
1614 { "/Analyze/PrepareaFilter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(tree_view_menu_prepare_selected_cb) },
1615 { "/Analyze/PrepareaFilter/NotSelected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_not_selected_cb) },
1616 { "/Analyze/PrepareaFilter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_and_selected_cb) },
1617 { "/Analyze/PrepareaFilter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_or_selected_cb) },
1618 { "/Analyze/PrepareaFilter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_and_not_selected_cb) },
1619 { "/Analyze/PrepareaFilter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_or_not_selected_cb) },
1621 { "/Analyze/EnabledProtocols", WIRESHARK_STOCK_CHECKBOX, "_Enabled Protocols...", "<shift><control>E", NULL, G_CALLBACK(proto_cb) },
1622 { "/Analyze/DecodeAs", WIRESHARK_STOCK_DECODE_AS, "Decode _As...", NULL, NULL, G_CALLBACK(decode_as_cb) },
1623 { "/Analyze/UserSpecifiedDecodes", WIRESHARK_STOCK_DECODE_AS, "_User Specified Decodes...", NULL, NULL, G_CALLBACK(decode_show_cb) },
1625 { "/Analyze/FollowTCPStream", NULL, "Follow TCP Stream", NULL, NULL, G_CALLBACK(follow_tcp_stream_cb) },
1626 { "/Analyze/FollowUDPStream", NULL, "Follow UDP Stream", NULL, NULL, G_CALLBACK(follow_udp_stream_cb) },
1627 { "/Analyze/FollowSSLStream", NULL, "Follow SSL Stream", NULL, NULL, G_CALLBACK(follow_ssl_stream_cb) },
1629 { "/Analyze/ExpertInfoComposite",WIRESHARK_STOCK_EXPERT_INFO, "Expert Info _Composite", NULL, NULL, G_CALLBACK(expert_comp_dlg_launch) },
1631 { "/Analyze/ConversationFilter", NULL, "Conversation Filter", NULL, NULL, NULL },
1634 { "/Stataistics/ConversationList", NULL, "_Conversation List", NULL, NULL, NULL },
1635 { "/Stataistics/ConversationList/Ethernet", WIRESHARK_STOCK_CONVERSATIONS, "Ethernet", NULL, NULL, G_CALLBACK(eth_endpoints_cb) },
1636 { "/Stataistics/ConversationList/FibreChannel", WIRESHARK_STOCK_CONVERSATIONS, "Fibre Channel", NULL, NULL, G_CALLBACK(fc_endpoints_cb) },
1637 { "/Stataistics/ConversationList/FDDI", WIRESHARK_STOCK_CONVERSATIONS, "FDDI", NULL, NULL, G_CALLBACK(fddi_endpoints_cb) },
1638 { "/Stataistics/ConversationList/IP", WIRESHARK_STOCK_CONVERSATIONS, "IPv4", NULL, NULL, G_CALLBACK(ip_endpoints_cb) },
1639 { "/Stataistics/ConversationList/IPv6", WIRESHARK_STOCK_CONVERSATIONS, "IPv6", NULL, NULL, G_CALLBACK(ipv6_endpoints_cb) },
1640 { "/Stataistics/ConversationList/IPX", WIRESHARK_STOCK_CONVERSATIONS, "IPX", NULL, NULL, G_CALLBACK(ipx_endpoints_cb) },
1641 { "/Stataistics/ConversationList/JXTA", WIRESHARK_STOCK_CONVERSATIONS, "JXTA", NULL, NULL, G_CALLBACK(jxta_conversation_cb) },
1642 { "/Stataistics/ConversationList/NCP", WIRESHARK_STOCK_CONVERSATIONS, "NCP", NULL, NULL, G_CALLBACK(ncp_endpoints_cb) },
1643 { "/Stataistics/ConversationList/RSVP", WIRESHARK_STOCK_CONVERSATIONS, "RSVP", NULL, NULL, G_CALLBACK(rsvp_endpoints_cb) },
1644 { "/Stataistics/ConversationList/SCTP", WIRESHARK_STOCK_CONVERSATIONS, "SCTP", NULL, NULL, G_CALLBACK(sctp_conversation_cb) },
1645 { "/Stataistics/ConversationList/TCPIP", WIRESHARK_STOCK_CONVERSATIONS, "TCP (IPv4 & IPv6)", NULL, NULL, G_CALLBACK(tcpip_conversation_cb) },
1646 { "/Stataistics/ConversationList/TR", WIRESHARK_STOCK_CONVERSATIONS, "Token Ring", NULL, NULL, G_CALLBACK(tr_conversation_cb) },
1647 { "/Stataistics/ConversationList/UDPIP", WIRESHARK_STOCK_CONVERSATIONS, "UDP (IPv4 & IPv6)", NULL, NULL, G_CALLBACK(udpip_conversation_cb) },
1648 { "/Stataistics/ConversationList/USB", WIRESHARK_STOCK_CONVERSATIONS, "USB", NULL, NULL, G_CALLBACK(usb_endpoints_cb) },
1649 { "/Stataistics/ConversationList/WLAN", WIRESHARK_STOCK_CONVERSATIONS, "WLAN", NULL, NULL, G_CALLBACK(wlan_endpoints_cb) },
1651 { "/Statistics/EndpointList", NULL, "_Endpoint List", NULL, NULL, NULL },
1652 { "/Statistics/EndpointList/Ethernet", WIRESHARK_STOCK_ENDPOINTS, "Ethernet", NULL, NULL, G_CALLBACK(gtk_eth_hostlist_cb) },
1653 { "/Statistics/EndpointList/FibreChannel", WIRESHARK_STOCK_ENDPOINTS, "Fibre Channel", NULL, NULL, G_CALLBACK(gtk_fc_hostlist_cb) },
1654 { "/Statistics/EndpointList/FDDI", WIRESHARK_STOCK_ENDPOINTS, "FDDI", NULL, NULL, G_CALLBACK(gtk_fddi_hostlist_cb) },
1655 { "/Statistics/EndpointList/IP", WIRESHARK_STOCK_ENDPOINTS, "IPv4", NULL, NULL, G_CALLBACK(gtk_ip_hostlist_cb) },
1656 { "/Statistics/EndpointList/IPv6", WIRESHARK_STOCK_ENDPOINTS, "IPv6", NULL, NULL, G_CALLBACK(gtk_ipv6_hostlist_cb) },
1657 { "/Statistics/EndpointList/IPX", WIRESHARK_STOCK_ENDPOINTS, "IPX", NULL, NULL, G_CALLBACK(gtk_ipx_hostlist_cb) },
1658 { "/Statistics/EndpointList/JXTA", WIRESHARK_STOCK_ENDPOINTS, "JXTA", NULL, NULL, G_CALLBACK(gtk_jxta_hostlist_cb) },
1659 { "/Statistics/EndpointList/NCP", WIRESHARK_STOCK_ENDPOINTS, "NCP", NULL, NULL, G_CALLBACK(gtk_ncp_hostlist_cb) },
1660 { "/Statistics/EndpointList/RSVP", WIRESHARK_STOCK_ENDPOINTS, "RSVP", NULL, NULL, G_CALLBACK(gtk_rsvp_hostlist_cb) },
1661 { "/Statistics/EndpointList/SCTP", WIRESHARK_STOCK_ENDPOINTS, "SCTP", NULL, NULL, G_CALLBACK(gtk_sctp_hostlist_cb) },
1662 { "/Statistics/EndpointList/TCPIP", WIRESHARK_STOCK_ENDPOINTS, "TCP (IPv4 & IPv6)", NULL, NULL, G_CALLBACK(gtk_tcpip_hostlist_cb) },
1663 { "/Statistics/EndpointList/TR", WIRESHARK_STOCK_ENDPOINTS, "Token Ring", NULL, NULL, G_CALLBACK(gtk_tr_hostlist_cb) },
1664 { "/Statistics/EndpointList/UDPIP", WIRESHARK_STOCK_ENDPOINTS, "UDP (IPv4 & IPv6)", NULL, NULL, G_CALLBACK(gtk_udpip_hostlist_cb) },
1665 { "/Statistics/EndpointList/USB", WIRESHARK_STOCK_ENDPOINTS, "USB", NULL, NULL, G_CALLBACK(gtk_usb_hostlist_cb) },
1666 { "/Statistics/EndpointList/WLAN", WIRESHARK_STOCK_ENDPOINTS, "WLAN", NULL, NULL, G_CALLBACK(gtk_wlan_hostlist_cb) },
1668 { "/Statistics/ServiceResponseTime", NULL, "Service _Response Time", NULL, NULL, NULL },
1669 { "/Statistics/ServiceResponseTime/ONC-RPC", WIRESHARK_STOCK_TIME, "ONC-RPC...", NULL, NULL, G_CALLBACK(gtk_rpcstat_cb) },
1670 { "/Statistics/ServiceResponseTime/AFP", WIRESHARK_STOCK_TIME, "AFP...", NULL, NULL, G_CALLBACK(afp_srt_stat_cb) },
1671 { "/Statistics/ServiceResponseTime/Camel", WIRESHARK_STOCK_TIME, "Camel...", NULL, NULL, G_CALLBACK(camel_srt_cb) },
1672 { "/Statistics/ServiceResponseTime/DCE-RPC", WIRESHARK_STOCK_TIME, "DCE-RPC...", NULL, NULL, G_CALLBACK(gtk_dcerpcstat_cb) },
1673 { "/Statistics/ServiceResponseTime/Diameter", WIRESHARK_STOCK_TIME, "Diameter...", NULL, NULL, G_CALLBACK(diameter_srt_cb) },
1674 { "/Statistics/ServiceResponseTime/FibreChannel", WIRESHARK_STOCK_TIME, "Fibre Channel...", NULL, NULL, G_CALLBACK(fc_srt_cb) },
1675 { "/Statistics/ServiceResponseTime/GTP", WIRESHARK_STOCK_TIME, "GTP...", NULL, NULL, G_CALLBACK(gtp_srt_cb) },
1676 { "/Statistics/ServiceResponseTime/H225", WIRESHARK_STOCK_TIME, "H225...", NULL, NULL, G_CALLBACK(h225_srt_cb) },
1677 { "/Statistics/ServiceResponseTime/LDAP", WIRESHARK_STOCK_TIME, "LDAP...", NULL, NULL, G_CALLBACK(ldap_srt_cb) },
1678 { "/Statistics/ServiceResponseTime/MEGACO", WIRESHARK_STOCK_TIME, "MEGACO...", NULL, NULL, G_CALLBACK(megaco_srt_cb) },
1679 { "/Statistics/ServiceResponseTime/MGCP", WIRESHARK_STOCK_TIME, "MGCP...", NULL, NULL, G_CALLBACK(mgcp_srt_cb) },
1680 { "/Statistics/ServiceResponseTime/NCP", WIRESHARK_STOCK_TIME, "NCP...", NULL, NULL, G_CALLBACK(ncp_srt_cb) },
1681 { "/Statistics/ServiceResponseTime/RADIUS", WIRESHARK_STOCK_TIME, "RADIUS...", NULL, NULL, G_CALLBACK(radius_srt_cb) },
1682 { "/Statistics/ServiceResponseTime/SCSI", WIRESHARK_STOCK_TIME, "SCSI...", NULL, NULL, G_CALLBACK(scsi_srt_cb) },
1683 { "/Statistics/ServiceResponseTime/SMB", WIRESHARK_STOCK_TIME, "SMB...", NULL, NULL, G_CALLBACK(smb_srt_cb) },
1684 { "/Statistics/ServiceResponseTime/SMB2", WIRESHARK_STOCK_TIME, "SMB2...", NULL, NULL, G_CALLBACK(smb2_srt_cb) },
1686 { "/StatisticsMenu/ancp", NULL, "ANCP", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1687 { "/StatisticsMenu/BACnet", NULL, "BACnet", NULL, NULL, NULL },
1688 { "/StatisticsMenu/BACnet/bacapp_instanceid", NULL, "Packets sorted by Instance ID", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1689 { "/StatisticsMenu/BACnet/bacapp_ip", NULL, "Packets sorted by IP", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1690 { "/StatisticsMenu/BACnet/bacapp_objectid", NULL, "Packets sorted by Object Type", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1691 { "/StatisticsMenu/BACnet/bacapp_service", NULL, "Packets sorted by Service", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1692 { "/StatisticsMenu/BOOTP-DHCP", NULL, "BOOTP-DHCP...", NULL, NULL, G_CALLBACK(bootp_dhcp_stat_cb) },
1694 { "/StatisticsMenu/collectd", NULL, "Collectd...", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1695 { "/StatisticsMenu/compare", NULL, "Compare...", NULL, NULL, G_CALLBACK(gtk_comparestat_cb) },
1696 { "/StatisticsMenu/FlowGraph", WIRESHARK_STOCK_FLOW_GRAPH, "Flo_w Graph...", NULL, NULL, G_CALLBACK(flow_graph_launch) },
1697 { "/StatisticsMenu/HTTP", NULL, "HTTP", NULL, NULL, NULL },
1698 { "/StatisticsMenu/HTTP/http", NULL, "Packet Counter", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1699 { "/StatisticsMenu/HTTP/http_req", NULL, "Requests", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1700 { "/StatisticsMenu/HTTP/http_srv", NULL, "Load Distribution", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1702 { "/StatisticsMenu/ip_hosts", NULL, "IP Addresses...", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1703 { "/StatisticsMenu/dests", NULL, "IP Destinations...", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1704 { "/StatisticsMenu/ptype", NULL, "IP Protocol Types..", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1705 { "/StatisticsMenu/ONC-RPC-Programs", NULL, "ONC-RPC Programs", NULL, NULL, G_CALLBACK(gtk_rpcprogs_cb) },
1706 { "/StatisticsMenu/Sametime", NULL, "Sametime", NULL, NULL, NULL },
1707 { "/StatisticsMenu/Sametime/sametime", NULL, "Messages", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1708 { "/StatisticsMenu/TCPStreamGraphMenu", NULL, "TCP StreamGraph", NULL, NULL, NULL },
1709 { "/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-Stevens", NULL, "Time-Sequence Graph (Stevens)", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1710 { "/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-tcptrace", NULL, "Time-Sequence Graph (tcptrace)", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1711 { "/StatisticsMenu/TCPStreamGraphMenu/Throughput-Graph", NULL, "Throughput Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1712 { "/StatisticsMenu/TCPStreamGraphMenu/RTT-Graph", NULL, "Round Trip Time Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1713 { "/StatisticsMenu/TCPStreamGraphMenu/Window-Scaling-Graph", NULL, "Window Scaling Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1715 { "/StatisticsMenu/UDPMulticastStreams", NULL, "UDP Multicast Streams", NULL, NULL, G_CALLBACK(mcaststream_launch) },
1716 { "/StatisticsMenu/WLANTraffic", NULL, "WLAN Traffic", NULL, NULL, G_CALLBACK(wlanstat_launch) },
1718 { "/Statistics/Summary", GTK_STOCK_PROPERTIES, "_Summary", NULL, NULL, G_CALLBACK(summary_open_cb) },
1719 { "/Statistics/ProtocolHierarchy", NULL, "_Protocol Hierarchy", NULL, NULL, G_CALLBACK(proto_hier_stats_cb) },
1720 { "/Statistics/Conversations", WIRESHARK_STOCK_CONVERSATIONS, "Conversations", NULL, NULL, G_CALLBACK(init_conversation_notebook_cb) },
1721 { "/Statistics/Endpoints", WIRESHARK_STOCK_ENDPOINTS, "Endpoints", NULL, NULL, G_CALLBACK(init_hostlist_notebook_cb) },
1722 { "/Statistics/IOGraphs", WIRESHARK_STOCK_GRAPHS, "_IO Graph", NULL, NULL, G_CALLBACK(gui_iostat_cb) },
1723 { "/Statistics/plen", NULL, "Packet Lengths...", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1725 { "/Telephony/ANSI", NULL, "_ANSI", NULL, NULL, NULL },
1726 { "/Telephony/ANSI/BSMAP", NULL, "A-Interface BSMAP", NULL, NULL, G_CALLBACK(ansi_a_stat_gtk_bsmap_cb) },
1727 { "/Telephony/ANSI/DTAP", NULL, "A-Interface DTAP", NULL, NULL, G_CALLBACK(ansi_a_stat_gtk_dtap_cb) },
1728 { "/Telephony/ANSI/MAP-OP", NULL, "MAP Operation", NULL, NULL, G_CALLBACK(ansi_map_stat_gtk_cb) },
1730 { "/Telephony/GSM", NULL, "_GSM", NULL, NULL, NULL },
1731 { "/Telephony/GSM/CAMEL", NULL, "CAMEL Messages and Response Status", NULL, NULL, G_CALLBACK(camel_counter_cb) },
1732 { "/Telephony/GSM/BSSMAP", NULL, "_GSM/A-Interface BSSMAP", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_bssmap_cb) },
1734 { "/Telephony/GSM/DTAP", NULL, "_GSM/A-Interface DTAP", NULL, NULL, NULL },
1735 { "/Telephony/GSM/DTAP/CC", NULL, "Call Control", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_cc_cb) },
1736 { "/Telephony/GSM/DTAP/GMM", NULL, "GPRS Mobility Management", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_gmm_cb) },
1737 { "/Telephony/GSM/DTAP/SM", NULL, "GPRS Session Management", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_sm_cb) },
1738 { "/Telephony/GSM/DTAP/MM", NULL, "Mobility Management", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_mm_cb) },
1739 { "/Telephony/GSM/DTAP/RR", NULL, "Radio Resource Management",NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_rr_cb) },
1740 { "/Telephony/GSM/DTAP/SMS", NULL, "Short Message Service", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_sms_cb) },
1741 { "/Telephony/GSM/DTAP/TP", NULL, "Special Conformance Testing Functions", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_tp_cb) },
1742 { "/Telephony/GSM/DTAP/SS", NULL, "Supplementary Services", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_ss_cb) },
1744 { "/Telephony/GSM/SACCH", NULL, "_GSM/A-Interface SACCH", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_sacch_rr_cb) },
1745 { "/Telephony/GSM/MAP-OP", NULL, "_GSM/MAP Operation", NULL, NULL, G_CALLBACK(gsm_map_stat_gtk_cb) },
1746 { "/Telephony/GSM/MAPSummary", NULL, "MAP Summary", NULL, NULL, G_CALLBACK(gsm_map_stat_gtk_sum_cb) },
1748 { "/Telephony/H225", NULL, "_H.225...", NULL, NULL, G_CALLBACK(h225_counter_cb) },
1750 { "/Telephony/IAX2", NULL, "IA_X2", NULL, NULL, NULL },
1751 { "/Telephony/IAX2/StreamAnalysis", NULL, "Stream Analysis...", NULL, NULL, G_CALLBACK(iax2_analysis_cb) },
1753 { "/Telephony/isup_msg", NULL, "_ISUP Messages", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1755 { "/Telephony/LTE", NULL, "_LTE", NULL, NULL, NULL },
1756 { "/Telephony/LTE/MAC", NULL, "_MAC...", NULL, NULL, G_CALLBACK(mac_lte_stat_cb) },
1757 { "/Telephony/LTE/RLC", NULL, "_RLC...", NULL, NULL, G_CALLBACK(rlc_lte_stat_cb) },
1758 { "/Telephony/MTP3", NULL, "_MTP3", NULL, NULL, NULL },
1759 { "/Telephony/MTP3/MSUs", NULL, "MSUs", NULL, NULL, G_CALLBACK(mtp3_stat_gtk_cb) },
1760 { "/Telephony/MTP3/MSUSummary", NULL, "MSU Summary", NULL, NULL, G_CALLBACK(mtp3_sum_gtk_sum_cb) },
1761 { "/Telephony/RTP", NULL, "_RTP", NULL, NULL, NULL },
1762 { "/Telephony/RTP/StreamAnalysis", NULL, "Stream Analysis...", NULL, NULL, G_CALLBACK(rtp_analysis_cb) },
1763 { "/Telephony/RTP/ShowAllStreams", NULL, "Show All Streams", NULL, NULL, G_CALLBACK(rtpstream_launch) },
1764 { "/Telephony/RTSP", NULL, "RTSP", NULL, NULL, NULL },
1765 { "/Telephony/RTSP/rtsp", NULL, "Packet Counter", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1766 { "/Telephony/SCTP", NULL, "S_CTP", NULL, NULL, NULL },
1767 { "/Telephony/SCTP/AnalysethisAssociation", NULL, "Analyse this Association", NULL, NULL, G_CALLBACK(sctp_analyse_start) },
1768 { "/Telephony/SCTP/ShowAllAssociations", NULL, "Show All Associations...", NULL, NULL, G_CALLBACK(sctp_stat_start) },
1769 { "/Telephony/SCTP/ChunkCounter", NULL, "Chunk Counter", NULL, NULL, G_CALLBACK(sctp_chunk_counter_cb) },
1770 { "/Telephony/SIP", NULL, "_SIP...", NULL, NULL, G_CALLBACK(sipstat_cb) },
1771 { "/Telephony/smpp_commands", NULL, "SM_PPOperations", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1772 { "/Telephony/ucp_messages", NULL, "_UCP Messages", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
1773 { "/Telephony/VoIPCalls", WIRESHARK_STOCK_TELEPHONE, "_VoIP Calls", NULL, NULL, G_CALLBACK(voip_calls_launch) },
1774 { "/Telephony/WSP", NULL, "_WAP-WSP...", NULL, NULL, G_CALLBACK(wsp_stat_cb) },
1776 { "/Tools/FirewallACLRules", NULL, "Firewall ACL Rules", NULL, NULL, G_CALLBACK(firewall_rule_cb) },
1777 { "/Tools/LUA", NULL, "LUA", NULL, NULL, NULL },
1779 { "/Internals/Dissectortables", NULL, "_Dissector tables", NULL, NULL, G_CALLBACK(dissector_tables_dlg_cb) },
1780 { "/Internals/SupportedProtocols", NULL, "_Supported Protocols (slow!)", NULL, NULL, G_CALLBACK(supported_cb) },
1782 { "/Help/Contents", GTK_STOCK_HELP, "_Contents", "F1", NULL, G_CALLBACK(help_menu_cont_cb) },
1783 { "/Help/ManualPages", NULL, "ManualPages", NULL, NULL, NULL },
1784 { "/Help/ManualPages/Wireshark", NULL, "Wireshark", NULL, NULL, G_CALLBACK(help_menu_wireshark_cb) },
1785 { "/Help/ManualPages/WiresharkFilter", NULL, "Wireshark Filter", NULL, NULL, G_CALLBACK(help_menu_wireshark_flt_cb) },
1786 { "/Help/ManualPages/TShark", NULL, "Wireshark", NULL, NULL, G_CALLBACK(help_menu_Tshark_cb) },
1787 { "/Help/ManualPages/RawShark", NULL, "RawShark", NULL, NULL, G_CALLBACK(help_menu_RawShark_cb) },
1788 { "/Help/ManualPages/Dumpcap", NULL, "Dumpcap", NULL, NULL, G_CALLBACK(help_menu_Dumpcap_cb) },
1789 { "/Help/ManualPages/Mergecap", NULL, "Mergecap", NULL, NULL, G_CALLBACK(help_menu_Mergecap_cb) },
1790 { "/Help/ManualPages/Editcap", NULL, "Editcap", NULL, NULL, G_CALLBACK(help_menu_Editcap_cb) },
1791 { "/Help/ManualPages/Text2pcap", NULL, "Text2pcap", NULL, NULL, G_CALLBACK(help_menu_Text2pcap_cb) },
1793 { "/Help/Website", GTK_STOCK_HOME, "Website", NULL, NULL, G_CALLBACK(help_menu_Website_cb) },
1794 { "/Help/FAQs", NULL, "FAQ's", NULL, NULL, G_CALLBACK(help_menu_faq_cb) },
1795 { "/Help/Downloads", NULL, "Downloads", NULL, NULL, G_CALLBACK(help_menu_Downloads_cb) },
1796 { "/Help/Wiki", WIRESHARK_STOCK_WIKI, "Wiki", NULL, NULL, G_CALLBACK(help_menu_Wiki_cb) },
1797 { "/Help/SampleCaptures", NULL, "Sample Captures", NULL, NULL, G_CALLBACK(help_menu_SampleCaptures_cb) },
1798 { "/Help/AboutWireshark", WIRESHARK_STOCK_ABOUT, "_About Wireshark", NULL, NULL, G_CALLBACK(about_wireshark_cb) },
1801 static const GtkToggleActionEntry main_menu_bar_toggle_action_entries[] =
1803 /* name, stock id, label, accel, tooltip, callback, is_active */
1804 {"/View/MainToolbar", NULL, "_Main Toolbar", NULL, NULL, G_CALLBACK(main_toolbar_show_hide_cb), TRUE},
1805 {"/View/FilterToolbar", NULL, "_FilterToolbar", NULL, NULL, G_CALLBACK(filter_toolbar_show_hide_cb), TRUE},
1807 {"/View/WirelessToolbar", NULL, "_WirelessToolbar", NULL, NULL, G_CALLBACK(wireless_toolbar_show_hide_cb), TRUE},
1808 #endif /* HAVE_AIRPCAP */
1809 {"/View/Statusbar", NULL, "_Statusbar", NULL, NULL, G_CALLBACK(status_bar_show_hide_cb), TRUE},
1810 {"/View/PacketList", NULL, "Packet _List", NULL, NULL, G_CALLBACK(packet_list_show_hide_cb), TRUE},
1811 {"/View/PacketDetails", NULL, "Packet _Details", NULL, NULL, G_CALLBACK(packet_details_show_hide_cb), TRUE},
1812 {"/View/PacketBytes", NULL, "Packet _Bytes", NULL, NULL, G_CALLBACK(packet_bytes_show_hide_cb), TRUE},
1813 {"/View/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes", NULL, "Display Seconds with hours and minutes", NULL, NULL, G_CALLBACK(view_menu_seconds_time_cb), FALSE},
1814 {"/View/NameResolution/ResolveName", NULL, "_Resolve Name", NULL, NULL, G_CALLBACK(resolve_name_cb), FALSE},
1815 {"/View/NameResolution/EnableforMACLayer", NULL, "Enable for _MAC Layer", NULL, NULL, G_CALLBACK(view_menu_en_for_MAC_cb), TRUE},
1816 {"/View/NameResolution/EnableforNetworkLayer", NULL, "Enable for _Network Layer", NULL, NULL, G_CALLBACK(view_menu_en_for_network_cb), TRUE },
1817 {"/View/NameResolution/EnableforTransportLayer", NULL, "Enable for _Transport Layer", NULL, NULL, G_CALLBACK(view_menu_en_for_transport_cb), TRUE },
1818 {"/View/ColorizePacketList", NULL, "Colorize Packet List", NULL, NULL, G_CALLBACK(view_menu_colorize_pkt_lst_cb), TRUE },
1820 {"/View/AutoScrollinLiveCapture", NULL, "Auto Scroll in Li_ve Capture", NULL, NULL, G_CALLBACK(view_menu_auto_scroll_live_cb), TRUE },
1824 static const GtkRadioActionEntry main_menu_bar_radio_view_time_entries [] =
1826 /* name, stock id, label, accel, tooltip, value */
1827 { "/View/TimeDisplayFormat/DateandTimeofDay", NULL, "Date and Time of Day: 1970-01-01 01:02:03.123456", "<alt><control>1", NULL, TS_ABSOLUTE_WITH_DATE },
1828 { "/View/TimeDisplayFormat/TimeofDay", NULL, "Time of Day: 01:02:03.123456", "<alt><control>2", NULL, TS_ABSOLUTE },
1829 { "/View/TimeDisplayFormat/SecondsSinceEpoch", NULL, "Seconds Since Epoch (1970-01-01): 1234567890.123456", "<alt><control>3", NULL, TS_EPOCH },
1830 { "/View/TimeDisplayFormat/SecondsSinceBeginningofCapture", NULL, "Seconds Since Beginning of Capture: 123.123456", "<alt><control>4", NULL, TS_RELATIVE },
1831 { "/View/TimeDisplayFormat/SecondsSincePreviousCapturedPacket", NULL, "Seconds Since Previous Captured Packet: 1.123456", "<alt><control>5", NULL, TS_DELTA },
1832 { "/View/TimeDisplayFormat/SecondsSincePreviousDisplayedPacket",NULL, "Seconds Since Previous Displayed Packet: 1.123456", "<alt><control>6", NULL, TS_DELTA_DIS },
1833 { "/View/TimeDisplayFormat/UTCDateandTimeofDay", NULL, "UTC Date and Time of Day: 1970-01-01 01:02:03.123456", "<alt><control>7", NULL, TS_UTC_WITH_DATE },
1834 { "/View/TimeDisplayFormat/UTCTimeofDay", NULL, "UTC Time of Day: 01:02:03.123456", "<alt><control>7", NULL, TS_UTC },
1837 static const GtkRadioActionEntry main_menu_bar_radio_view_time_fileformat_prec_entries [] =
1839 /* name, stock id, label, accel, tooltip, value */
1840 { "/View/TimeDisplayFormat/FileFormatPrecision-Automatic", NULL, "Automatic (File Format Precision)", NULL, NULL, TS_PREC_AUTO },
1841 { "/View/TimeDisplayFormat/FileFormatPrecision-Seconds", NULL, "Seconds: 0", NULL, NULL, TS_PREC_FIXED_SEC },
1842 { "/View/TimeDisplayFormat/FileFormatPrecision-Deciseconds", NULL, "Deciseconds: 0.1", NULL, NULL, TS_PREC_FIXED_DSEC },
1843 { "/View/TimeDisplayFormat/FileFormatPrecision-Centiseconds", NULL, "Centiseconds: 0.12", NULL, NULL, TS_PREC_FIXED_CSEC },
1844 { "/View/TimeDisplayFormat/FileFormatPrecision-Milliseconds", NULL, "Milliseconds: 0.123", NULL, NULL, TS_PREC_FIXED_MSEC },
1845 { "/View/TimeDisplayFormat/FileFormatPrecision-Microseconds", NULL, "Microseconds: 0.123456", NULL, NULL, TS_PREC_FIXED_USEC },
1846 { "/View/TimeDisplayFormat/FileFormatPrecision-Nanoseconds", NULL, "Nanoseconds: 0.123456789", NULL, NULL, TS_PREC_FIXED_NSEC },
1851 select_bytes_view_cb (GtkRadioAction *action, GtkRadioAction *current _U_, gpointer user_data _U_)
1855 value = gtk_radio_action_get_current_value (action);
1857 select_bytes_view( NULL, NULL, value);
1861 sort_ascending_cb(GtkAction *action _U_, gpointer user_data)
1863 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortAscending");
1864 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_SORT_ASCENDING);
1868 sort_descending_cb(GtkAction *action _U_, gpointer user_data)
1870 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortDescending");
1871 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_SORT_DESCENDING);
1875 no_sorting_cb(GtkAction *action _U_, gpointer user_data)
1877 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/NoSorting");
1878 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_SORT_NONE);
1882 packet_list_heading_show_resolved_cb(GtkAction *action _U_, gpointer user_data _U_)
1884 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ShowResolved");
1886 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_TOGGLE_RESOLVED);
1890 packet_list_heading_align_left_cb(GtkAction *action _U_, gpointer user_data)
1892 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/AlignLeft");
1893 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_ALIGN_LEFT);
1897 packet_list_heading_align_center_cb(GtkAction *action _U_, gpointer user_data)
1899 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/AlignCenter");
1900 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_ALIGN_CENTER);
1904 packet_list_heading_align_right_cb(GtkAction *action _U_, gpointer user_data)
1906 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/AlignRight");
1907 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_ALIGN_RIGHT);
1911 packet_list_heading_col_pref_cb(GtkAction *action _U_, gpointer user_data)
1913 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ColumnPreferences");
1914 prefs_page_cb( widget , user_data, PREFS_PAGE_COLUMNS);
1918 packet_list_heading_resize_col_cb(GtkAction *action _U_, gpointer user_data)
1920 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ResizeColumn");
1921 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_RESIZE);
1925 packet_list_heading_change_col_cb(GtkAction *action _U_, gpointer user_data)
1927 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/EditColumnDetails");
1928 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_CHANGE);
1932 packet_list_heading_activate_all_columns_cb(GtkAction *action _U_, gpointer user_data _U_)
1934 new_packet_list_set_all_columns_visible ();
1938 packet_list_heading_hide_col_cb(GtkAction *action _U_, gpointer user_data)
1940 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/HideColumn");
1941 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_HIDE);
1945 packet_list_heading_remove_col_cb(GtkAction *action _U_, gpointer user_data)
1947 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/RemoveColumn");
1948 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_REMOVE);
1952 packet_list_menu_set_ref_time_cb(GtkAction *action _U_, gpointer user_data)
1954 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_TOGGLE);
1959 packet_list_menu_apply_selected_cb(GtkAction *action _U_, gpointer user_data)
1961 match_selected_plist_cb( NULL /* widget _U_ */, user_data, MATCH_SELECTED_REPLACE|MATCH_SELECTED_APPLY_NOW);
1965 packet_list_menu_apply_not_selected_cb(GtkAction *action _U_, gpointer user_data)
1967 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_NOT|MATCH_SELECTED_APPLY_NOW);
1971 packet_list_menu_apply_and_selected_cb(GtkAction *action _U_, gpointer user_data)
1973 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_AND|MATCH_SELECTED_APPLY_NOW);
1977 packet_list_menu_apply_or_selected_cb(GtkAction *action _U_, gpointer user_data)
1979 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_OR|MATCH_SELECTED_APPLY_NOW);
1983 packet_list_menu_apply_and_not_selected_cb(GtkAction *action _U_, gpointer user_data)
1985 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_AND_NOT|MATCH_SELECTED_APPLY_NOW);
1989 packet_list_menu_apply_or_not_selected_cb(GtkAction *action _U_, gpointer user_data)
1991 match_selected_plist_cb( NULL /* widget _U_ */ , user_data,MATCH_SELECTED_OR_NOT|MATCH_SELECTED_APPLY_NOW);
1993 /* Prepare a filter */
1995 packet_list_menu_prepare_selected_cb(GtkAction *action _U_, gpointer user_data)
1997 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_REPLACE);
2001 packet_list_menu_prepare_not_selected_cb(GtkAction *action _U_, gpointer user_data)
2003 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_NOT);
2007 packet_list_menu_prepare_and_selected_cb(GtkAction *action _U_, gpointer user_data)
2009 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_AND);
2013 packet_list_menu_prepare_or_selected_cb(GtkAction *action _U_, gpointer user_data)
2015 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_OR);
2019 packet_list_menu_prepare_and_not_selected_cb(GtkAction *action _U_, gpointer user_data)
2021 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_AND_NOT);
2025 packet_list_menu_prepare_or_not_selected_cb(GtkAction *action _U_, gpointer user_data)
2027 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_OR_NOT);
2031 packet_list_menu_conversation_ethernet_cb(GtkAction *action, gpointer user_data)
2033 conversation_cb( action, user_data, CONV_ETHER);
2037 packet_list_menu_conversation_ip_cb(GtkAction *action _U_, gpointer user_data)
2039 conversation_cb( action, user_data, CONV_IP);
2043 packet_list_menu_conversation_tcp_cb(GtkAction *action _U_, gpointer user_data)
2045 conversation_cb( action, user_data, CONV_TCP);
2049 packet_list_menu_conversation_udp_cb(GtkAction *action _U_, gpointer user_data)
2051 conversation_cb( action, user_data, CONV_UDP);
2055 packet_list_menu_conversation_pn_cba_cb(GtkAction *action _U_, gpointer user_data)
2057 conversation_cb( action, user_data, CONV_CBA);
2063 packet_list_menu_color_conv_ethernet_color1_cb(GtkAction *action, gpointer user_data)
2065 colorize_conversation_cb(action, user_data, CONV_ETHER+1*256);
2069 packet_list_menu_color_conv_ethernet_color2_cb(GtkAction *action, gpointer user_data)
2071 colorize_conversation_cb(action, user_data, CONV_ETHER+2*256);
2075 packet_list_menu_color_conv_ethernet_color3_cb(GtkAction *action, gpointer user_data)
2077 colorize_conversation_cb(action, user_data, CONV_ETHER+3*256);
2081 packet_list_menu_color_conv_ethernet_color4_cb(GtkAction *action, gpointer user_data)
2083 colorize_conversation_cb(action, user_data, CONV_ETHER+4*256);
2087 packet_list_menu_color_conv_ethernet_color5_cb(GtkAction *action, gpointer user_data)
2089 colorize_conversation_cb(action, user_data, CONV_ETHER+5*256);
2093 packet_list_menu_color_conv_ethernet_color6_cb(GtkAction *action, gpointer user_data)
2095 colorize_conversation_cb(action, user_data, CONV_ETHER+6*256);
2099 packet_list_menu_color_conv_ethernet_color7_cb(GtkAction *action, gpointer user_data)
2101 colorize_conversation_cb(action, user_data, CONV_ETHER+7*256);
2105 packet_list_menu_color_conv_ethernet_color8_cb(GtkAction *action, gpointer user_data)
2107 colorize_conversation_cb(action, user_data, CONV_ETHER+8*256);
2111 packet_list_menu_color_conv_ethernet_color9_cb(GtkAction *action, gpointer user_data)
2113 colorize_conversation_cb(action, user_data, CONV_ETHER+9*256);
2117 packet_list_menu_color_conv_ethernet_color10_cb(GtkAction *action, gpointer user_data)
2119 colorize_conversation_cb(action, user_data, CONV_ETHER+10*256);
2123 packet_list_menu_color_conv_ethernet_new_rule_cb(GtkAction *action, gpointer user_data)
2125 colorize_conversation_cb(action, user_data, CONV_ETHER);
2131 packet_list_menu_color_conv_ip_color1_cb(GtkAction *action, gpointer user_data)
2133 colorize_conversation_cb(action, user_data, CONV_IP+1*256);
2137 packet_list_menu_color_conv_ip_color2_cb(GtkAction *action, gpointer user_data)
2139 colorize_conversation_cb(action, user_data, CONV_IP+2*256);
2143 packet_list_menu_color_conv_ip_color3_cb(GtkAction *action, gpointer user_data)
2145 colorize_conversation_cb(action, user_data, CONV_IP+3*256);
2149 packet_list_menu_color_conv_ip_color4_cb(GtkAction *action, gpointer user_data)
2151 colorize_conversation_cb(action, user_data, CONV_IP+4*256);
2155 packet_list_menu_color_conv_ip_color5_cb(GtkAction *action, gpointer user_data)
2157 colorize_conversation_cb(action, user_data, CONV_IP+5*256);
2161 packet_list_menu_color_conv_ip_color6_cb(GtkAction *action, gpointer user_data)
2163 colorize_conversation_cb(action, user_data, CONV_IP+6*256);
2167 packet_list_menu_color_conv_ip_color7_cb(GtkAction *action, gpointer user_data)
2169 colorize_conversation_cb(action, user_data, CONV_IP+7*256);
2173 packet_list_menu_color_conv_ip_color8_cb(GtkAction *action, gpointer user_data)
2175 colorize_conversation_cb(action, user_data, CONV_IP+8*256);
2179 packet_list_menu_color_conv_ip_color9_cb(GtkAction *action, gpointer user_data)
2181 colorize_conversation_cb(action, user_data, CONV_IP+9*256);
2185 packet_list_menu_color_conv_ip_color10_cb(GtkAction *action, gpointer user_data)
2187 colorize_conversation_cb(action, user_data, CONV_IP+10*256);
2191 packet_list_menu_color_conv_ip_new_rule_cb(GtkAction *action, gpointer user_data)
2193 colorize_conversation_cb(action, user_data, CONV_TCP);
2199 packet_list_menu_color_conv_tcp_color1_cb(GtkAction *action, gpointer user_data)
2201 colorize_conversation_cb(action, user_data, CONV_TCP+1*256);
2205 packet_list_menu_color_conv_tcp_color2_cb(GtkAction *action, gpointer user_data)
2207 colorize_conversation_cb(action, user_data, CONV_TCP+2*256);
2211 packet_list_menu_color_conv_tcp_color3_cb(GtkAction *action, gpointer user_data)
2213 colorize_conversation_cb(action, user_data, CONV_TCP+3*256);
2217 packet_list_menu_color_conv_tcp_color4_cb(GtkAction *action, gpointer user_data)
2219 colorize_conversation_cb(action, user_data, CONV_TCP+4*256);
2223 packet_list_menu_color_conv_tcp_color5_cb(GtkAction *action, gpointer user_data)
2225 colorize_conversation_cb(action, user_data, CONV_TCP+5*256);
2229 packet_list_menu_color_conv_tcp_color6_cb(GtkAction *action, gpointer user_data)
2231 colorize_conversation_cb(action, user_data, CONV_TCP+6*256);
2235 packet_list_menu_color_conv_tcp_color7_cb(GtkAction *action, gpointer user_data)
2237 colorize_conversation_cb(action, user_data, CONV_TCP+7*256);
2241 packet_list_menu_color_conv_tcp_color8_cb(GtkAction *action, gpointer user_data)
2243 colorize_conversation_cb(action, user_data, CONV_TCP+8*256);
2247 packet_list_menu_color_conv_tcp_color9_cb(GtkAction *action, gpointer user_data)
2249 colorize_conversation_cb(action, user_data, CONV_TCP+9*256);
2253 packet_list_menu_color_conv_tcp_color10_cb(GtkAction *action, gpointer user_data)
2255 colorize_conversation_cb(action, user_data, CONV_TCP+10*256);
2259 packet_list_menu_color_conv_tcp_new_rule_cb(GtkAction *action, gpointer user_data)
2261 colorize_conversation_cb(action, user_data, CONV_TCP);
2267 packet_list_menu_color_conv_udp_color1_cb(GtkAction *action, gpointer user_data)
2269 colorize_conversation_cb(action, user_data, CONV_UDP+1*256);
2273 packet_list_menu_color_conv_udp_color2_cb(GtkAction *action, gpointer user_data)
2275 colorize_conversation_cb(action, user_data, CONV_UDP+2*256);
2279 packet_list_menu_color_conv_udp_color3_cb(GtkAction *action, gpointer user_data)
2281 colorize_conversation_cb(action, user_data, CONV_UDP+3*256);
2285 packet_list_menu_color_conv_udp_color4_cb(GtkAction *action, gpointer user_data)
2287 colorize_conversation_cb(action, user_data, CONV_UDP+4*256);
2291 packet_list_menu_color_conv_udp_color5_cb(GtkAction *action, gpointer user_data)
2293 colorize_conversation_cb(action, user_data, CONV_UDP+5*256);
2297 packet_list_menu_color_conv_udp_color6_cb(GtkAction *action, gpointer user_data)
2299 colorize_conversation_cb(action, user_data, CONV_UDP+6*256);
2303 packet_list_menu_color_conv_udp_color7_cb(GtkAction *action, gpointer user_data)
2305 colorize_conversation_cb(action, user_data, CONV_UDP+7*256);
2309 packet_list_menu_color_conv_udp_color8_cb(GtkAction *action, gpointer user_data)
2311 colorize_conversation_cb(action, user_data, CONV_UDP+8*256);
2315 packet_list_menu_color_conv_udp_color9_cb(GtkAction *action, gpointer user_data)
2317 colorize_conversation_cb(action, user_data, CONV_UDP+9*256);
2321 packet_list_menu_color_conv_udp_color10_cb(GtkAction *action, gpointer user_data)
2323 colorize_conversation_cb(action, user_data, CONV_UDP+10*256);
2327 packet_list_menu_color_conv_udp_new_rule_cb(GtkAction *action, gpointer user_data)
2329 colorize_conversation_cb(action, user_data, CONV_UDP);
2335 packet_list_menu_color_conv_cba_color1_cb(GtkAction *action, gpointer user_data)
2337 colorize_conversation_cb(action, user_data, CONV_CBA+1*256);
2341 packet_list_menu_color_conv_cba_color2_cb(GtkAction *action, gpointer user_data)
2343 colorize_conversation_cb(action, user_data, CONV_CBA+2*256);
2347 packet_list_menu_color_conv_cba_color3_cb(GtkAction *action, gpointer user_data)
2349 colorize_conversation_cb(action, user_data, CONV_CBA+3*256);
2353 packet_list_menu_color_conv_cba_color4_cb(GtkAction *action, gpointer user_data)
2355 colorize_conversation_cb(action, user_data, CONV_CBA+4*256);
2359 packet_list_menu_color_conv_cba_color5_cb(GtkAction *action, gpointer user_data)
2361 colorize_conversation_cb(action, user_data, CONV_CBA+5*256);
2365 packet_list_menu_color_conv_cba_color6_cb(GtkAction *action, gpointer user_data)
2367 colorize_conversation_cb(action, user_data, CONV_CBA+6*256);
2371 packet_list_menu_color_conv_cba_color7_cb(GtkAction *action, gpointer user_data)
2373 colorize_conversation_cb(action, user_data, CONV_CBA+7*256);
2377 packet_list_menu_color_conv_cba_color8_cb(GtkAction *action, gpointer user_data)
2379 colorize_conversation_cb(action, user_data, CONV_CBA+8*256);
2383 packet_list_menu_color_conv_cba_color9_cb(GtkAction *action, gpointer user_data)
2385 colorize_conversation_cb(action, user_data, CONV_CBA+9*256);
2389 packet_list_menu_color_conv_cba_color10_cb(GtkAction *action, gpointer user_data)
2391 colorize_conversation_cb(action, user_data, CONV_CBA+10*256);
2395 packet_list_menu_color_conv_cba_new_rule_cb(GtkAction *action, gpointer user_data)
2397 colorize_conversation_cb(action, user_data, CONV_CBA);
2401 packet_list_menu_copy_sum_txt(GtkAction *action _U_, gpointer user_data)
2403 new_packet_list_copy_summary_cb(user_data, CS_TEXT);
2407 packet_list_menu_copy_sum_csv(GtkAction *action _U_, gpointer user_data)
2409 new_packet_list_copy_summary_cb(user_data, CS_CSV);
2413 packet_list_menu_copy_as_flt(GtkAction *action _U_, gpointer user_data)
2415 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_REPLACE|MATCH_SELECTED_COPY_ONLY);
2419 packet_list_menu_copy_bytes_oht_cb(GtkAction *action _U_, gpointer user_data)
2421 copy_hex_cb( NULL /* widget _U_ */ , user_data, CD_ALLINFO | CD_FLAGS_SELECTEDONLY);
2425 packet_list_menu_copy_bytes_oh_cb(GtkAction *action _U_, gpointer user_data)
2427 copy_hex_cb( NULL /* widget _U_ */ , user_data, CD_HEXCOLUMNS | CD_FLAGS_SELECTEDONLY);
2431 packet_list_menu_copy_bytes_text_cb(GtkAction *action _U_, gpointer user_data)
2433 copy_hex_cb( NULL /* widget _U_ */ , user_data, CD_TEXTONLY | CD_FLAGS_SELECTEDONLY);
2437 packet_list_menu_copy_bytes_hex_strm_cb(GtkAction *action _U_, gpointer user_data)
2439 copy_hex_cb( NULL /* widget _U_ */ , user_data, CD_HEX | CD_FLAGS_SELECTEDONLY);
2443 packet_list_menu_copy_bytes_bin_strm_cb(GtkAction *action _U_, gpointer user_data)
2445 copy_hex_cb( NULL /* widget _U_ */ , user_data, CD_BINARY | CD_FLAGS_SELECTEDONLY);
2451 tree_view_menu_color_with_flt_color1_cb(GtkAction *action _U_, gpointer user_data)
2453 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 1);
2457 tree_view_menu_color_with_flt_color2_cb(GtkAction *action _U_, gpointer user_data)
2459 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 2);
2463 tree_view_menu_color_with_flt_color3_cb(GtkAction *action _U_, gpointer user_data)
2465 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 3);
2469 tree_view_menu_color_with_flt_color4_cb(GtkAction *action _U_, gpointer user_data)
2471 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 4);
2475 tree_view_menu_color_with_flt_color5_cb(GtkAction *action _U_, gpointer user_data)
2477 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 5);
2481 tree_view_menu_color_with_flt_color6_cb(GtkAction *action _U_, gpointer user_data)
2483 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 6);
2487 tree_view_menu_color_with_flt_color7_cb(GtkAction *action _U_, gpointer user_data)
2489 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 7);
2493 tree_view_menu_color_with_flt_color8_cb(GtkAction *action _U_, gpointer user_data)
2495 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 8);
2499 tree_view_menu_color_with_flt_color9_cb(GtkAction *action _U_, gpointer user_data)
2501 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 9);
2505 tree_view_menu_color_with_flt_color10_cb(GtkAction *action _U_, gpointer user_data)
2507 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 10);
2511 tree_view_menu_color_with_flt_new_rule_cb(GtkAction *action _U_, gpointer user_data)
2513 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 0);
2518 tree_view_menu_copy_desc(GtkAction *action _U_, gpointer user_data)
2520 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_DESCRIPTION);
2524 tree_view_menu_copy_field(GtkAction *action _U_, gpointer user_data)
2526 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_FIELDNAME);
2530 tree_view_menu_copy_value(GtkAction *action _U_, gpointer user_data)
2532 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_VALUE);
2536 tree_view_menu_copy_as_flt(GtkAction *action _U_, gpointer user_data)
2538 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/Copy/AsFilter");
2539 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_REPLACE|MATCH_SELECTED_COPY_ONLY);
2542 static const char *ui_desc_packet_list_heading_menu_popup =
2544 " <popup name='PacketListHeadingPopup' action='PopupAction'>\n"
2545 " <menuitem name='SortAscending' action='/Sort Ascending'/>\n"
2546 " <menuitem name='SortDescending' action='/Sort Descending'/>\n"
2547 " <menuitem name='NoSorting' action='/No Sorting'/>\n"
2549 " <menuitem name='ShowResolved' action='/Show Resolved'/>\n"
2551 " <menuitem name='AlignLeft' action='/Align Left'/>\n"
2552 " <menuitem name='AlignCenter' action='/Align Center'/>\n"
2553 " <menuitem name='AlignRight' action='/Align Right'/>\n"
2555 " <menuitem name='ColumnPreferences' action='/Column Preferences'/>\n"
2556 " <menuitem name='EditColumnDetails' action='/Edit Column Details'/>\n"
2557 " <menuitem name='ResizeColumn' action='/Resize Column'/>\n"
2559 " <menu name='DisplayedColumns' action='/Displayed Columns'>\n"
2560 " <menuitem name='Display All' action='/Displayed Columns/Display All'/>\n"
2562 " <menuitem name='HideColumn' action='/Hide Column'/>\n"
2563 " <menuitem name='RemoveColumn' action='/Remove Column'/>\n"
2567 static const GtkActionEntry packet_list_heading_menu_popup_action_entries[] = {
2568 { "/Sort Ascending", GTK_STOCK_SORT_ASCENDING, "Sort Ascending", NULL, NULL, G_CALLBACK(sort_ascending_cb) },
2569 { "/Sort Descending", GTK_STOCK_SORT_DESCENDING, "Sort Descending", NULL, NULL, G_CALLBACK(sort_descending_cb) },
2570 { "/No Sorting", NULL, "No Sorting", NULL, NULL, G_CALLBACK(no_sorting_cb) },
2571 { "/Align Left", GTK_STOCK_JUSTIFY_LEFT, "Align Left", NULL, NULL, G_CALLBACK(packet_list_heading_align_left_cb) },
2572 { "/Align Center", GTK_STOCK_JUSTIFY_CENTER, "Align Center", NULL, NULL, G_CALLBACK(packet_list_heading_align_center_cb) },
2573 { "/Align Right", GTK_STOCK_JUSTIFY_RIGHT, "Align Right", NULL, NULL, G_CALLBACK(packet_list_heading_align_right_cb) },
2574 { "/Column Preferences", GTK_STOCK_PREFERENCES, "Column Preferences...", NULL, NULL, G_CALLBACK(packet_list_heading_col_pref_cb) },
2575 { "/Edit Column Details", WIRESHARK_STOCK_EDIT, "Edit Column Details...", NULL, NULL, G_CALLBACK(packet_list_heading_change_col_cb) },
2576 { "/Resize Column", WIRESHARK_STOCK_RESIZE_COLUMNS, "Resize Column", NULL, NULL, G_CALLBACK(packet_list_heading_resize_col_cb) },
2577 { "/Displayed Columns", NULL, "Displayed Columns", NULL, NULL, NULL },
2578 { "/Displayed Columns/Display All", NULL, "Display All", NULL, NULL, G_CALLBACK(packet_list_heading_activate_all_columns_cb) },
2579 { "/Hide Column", NULL, "Hide Column", NULL, NULL, G_CALLBACK(packet_list_heading_hide_col_cb) },
2580 { "/Remove Column", GTK_STOCK_DELETE, "Remove Column", NULL, NULL, G_CALLBACK(packet_list_heading_remove_col_cb) },
2583 static const GtkToggleActionEntry packet_list_heading_menu_toggle_action_entries[] =
2585 /* name, stock id, label, accel, tooltip, callback, is_active */
2586 {"/Show Resolved", NULL, "Show Resolved", NULL, NULL, G_CALLBACK(packet_list_heading_show_resolved_cb), FALSE},
2589 static const char *ui_desc_packet_list_menu_popup =
2591 " <popup name='PacketListMenuPopup' action='PopupAction'>\n"
2592 " <menuitem name='MarkPacket' action='/MarkPacket'/>\n"
2593 " <menuitem name='IgnorePacket' action='/IgnorePacket'/>\n"
2594 " <menuitem name='SetTimeReference' action='/Set Time Reference'/>\n"
2595 " <menuitem name='TimeShift' action='/TimeShift'/>\n"
2597 " <menuitem name='ManuallyResolveAddress' action='/ManuallyResolveAddress'/>\n"
2599 " <menu name= 'ApplyAsFilter' action='/Apply as Filter'>\n"
2600 " <menuitem name='Selected' action='/Apply as Filter/Selected'/>\n"
2601 " <menuitem name='NotSelected' action='/Apply as Filter/Not Selected'/>\n"
2602 " <menuitem name='AndSelected' action='/Apply as Filter/AndSelected'/>\n"
2603 " <menuitem name='OrSelected' action='/Apply as Filter/OrSelected'/>\n"
2604 " <menuitem name='AndNotSelected' action='/Apply as Filter/AndNotSelected'/>\n"
2605 " <menuitem name='OrNotSelected' action='/Apply as Filter/OrNotSelected'/>\n"
2607 " <menu name= 'PrepareaFilter' action='/Prepare a Filter'>\n"
2608 " <menuitem name='Selected' action='/Prepare a Filter/Selected'/>\n"
2609 " <menuitem name='NotSelected' action='/Prepare a Filter/Not Selected'/>\n"
2610 " <menuitem name='AndSelected' action='/Prepare a Filter/AndSelected'/>\n"
2611 " <menuitem name='OrSelected' action='/Prepare a Filter/OrSelected'/>\n"
2612 " <menuitem name='AndNotSelected' action='/Prepare a Filter/AndNotSelected'/>\n"
2613 " <menuitem name='OrNotSelected' action='/Prepare a Filter/OrNotSelected'/>\n"
2615 " <menu name= 'ConversationFilter' action='/Conversation Filter'>\n"
2616 " <menuitem name='Ethernet' action='/Conversation Filter/Ethernet'/>\n"
2617 " <menuitem name='IP' action='/Conversation Filter/IP'/>\n"
2618 " <menuitem name='TCP' action='/Conversation Filter/TCP'/>\n"
2619 " <menuitem name='UDP' action='/Conversation Filter/UDP'/>\n"
2620 " <menuitem name='PN-CBA' action='/Conversation Filter/PN-CBA'/>\n"
2622 " <menu name= 'ColorizeConversation' action='/Colorize Conversation'>\n"
2623 " <menu name= 'Ethernet' action='/Colorize Conversation/Ethernet'>\n"
2624 " <menuitem name='Color1' action='/Colorize Conversation/Ethernet/Color 1'/>\n"
2625 " <menuitem name='Color2' action='/Colorize Conversation/Ethernet/Color 2'/>\n"
2626 " <menuitem name='Color3' action='/Colorize Conversation/Ethernet/Color 3'/>\n"
2627 " <menuitem name='Color4' action='/Colorize Conversation/Ethernet/Color 4'/>\n"
2628 " <menuitem name='Color5' action='/Colorize Conversation/Ethernet/Color 5'/>\n"
2629 " <menuitem name='Color6' action='/Colorize Conversation/Ethernet/Color 6'/>\n"
2630 " <menuitem name='Color7' action='/Colorize Conversation/Ethernet/Color 7'/>\n"
2631 " <menuitem name='Color8' action='/Colorize Conversation/Ethernet/Color 8'/>\n"
2632 " <menuitem name='Color9' action='/Colorize Conversation/Ethernet/Color 9'/>\n"
2633 " <menuitem name='Color10' action='/Colorize Conversation/Ethernet/Color 10'/>\n"
2634 " <menuitem name='NewColoringRule' action='/Colorize Conversation/Ethernet/New Coloring Rule'/>\n"
2636 " <menu name= 'IP' action='/Colorize Conversation/IP'>\n"
2637 " <menuitem name='Color1' action='/Colorize Conversation/IP/Color 1'/>\n"
2638 " <menuitem name='Color2' action='/Colorize Conversation/IP/Color 2'/>\n"
2639 " <menuitem name='Color3' action='/Colorize Conversation/IP/Color 3'/>\n"
2640 " <menuitem name='Color4' action='/Colorize Conversation/IP/Color 4'/>\n"
2641 " <menuitem name='Color5' action='/Colorize Conversation/IP/Color 5'/>\n"
2642 " <menuitem name='Color6' action='/Colorize Conversation/IP/Color 6'/>\n"
2643 " <menuitem name='Color7' action='/Colorize Conversation/IP/Color 7'/>\n"
2644 " <menuitem name='Color8' action='/Colorize Conversation/IP/Color 8'/>\n"
2645 " <menuitem name='Color9' action='/Colorize Conversation/IP/Color 9'/>\n"
2646 " <menuitem name='Color10' action='/Colorize Conversation/IP/Color 10'/>\n"
2647 " <menuitem name='NewColoringRule' action='/Colorize Conversation/IP/New Coloring Rule'/>\n"
2649 " <menu name= 'TCP' action='/Colorize Conversation/TCP'>\n"
2650 " <menuitem name='Color1' action='/Colorize Conversation/TCP/Color 1'/>\n"
2651 " <menuitem name='Color2' action='/Colorize Conversation/TCP/Color 2'/>\n"
2652 " <menuitem name='Color3' action='/Colorize Conversation/TCP/Color 3'/>\n"
2653 " <menuitem name='Color4' action='/Colorize Conversation/TCP/Color 4'/>\n"
2654 " <menuitem name='Color5' action='/Colorize Conversation/TCP/Color 5'/>\n"
2655 " <menuitem name='Color6' action='/Colorize Conversation/TCP/Color 6'/>\n"
2656 " <menuitem name='Color7' action='/Colorize Conversation/TCP/Color 7'/>\n"
2657 " <menuitem name='Color8' action='/Colorize Conversation/TCP/Color 8'/>\n"
2658 " <menuitem name='Color9' action='/Colorize Conversation/TCP/Color 9'/>\n"
2659 " <menuitem name='Color10' action='/Colorize Conversation/TCP/Color 10'/>\n"
2660 " <menuitem name='NewColoringRule' action='/Colorize Conversation/TCP/New Coloring Rule'/>\n"
2662 " <menu name= 'UDP' action='/Colorize Conversation/UDP'>\n"
2663 " <menuitem name='Color1' action='/Colorize Conversation/UDP/Color 1'/>\n"
2664 " <menuitem name='Color2' action='/Colorize Conversation/UDP/Color 2'/>\n"
2665 " <menuitem name='Color3' action='/Colorize Conversation/UDP/Color 3'/>\n"
2666 " <menuitem name='Color4' action='/Colorize Conversation/UDP/Color 4'/>\n"
2667 " <menuitem name='Color5' action='/Colorize Conversation/UDP/Color 5'/>\n"
2668 " <menuitem name='Color6' action='/Colorize Conversation/UDP/Color 6'/>\n"
2669 " <menuitem name='Color7' action='/Colorize Conversation/UDP/Color 7'/>\n"
2670 " <menuitem name='Color8' action='/Colorize Conversation/UDP/Color 8'/>\n"
2671 " <menuitem name='Color9' action='/Colorize Conversation/UDP/Color 9'/>\n"
2672 " <menuitem name='Color10' action='/Colorize Conversation/UDP/Color 10'/>\n"
2673 " <menuitem name='NewColoringRule' action='/Colorize Conversation/UDP/New Coloring Rule'/>\n"
2675 " <menu name= 'PN-CBA' action='/Colorize Conversation/PN-CBA'>\n"
2676 " <menuitem name='Color1' action='/Colorize Conversation/PN-CBA/Color 1'/>\n"
2677 " <menuitem name='Color2' action='/Colorize Conversation/PN-CBA/Color 2'/>\n"
2678 " <menuitem name='Color3' action='/Colorize Conversation/PN-CBA/Color 3'/>\n"
2679 " <menuitem name='Color4' action='/Colorize Conversation/PN-CBA/Color 4'/>\n"
2680 " <menuitem name='Color5' action='/Colorize Conversation/PN-CBA/Color 5'/>\n"
2681 " <menuitem name='Color6' action='/Colorize Conversation/PN-CBA/Color 6'/>\n"
2682 " <menuitem name='Color7' action='/Colorize Conversation/PN-CBA/Color 7'/>\n"
2683 " <menuitem name='Color8' action='/Colorize Conversation/PN-CBA/Color 8'/>\n"
2684 " <menuitem name='Color9' action='/Colorize Conversation/PN-CBA/Color 9'/>\n"
2685 " <menuitem name='Color10' action='/Colorize Conversation/PN-CBA/Color 10'/>\n"
2686 " <menuitem name='NewColoringRule' action='/Colorize Conversation/PN-CBA/New Coloring Rule'/>\n"
2689 " <menu name= 'SCTP' action='/SCTP'>\n"
2690 " <menuitem name='AnalysethisAssociation' action='/SCTP/Analyse this Association'/>\n"
2691 " <menuitem name='PrepareFilterforthisAssociation' action='/SCTP/Prepare Filter for this Association'/>\n"
2693 " <menuitem name='FollowTCPStream' action='/Follow TCP Stream'/>\n"
2694 " <menuitem name='FollowUDPStream' action='/Follow UDP Stream'/>\n"
2695 " <menuitem name='FollowSSLStream' action='/Follow SSL Stream'/>\n"
2697 " <menu name= 'Copy' action='/Copy'>\n"
2698 " <menuitem name='SummaryTxt' action='/Copy/SummaryTxt'/>\n"
2699 " <menuitem name='SummaryCSV' action='/Copy/SummaryCSV'/>\n"
2700 " <menuitem name='AsFilter' action='/Copy/AsFilter'/>\n"
2702 " <menu name= 'Bytes' action='/Copy/Bytes'>\n"
2703 " <menuitem name='OffsetHexText' action='/Copy/Bytes/OffsetHexText'/>\n"
2704 " <menuitem name='OffsetHex' action='/Copy/Bytes/OffsetHex'/>\n"
2705 " <menuitem name='PrintableTextOnly' action='/Copy/Bytes/PrintableTextOnly'/>\n"
2707 " <menuitem name='HexStream' action='/Copy/Bytes/HexStream'/>\n"
2708 " <menuitem name='BinaryStream' action='/Copy/Bytes/BinaryStream'/>\n"
2712 " <menuitem name='DecodeAs' action='/DecodeAs'/>\n"
2713 " <menuitem name='Print' action='/Print'/>\n"
2714 " <menuitem name='ShowPacketinNewWindow' action='/ShowPacketinNewWindow'/>\n"
2718 static const GtkActionEntry packet_list_menu_popup_action_entries[] = {
2719 { "/MarkPacket", NULL, "Mark Packet (toggle)", NULL, NULL, G_CALLBACK(new_packet_list_mark_frame_cb) },
2720 { "/IgnorePacket", NULL, "Ignore Packet (toggle)", NULL, NULL, G_CALLBACK(new_packet_list_ignore_frame_cb) },
2721 { "/Set Time Reference", WIRESHARK_STOCK_TIME, "Set Time Reference (toggle)", NULL, NULL, G_CALLBACK(packet_list_menu_set_ref_time_cb) },
2722 { "/TimeShift", WIRESHARK_STOCK_TIME, "Time Shift...", NULL, NULL, G_CALLBACK(time_shift_cb) },
2723 { "/ManuallyResolveAddress", NULL, "Manually Resolve Address", NULL, NULL, G_CALLBACK(manual_addr_resolv_dlg) },
2724 { "/Apply as Filter", NULL, "Apply as Filter", NULL, NULL, NULL },
2726 { "/Apply as Filter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(packet_list_menu_apply_selected_cb) },
2727 { "/Apply as Filter/Not Selected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_apply_not_selected_cb) },
2728 { "/Apply as Filter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(packet_list_menu_apply_and_selected_cb) },
2729 { "/Apply as Filter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(packet_list_menu_apply_or_selected_cb) },
2730 { "/Apply as Filter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_apply_and_not_selected_cb) },
2731 { "/Apply as Filter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_apply_or_not_selected_cb) },
2733 { "/Prepare a Filter", NULL, "Prepare a Filter", NULL, NULL, NULL },
2734 { "/Prepare a Filter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(packet_list_menu_prepare_selected_cb) },
2735 { "/Prepare a Filter/Not Selected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_prepare_not_selected_cb) },
2736 { "/Prepare a Filter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(packet_list_menu_prepare_and_selected_cb) },
2737 { "/Prepare a Filter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(packet_list_menu_prepare_or_selected_cb) },
2738 { "/Prepare a Filter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_prepare_and_not_selected_cb) },
2739 { "/Prepare a Filter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_prepare_or_not_selected_cb) },
2741 { "/Conversation Filter", NULL, "Conversation Filter", NULL, NULL, NULL },
2742 { "/Conversation Filter/Ethernet", NULL, "Ethernet", NULL, NULL, G_CALLBACK(packet_list_menu_conversation_ethernet_cb) },
2743 { "/Conversation Filter/IP", NULL, "IP", NULL, NULL, G_CALLBACK(packet_list_menu_conversation_ip_cb) },
2744 { "/Conversation Filter/TCP", NULL, "TCP", NULL, NULL, G_CALLBACK(packet_list_menu_conversation_tcp_cb) },
2745 { "/Conversation Filter/UDP", NULL, "UDP", NULL, NULL, G_CALLBACK(packet_list_menu_conversation_udp_cb) },
2746 { "/Conversation Filter/PN-CBA", NULL, "PN-CBA", NULL, NULL, G_CALLBACK(packet_list_menu_conversation_pn_cba_cb) },
2748 { "/Colorize Conversation", NULL, "Colorize Conversation", NULL, NULL, NULL },
2750 { "/Colorize Conversation/Ethernet", NULL, "Ethernet", NULL, NULL, NULL },
2752 { "/Colorize Conversation/Ethernet/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color1_cb) },
2753 { "/Colorize Conversation/Ethernet/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color2_cb) },
2754 { "/Colorize Conversation/Ethernet/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color3_cb) },
2755 { "/Colorize Conversation/Ethernet/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color4_cb) },
2756 { "/Colorize Conversation/Ethernet/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color5_cb) },
2757 { "/Colorize Conversation/Ethernet/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color6_cb) },
2758 { "/Colorize Conversation/Ethernet/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color7_cb) },
2759 { "/Colorize Conversation/Ethernet/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color8_cb) },
2760 { "/Colorize Conversation/Ethernet/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color9_cb) },
2761 { "/Colorize Conversation/Ethernet/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color10_cb) },
2762 { "/Colorize Conversation/Ethernet/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_new_rule_cb) },
2764 { "/Colorize Conversation/IP", NULL, "IP", NULL, NULL, NULL },
2766 { "/Colorize Conversation/IP/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color1_cb) },
2767 { "/Colorize Conversation/IP/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color2_cb) },
2768 { "/Colorize Conversation/IP/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color3_cb) },
2769 { "/Colorize Conversation/IP/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color4_cb) },
2770 { "/Colorize Conversation/IP/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color5_cb) },
2771 { "/Colorize Conversation/IP/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color6_cb) },
2772 { "/Colorize Conversation/IP/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color7_cb) },
2773 { "/Colorize Conversation/IP/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color8_cb) },
2774 { "/Colorize Conversation/IP/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color9_cb) },
2775 { "/Colorize Conversation/IP/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color10_cb) },
2776 { "/Colorize Conversation/IP/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_new_rule_cb) },
2778 { "/Colorize Conversation/TCP", NULL, "TCP", NULL, NULL, NULL },
2780 { "/Colorize Conversation/TCP/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color1_cb) },
2781 { "/Colorize Conversation/TCP/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color2_cb) },
2782 { "/Colorize Conversation/TCP/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color3_cb) },
2783 { "/Colorize Conversation/TCP/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color4_cb) },
2784 { "/Colorize Conversation/TCP/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color5_cb) },
2785 { "/Colorize Conversation/TCP/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color6_cb) },
2786 { "/Colorize Conversation/TCP/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color7_cb) },
2787 { "/Colorize Conversation/TCP/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color8_cb) },
2788 { "/Colorize Conversation/TCP/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color9_cb) },
2789 { "/Colorize Conversation/TCP/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color10_cb) },
2790 { "/Colorize Conversation/TCP/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_new_rule_cb) },
2792 { "/Colorize Conversation/UDP", NULL, "UDP", NULL, NULL, NULL },
2794 { "/Colorize Conversation/UDP/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color1_cb) },
2795 { "/Colorize Conversation/UDP/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color2_cb) },
2796 { "/Colorize Conversation/UDP/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color3_cb) },
2797 { "/Colorize Conversation/UDP/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color4_cb) },
2798 { "/Colorize Conversation/UDP/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color5_cb) },
2799 { "/Colorize Conversation/UDP/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color6_cb) },
2800 { "/Colorize Conversation/UDP/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color7_cb) },
2801 { "/Colorize Conversation/UDP/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color8_cb) },
2802 { "/Colorize Conversation/UDP/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color9_cb) },
2803 { "/Colorize Conversation/UDP/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color10_cb) },
2804 { "/Colorize Conversation/UDP/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_new_rule_cb) },
2806 { "/Colorize Conversation/PN-CBA", NULL, "PN-CBA Server", NULL, NULL, NULL },
2808 { "/Colorize Conversation/PN-CBA/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color1_cb) },
2809 { "/Colorize Conversation/PN-CBA/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color2_cb) },
2810 { "/Colorize Conversation/PN-CBA/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color3_cb) },
2811 { "/Colorize Conversation/PN-CBA/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color4_cb) },
2812 { "/Colorize Conversation/PN-CBA/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color5_cb) },
2813 { "/Colorize Conversation/PN-CBA/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color6_cb) },
2814 { "/Colorize Conversation/PN-CBA/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color7_cb) },
2815 { "/Colorize Conversation/PN-CBA/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color8_cb) },
2816 { "/Colorize Conversation/PN-CBA/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color9_cb) },
2817 { "/Colorize Conversation/PN-CBA/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color10_cb) },
2818 { "/Colorize Conversation/PN-CBA/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_new_rule_cb) },
2820 { "/SCTP", NULL, "SCTP", NULL, NULL, NULL },
2821 { "/SCTP/Analyse this Association", NULL, "Analyse this Association", NULL, NULL, G_CALLBACK(sctp_analyse_start) },
2822 { "/SCTP/Prepare Filter for this Association", NULL, "Prepare Filter for this Association", NULL, NULL, G_CALLBACK(sctp_set_assoc_filter) },
2825 { "/Follow TCP Stream", NULL, "Follow TCP Stream", NULL, NULL, G_CALLBACK(follow_tcp_stream_cb) },
2826 { "/Follow UDP Stream", NULL, "Follow UDP Stream", NULL, NULL, G_CALLBACK(follow_udp_stream_cb) },
2827 { "/Follow SSL Stream", NULL, "Follow SSL Stream", NULL, NULL, G_CALLBACK(follow_ssl_stream_cb) },
2829 { "/Copy", NULL, "Copy", NULL, NULL, NULL },
2830 { "/Copy/SummaryTxt", NULL, "Summary (Text)", NULL, NULL, G_CALLBACK(packet_list_menu_copy_sum_txt) },
2831 { "/Copy/SummaryCSV", NULL, "Summary (CSV)", NULL, NULL, G_CALLBACK(packet_list_menu_copy_sum_csv) },
2832 { "/Copy/AsFilter", NULL, "As Filter", NULL, NULL, G_CALLBACK(packet_list_menu_copy_as_flt) },
2835 { "/Copy/Bytes", NULL, "Bytes", NULL, NULL, NULL },
2836 { "/Copy/Bytes/OffsetHexText", NULL, "Offset Hex Text", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oht_cb) },
2837 { "/Copy/Bytes/OffsetHex", NULL, "Offset Hex", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oh_cb) },
2838 { "/Copy/Bytes/PrintableTextOnly", NULL, "Printable Text Only", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_text_cb) },
2840 { "/Copy/Bytes/HexStream", NULL, "Hex Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_hex_strm_cb) },
2841 { "/Copy/Bytes/BinaryStream", NULL, "Binary Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_bin_strm_cb) },
2843 { "/DecodeAs", WIRESHARK_STOCK_DECODE_AS, "Decode As...", NULL, NULL, G_CALLBACK(decode_as_cb) },
2844 { "/Print", GTK_STOCK_PRINT, "Print...", NULL, NULL, G_CALLBACK(file_print_selected_cmd_cb) },
2845 { "/ShowPacketinNewWindow", NULL, "Show Packet in New Window", NULL, NULL, G_CALLBACK(new_window_cb) },
2849 static const char *ui_desc_tree_view_menu_popup =
2851 " <popup name='TreeViewPopup' action='PopupAction'>\n"
2852 " <menuitem name='ExpandSubtrees' action='/ExpandSubtrees'/>\n"
2853 " <menuitem name='ExpandAll' action='/ExpandAll'/>\n"
2854 " <menuitem name='CollapseAll' action='/CollapseAll'/>\n"
2856 " <menuitem name='ApplyasColumn' action='/Apply as Column'/>\n"
2858 " <menu name= 'ApplyAsFilter' action='/Apply as Filter'>\n"
2859 " <menuitem name='Selected' action='/Apply as Filter/Selected'/>\n"
2860 " <menuitem name='NotSelected' action='/Apply as Filter/Not Selected'/>\n"
2861 " <menuitem name='AndSelected' action='/Apply as Filter/AndSelected'/>\n"
2862 " <menuitem name='OrSelected' action='/Apply as Filter/OrSelected'/>\n"
2863 " <menuitem name='AndNotSelected' action='/Apply as Filter/AndNotSelected'/>\n"
2864 " <menuitem name='OrNotSelected' action='/Apply as Filter/OrNotSelected'/>\n"
2866 " <menu name= 'PrepareaFilter' action='/Prepare a Filter'>\n"
2867 " <menuitem name='Selected' action='/Prepare a Filter/Selected'/>\n"
2868 " <menuitem name='NotSelected' action='/Prepare a Filter/Not Selected'/>\n"
2869 " <menuitem name='AndSelected' action='/Prepare a Filter/AndSelected'/>\n"
2870 " <menuitem name='OrSelected' action='/Prepare a Filter/OrSelected'/>\n"
2871 " <menuitem name='AndNotSelected' action='/Prepare a Filter/AndNotSelected'/>\n"
2872 " <menuitem name='OrNotSelected' action='/Prepare a Filter/OrNotSelected'/>\n"
2874 " <menu name= 'ColorizewithFilter' action='/Colorize with Filter'>\n"
2875 " <menuitem name='Color1' action='/Colorize with Filter/Color 1'/>\n"
2876 " <menuitem name='Color2' action='/Colorize with Filter/Color 2'/>\n"
2877 " <menuitem name='Color3' action='/Colorize with Filter/Color 3'/>\n"
2878 " <menuitem name='Color4' action='/Colorize with Filter/Color 4'/>\n"
2879 " <menuitem name='Color5' action='/Colorize with Filter/Color 5'/>\n"
2880 " <menuitem name='Color6' action='/Colorize with Filter/Color 6'/>\n"
2881 " <menuitem name='Color7' action='/Colorize with Filter/Color 7'/>\n"
2882 " <menuitem name='Color8' action='/Colorize with Filter/Color 8'/>\n"
2883 " <menuitem name='Color9' action='/Colorize with Filter/Color 9'/>\n"
2884 " <menuitem name='Color10' action='/Colorize with Filter/Color 10'/>\n"
2885 " <menuitem name='NewColoringRule' action='/Colorize with Filter/New Coloring Rule'/>\n"
2887 " <menuitem name='FollowTCPStream' action='/Follow TCP Stream'/>\n"
2888 " <menuitem name='FollowUDPStream' action='/Follow UDP Stream'/>\n"
2889 " <menuitem name='FollowSSLStream' action='/Follow SSL Stream'/>\n"
2891 " <menu name= 'Copy' action='/Copy'>\n"
2892 " <menuitem name='Description' action='/Copy/Description'/>\n"
2893 " <menuitem name='Fieldname' action='/Copy/Fieldname'/>\n"
2894 " <menuitem name='Value' action='/Copy/Value'/>\n"
2896 " <menuitem name='AsFilter' action='/Copy/AsFilter'/>\n"
2898 " <menu name= 'Bytes' action='/Copy/Bytes'>\n"
2899 " <menuitem name='OffsetHexText' action='/Copy/Bytes/OffsetHexText'/>\n"
2900 " <menuitem name='OffsetHex' action='/Copy/Bytes/OffsetHex'/>\n"
2901 " <menuitem name='PrintableTextOnly' action='/Copy/Bytes/PrintableTextOnly'/>\n"
2903 " <menuitem name='HexStream' action='/Copy/Bytes/HexStream'/>\n"
2904 " <menuitem name='BinaryStream' action='/Copy/Bytes/BinaryStream'/>\n"
2907 " <menuitem name='ExportSelectedPacketBytes' action='/ExportSelectedPacketBytes'/>\n"
2909 " <menuitem name='WikiProtocolPage' action='/WikiProtocolPage'/>\n"
2910 " <menuitem name='FilterFieldReference' action='/FilterFieldReference'/>\n"
2911 " <menuitem name='ProtocolHelp' action='/ProtocolHelp'/>\n"
2912 " <menuitem name='ProtocolPreferences' action='/ProtocolPreferences'/>\n"
2914 " <menuitem name='DecodeAs' action='/DecodeAs'/>\n"
2915 " <menuitem name='DisableProtocol' action='/DisableProtocol'/>\n"
2916 " <menuitem name='ResolveName' action='/ResolveName'/>\n"
2917 " <menuitem name='GotoCorrespondingPacket' action='/GotoCorrespondingPacket'/>\n"
2921 static const GtkActionEntry tree_view_menu_popup_action_entries[] = {
2922 { "/ExpandSubtrees", NULL, "Expand Subtrees", NULL, NULL, G_CALLBACK(expand_tree_cb) },
2923 { "/ExpandAll", NULL, "Expand All", NULL, NULL, G_CALLBACK(expand_all_cb) },
2924 { "/CollapseAll", NULL, "Collapse All", NULL, NULL, G_CALLBACK(collapse_all_cb) },
2925 { "/Apply as Column", NULL, "Apply as Column", NULL, NULL, G_CALLBACK(apply_as_custom_column_cb) },
2926 { "/Apply as Filter", NULL, "Apply as Filter", NULL, NULL, NULL },
2928 { "/Apply as Filter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(tree_view_menu_apply_selected_cb) },
2929 { "/Apply as Filter/Not Selected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_not_selected_cb) },
2930 { "/Apply as Filter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_and_selected_cb) },
2931 { "/Apply as Filter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_or_selected_cb) },
2932 { "/Apply as Filter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_and_not_selected_cb) },
2933 { "/Apply as Filter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_or_not_selected_cb) },
2935 { "/Prepare a Filter", NULL, "Prepare a Filter", NULL, NULL, NULL },
2936 { "/Prepare a Filter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(tree_view_menu_prepare_selected_cb) },
2937 { "/Prepare a Filter/Not Selected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_not_selected_cb) },
2938 { "/Prepare a Filter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_and_selected_cb) },
2939 { "/Prepare a Filter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_or_selected_cb) },
2940 { "/Prepare a Filter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_and_not_selected_cb) },
2941 { "/Prepare a Filter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_or_not_selected_cb) },
2943 { "/Colorize with Filter", NULL, "Colorize with Filter", NULL, NULL, NULL },
2944 { "/Colorize with Filter/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color1_cb) },
2945 { "/Colorize with Filter/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color2_cb) },
2946 { "/Colorize with Filter/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color3_cb) },
2947 { "/Colorize with Filter/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color4_cb) },
2948 { "/Colorize with Filter/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color5_cb) },
2949 { "/Colorize with Filter/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color6_cb) },
2950 { "/Colorize with Filter/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color7_cb) },
2951 { "/Colorize with Filter/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color8_cb) },
2952 { "/Colorize with Filter/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color9_cb) },
2953 { "/Colorize with Filter/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color10_cb) },
2954 { "/Colorize with Filter/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_new_rule_cb) },
2956 { "/Follow TCP Stream", NULL, "Follow TCP Stream", NULL, NULL, G_CALLBACK(follow_tcp_stream_cb) },
2957 { "/Follow UDP Stream", NULL, "Follow UDP Stream", NULL, NULL, G_CALLBACK(follow_udp_stream_cb) },
2958 { "/Follow SSL Stream", NULL, "Follow SSL Stream", NULL, NULL, G_CALLBACK(follow_ssl_stream_cb) },
2960 { "/Copy", NULL, "Copy", NULL, NULL, NULL },
2961 { "/Copy/Description", NULL, "Description", NULL, NULL, G_CALLBACK(tree_view_menu_copy_desc) },
2962 { "/Copy/Fieldname", NULL, "Fieldname", NULL, NULL, G_CALLBACK(tree_view_menu_copy_field) },
2963 { "/Copy/Value", NULL, "Value", NULL, NULL, G_CALLBACK(tree_view_menu_copy_value) },
2965 { "/Copy/AsFilter", NULL, "As Filter", NULL, NULL, G_CALLBACK(tree_view_menu_copy_as_flt) },
2967 { "/Copy/Bytes", NULL, "Bytes", NULL, NULL, NULL },
2968 { "/Copy/Bytes/OffsetHexText", NULL, "Offset Hex Text", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oht_cb) },
2969 { "/Copy/Bytes/OffsetHex", NULL, "Offset Hex", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oh_cb) },
2970 { "/Copy/Bytes/PrintableTextOnly", NULL, "Printable Text Only", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_text_cb) },
2972 { "/Copy/Bytes/HexStream", NULL, "Hex Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_hex_strm_cb) },
2973 { "/Copy/Bytes/BinaryStream", NULL, "Binary Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_bin_strm_cb) },
2975 { "/ExportSelectedPacketBytes", NULL, "Export Selected Packet Bytes...", NULL, NULL, G_CALLBACK(savehex_cb) },
2977 { "/WikiProtocolPage", WIRESHARK_STOCK_WIKI, "Wiki Protocol Page", NULL, NULL, G_CALLBACK(selected_ptree_info_cb) },
2978 { "/FilterFieldReference", WIRESHARK_STOCK_INTERNET, "Filter Field Reference", NULL, NULL, G_CALLBACK(selected_ptree_ref_cb) },
2979 { "/ProtocolHelp", NULL, "Protocol Help", NULL, NULL, NULL },
2980 { "/ProtocolPreferences", NULL, "Protocol Preferences", NULL, NULL, NULL },
2981 { "/DecodeAs", WIRESHARK_STOCK_DECODE_AS, "Decode As...", NULL, NULL, G_CALLBACK(decode_as_cb) },
2982 { "/DisableProtocol", WIRESHARK_STOCK_CHECKBOX, "Disable Protocol...", NULL, NULL, G_CALLBACK(proto_disable_cb) },
2983 { "/ResolveName", NULL, "_Resolve Name", NULL, NULL, G_CALLBACK(resolve_name_cb) },
2984 { "/GotoCorrespondingPacket", NULL, "_Go to Corresponding Packet", NULL, NULL, G_CALLBACK(goto_framenum_cb) },
2987 static const char *ui_desc_bytes_menu_popup =
2989 " <popup name='BytesMenuPopup' action='PopupAction'>\n"
2990 " <menuitem name='HexView' action='/HexView'/>\n"
2991 " <menuitem name='BitsView' action='/BitsView'/>\n"
2994 static const GtkRadioActionEntry bytes_menu_radio_action_entries [] =
2996 /* name, stock id, label, accel, tooltip, value */
2997 { "/HexView", NULL, "Hex View", NULL, NULL, BYTES_HEX },
2998 { "/BitsView", NULL, "Bits View", NULL, NULL, BYTES_BITS },
3001 static const char *ui_statusbar_profiles_menu_popup =
3003 " <popup name='ProfilesMenuPopup' action='PopupAction'>\n"
3004 " <menuitem name='Profiles' action='/Profiles'/>\n"
3006 " <menuitem name='New' action='/New'/>\n"
3007 " <menuitem name='Edit' action='/Edit'/>\n"
3008 " <menuitem name='Delete' action='/Delete'/>\n"
3010 " <menu name='Change' action='/Change'>\n"
3011 " <menuitem name='Default' action='/Change/Default'/>\n"
3015 static const GtkActionEntry statusbar_profiles_menu_action_entries [] =
3017 { "/Profiles", NULL, "Configuration Profiles...", NULL, NULL, G_CALLBACK(profile_dialog_cb) },
3018 { "/New", GTK_STOCK_NEW, "New...", NULL, NULL, G_CALLBACK(profile_new_cb) },
3019 { "/Edit", GTK_STOCK_EDIT, "Edit...", NULL, NULL, G_CALLBACK(profile_edit_cb) },
3020 { "/Delete", GTK_STOCK_DELETE, "Delete", NULL, NULL, G_CALLBACK(profile_delete_cb) },
3021 { "/Change", NULL, "Change", NULL, NULL, NULL },
3022 { "/Change/Default", NULL, "Default", NULL, NULL, NULL },
3026 main_menu_new(GtkAccelGroup ** table) {
3028 #ifdef HAVE_IGE_MAC_INTEGRATION
3029 GtkWidget *quit_item, *about_item, *preferences_item;
3030 IgeMacMenuGroup *group;
3032 #ifdef HAVE_GTKOSXAPPLICATION
3033 GtkOSXApplication *theApp;
3035 GtkOSXApplicationMenuGroup *group;
3036 GtkWidget * dock_menu;
3039 grp = gtk_accel_group_new();
3044 menubar = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar");
3045 #ifdef HAVE_IGE_MAC_INTEGRATION
3046 if(prefs.gui_macosx_style) {
3047 ige_mac_menu_set_menu_bar(GTK_MENU_SHELL(menubar));
3048 ige_mac_menu_set_global_key_handler_enabled(TRUE);
3050 /* Create menu items to populate the application menu with. We have to
3051 * do this because we are still using the old GtkItemFactory API for
3053 group = ige_mac_menu_add_app_menu_group();
3054 about_item = gtk_menu_item_new_with_label("About");
3055 g_signal_connect(about_item, "activate", G_CALLBACK(about_wireshark_cb),
3057 ige_mac_menu_add_app_menu_item(group, GTK_MENU_ITEM(about_item), NULL);
3059 group = ige_mac_menu_add_app_menu_group();
3060 preferences_item = gtk_menu_item_new_with_label("Preferences");
3061 g_signal_connect(preferences_item, "activate", G_CALLBACK(prefs_cb),
3063 ige_mac_menu_add_app_menu_item(group, GTK_MENU_ITEM(preferences_item),
3067 /* The quit item in the application menu shows up whenever ige mac
3068 * integration is enabled, even if the OS X UI style in Wireshark isn't
3070 quit_item = gtk_menu_item_new_with_label("Quit");
3071 g_signal_connect(quit_item, "activate", G_CALLBACK(file_quit_cmd_cb), NULL);
3072 ige_mac_menu_set_quit_menu_item(GTK_MENU_ITEM(quit_item));
3075 #ifdef HAVE_GTKOSXAPPLICATION
3076 theApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
3078 if(prefs.gui_macosx_style) {
3079 gtk_osxapplication_set_menu_bar(theApp, GTK_MENU_SHELL(menubar));
3080 gtk_osxapplication_set_use_quartz_accelerators(theApp, TRUE);
3082 group = gtk_osxapplication_add_app_menu_group (theApp);
3083 item = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/HelpMenu/AboutWireshark");
3084 gtk_osxapplication_add_app_menu_item(theApp, group,GTK_MENU_ITEM (item));
3086 group = gtk_osxapplication_add_app_menu_group (theApp);
3087 item = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/EditMenu/Preferences");
3088 gtk_osxapplication_add_app_menu_item(theApp, group,GTK_MENU_ITEM (item));
3090 group = gtk_osxapplication_add_app_menu_group (theApp);
3091 item = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/HelpMenu");
3092 gtk_osxapplication_set_help_menu(theApp,GTK_MENU_ITEM(item));
3094 /* Quit item is not needed */
3096 /*gtk_item_factory_delete_item(main_menu_factory,"/File/Quit");*/
3099 /* generate dock menu */
3100 dock_menu = gtk_menu_new();
3102 item = gtk_menu_item_new_with_label("Start");
3103 g_signal_connect(item, "activate", G_CALLBACK (capture_start_cb), NULL);
3104 gtk_menu_shell_append(GTK_MENU_SHELL(dock_menu), item);
3106 item = gtk_menu_item_new_with_label("Stop");
3107 g_signal_connect(item, "activate", G_CALLBACK (capture_stop_cb), NULL);
3108 gtk_menu_shell_append(GTK_MENU_SHELL(dock_menu), item);
3110 item = gtk_menu_item_new_with_label("Restart");
3111 g_signal_connect(item, "activate", G_CALLBACK (capture_restart_cb), NULL);
3112 gtk_menu_shell_append(GTK_MENU_SHELL(dock_menu), item);
3114 gtk_osxapplication_set_dock_menu(theApp, GTK_MENU_SHELL(dock_menu));
3124 menu_dissector_filter_cb( GtkAction *action _U_, gpointer callback_data)
3126 dissector_filter_t *filter_entry = callback_data;
3127 GtkWidget *filter_te;
3130 filter_te = gtk_bin_get_child(GTK_BIN(g_object_get_data(G_OBJECT(top_level), E_DFILTER_CM_KEY)));
3132 /* XXX - this gets the packet_info of the last dissected packet, */
3133 /* which is not necessarily the last selected packet */
3134 /* e.g. "Update list of packets in real time" won't work correct */
3135 buf = filter_entry->build_filter_string(&cfile.edt->pi);
3137 gtk_entry_set_text(GTK_ENTRY(filter_te), buf);
3139 /* Run the display filter so it goes in effect - even if it's the
3140 same as the previous display filter. */
3141 main_filter_packets(&cfile, buf, TRUE);
3143 g_free( (void *) buf);
3146 static gboolean menu_dissector_filter_spe_cb(frame_data *fd _U_, epan_dissect_t *edt, gpointer callback_data) {
3147 dissector_filter_t *filter_entry = callback_data;
3149 /* XXX - this gets the packet_info of the last dissected packet, */
3150 /* which is not necessarily the last selected packet */
3151 /* e.g. "Update list of packets in real time" won't work correct */
3152 return (edt != NULL) ? filter_entry->is_filter_valid(&edt->pi) : FALSE;
3155 static void menu_dissector_filter(capture_file *cf) {
3156 GList *list_entry = dissector_filter_list;
3157 dissector_filter_t *filter_entry;
3160 GtkActionGroup *action_group;
3162 GtkWidget *submenu_dissector_filters;
3167 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
3169 action_group = gtk_action_group_new ("diessector-filters-group");
3171 submenu_dissector_filters = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ConversationFilterMenu");
3172 if(!submenu_dissector_filters){
3173 g_warning("add_recent_items: No submenu_dissector_filters found, path= /Menubar/AnalyzeMenu/ConversationFilterMenu");
3176 gtk_ui_manager_insert_action_group (ui_manager_main_menubar, action_group, 0);
3177 g_object_set_data (G_OBJECT (ui_manager_main_menubar),
3178 "diessector-filters-merge-id", GUINT_TO_POINTER (merge_id));
3183 action = g_object_new (GTK_TYPE_ACTION,
3184 "name", "filter-list-empty",
3185 "label", "No fileters",
3188 gtk_action_group_add_action (action_group, action);
3189 gtk_action_set_sensitive(action, FALSE);
3190 g_object_unref (action);
3192 gtk_ui_manager_add_ui (ui_manager_main_menubar, merge_id,
3193 "/Menubar/AnalyzeMenu/ConversationFilterMenu/Filters",
3194 "filter-list-empty",
3195 "filter-list-empty",
3196 GTK_UI_MANAGER_MENUITEM,
3202 while(list_entry != NULL) {
3203 filter_entry = list_entry->data;
3204 action_name = g_strdup_printf ("filter-%u", i);
3205 /*g_warning("action_name %s, filter_entry->name %s",action_name,filter_entry->name);*/
3206 action = g_object_new (GTK_TYPE_ACTION,
3207 "name", action_name,
3208 "label", filter_entry->name,
3209 "sensitive", menu_dissector_filter_spe_cb(/* frame_data *fd _U_*/ NULL, cf->edt, filter_entry),
3211 g_signal_connect (action, "activate",
3212 G_CALLBACK (menu_dissector_filter_cb), filter_entry);
3213 gtk_action_group_add_action (action_group, action);
3214 g_object_unref (action);
3216 gtk_ui_manager_add_ui (ui_manager_main_menubar, merge_id,
3217 "/Menubar/AnalyzeMenu/ConversationFilterMenu/Filters",
3220 GTK_UI_MANAGER_MENUITEM,
3223 list_entry = g_list_next(list_entry);
3229 GtkActionGroup *packet_list_heading_action_group, *packet_list_action_group,
3230 *packet_list_details_action_group, *packet_list_byte_menu_action_group,
3231 *statusbar_profiles_action_group;
3232 GError *error = NULL;
3238 popup_menu_object = gtk_menu_new();
3240 /* packet list heading pop-up menu */
3241 packet_list_heading_action_group = gtk_action_group_new ("PacketListHeadingPopUpMenuActionGroup");
3243 gtk_action_group_add_actions (packet_list_heading_action_group, /* the action group */
3244 (gpointer)packet_list_heading_menu_popup_action_entries, /* an array of action descriptions */
3245 G_N_ELEMENTS(packet_list_heading_menu_popup_action_entries), /* the number of entries */
3246 popup_menu_object); /* data to pass to the action callbacks */
3248 gtk_action_group_add_toggle_actions(packet_list_heading_action_group, /* the action group */
3249 (gpointer)packet_list_heading_menu_toggle_action_entries, /* an array of action descriptions */
3250 G_N_ELEMENTS(packet_list_heading_menu_toggle_action_entries), /* the number of entries */
3251 NULL); /* data to pass to the action callbacks */
3253 ui_manager_packet_list_heading = gtk_ui_manager_new ();
3254 gtk_ui_manager_insert_action_group (ui_manager_packet_list_heading,
3255 packet_list_heading_action_group,
3256 0); /* the position at which the group will be inserted. */
3258 gtk_ui_manager_add_ui_from_string (ui_manager_packet_list_heading,ui_desc_packet_list_heading_menu_popup, -1, &error);
3261 fprintf (stderr, "Warning: building Packet List Heading Pop-Up failed: %s\n",
3263 g_error_free (error);
3267 g_object_set_data(G_OBJECT(popup_menu_object), PM_PACKET_LIST_COL_KEY,
3268 gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup"));
3270 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_packet_list_heading);
3272 /* packet list pop-up menu */
3273 packet_list_action_group = gtk_action_group_new ("PacketListPopUpMenuActionGroup");
3275 gtk_action_group_add_actions (packet_list_action_group, /* the action group */
3276 (gpointer)packet_list_menu_popup_action_entries, /* an array of action descriptions */
3277 G_N_ELEMENTS(packet_list_menu_popup_action_entries), /* the number of entries */
3278 popup_menu_object); /* data to pass to the action callbacks */
3280 ui_manager_packet_list_menu = gtk_ui_manager_new ();
3282 gtk_ui_manager_insert_action_group (ui_manager_packet_list_menu,
3283 packet_list_action_group,
3284 0); /* the position at which the group will be inserted. */
3286 gtk_ui_manager_add_ui_from_string (ui_manager_packet_list_menu, ui_desc_packet_list_menu_popup, -1, &error);
3289 fprintf (stderr, "Warning: building Packet List Pop-Up menu failed: %s\n",
3291 g_error_free (error);
3295 g_object_set_data(G_OBJECT(popup_menu_object), PM_PACKET_LIST_KEY,
3296 gtk_ui_manager_get_widget(ui_manager_packet_list_menu, "/PacketListMenuPopup"));
3298 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_packet_list_menu);
3301 /* packet detail pop-up menu */
3302 packet_list_details_action_group = gtk_action_group_new ("PacketListDetailsMenuPopUpActionGroup");
3304 gtk_action_group_add_actions (packet_list_details_action_group, /* the action group */
3305 (gpointer)tree_view_menu_popup_action_entries, /* an array of action descriptions */
3306 G_N_ELEMENTS(tree_view_menu_popup_action_entries), /* the number of entries */
3307 popup_menu_object); /* data to pass to the action callbacks */
3309 ui_manager_tree_view_menu = gtk_ui_manager_new ();
3311 gtk_ui_manager_insert_action_group (ui_manager_tree_view_menu,
3312 packet_list_details_action_group,
3313 0); /* the position at which the group will be inserted. */
3315 gtk_ui_manager_add_ui_from_string (ui_manager_tree_view_menu, ui_desc_tree_view_menu_popup, -1, &error);
3318 fprintf (stderr, "Warning: building TreeWiew Pop-Up menu failed: %s\n",
3320 g_error_free (error);
3324 g_object_set_data(G_OBJECT(popup_menu_object), PM_TREE_VIEW_KEY,
3325 gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup"));
3327 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_tree_view_menu);
3330 * Hex dump pop-up menu.
3331 * We provide our own empty menu to suppress the default pop-up menu
3334 packet_list_byte_menu_action_group = gtk_action_group_new ("PacketListByteMenuPopUpActionGroup");
3337 gtk_action_group_add_radio_actions (packet_list_byte_menu_action_group, /* the action group */
3338 (gpointer)bytes_menu_radio_action_entries, /* an array of radio action descriptions */
3339 G_N_ELEMENTS(bytes_menu_radio_action_entries), /* the number of entries */
3340 recent.gui_bytes_view, /* the value of the action to activate initially, or -1 if no action should be activated */
3341 G_CALLBACK(select_bytes_view_cb), /* the callback to connect to the changed signal */
3342 popup_menu_object); /* data to pass to the action callbacks */
3344 ui_manager_bytes_menu = gtk_ui_manager_new ();
3346 gtk_ui_manager_insert_action_group (ui_manager_bytes_menu,
3347 packet_list_byte_menu_action_group,
3348 0); /* the position at which the group will be inserted. */
3350 gtk_ui_manager_add_ui_from_string (ui_manager_bytes_menu, ui_desc_bytes_menu_popup, -1, &error);
3353 fprintf (stderr, "Warning: building Bytes Pop-Up menu failed: %s\n",
3355 g_error_free (error);
3359 g_object_unref(packet_list_byte_menu_action_group);
3361 g_object_set_data(G_OBJECT(popup_menu_object), PM_BYTES_VIEW_KEY,
3362 gtk_ui_manager_get_widget(ui_manager_bytes_menu, "/BytesMenuPopup"));
3364 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_bytes_menu);
3367 main_menu_bar_action_group = gtk_action_group_new ("MenuActionGroup");
3368 gtk_action_group_add_actions (main_menu_bar_action_group, /* the action group */
3369 main_menu_bar_entries, /* an array of action descriptions */
3370 G_N_ELEMENTS(main_menu_bar_entries), /* the number of entries */
3371 NULL); /* data to pass to the action callbacks */
3373 gtk_action_group_add_toggle_actions(main_menu_bar_action_group, /* the action group */
3374 main_menu_bar_toggle_action_entries, /* an array of action descriptions */
3375 G_N_ELEMENTS(main_menu_bar_toggle_action_entries), /* the number of entries */
3376 NULL); /* data to pass to the action callbacks */
3378 gtk_action_group_add_radio_actions (main_menu_bar_action_group, /* the action group */
3379 main_menu_bar_radio_view_time_entries, /* an array of radio action descriptions */
3380 G_N_ELEMENTS(main_menu_bar_radio_view_time_entries), /* the number of entries */
3381 recent.gui_time_format, /* the value of the action to activate initially, or -1 if no action should be activated */
3382 G_CALLBACK(timestamp_format_new_cb), /* the callback to connect to the changed signal */
3383 NULL); /* data to pass to the action callbacks */
3385 gtk_action_group_add_radio_actions (main_menu_bar_action_group, /* the action group */
3386 main_menu_bar_radio_view_time_fileformat_prec_entries, /* an array of radio action descriptions */
3387 G_N_ELEMENTS(main_menu_bar_radio_view_time_fileformat_prec_entries), /* the number of entries */
3388 recent.gui_time_precision, /* the value of the action to activate initially, or -1 if no action should be activated */
3389 G_CALLBACK(timestamp_precision_new_cb), /* the callback to connect to the changed signal */
3390 NULL); /* data to pass to the action callbacks */
3394 ui_manager_main_menubar = gtk_ui_manager_new ();
3395 gtk_ui_manager_insert_action_group (ui_manager_main_menubar, main_menu_bar_action_group, 0);
3396 gtk_ui_manager_add_ui_from_string (ui_manager_main_menubar,ui_desc_menubar, -1, &error);
3399 fprintf (stderr, "Warning: building main menubar failed: %s\n",
3401 g_error_free (error);
3404 g_object_unref(main_menu_bar_action_group);
3405 gtk_window_add_accel_group (GTK_WINDOW(top_level),
3406 gtk_ui_manager_get_accel_group(ui_manager_main_menubar));
3409 /* Add the recent files items to the menu
3410 * use place holders and
3411 * gtk_ui_manager_add_ui().
3413 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
3414 add_recent_items (merge_id, ui_manager_main_menubar);
3416 statusbar_profiles_action_group = gtk_action_group_new ("StatusBarProfilesPopUpMenuActionGroup");
3418 gtk_action_group_add_actions (statusbar_profiles_action_group, /* the action group */
3419 (gpointer)statusbar_profiles_menu_action_entries, /* an array of action descriptions */
3420 G_N_ELEMENTS(statusbar_profiles_menu_action_entries), /* the number of entries */
3421 popup_menu_object); /* data to pass to the action callbacks */
3423 ui_manager_statusbar_profiles_menu = gtk_ui_manager_new ();
3424 gtk_ui_manager_insert_action_group (ui_manager_statusbar_profiles_menu,
3425 statusbar_profiles_action_group,
3426 0); /* the position at which the group will be inserted. */
3428 gtk_ui_manager_add_ui_from_string (ui_manager_statusbar_profiles_menu,ui_statusbar_profiles_menu_popup, -1, &error);
3431 fprintf (stderr, "Warning: building Statusbar Profiles Pop-Up failed: %s\n",
3433 g_error_free (error);
3437 g_object_unref(statusbar_profiles_action_group);
3439 g_object_set_data(G_OBJECT(popup_menu_object), PM_STATUSBAR_PROFILES_KEY,
3440 gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup"));
3442 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_statusbar_profiles_menu);
3444 menu_dissector_filter(&cfile);
3445 /* Only LUA uses this currently. NOTE that "placeholders" must exist in the GUI description */
3446 merge_lua_menu_items(merge_lua_menu_items_list);
3448 /* Initialize enabled/disabled state of menu items */
3449 set_menus_for_capture_file(NULL);
3451 /* Un-#if this when we actually implement Cut/Copy/Paste.
3452 Then make sure you enable them when they can be done. */
3453 set_menu_sensitivity_old("/Edit/Cut", FALSE);
3454 set_menu_sensitivity_old("/Edit/Copy", FALSE);
3455 set_menu_sensitivity_old("/Edit/Paste", FALSE);
3458 set_menus_for_captured_packets(FALSE);
3459 set_menus_for_selected_packet(&cfile);
3460 set_menus_for_selected_tree_row(&cfile);
3461 set_menus_for_capture_in_progress(FALSE);
3462 set_menus_for_file_set(/* dialog */TRUE, /* previous file */ FALSE, /* next_file */ FALSE);
3467 typedef struct _menu_item {
3468 const char *gui_path;
3470 const char *stock_id;
3472 const char *accelerator;
3473 const gchar *tooltip;
3475 gpointer callback_data;
3477 gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data);
3478 gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data);
3481 void register_lua_menu_bar_menu_items(
3482 const char *gui_path,
3484 const gchar *stock_id,
3486 const char *accelerator,
3487 const gchar *tooltip,
3489 gpointer callback_data,
3491 gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data),
3492 gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data))
3494 menu_item_t *menu_item_data;
3496 menu_item_data = g_malloc0(sizeof (menu_item_t));
3497 menu_item_data->gui_path = gui_path;
3498 menu_item_data->name = name;
3499 menu_item_data->label = label;
3500 menu_item_data->stock_id = stock_id;
3501 menu_item_data->accelerator = accelerator;
3502 menu_item_data->tooltip = tooltip;
3503 menu_item_data->callback = callback;
3504 menu_item_data->callback_data = callback_data;
3505 menu_item_data->enabled = enabled;
3506 menu_item_data->selected_packet_enabled = selected_packet_enabled;
3507 menu_item_data->selected_tree_row_enabled = selected_tree_row_enabled;
3509 merge_lua_menu_items_list = g_list_append(merge_lua_menu_items_list, menu_item_data);
3514 merge_lua_menu_items(GList *merge_lua_menu_items_list)
3517 GtkActionGroup *action_group;
3519 GtkWidget *lua_submenu;
3522 menu_item_t *menu_item_data;
3524 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
3526 action_group = gtk_action_group_new ("LUA-action-group");
3528 lua_submenu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ToolsMenu/LUA");
3530 g_warning("lua_submenu: No submenu for LUA found, path= /Menubar/ToolsMenu/LUA");
3533 gtk_ui_manager_insert_action_group (ui_manager_main_menubar, action_group, 0);
3535 while(merge_lua_menu_items_list != NULL) {
3536 menu_item_data = merge_lua_menu_items_list->data;
3537 action_name = g_strdup_printf ("LUA-menuitem-%u", i);
3538 /*g_warning("action_name %s, filter_entry->name %s",action_name,filter_entry->name);*/
3539 action = g_object_new (GTK_TYPE_ACTION,
3540 "name", action_name,
3541 "label", menu_item_data->label,
3542 "stock-id", menu_item_data->stock_id,
3543 "tooltip", menu_item_data->tooltip,
3544 "sensitive", menu_item_data->enabled,
3546 g_signal_connect (action, "activate",
3547 G_CALLBACK (menu_item_data->callback), menu_item_data->callback_data);
3548 gtk_action_group_add_action (action_group, action);
3549 g_object_unref (action);
3551 gtk_ui_manager_add_ui (ui_manager_main_menubar, merge_id,
3552 "/Menubar/ToolsMenu/LUA/LUA-menu-items",
3555 GTK_UI_MANAGER_MENUITEM,
3558 merge_lua_menu_items_list = g_list_next(merge_lua_menu_items_list);
3563 GtkActionGroup *action_group;
3565 GtkWidget *submenu_dissector_filters;
3570 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
3572 action_group = gtk_action_group_new ("diessector-filters-group");
3574 submenu_dissector_filters = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ConversationFilterMenu");
3575 if(!submenu_dissector_filters){
3576 g_warning("add_recent_items: No submenu_dissector_filters found, path= /Menubar/AnalyzeMenu/ConversationFilterMenu");
3579 gtk_ui_manager_insert_action_group (ui_manager_main_menubar, action_group, 0);
3580 g_object_set_data (G_OBJECT (ui_manager_main_menubar),
3581 "diessector-filters-merge-id", GUINT_TO_POINTER (merge_id));
3586 action = g_object_new (GTK_TYPE_ACTION,
3587 "name", "filter-list-empty",
3588 "label", "No fileters",
3591 gtk_action_group_add_action (action_group, action);
3592 gtk_action_set_sensitive(action, FALSE);
3593 g_object_unref (action);
3595 gtk_ui_manager_add_ui (ui_manager_main_menubar, merge_id,
3596 "/Menubar/AnalyzeMenu/ConversationFilterMenu/Filters",
3597 "filter-list-empty",
3598 "filter-list-empty",
3599 GTK_UI_MANAGER_MENUITEM,
3605 while(list_entry != NULL) {
3606 filter_entry = list_entry->data;
3607 action_name = g_strdup_printf ("filter-%u", i);
3608 /*g_warning("action_name %s, filter_entry->name %s",action_name,filter_entry->name);*/
3609 action = g_object_new (GTK_TYPE_ACTION,
3610 "name", action_name,
3611 "label", filter_entry->name,
3612 "sensitive", menu_dissector_filter_spe_cb(/* frame_data *fd _U_*/ NULL, cf->edt, filter_entry),
3614 g_signal_connect (action, "activate",
3615 G_CALLBACK (menu_dissector_filter_cb), filter_entry);
3616 gtk_action_group_add_action (action_group, action);
3617 g_object_unref (action);
3619 gtk_ui_manager_add_ui (ui_manager_main_menubar, merge_id,
3620 "/Menubar/AnalyzeMenu/ConversationFilterMenu/Filters",
3623 GTK_UI_MANAGER_MENUITEM,
3626 list_entry = g_list_next(list_entry);
3634 add_menu_item(menu_item_t *node_data){
3635 GtkActionGroup *action_group = NULL;
3637 GList *action_groups, *l;
3640 g_warning("path '%s', node_data->name '%s'",node_data->gui_path,node_data->name);
3641 if(node_data->stock_id){
3642 g_warning("node_data->stock_id %s",node_data->stock_id);
3645 action_groups = gtk_ui_manager_get_action_groups (ui_manager_main_menubar);
3646 for (l = action_groups; l != NULL; l = l->next)
3648 GtkActionGroup *group = l->data;
3650 if (strcmp (gtk_action_group_get_name (group), "MenuActionGroup") == 0){
3651 /* This unrefs the action group and all of its actions */
3652 action_group = group;
3657 g_warning("Failed to find the action group");
3660 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
3662 action = g_object_new (GTK_TYPE_ACTION,
3663 "name", node_data->name,
3664 "label", node_data->label,
3665 "stock_id", node_data->stock_id,
3666 "sensitive", node_data->enabled,
3668 gtk_action_group_add_action (action_group, action);
3669 g_signal_connect (action, "activate",
3670 G_CALLBACK (node_data->callback), node_data->callback_data);
3672 g_object_unref (action);
3674 gtk_ui_manager_add_ui (ui_manager_main_menubar, merge_id,
3675 node_data->gui_path,
3676 node_data->name, /* XXX is this ok, the name for the added UI element */
3677 node_data->name, /* the name of the action to be proxied, or NULL to add a separator */
3678 GTK_UI_MANAGER_MENUITEM,
3686 * Enable/disable menu sensitivity.
3689 set_menu_sensitivity(GtkUIManager *ui_manager, const gchar *path, gint val)
3693 action = gtk_ui_manager_get_action(ui_manager, path);
3696 fprintf (stderr, "Warning: couldn't find action path= %s\n",
3701 gtk_action_set_sensitive (action,
3702 val); /* TRUE to make the action sensitive */
3707 set_menu_object_data_meat(GtkUIManager *ui_manager, const gchar *path, const gchar *key, gpointer data)
3709 GtkWidget *menu = NULL;
3711 if ((menu = gtk_ui_manager_get_widget(ui_manager, path)) != NULL){
3712 g_object_set_data(G_OBJECT(menu), key, data);
3715 g_warning("set_menu_object_data_meat: no menu, path: %s",path);
3721 set_menu_object_data (const gchar *path, const gchar *key, gpointer data) {
3722 if (strncmp (path,"/Menubar",8) == 0){
3723 set_menu_object_data_meat(ui_manager_main_menubar, path, key, data);
3724 }else if (strncmp (path,"/PacketListMenuPopup",20) == 0){
3725 set_menu_object_data_meat(ui_manager_packet_list_menu, path, key, data);
3726 }else if (strncmp (path,"/TreeViewPopup",14) == 0){
3727 set_menu_object_data_meat(ui_manager_tree_view_menu, path, key, data);
3728 }else if (strncmp (path,"/BytesMenuPopup",15) == 0){
3729 set_menu_object_data_meat(ui_manager_bytes_menu, path, key, data);
3730 }else if (strncmp (path,"/ProfilesMenuPopup",18) == 0){
3731 set_menu_object_data_meat(ui_manager_statusbar_profiles_menu, path, key, data);
3736 /* Recently used capture files submenu:
3737 * Submenu containing the recently used capture files.
3738 * The capture filenames are always kept with the absolute path, to be independant
3739 * of the current path.
3740 * They are only stored inside the labels of the submenu (no separate list). */
3742 #define MENU_RECENT_FILES_PATH "/Menubar/FileMenu/OpenRecent"
3743 #define MENU_RECENT_FILES_KEY "Recent File Name"
3745 /* Add a file name to the top of the list, if its allrady present remove it first */
3747 remove_present_file_name(GList *recent_files_list, const gchar *cf_name){
3749 gchar *widget_cf_name;
3751 for (li = g_list_first(recent_files_list); li; li = li->next) {
3752 widget_cf_name = li->data;
3755 /* do a case insensitive compare on win32 */
3756 g_ascii_strncasecmp(widget_cf_name, cf_name, 1000) == 0){
3758 /* do a case sensitive compare on unix */
3759 strncmp(widget_cf_name, cf_name, 1000) == 0 ){
3761 recent_files_list = g_list_remove(recent_files_list,widget_cf_name);
3765 return recent_files_list;
3769 recent_changed_cb (GtkUIManager *ui_manager,
3770 gpointer user_data _U_)
3773 GList *action_groups, *l;
3776 merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (ui_manager),
3777 "recent-files-merge-id"));
3780 gtk_ui_manager_remove_ui (ui_manager, merge_id);
3782 /* remove the action group; gtk_ui_manager_remove_action_group()
3783 * should really take the action group's name instead of its
3786 action_groups = gtk_ui_manager_get_action_groups (ui_manager);
3787 for (l = action_groups; l != NULL; l = l->next)
3789 GtkActionGroup *group = l->data;
3791 if (strcmp (gtk_action_group_get_name (group), "recent-files-group") == 0){
3792 /* this unrefs the action group and all of its actions */
3793 gtk_ui_manager_remove_action_group (ui_manager, group);
3798 /* generate a new merge id and re-add everything */
3799 merge_id = gtk_ui_manager_new_merge_id (ui_manager);
3800 add_recent_items (merge_id, ui_manager);
3804 recent_clear_cb(GtkAction *action _U_, gpointer user_data _U_)
3806 GtkWidget *submenu_recent_files;
3807 GList *recent_files_list;
3809 /* Get the list of recent files, free the list and store the empty list with the widget */
3810 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
3811 recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
3812 /* Free the name strings ?? */
3813 g_list_free(recent_files_list);
3814 recent_files_list = NULL;
3815 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
3816 /* Calling recent_changed_cb will rebuild the GUI call add_recent_items which will in turn call
3817 * main_welcome_reset_recent_capture_files
3819 recent_changed_cb(ui_manager_main_menubar, NULL);
3823 add_recent_items (guint merge_id, GtkUIManager *ui_manager)
3825 GtkActionGroup *action_group;
3827 GtkWidget *submenu_recent_files;
3832 /* Reset the recent files list in the welcome screen */
3833 main_welcome_reset_recent_capture_files();
3835 action_group = gtk_action_group_new ("recent-files-group");
3837 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
3838 if(!submenu_recent_files){
3839 g_warning("add_recent_items: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
3841 items = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
3843 gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
3844 g_object_set_data (G_OBJECT (ui_manager),
3845 "recent-files-merge-id", GUINT_TO_POINTER (merge_id));
3850 action = g_object_new (GTK_TYPE_ACTION,
3851 "name", "recent-info-empty",
3852 "label", "No recently used files",
3855 gtk_action_group_add_action (action_group, action);
3856 gtk_action_set_sensitive(action, FALSE);
3857 g_object_unref (action);
3859 gtk_ui_manager_add_ui (ui_manager, merge_id,
3860 "/Menubar/FileMenu/OpenRecent/RecentFiles",
3861 "recent-info-empty",
3862 "recent-info-empty",
3863 GTK_UI_MANAGER_MENUITEM,
3869 for (i = 0, l = items;
3870 i < prefs.gui_recent_files_count_max && l != NULL;
3873 gchar *item_name = l->data;
3874 action_name = g_strdup_printf ("recent-info-%u", i);
3876 action = g_object_new (GTK_TYPE_ACTION,
3877 "name", action_name,
3879 "stock_id", WIRESHARK_STOCK_FILE,
3881 g_signal_connect (action, "activate",
3882 G_CALLBACK (menu_open_recent_file_cmd_cb), NULL);
3883 #if !GTK_CHECK_VERSION(2,16,0)
3884 g_object_set_data (G_OBJECT (action), "FileName", item_name);
3886 gtk_action_group_add_action (action_group, action);
3887 g_object_unref (action);
3889 gtk_ui_manager_add_ui (ui_manager, merge_id,
3890 "/Menubar/FileMenu/OpenRecent/RecentFiles",
3893 GTK_UI_MANAGER_MENUITEM,
3896 /* Add the file name to the recent files list on the Welcome screen */
3897 main_welcome_add_recent_capture_file(item_name, G_OBJECT(action));
3899 g_free (action_name);
3901 /* Add a Separator */
3902 gtk_ui_manager_add_ui (ui_manager, merge_id,
3903 "/Menubar/FileMenu/OpenRecent/RecentFiles",
3904 "separator-recent-info",
3906 GTK_UI_MANAGER_SEPARATOR,
3909 /* Add a clear Icon */
3910 action = g_object_new (GTK_TYPE_ACTION,
3911 "name", "clear-recent-info",
3912 "label", "Clear the recent files list",
3913 "stock_id", GTK_STOCK_CLEAR,
3916 g_signal_connect (action, "activate",
3917 G_CALLBACK (recent_clear_cb), NULL);
3919 gtk_action_group_add_action (action_group, action);
3920 g_object_unref (action);
3922 gtk_ui_manager_add_ui (ui_manager, merge_id,
3923 "/Menubar/FileMenu/OpenRecent/RecentFiles",
3924 "clear-recent-info",
3925 "clear-recent-info",
3926 GTK_UI_MANAGER_MENUITEM,
3932 /* Open a file by it's name
3933 (Beware: will not ask to close existing capture file!) */
3935 menu_open_filename(gchar *cf_name)
3937 GtkWidget *submenu_recent_files;
3939 GList *recent_files_list;
3942 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
3943 if(!submenu_recent_files){
3944 g_warning("menu_open_filename: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
3946 recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
3947 /* XXX: ask user to remove item, it's maybe only a temporary problem */
3948 /* open and read the capture file (this will close an existing file) */
3949 if (cf_open(&cfile, cf_name, FALSE, &err) == CF_OK) {
3950 cf_read(&cfile, FALSE);
3952 recent_files_list = remove_present_file_name(recent_files_list, cf_name);
3953 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
3954 /* Calling recent_changed_cb will rebuild the GUI call add_recent_items which will in turn call
3955 * main_welcome_reset_recent_capture_files
3957 recent_changed_cb(ui_manager_main_menubar, NULL);
3961 /* callback, if the user pushed a recent file submenu item */
3963 menu_open_recent_file_cmd(gpointer action)
3965 GtkWidget *submenu_recent_files;
3966 GList *recent_files_list;
3967 const gchar *cf_name;
3970 #if GTK_CHECK_VERSION(2,16,0)
3971 cf_name = gtk_action_get_label(action);
3973 cf_name = g_object_get_data(G_OBJECT(action), "FileName");
3976 /* open and read the capture file (this will close an existing file) */
3977 if (cf_open(&cfile, cf_name, FALSE, &err) == CF_OK) {
3978 cf_read(&cfile, FALSE);
3980 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
3981 recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
3983 recent_files_list = remove_present_file_name(recent_files_list, cf_name);
3984 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
3985 /* Calling recent_changed_cb will rebuild the GUI call add_recent_items which will in turn call
3986 * main_welcome_reset_recent_capture_files
3988 recent_changed_cb(ui_manager_main_menubar, NULL);
3992 static void menu_open_recent_file_answered_cb(gpointer dialog _U_, gint btn, gpointer data)
3996 /* save file first */
3997 file_save_as_cmd(after_save_open_recent_file, data);
4001 menu_open_recent_file_cmd(data);
4003 case(ESD_BTN_CANCEL):
4006 g_assert_not_reached();
4010 menu_open_recent_file_cmd_cb(GtkAction *action, gpointer data _U_) {
4014 if((cfile.state != FILE_CLOSED) && !cfile.user_saved && prefs.gui_ask_unsaved) {
4015 /* user didn't saved his current file, ask him */
4016 dialog = simple_dialog(ESD_TYPE_CONFIRMATION, ESD_BTNS_YES_NO_CANCEL,
4017 "%sSave capture file before opening a new one?%s\n\n"
4018 "If you open a new capture file without saving, your current capture data will be discarded.",
4019 simple_dialog_primary_start(), simple_dialog_primary_end());
4020 simple_dialog_set_cb(dialog, menu_open_recent_file_answered_cb, action);
4022 /* unchanged file */
4023 menu_open_recent_file_cmd(action);
4028 add_menu_recent_capture_file_absolute(gchar *cf_name) {
4029 GtkWidget *submenu_recent_files;
4031 gchar *widget_cf_name;
4032 gchar *normalized_cf_name;
4034 GList *recent_files_list;
4036 normalized_cf_name = g_strdup(cf_name);
4038 /* replace all slashes by backslashes */
4039 g_strdelimit(normalized_cf_name, "/", '\\');
4042 /* get the submenu container item */
4043 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
4044 if(!submenu_recent_files){
4045 g_warning("add_menu_recent_capture_file_absolute: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
4048 recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
4050 for (li = g_list_first(recent_files_list); li; li = li->next, cnt++) {
4051 widget_cf_name = li->data;
4054 /* do a case insensitive compare on win32 */
4055 g_ascii_strncasecmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
4057 /* do a case sensitive compare on unix */
4058 strncmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
4060 cnt >= prefs.gui_recent_files_count_max) {
4061 recent_files_list = g_list_remove(recent_files_list,widget_cf_name);
4065 recent_files_list = g_list_prepend(recent_files_list, normalized_cf_name);
4066 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
4067 recent_changed_cb( ui_manager_main_menubar, NULL);
4071 /* add the capture filename to the "Recent Files" menu */
4072 /* (will change nothing, if this filename is already in the menu) */
4074 * XXX - We might want to call SHAddToRecentDocs under Windows 7:
4075 * http://stackoverflow.com/questions/437212/how-do-you-register-a-most-recently-used-list-with-windows-in-preparation-for-win
4078 add_menu_recent_capture_file(gchar *cf_name) {
4083 /* if this filename is an absolute path, we can use it directly */
4084 if (g_path_is_absolute(cf_name)) {
4085 add_menu_recent_capture_file_absolute(cf_name);
4089 /* this filename is not an absolute path, prepend the current dir */
4090 curr = g_get_current_dir();
4091 absolute = g_strdup_printf("%s%s%s", curr, G_DIR_SEPARATOR_S, cf_name);
4092 add_menu_recent_capture_file_absolute(absolute);
4098 /* write all capture filenames of the menu to the user's recent file */
4100 menu_recent_file_write_all(FILE *rf) {
4101 GtkWidget *submenu_recent_files;
4105 GList *recent_files_list, *list;
4107 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
4108 if(!submenu_recent_files){
4109 g_warning("menu_recent_file_write_all: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
4111 recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
4112 list = g_list_last(recent_files_list);
4113 while(list != NULL) {
4114 cf_name = list->data;
4117 fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", u3_contract_device_path(cf_name));
4119 fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", cf_name);
4121 list = g_list_previous(list);
4123 g_list_free(recent_files_list);
4126 /* we have to iterate backwards through the children's list,
4127 * so we get the latest item last in the file.
4128 * (don't use gtk_container_foreach() here, it will return the wrong iteration order) */
4129 children = gtk_container_get_children(GTK_CONTAINER(submenu_recent_files));
4130 child = g_list_last(children);
4131 while(child != NULL) {
4132 /* get capture filename from the menu item label */
4133 cf_name = g_object_get_data(G_OBJECT(child->data), MENU_RECENT_FILES_KEY);
4136 fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", u3_contract_device_path(cf_name));
4138 fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", cf_name);
4141 child = g_list_previous(child);
4144 g_list_free(children);
4149 show_hide_cb(GtkWidget *w, gpointer data _U_, gint action)
4152 /* save current setting in recent */
4154 case(SHOW_HIDE_MAIN_TOOLBAR):
4155 recent.main_toolbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
4157 case(SHOW_HIDE_FILTER_TOOLBAR):
4158 recent.filter_toolbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
4161 case(SHOW_HIDE_AIRPCAP_TOOLBAR):
4162 recent.airpcap_toolbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
4165 case(SHOW_HIDE_STATUSBAR):
4166 recent.statusbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
4168 case(SHOW_HIDE_PACKET_LIST):
4169 recent.packet_list_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
4171 case(SHOW_HIDE_TREE_VIEW):
4172 recent.tree_view_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
4174 case(SHOW_HIDE_BYTE_VIEW):
4175 recent.byte_view_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
4178 g_assert_not_reached();
4181 main_widgets_show_or_hide();
4186 timestamp_seconds_time_cb(GtkWidget *w, gpointer d _U_, gint action _U_)
4188 if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w))) {
4189 recent.gui_seconds_format = TS_SECONDS_HOUR_MIN_SEC;
4191 recent.gui_seconds_format = TS_SECONDS_DEFAULT;
4193 timestamp_set_seconds_type (recent.gui_seconds_format);
4195 /* This call adjusts column width */
4196 cf_timestamp_auto_precision(&cfile);
4197 new_packet_list_queue_draw();
4201 menu_name_resolution_changed(void)
4203 GtkWidget *menu = NULL;
4204 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforMACLayer");
4206 g_warning("menu_name_resolution_changed: No menu found, path= /Menubar/ViewMenu/NameResolution/EnableforMACLayer");
4208 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags & RESOLV_MAC);
4210 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforNetworkLayer");
4212 g_warning("menu_name_resolution_changed: No menu found, path= /Menubar/ViewMenu/NameResolution/EnableforNetworkLayer");
4214 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags & RESOLV_NETWORK);
4216 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforTransportLayer");
4218 g_warning("menu_name_resolution_changed: No menu found, path= /Menubar/ViewMenu/NameResolution/EnableforTransportLayer");
4220 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags & RESOLV_TRANSPORT);
4225 name_resolution_cb(GtkWidget *w, gpointer d _U_, gint action)
4227 if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w))) {
4228 gbl_resolv_flags |= action;
4230 gbl_resolv_flags &= ~action;
4236 menu_auto_scroll_live_changed(gboolean auto_scroll_live_in) {
4240 /* tell menu about it */
4241 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/AutoScrollinLiveCapture");
4243 g_warning("menu_auto_scroll_live_changed: No menu found, path= /Menubar/ViewMenu/AutoScrollinLiveCapture");
4245 if( ((gboolean) gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu)) != auto_scroll_live_in) ) {
4246 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), auto_scroll_live_in);
4249 /* tell toolbar about it */
4250 toolbar_auto_scroll_live_changed(auto_scroll_live_in);
4252 /* change auto scroll */
4253 if(auto_scroll_live_in != auto_scroll_live) {
4254 auto_scroll_live = auto_scroll_live_in;
4259 #endif /*HAVE_LIBPCAP */
4263 menu_colorize_changed(gboolean packet_list_colorize) {
4267 /* tell menu about it */
4268 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizePacketList");
4270 g_warning("menu_colorize_changed: No menu found, path= /Menubar/ViewMenu/ColorizePacketList");
4272 if( (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu)) != packet_list_colorize) ) {
4273 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), packet_list_colorize);
4276 /* tell toolbar about it */
4277 toolbar_colorize_changed(packet_list_colorize);
4279 /* change colorization */
4280 if(packet_list_colorize != recent.packet_list_colorize) {
4281 recent.packet_list_colorize = packet_list_colorize;
4282 color_filters_enable(packet_list_colorize);
4283 new_packet_list_colorize_packets();
4288 colorize_cb(GtkWidget *w, gpointer d _U_)
4290 menu_colorize_changed(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w)));
4294 /* the recent file read has finished, update the menu corresponding */
4296 menu_recent_read_finished(void) {
4297 GtkWidget *menu = NULL;
4299 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/MainToolbar");
4301 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/MainToolbar");
4303 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.main_toolbar_show);
4305 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/FilterToolbar");
4307 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/FilterToolbar");
4309 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.filter_toolbar_show);
4312 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/WirelessToolbar");
4314 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/WirelessToolbar");
4316 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.airpcap_toolbar_show);
4318 #endif /* HAVE_AIRPCAP */
4321 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/Statusbar");
4323 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/Statusbar");
4325 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.statusbar_show);
4328 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketList");
4330 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/PacketList");
4332 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.packet_list_show);
4335 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketDetails");
4337 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/PacketDetails");
4339 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.tree_view_show);
4342 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketBytes");
4344 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/PacketBytes");
4346 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.byte_view_show);
4349 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizePacketList");
4351 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/ColorizePacketList");
4353 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.packet_list_colorize);
4356 menu_name_resolution_changed();
4359 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/AutoScrollinLiveCapture");
4361 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/AutoScrollinLiveCapture");
4363 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), auto_scroll_live);
4365 #endif /* HAVE_LIBPCAP */
4367 main_widgets_rearrange();
4369 /* don't change the time format, if we had a command line value */
4370 if (timestamp_get_type() != TS_NOT_SET) {
4371 recent.gui_time_format = timestamp_get_type();
4375 timestamp_set_type(recent.gui_time_format);
4376 /* This call adjusts column width */
4377 cf_timestamp_auto_precision(&cfile);
4378 new_packet_list_queue_draw();
4380 /* This should not be needed as we set the active radioItem when we crate the actiongroup */
4381 switch(recent.gui_time_format) {
4382 case(TS_ABSOLUTE_WITH_DATE):
4383 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/DateandTimeofDay");
4385 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/DateandTimeofDay");
4389 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/TimeofDay");
4391 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/TimeofDay");
4395 g_warning("TS_RELATIVE");
4396 action = gtk_ui_manager_get_action(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/SecondsSinceBeginningofCapture");
4397 gtk_action_activate(action);
4398 if(gtk_action_is_sensitive(action))
4399 g_warning("ACTION IS SENSIBLE");
4401 g_warning("NO ACTION");
4404 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/SecondsSinceBeginningofCapture");
4406 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/SecondsSinceBeginningofCapture");
4410 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/SecondsSincePreviousCapturedPacket");
4412 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/SecondsSincePreviousCapturedPacket");
4416 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/SecondsSincePreviousDisplayedPacket");
4418 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/SecondsSincePreviousDisplayedPacket");
4422 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/SecondsSinceEpoch");
4424 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/SecondsSinceEpoch");
4427 case(TS_UTC_WITH_DATE):
4428 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/UTCDateandTimeofDay");
4430 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/UTCDateandTimeofDay");
4434 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/UTCTimeofDay");
4436 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/UTCTimeofDay");
4440 g_assert_not_reached();
4442 /* set_active will not trigger the callback when activating an active item! */
4443 recent.gui_time_format = -1;
4444 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
4445 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
4447 /* the actual precision will be set in new_packet_list_queue_draw() below */
4448 if (recent.gui_time_precision == TS_PREC_AUTO) {
4449 timestamp_set_precision(TS_PREC_AUTO_SEC);
4451 timestamp_set_precision(recent.gui_time_precision);
4453 /* This call adjusts column width */
4454 cf_timestamp_auto_precision(&cfile);
4455 new_packet_list_queue_draw();
4457 /* don't change the seconds format, if we had a command line value */
4458 if (timestamp_get_seconds_type() != TS_SECONDS_NOT_SET) {
4459 recent.gui_seconds_format = timestamp_get_seconds_type();
4461 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes");
4463 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes");
4466 switch (recent.gui_seconds_format) {
4467 case TS_SECONDS_DEFAULT:
4468 recent.gui_seconds_format = -1;
4469 /* set_active will not trigger the callback when deactivating an inactive item! */
4470 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
4471 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
4473 case TS_SECONDS_HOUR_MIN_SEC:
4474 recent.gui_seconds_format = -1;
4475 /* set_active will not trigger the callback when activating an active item! */
4476 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
4477 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
4480 g_assert_not_reached();
4483 menu_colorize_changed(recent.packet_list_colorize);
4488 popup_menu_handler(GtkWidget *widget, GdkEvent *event, gpointer data)
4490 GtkWidget *menu = (GtkWidget *)data;
4491 GdkEventButton *event_button = NULL;
4494 if(widget == NULL || event == NULL || data == NULL) {
4499 * If we ever want to make the menu differ based on what row
4500 * and/or column we're above, we'd use "eth_clist_get_selection_info()"
4501 * to find the row and column number for the coordinates; a CTree is,
4502 * I guess, like a CList with one column(?) and the expander widget
4505 /* Check if we are on packet_list object */
4506 if (widget == g_object_get_data(G_OBJECT(popup_menu_object), E_MPACKET_LIST_KEY) &&
4507 ((GdkEventButton *)event)->button != 1) {
4509 if (new_packet_list_get_event_row_column((GdkEventButton *)event, &physical_row, &row, &column)) {
4510 g_object_set_data(G_OBJECT(popup_menu_object), E_MPACKET_LIST_ROW_KEY,
4511 GINT_TO_POINTER(row));
4512 g_object_set_data(G_OBJECT(popup_menu_object), E_MPACKET_LIST_COL_KEY,
4513 GINT_TO_POINTER(column));
4514 new_packet_list_set_selected_row(row);
4518 /* Check if we are on tree_view object */
4519 if (widget == tree_view_gbl) {
4520 tree_view_select(widget, (GdkEventButton *) event);
4523 /* context menu handler */
4524 if(event->type == GDK_BUTTON_PRESS) {
4525 event_button = (GdkEventButton *) event;
4527 /* To quote the "Gdk Event Structures" doc:
4528 * "Normally button 1 is the left mouse button, 2 is the middle button, and 3 is the right button" */
4529 if(event_button->button == 3) {
4530 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
4531 event_button->button,
4532 event_button->time);
4533 g_signal_stop_emission_by_name(widget, "button_press_event");
4538 /* Check if we are on byte_view object */
4539 if(widget == get_notebook_bv_ptr(byte_nb_ptr_gbl)) {
4540 byte_view_select(widget, (GdkEventButton *) event);
4543 /* GDK_2BUTTON_PRESS is a doubleclick -> expand/collapse tree row */
4544 /* GTK version 1 seems to be doing this automatically */
4545 if (widget == tree_view_gbl && event->type == GDK_2BUTTON_PRESS) {
4548 if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget),
4549 (gint) (((GdkEventButton *)event)->x),
4550 (gint) (((GdkEventButton *)event)->y),
4551 &path, NULL, NULL, NULL))
4553 if (gtk_tree_view_row_expanded(GTK_TREE_VIEW(widget), path))
4554 gtk_tree_view_collapse_row(GTK_TREE_VIEW(widget), path);
4556 gtk_tree_view_expand_row(GTK_TREE_VIEW(widget), path,
4558 gtk_tree_path_free(path);
4564 /* Enable or disable menu items based on whether you have a capture file
4565 you've finished reading and, if you have one, whether it's been saved
4566 and whether it could be saved except by copying the raw packet data. */
4568 set_menus_for_capture_file(capture_file *cf)
4571 /* We have no capture file */
4572 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Merge", FALSE);
4573 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Close", FALSE);
4574 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Save", FALSE);
4575 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/SaveAs", FALSE);
4576 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Export", FALSE);
4577 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/Reload", FALSE);
4578 set_toolbar_for_capture_file(FALSE);
4579 set_toolbar_for_unsaved_capture_file(FALSE);
4581 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Merge", TRUE);
4582 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Close", TRUE);
4583 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Save", !cf->user_saved);
4585 * "Save As..." works only if we can write the file out in at least
4586 * one format (so we can save the whole file or just a subset) or
4587 * if we have an unsaved capture (so writing the whole file out
4588 * with a raw data copy makes sense).
4590 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/SaveAs",
4591 cf_can_save_as(cf) || !cf->user_saved);
4592 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Export", TRUE);
4593 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/Reload", TRUE);
4594 set_toolbar_for_unsaved_capture_file(!cf->user_saved);
4595 set_toolbar_for_capture_file(TRUE);
4599 /* Enable or disable menu items based on whether there's a capture in
4602 set_menus_for_capture_in_progress(gboolean capture_in_progress)
4604 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Open",
4605 !capture_in_progress);
4606 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/OpenRecent",
4607 !capture_in_progress);
4608 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Export",
4609 capture_in_progress);
4610 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set",
4611 !capture_in_progress);
4612 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortAscending",
4613 !capture_in_progress);
4614 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortDescending",
4615 !capture_in_progress);
4616 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/NoSorting",
4617 !capture_in_progress);
4620 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Options",
4621 !capture_in_progress);
4622 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Start",
4623 !capture_in_progress);
4624 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Stop",
4625 capture_in_progress);
4626 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Restart",
4627 capture_in_progress);
4628 set_toolbar_for_capture_in_progress(capture_in_progress);
4630 set_capture_if_dialog_for_capture_in_progress(capture_in_progress);
4631 #endif /* HAVE_LIBPCAP */
4636 set_menus_for_captured_packets(gboolean have_captured_packets)
4638 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Print",
4639 have_captured_packets);
4640 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/Print",
4641 have_captured_packets);
4643 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPacket",
4644 have_captured_packets);
4645 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindNext",
4646 have_captured_packets);
4647 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPrevious",
4648 have_captured_packets);
4649 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ZoomIn",
4650 have_captured_packets);
4651 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ZoomOut",
4652 have_captured_packets);
4653 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/NormalSize",
4654 have_captured_packets);
4655 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/Goto",
4656 have_captured_packets);
4657 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/PreviousPacket",
4658 have_captured_packets);
4659 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/NextPacket",
4660 have_captured_packets);
4661 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/FirstPacket",
4662 have_captured_packets);
4663 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/LastPacket",
4664 have_captured_packets);
4665 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/PreviousPacketInConversation",
4666 have_captured_packets);
4667 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/NextPacketInConversation",
4668 have_captured_packets);
4669 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/StatisticsMenu/Summary",
4670 have_captured_packets);
4671 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/StatisticsMenu/ProtocolHierarchy",
4672 have_captured_packets);
4673 set_toolbar_for_captured_packets(have_captured_packets);
4678 packet_is_ssl(epan_dissect_t* edt)
4684 if (!edt || !edt->tree)
4686 ssl_id = proto_get_id_by_filter_name("ssl");
4689 array = proto_find_finfo(edt->tree, ssl_id);
4690 is_ssl = (array->len > 0) ? TRUE : FALSE;
4691 g_ptr_array_free(array, TRUE);
4696 set_menus_for_selected_packet(capture_file *cf)
4698 GList *list_entry = dissector_filter_list;
4700 /* Making the menu context-sensitive allows for easier selection of the
4701 desired item and has the added benefit, with large captures, of
4702 avoiding needless looping through huge lists for marked, ignored,
4703 or time-referenced packets. */
4704 gboolean is_ssl = packet_is_ssl(cf->edt);
4705 gboolean frame_selected = cf->current_frame != NULL;
4706 /* A frame is selected */
4707 gboolean have_marked = frame_selected && cf->marked_count > 0;
4708 /* We have marked frames. (XXX - why check frame_selected?) */
4709 gboolean another_is_marked = have_marked &&
4710 !(cf->marked_count == 1 && cf->current_frame->flags.marked);
4711 /* We have a marked frame other than the current frame (i.e.,
4712 we have at least one marked frame, and either there's more
4713 than one marked frame or the current frame isn't marked). */
4714 gboolean have_time_ref = cf->ref_time_count > 0;
4715 gboolean another_is_time_ref = frame_selected && have_time_ref &&
4716 !(cf->ref_time_count == 1 && cf->current_frame->flags.ref_time);
4717 /* We have a time reference frame other than the current frame (i.e.,
4718 we have at least one time reference frame, and either there's more
4719 than one time reference frame or the current frame isn't a
4720 time reference frame). (XXX - why check frame_selected?) */
4722 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/MarkPacket",
4724 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/MarkPacket",
4726 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/MarkAllDisplayedPackets",
4727 cf->displayed_count > 0);
4728 /* Unlike un-ignore, do not allow unmark of all frames when no frames are displayed */
4729 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/UnmarkAllDisplayedPackets",
4731 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindNextMark",
4733 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPreviousMark",
4736 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/IgnorePacket",
4738 #ifdef WANT_PACKET_EDITOR
4739 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/EditPacket",
4741 #endif /* WANT_PACKET_EDITOR */
4742 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/IgnorePacket",
4744 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/IgnoreAllDisplayedPackets",
4745 cf->displayed_count > 0 && cf->displayed_count != cf->count);
4746 /* Allow un-ignore of all frames even with no frames currently displayed */
4747 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Un-IgnoreAllPackets",
4748 cf->ignored_count > 0);
4750 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/SetTimeReference",
4752 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Un-TimeReferenceAllPackets",
4754 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/TimeShift",
4756 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/SetTimeReference",
4758 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindNextTimeReference",
4759 another_is_time_ref);
4760 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPreviousTimeReference",
4761 another_is_time_ref);
4763 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ResizeAllColumns",
4765 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/CollapseAll",
4767 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/CollapseAll",
4769 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ExpandAll",
4771 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ExpandAll",
4773 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizeConversation",
4775 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ResetColoring1-10",
4776 tmp_color_filters_used());
4777 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ShowPacketinNewWindow",
4779 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ShowPacketinNewWindow",
4781 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ManuallyResolveAddress",
4782 frame_selected ? ((cf->edt->pi.ethertype == ETHERTYPE_IP)||(cf->edt->pi.ethertype == ETHERTYPE_IPv6)) : FALSE);
4783 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/SCTP",
4784 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_SCTP) : FALSE);
4785 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/FollowTCPStream",
4786 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
4787 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FollowTCPStream",
4788 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
4789 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/FollowUDPStream",
4790 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
4791 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/FollowSSLStream",
4792 frame_selected ? is_ssl : FALSE);
4793 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FollowSSLStream",
4794 frame_selected ? is_ssl : FALSE);
4795 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter",
4797 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter/Ethernet",
4798 frame_selected ? (cf->edt->pi.dl_src.type == AT_ETHER) : FALSE);
4799 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter/IP",
4800 frame_selected ? ((cf->edt->pi.ethertype == ETHERTYPE_IP)||(cf->edt->pi.ethertype == ETHERTYPE_IPv6)) : FALSE);
4801 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter/TCP",
4802 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
4803 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter/UDP",
4804 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
4805 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FollowUDPStream",
4806 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
4807 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter/PN-CBA",
4808 frame_selected ? (cf->edt->pi.profinet_type != 0 && cf->edt->pi.profinet_type < 10) : FALSE);
4809 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation",
4811 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation/Ethernet",
4812 frame_selected ? (cf->edt->pi.dl_src.type == AT_ETHER) : FALSE);
4813 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation/IP",
4814 frame_selected ? ((cf->edt->pi.ethertype == ETHERTYPE_IP)||(cf->edt->pi.ethertype == ETHERTYPE_IPv6)) : FALSE);
4815 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation/TCP",
4816 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
4817 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation/UDP",
4818 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
4819 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation/PN-CBA",
4820 frame_selected ? (cf->edt->pi.profinet_type != 0 && cf->edt->pi.profinet_type < 10) : FALSE);
4821 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/DecodeAs",
4822 frame_selected && decode_as_ok());
4823 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/DecodeAs",
4824 frame_selected && decode_as_ok());
4825 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/Copy",
4827 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ApplyAsFilter",
4829 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/PrepareaFilter",
4831 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ResolveName",
4832 frame_selected && (gbl_resolv_flags & RESOLV_ALL_ADDRS) != RESOLV_ALL_ADDRS);
4833 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/FollowTCPStream",
4834 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
4835 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/FollowUDPStream",
4836 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
4837 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/FollowSSLStream",
4838 frame_selected ? is_ssl : FALSE);
4839 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/DecodeAs",
4840 frame_selected && decode_as_ok());
4841 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/ResolveName",
4842 frame_selected && (gbl_resolv_flags & RESOLV_ALL_ADDRS) != RESOLV_ALL_ADDRS);
4843 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ToolsMenu/FirewallACLRules",
4845 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/StatisticsMenu/TCPStreamGraphMenu",
4846 tcp_graph_selected_packet_enabled(cf->current_frame,cf->edt, NULL));
4848 while(list_entry != NULL) {
4849 dissector_filter_t *filter_entry;
4852 filter_entry = list_entry->data;
4853 path = g_strdup_printf("/Menubar/AnalyzeMenu/ConversationFilterMenu/filter-%u", i);
4855 set_menu_sensitivity(ui_manager_main_menubar, path,
4856 menu_dissector_filter_spe_cb(/* frame_data *fd _U_*/ NULL, cf->edt, filter_entry));
4858 list_entry = g_list_next(list_entry);
4864 menu_prefs_toggle_bool (GtkWidget *w, gpointer data)
4866 gboolean *value = data;
4867 module_t *module = g_object_get_data (G_OBJECT(w), "module");
4869 module->prefs_changed = TRUE;
4872 prefs_apply (module);
4873 if (!prefs.gui_use_pref_save) {
4876 redissect_packets();
4880 menu_prefs_change_enum (GtkWidget *w, gpointer data)
4883 module_t *module = g_object_get_data (G_OBJECT(w), "module");
4884 gint new_value = GPOINTER_TO_INT(g_object_get_data (G_OBJECT(w), "enumval"));
4886 if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM(w)))
4889 if (*value != new_value) {
4890 module->prefs_changed = TRUE;
4893 prefs_apply (module);
4894 if (!prefs.gui_use_pref_save) {
4897 redissect_packets();
4902 menu_prefs_reset(void)
4904 g_free (g_object_get_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev"));
4905 g_object_set_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev", NULL);
4909 menu_prefs_change_ok (GtkWidget *w, gpointer parent_w)
4911 GtkWidget *entry = g_object_get_data (G_OBJECT(w), "entry");
4912 module_t *module = g_object_get_data (G_OBJECT(w), "module");
4913 pref_t *pref = g_object_get_data (G_OBJECT(w), "pref");
4914 const gchar *new_value = gtk_entry_get_text(GTK_ENTRY(entry));
4919 switch (pref->type) {
4921 uval = strtoul(new_value, &p, pref->info.base);
4922 if (p == new_value || *p != '\0') {
4923 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
4924 "The value \"%s\" isn't a valid number.",
4928 if (*pref->varp.uint != uval) {
4929 module->prefs_changed = TRUE;
4930 *pref->varp.uint = uval;
4934 if (strcmp (*pref->varp.string, new_value) != 0) {
4935 module->prefs_changed = TRUE;
4936 g_free((void*)*pref->varp.string);
4937 *pref->varp.string = g_strdup(new_value);
4941 if (range_convert_str(&newrange, new_value, pref->info.max_value) != CVT_NO_ERROR) {
4942 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
4943 "The value \"%s\" isn't a valid range.",
4947 if (!ranges_are_equal(*pref->varp.range, newrange)) {
4948 module->prefs_changed = TRUE;
4949 g_free(*pref->varp.range);
4950 *pref->varp.range = newrange;
4956 g_assert_not_reached();
4960 if (module->prefs_changed) {
4961 /* Ensure we reload the sub menu */
4963 prefs_apply (module);
4964 if (!prefs.gui_use_pref_save) {
4967 redissect_packets();
4970 window_destroy(GTK_WIDGET(parent_w));
4974 menu_prefs_change_cancel (GtkWidget *w _U_, gpointer parent_w)
4976 window_destroy(GTK_WIDGET(parent_w));
4980 menu_prefs_edit_dlg (GtkWidget *w, gpointer data)
4982 pref_t *pref = data;
4983 module_t *module = g_object_get_data (G_OBJECT(w), "module");
4984 gchar *value = NULL;
4986 GtkWidget *win, *main_tb, *main_vb, *bbox, *cancel_bt, *ok_bt;
4987 GtkWidget *entry, *label;
4989 switch (pref->type) {
4991 switch (pref->info.base) {
4993 value = g_strdup_printf("%o", *pref->varp.uint);
4996 value = g_strdup_printf("%u", *pref->varp.uint);
4999 value = g_strdup_printf("%x", *pref->varp.uint);
5002 g_assert_not_reached();
5007 value = g_strdup(*pref->varp.string);
5010 value = g_strdup(range_convert_range (*pref->varp.range));
5013 g_assert_not_reached();
5017 win = dlg_window_new(module->description);
5019 gtk_window_set_resizable(GTK_WINDOW(win),FALSE);
5020 gtk_window_resize(GTK_WINDOW(win), 400, 100);
5022 main_vb = gtk_vbox_new(FALSE, 5);
5023 gtk_container_add(GTK_CONTAINER(win), main_vb);
5024 gtk_container_set_border_width(GTK_CONTAINER(main_vb), 6);
5026 main_tb = gtk_table_new(2, 2, FALSE);
5027 gtk_box_pack_start(GTK_BOX(main_vb), main_tb, FALSE, FALSE, 0);
5028 gtk_table_set_col_spacings(GTK_TABLE(main_tb), 10);
5030 label = gtk_label_new(ep_strdup_printf("%s:", pref->title));
5031 gtk_table_attach_defaults(GTK_TABLE(main_tb), label, 0, 1, 1, 2);
5032 gtk_misc_set_alignment(GTK_MISC(label), 1.0f, 0.5f);
5033 if (pref->description)
5034 gtk_widget_set_tooltip_text(label, pref->description);
5036 entry = gtk_entry_new();
5037 gtk_table_attach_defaults(GTK_TABLE(main_tb), entry, 1, 2, 1, 2);
5038 gtk_entry_set_text(GTK_ENTRY(entry), value);
5039 if (pref->description)
5040 gtk_widget_set_tooltip_text(entry, pref->description);
5042 bbox = dlg_button_row_new(GTK_STOCK_CANCEL,GTK_STOCK_OK, NULL);
5043 gtk_box_pack_end(GTK_BOX(main_vb), bbox, FALSE, FALSE, 0);
5045 ok_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_OK);
5046 g_object_set_data (G_OBJECT(ok_bt), "module", module);
5047 g_object_set_data (G_OBJECT(ok_bt), "entry", entry);
5048 g_object_set_data (G_OBJECT(ok_bt), "pref", pref);
5049 g_signal_connect(ok_bt, "clicked", G_CALLBACK(menu_prefs_change_ok), win);
5051 dlg_set_activate(entry, ok_bt);
5053 cancel_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CANCEL);
5054 g_signal_connect(cancel_bt, "clicked", G_CALLBACK(menu_prefs_change_cancel), win);
5055 window_set_cancel_button(win, cancel_bt, NULL);
5057 gtk_widget_grab_default(ok_bt);
5058 gtk_widget_show_all(win);
5063 add_protocol_prefs_menu (pref_t *pref, gpointer data)
5065 GtkWidget *menu_preferences;
5066 GtkWidget *menu_item, *menu_sub_item, *sub_menu;
5067 GSList *group = NULL;
5068 module_t *module = data;
5069 const enum_val_t *enum_valp;
5070 gchar *label = NULL;
5072 switch (pref->type) {
5074 switch (pref->info.base) {
5076 label = g_strdup_printf ("%s: %o", pref->title, *pref->varp.uint);
5079 label = g_strdup_printf ("%s: %u", pref->title, *pref->varp.uint);
5082 label = g_strdup_printf ("%s: %x", pref->title, *pref->varp.uint);
5085 g_assert_not_reached();
5088 menu_item = gtk_menu_item_new_with_label(label);
5089 g_object_set_data (G_OBJECT(menu_item), "module", module);
5090 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_edit_dlg), pref);
5094 menu_item = gtk_check_menu_item_new_with_label(pref->title);
5095 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(menu_item), *pref->varp.boolp);
5096 g_object_set_data (G_OBJECT(menu_item), "module", module);
5097 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_toggle_bool), pref->varp.boolp);
5100 menu_item = gtk_menu_item_new_with_label(pref->title);
5101 sub_menu = gtk_menu_new();
5102 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_item), sub_menu);
5103 enum_valp = pref->info.enum_info.enumvals;
5104 while (enum_valp->name != NULL) {
5105 menu_sub_item = gtk_radio_menu_item_new_with_label(group, enum_valp->description);
5106 group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_sub_item));
5107 if (enum_valp->value == *pref->varp.enump) {
5108 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(menu_sub_item), TRUE);
5110 g_object_set_data (G_OBJECT(menu_sub_item), "module", module);
5111 g_object_set_data (G_OBJECT(menu_sub_item), "enumval", GINT_TO_POINTER(enum_valp->value));
5112 g_signal_connect(menu_sub_item, "activate", G_CALLBACK(menu_prefs_change_enum), pref->varp.enump);
5113 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_sub_item);
5114 gtk_widget_show (menu_sub_item);
5119 label = g_strdup_printf ("%s: %s", pref->title, *pref->varp.string);
5120 menu_item = gtk_menu_item_new_with_label(label);
5121 g_object_set_data (G_OBJECT(menu_item), "module", module);
5122 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_edit_dlg), pref);
5126 label = g_strdup_printf ("%s: %s", pref->title, range_convert_range (*pref->varp.range));
5127 menu_item = gtk_menu_item_new_with_label(label);
5128 g_object_set_data (G_OBJECT(menu_item), "module", module);
5129 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_edit_dlg), pref);
5133 label = g_strdup_printf ("%s...", pref->title);
5134 menu_item = gtk_menu_item_new_with_label(label);
5135 g_signal_connect (menu_item, "activate", G_CALLBACK(uat_window_cb), pref->varp.uat);
5138 case PREF_STATIC_TEXT:
5141 /* Nothing to add */
5145 menu_preferences = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences");
5146 if(!menu_preferences)
5147 g_warning("menu_preferences Not found path:TreeViewPopup/ProtocolPreferences");
5148 sub_menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM(menu_preferences));
5149 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5150 gtk_widget_show (menu_item);
5156 rebuild_protocol_prefs_menu (module_t *prefs_module_p, gboolean preferences)
5158 GtkWidget *menu_preferences, *menu_item;
5159 GtkWidget *sub_menu;
5162 menu_preferences = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences");
5163 if (prefs_module_p && preferences) {
5164 sub_menu = gtk_menu_new();
5165 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_preferences), sub_menu);
5167 label = g_strdup_printf ("%s Preferences...", prefs_module_p->description);
5168 menu_item = gtk_image_menu_item_new_with_label (label);
5169 gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM(menu_item),
5170 gtk_image_new_from_stock(GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_MENU));
5171 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5172 g_signal_connect_swapped(G_OBJECT(menu_item), "activate",
5173 G_CALLBACK(properties_cb), (GObject *) menu_item);
5174 gtk_widget_show (menu_item);
5177 menu_item = gtk_menu_item_new();
5178 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5179 gtk_widget_show (menu_item);
5181 prefs_pref_foreach(prefs_module_p, add_protocol_prefs_menu, prefs_module_p);
5183 /* No preferences, remove sub menu */
5184 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_preferences), NULL);
5190 menu_visible_column_toggle (GtkWidget *w _U_, gpointer data)
5192 new_packet_list_toggle_visible_column (GPOINTER_TO_INT(data));
5196 rebuild_visible_columns_menu (void)
5198 GtkWidget *menu_columns[2], *menu_item;
5199 GtkWidget *sub_menu;
5203 gint i, col_id, cur_fmt;
5204 menu_columns[0] = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/DisplayedColumns");
5205 if(! menu_columns[0]){
5206 fprintf (stderr, "Warning: couldn't find menu_columns[0] path=/Menubar/ViewMenu/DisplayedColumns");
5208 menu_columns[1] = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/DisplayedColumns");
5210 if(! menu_columns[1]){
5211 fprintf (stderr, "Warning: couldn't find menu_columns[1] path=/PacketListHeadingPopup/DisplayedColumns");
5214 for (i = 0; i < 2; i++) {
5215 sub_menu = gtk_menu_new();
5216 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_columns[i]), sub_menu);
5218 clp = g_list_first (prefs.col_list);
5221 cfmt = (fmt_data *) clp->data;
5222 cur_fmt = get_column_format_from_str(cfmt->fmt);
5223 if (cfmt->title[0]) {
5224 if (cur_fmt == COL_CUSTOM) {
5225 title = g_strdup_printf ("%s (%s)", cfmt->title, cfmt->custom_field);
5227 title = g_strdup_printf ("%s (%s)", cfmt->title, col_format_desc (cur_fmt));
5230 if (cur_fmt == COL_CUSTOM) {
5231 title = g_strdup_printf ("(%s)", cfmt->custom_field);
5233 title = g_strdup_printf ("(%s)", col_format_desc (cur_fmt));
5236 menu_item = gtk_check_menu_item_new_with_label(title);
5238 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(menu_item), cfmt->visible);
5239 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_visible_column_toggle), GINT_TO_POINTER(col_id));
5240 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5241 gtk_widget_show (menu_item);
5242 clp = g_list_next (clp);
5246 menu_item = gtk_menu_item_new();
5247 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5248 gtk_widget_show (menu_item);
5250 menu_item = gtk_menu_item_new_with_label ("Display All");
5251 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
5252 g_signal_connect(menu_item, "activate", G_CALLBACK(packet_list_heading_activate_all_columns_cb), NULL);
5253 gtk_widget_show (menu_item);
5258 menus_set_column_resolved (gboolean resolved, gboolean can_resolve)
5262 menu = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ShowResolved");
5264 fprintf (stderr, "Warning: couldn't find menu path=/PacketListHeadingPopup/ShowResolved");
5266 g_object_set_data(G_OBJECT(menu), "skip-update", (void *)1);
5267 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), resolved && can_resolve);
5268 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ShowResolved", can_resolve);
5269 g_object_set_data(G_OBJECT(menu), "skip-update", NULL);
5273 menus_set_column_align_default (gboolean right_justify)
5275 GtkWidget *submenu, *menu_item_child;
5276 GList *child_list, *child_list_item;
5277 const gchar *menu_item_name;
5278 size_t menu_item_len;
5280 /* get the submenu container item */
5281 submenu = gtk_ui_manager_get_widget (ui_manager_packet_list_heading, "/PacketListHeadingPopup");
5283 fprintf (stderr, "Warning: couldn't find submenu path=/PacketListHeadingPopup");
5286 /* find the corresponding menu items to update */
5287 child_list = gtk_container_get_children(GTK_CONTAINER(submenu));
5288 child_list_item = child_list;
5289 while(child_list_item) {
5290 menu_item_child = gtk_bin_get_child(GTK_BIN(child_list_item->data));
5291 if (menu_item_child != NULL) {
5292 menu_item_name = gtk_label_get_text(GTK_LABEL(menu_item_child));
5293 menu_item_len = strlen (menu_item_name);
5294 if(strncmp(menu_item_name, "Align Left", 10) == 0) {
5295 if (!right_justify && menu_item_len == 10) {
5296 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Left\t(default)");
5297 } else if (right_justify && menu_item_len > 10) {
5298 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Left");
5300 } else if (strncmp (menu_item_name, "Align Right", 11) == 0) {
5301 if (right_justify && menu_item_len == 11) {
5302 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Right\t(default)");
5303 } else if (!right_justify && menu_item_len > 11) {
5304 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Right");
5308 child_list_item = g_list_next(child_list_item);
5310 g_list_free(child_list);
5314 set_menus_for_selected_tree_row(capture_file *cf)
5316 gboolean properties;
5319 if (cf->finfo_selected != NULL) {
5320 header_field_info *hfinfo = cf->finfo_selected->hfinfo;
5324 if (hfinfo->parent == -1) {
5325 abbrev = hfinfo->abbrev;
5326 id = (hfinfo->type == FT_PROTOCOL) ? proto_get_id((protocol_t *)hfinfo->strings) : -1;
5328 abbrev = proto_registrar_get_abbrev(hfinfo->parent);
5329 id = hfinfo->parent;
5331 properties = prefs_is_registered_protocol(abbrev);
5332 set_menu_sensitivity(ui_manager_tree_view_menu,
5333 "/TreeViewPopup/GotoCorrespondingPacket", hfinfo->type == FT_FRAMENUM);
5334 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/Copy",
5336 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/Copy/AsFilter",
5337 proto_can_match_selected(cf->finfo_selected, cf->edt));
5338 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyasColumn",
5339 hfinfo->type != FT_NONE);
5340 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter",
5341 proto_can_match_selected(cf->finfo_selected, cf->edt));
5342 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter",
5343 proto_can_match_selected(cf->finfo_selected, cf->edt));
5344 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ColorizewithFilter",
5345 proto_can_match_selected(cf->finfo_selected, cf->edt));
5346 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences",
5348 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/DisableProtocol",
5349 (id == -1) ? FALSE : proto_can_toggle_protocol(id));
5350 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ExpandSubtrees",
5351 cf->finfo_selected->tree_type != -1);
5352 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/WikiProtocolPage",
5353 (id == -1) ? FALSE : TRUE);
5354 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FilterFieldReference",
5355 (id == -1) ? FALSE : TRUE);
5356 set_menu_sensitivity(ui_manager_main_menubar,
5357 "/Menubar/FileMenu/Export/SelectedPacketBytes", TRUE);
5358 set_menu_sensitivity(ui_manager_main_menubar,
5359 "/Menubar/GoMenu/GotoCorrespondingPacket", hfinfo->type == FT_FRAMENUM);
5360 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Description",
5361 proto_can_match_selected(cf->finfo_selected, cf->edt));
5362 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Fieldname",
5363 proto_can_match_selected(cf->finfo_selected, cf->edt));
5364 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Value",
5365 proto_can_match_selected(cf->finfo_selected, cf->edt));
5366 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/AsFilter",
5367 proto_can_match_selected(cf->finfo_selected, cf->edt));
5368 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ApplyasColumn",
5369 hfinfo->type != FT_NONE);
5370 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ApplyAsFilter",
5371 proto_can_match_selected(cf->finfo_selected, cf->edt));
5372 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/PrepareaFilter",
5373 proto_can_match_selected(cf->finfo_selected, cf->edt));
5374 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ExpandSubtrees",
5375 cf->finfo_selected->tree_type != -1);
5376 prev_abbrev = g_object_get_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev");
5377 if (!prev_abbrev || (strcmp (prev_abbrev, abbrev) != 0)) {
5378 /* No previous protocol or protocol changed - update Protocol Preferences menu */
5379 module_t *prefs_module_p = prefs_find_module(abbrev);
5380 rebuild_protocol_prefs_menu (prefs_module_p, properties);
5382 g_object_set_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev", g_strdup(abbrev));
5383 g_free (prev_abbrev);
5386 set_menu_sensitivity(ui_manager_tree_view_menu,
5387 "/TreeViewPopup/GotoCorrespondingPacket", FALSE);
5388 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/Copy", FALSE);
5389 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyasColumn", FALSE);
5390 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter", FALSE);
5391 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter", FALSE);
5392 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ColorizewithFilter", FALSE);
5393 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences",
5395 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/DisableProtocol", FALSE);
5396 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ExpandSubtrees", FALSE);
5397 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/WikiProtocolPage",
5399 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FilterFieldReference",
5401 set_menu_sensitivity(ui_manager_main_menubar,
5402 "/Menubar/FileMenu/Export/SelectedPacketBytes", FALSE);
5403 set_menu_sensitivity(ui_manager_main_menubar,
5404 "/Menubar/GoMenu/GotoCorrespondingPacket", FALSE);
5405 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Description", FALSE);
5406 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Fieldname", FALSE);
5407 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Value", FALSE);
5408 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/AsFilter", FALSE);
5409 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ApplyasColumn", FALSE);
5410 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ApplyAsFilter", FALSE);
5411 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/PrepareaFilter", FALSE);
5412 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ExpandSubtrees", FALSE);
5416 void set_menus_for_packet_history(gboolean back_history, gboolean forward_history) {
5417 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/Back", back_history);
5418 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/Forward", forward_history);
5419 set_toolbar_for_packet_history(back_history, forward_history);
5423 void set_menus_for_file_set(gboolean file_set, gboolean previous_file, gboolean next_file) {
5424 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set/ListFiles", file_set);
5425 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set/PreviousFile", previous_file);
5426 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set/NextFile", next_file);
5429 GtkWidget *menus_get_profiles_edit_menu (void)
5431 return gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Edit");
5434 GtkWidget *menus_get_profiles_delete_menu (void)
5436 return gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Delete");
5439 GtkWidget *menus_get_profiles_change_menu (void)
5441 return gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Change");
5444 void set_menus_for_profiles(gboolean default_profile)
5446 set_menu_sensitivity(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Edit", !default_profile);
5447 set_menu_sensitivity(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Delete", !default_profile);
5456 * indent-tabs-mode: nil
5459 * ex: set shiftwidth=4 tabstop=8 expandtab
5460 * :indentSize=4:tabSize=8:noTabs=true:
5462 #endif /* MAIN_MENU_USE_UIMANAGER */