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.
34 #include <epan/packet.h>
35 #include <epan/addr_resolv.h>
36 #include <epan/prefs.h>
37 #include <epan/prefs-int.h>
39 #include <epan/timestamp.h>
40 #include <epan/etypes.h>
41 #include <epan/ipproto.h>
42 #include <epan/dissector_filters.h>
43 #include <epan/strutil.h>
44 #include <epan/plugins.h>
45 #include <epan/epan_dissect.h>
46 #include <epan/column.h>
49 #include "../ui_util.h"
50 #include "../simple_dialog.h"
51 #include "../main_statusbar.h"
52 #include "../color_filters.h"
53 #include "../stat_menu.h"
56 #include "gtk/about_dlg.h"
57 #include "gtk/capture_dlg.h"
58 #include "gtk/capture_if_dlg.h"
59 #include "gtk/color_dlg.h"
60 #include "gtk/filter_dlg.h"
61 #include "gtk/profile_dlg.h"
62 #include "gtk/dlg_utils.h"
63 #include "gtk/capture_file_dlg.h"
64 #include "gtk/fileset_dlg.h"
65 #include "gtk/file_import_dlg.h"
66 #include "gtk/find_dlg.h"
67 #include "gtk/goto_dlg.h"
68 #include "gtk/summary_dlg.h"
69 #include "gtk/prefs_dlg.h"
70 #include "gtk/packet_win.h"
71 #include "gtk/follow_tcp.h"
72 #include "gtk/follow_udp.h"
73 #include "gtk/follow_ssl.h"
74 #include "gtk/decode_as_dlg.h"
75 #include "gtk/help_dlg.h"
76 #include "gtk/supported_protos_dlg.h"
77 #include "gtk/proto_dlg.h"
78 #include "gtk/proto_hier_stats_dlg.h"
80 #include "gtk/stock_icons.h"
81 #include "gtk/gtkglobals.h"
82 #include "gtk/recent.h"
83 #include "gtk/main_proto_draw.h"
84 #include "gtk/conversations_table.h"
85 #include "gtk/hostlist_table.h"
86 #include "gtk/packet_history.h"
87 #include "gtk/sctp_stat.h"
88 #include "gtk/firewall_dlg.h"
89 #include "gtk/macros_dlg.h"
90 #include "gtk/export_object.h"
91 #include "epan/dissectors/packet-ssl-utils.h"
92 #include "gtk/export_sslkeys.h"
93 #include "gtk/gui_stat_menu.h"
95 #include "gtk/menus.h"
96 #include "gtk/main_toolbar.h"
97 #include "gtk/main_welcome.h"
98 #include "gtk/uat_gui.h"
99 #include "gtk/gui_utils.h"
100 #include "gtk/manual_addr_resolv.h"
101 #include "gtk/proto_help.h"
102 #include "gtk/dissector_tables_dlg.h"
103 #include "gtk/utf8_entities.h"
104 #include "gtk/expert_comp_dlg.h"
105 #include "gtk/time_shift_dlg.h"
107 #include "gtk/new_packet_list.h"
110 #include "capture_opts.h"
111 #include "gtk/capture_globals.h"
113 #ifdef HAVE_IGE_MAC_INTEGRATION
114 #include <ige-mac-menu.h>
117 #ifdef HAVE_GTKOSXAPPLICATION
118 #include <igemacintegration/gtkosxapplication.h>
121 static int initialize = TRUE;
122 #ifdef MAIN_MENU_USE_UIMANAGER
123 GtkActionGroup *main_menu_bar_action_group;
125 static GtkItemFactory *main_menu_factory = NULL;
126 #endif /* MAIN_MENU_USE_UIMANAGER */
127 static GtkUIManager *ui_manager_main_menubar = NULL;
128 static GtkUIManager *ui_manager_packet_list_heading = NULL;
129 static GtkUIManager *ui_manager_packet_list_menu = NULL;
130 static GtkUIManager *ui_manager_tree_view_menu = NULL;
131 static GtkUIManager *ui_manager_bytes_menu = NULL;
132 static GtkUIManager *ui_manager_statusbar_profiles_menu = NULL;
133 static GSList *popup_menu_list = NULL;
135 static GtkAccelGroup *grp;
137 typedef struct _menu_item {
139 const char *gui_path;
141 const char *stock_id;
143 const char *accelerator;
144 const gchar *tooltip;
145 #ifdef MAIN_MENU_USE_UIMANAGER
148 GtkItemFactoryCallback callback;
151 gpointer callback_data;
152 gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data);
153 gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data);
157 static GList *tap_menu_tree_root = NULL;
159 GtkWidget *popup_menu_object;
162 #define GTK_MENU_FUNC(a) ((GtkItemFactoryCallback)(a))
164 static void merge_all_tap_menus(GList *node);
165 #ifdef MAIN_MENU_USE_UIMANAGER
166 static void menu_open_recent_file_cmd_cb(GtkAction *action, gpointer data _U_ );
167 static void add_recent_items (guint merge_id, GtkUIManager *ui_manager);
168 #endif /* MAIN_MENU_USE_UIMANAGER */
170 static void menus_init(void);
171 static void set_menu_sensitivity (GtkUIManager *ui_manager, const gchar *, gint);
172 #ifndef MAIN_MENU_USE_UIMANAGER
173 static void clear_menu_recent_capture_file_cmd_cb(GtkWidget *w, gpointer unused _U_);
174 static void set_menu_sensitivity_old (const gchar *, gint);
175 #endif /* MAIN_MENU_USE_UIMANAGER */
176 static void show_hide_cb(GtkWidget *w, gpointer data, gint action);
177 #ifndef MAIN_MENU_USE_UIMANAGER
178 static void timestamp_format_cb(GtkWidget *w, gpointer d, gint action);
179 static void timestamp_precision_cb(GtkWidget *w, gpointer d, gint action);
181 static void timestamp_seconds_time_cb(GtkWidget *w, gpointer d, gint action);
182 static void name_resolution_cb(GtkWidget *w, gpointer d, gint action);
184 #ifndef MAIN_MENU_USE_UIMANAGER
185 static void auto_scroll_live_cb(GtkWidget *w, gpointer d);
188 static void colorize_cb(GtkWidget *w, gpointer d);
191 /* As a general GUI guideline, we try to follow the Gnome Human Interface Guidelines, which can be found at:
192 http://developer.gnome.org/projects/gup/hig/1.0/index.html
194 Please note: there are some differences between the Gnome HIG menu suggestions and our implementation:
196 File/Open Recent: the Gnome HIG suggests putting the list of recently used files as elements into the File menuitem.
197 As this is ok for only a few items, this will become unhandy for 10 or even more list entries.
198 For this reason, we use a submenu for this.
200 File/Close: the Gnome HIG suggests putting this item just above the Quit item.
201 This results in unintuitive behaviour as both Close and Quit items are very near together.
202 By putting the Close item near the open item(s), it better suggests that it will close the
203 currently opened/captured file only.
207 SHOW_HIDE_MAIN_TOOLBAR = 1,
208 SHOW_HIDE_FILTER_TOOLBAR,
209 SHOW_HIDE_AIRPCAP_TOOLBAR,
211 SHOW_HIDE_PACKET_LIST,
214 } show_hide_values_e;
225 build_conversation_filter(int action, gboolean show_dialog)
227 packet_info *pi = &cfile.edt->pi;
233 if (pi->profinet_type == 0) {
235 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
236 "Error filtering conversation. Please make\n"
237 "sure you have a PROFINET CBA packet selected.");
242 if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4
243 && pi->ipproto == IP_PROTO_TCP ) {
245 switch(pi->profinet_type) {
247 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)",
248 ip_to_str( pi->net_dst.data),
249 ip_to_str( pi->net_src.data),
250 ip_to_str( pi->net_src.data),
251 ip_to_str( pi->net_dst.data));
254 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)",
255 ip_to_str( pi->net_src.data),
256 ip_to_str( pi->net_dst.data),
257 ip_to_str( pi->net_dst.data),
258 ip_to_str( pi->net_src.data));
261 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)",
262 ip_to_str( pi->net_dst.data),
263 ip_to_str( pi->net_src.data),
264 ip_to_str( pi->net_src.data),
265 ip_to_str( pi->net_dst.data));
268 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)",
269 ip_to_str( pi->net_src.data),
270 ip_to_str( pi->net_dst.data),
271 ip_to_str( pi->net_dst.data),
272 ip_to_str( pi->net_src.data));
282 if (pi->ipproto != IP_PROTO_TCP) {
284 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
285 "Error filtering conversation. Please make\n"
286 "sure you have a TCP packet selected.");
291 if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4 ) {
293 buf = g_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
294 ip_to_str( pi->net_src.data),
295 ip_to_str( pi->net_dst.data),
296 pi->srcport, pi->destport );
297 } else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6 ) {
299 buf = g_strdup_printf("(ipv6.addr eq %s and ipv6.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
300 ip6_to_str((const struct e_in6_addr *)pi->net_src.data),
301 ip6_to_str((const struct e_in6_addr *)pi->net_dst.data),
302 pi->srcport, pi->destport );
308 if (pi->ipproto != IP_PROTO_UDP) {
310 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
311 "Error filtering conversation. Please make\n"
312 "sure you have a UDP packet selected.");
317 if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4 ) {
319 buf = g_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (udp.port eq %d and udp.port eq %d)",
320 ip_to_str( pi->net_src.data),
321 ip_to_str( pi->net_dst.data),
322 pi->srcport, pi->destport );
323 } else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6 ) {
325 buf = g_strdup_printf("(ipv6.addr eq %s and ipv6.addr eq %s) and (udp.port eq %d and udp.port eq %d)",
326 ip6_to_str((const struct e_in6_addr *)pi->net_src.data),
327 ip6_to_str((const struct e_in6_addr *)pi->net_dst.data),
328 pi->srcport, pi->destport );
334 if ((pi->ethertype != ETHERTYPE_IP) && (pi->ethertype != ETHERTYPE_IPv6)) {
336 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
337 "Error filtering conversation. Please make\n"
338 "sure you have a IP packet selected.");
343 if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4 ) {
345 buf = g_strdup_printf("ip.addr eq %s and ip.addr eq %s",
346 ip_to_str( pi->net_src.data),
347 ip_to_str( pi->net_dst.data));
348 } else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6 ) {
350 buf = g_strdup_printf("ipv6.addr eq %s and ipv6.addr eq %s",
351 ip6_to_str((const struct e_in6_addr *)pi->net_src.data),
352 ip6_to_str((const struct e_in6_addr *)pi->net_dst.data));
358 /* XXX - is this the right way to check for Ethernet? */
359 /* check for the data link address type */
360 /* (ethertype will be 0 when used as length field) */
361 if (pi->dl_src.type != AT_ETHER) {
363 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
364 "Error filtering conversation. Please make\n"
365 "sure you have a Ethernet packet selected.");
370 if( pi->dl_src.type == AT_ETHER && pi->dl_dst.type == AT_ETHER ) {
372 buf = g_strdup_printf("eth.addr eq %s and eth.addr eq %s",
373 ether_to_str( pi->dl_src.data),
374 ether_to_str( pi->dl_dst.data));
387 new_window_cb(GtkWidget *widget)
389 new_packet_window(widget, FALSE);
392 #ifdef WANT_PACKET_EDITOR
394 edit_window_cb(GtkWidget *widget)
396 new_packet_window(widget, TRUE);
401 conversation_cb(GtkAction *a _U_, gpointer data _U_, int action)
404 GtkWidget *filter_te;
406 if (cfile.current_frame) {
407 /* create a filter-string based on the selected packet and action */
408 filter = build_conversation_filter(action, TRUE);
410 /* Run the display filter so it goes in effect - even if it's the
411 same as the previous display filter. */
412 filter_te = gtk_bin_get_child(GTK_BIN(g_object_get_data(G_OBJECT(top_level), E_DFILTER_CM_KEY)));
414 gtk_entry_set_text(GTK_ENTRY(filter_te), filter);
415 main_filter_packets(&cfile, filter, TRUE);
422 colorize_conversation_cb(GtkWidget * w _U_, gpointer data _U_, int action)
424 gchar *filter = NULL;
426 if( (action>>8) == 255 ) {
427 color_filters_reset_tmp();
428 new_packet_list_colorize_packets();
429 } else if (cfile.current_frame) {
430 if( (action&0xff) == 0 ) {
431 /* colorize_conversation_cb was called from the window-menu
432 * or through an accelerator key. Try to build a conversation
433 * filter in the order TCP, UDP, IP, Ethernet and apply the
435 filter = build_conversation_filter(CONV_TCP,FALSE);
437 filter = build_conversation_filter(CONV_UDP,FALSE);
439 filter = build_conversation_filter(CONV_IP,FALSE);
441 filter = build_conversation_filter(CONV_ETHER,FALSE);
442 if( filter == NULL ) {
443 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Unable to build conversation filter.");
447 /* create a filter-string based on the selected packet and action */
448 filter = build_conversation_filter(action&0xff, TRUE);
451 if( (action>>8) == 0) {
452 /* Open the "new coloring filter" dialog with the filter */
453 color_display_with_filter(filter);
455 /* Set one of the temporary coloring filters */
456 color_filters_set_tmp((guint8)(action>>8),filter,FALSE);
457 new_packet_list_colorize_packets();
465 goto_conversation_frame(gboolean dir)
468 dfilter_t *dfcode = NULL;
469 gboolean found_packet=FALSE;
471 filter = build_conversation_filter(CONV_TCP,FALSE);
473 filter = build_conversation_filter(CONV_UDP,FALSE);
475 filter = build_conversation_filter(CONV_IP,FALSE);
476 if( filter == NULL ) {
477 statusbar_push_temporary_msg("Unable to build conversation filter.");
482 if (!dfilter_compile(filter, &dfcode)) {
483 /* The attempt failed; report an error. */
484 statusbar_push_temporary_msg("Error compiling filter for this conversation.");
489 found_packet = cf_find_packet_dfilter(&cfile, dfcode, dir);
492 /* We didn't find a packet */
493 statusbar_push_temporary_msg("No previous/next packet in conversation.");
496 dfilter_free(dfcode);
500 #ifdef MAIN_MENU_USE_UIMANAGER
502 goto_next_frame_conversation_cb(GtkAction *action _U_, gpointer user_data _U_)
504 goto_conversation_frame(FALSE);
508 goto_previous_frame_conversation_cb(GtkAction *action _U_, gpointer user_data _U_)
510 goto_conversation_frame(TRUE);
514 goto_next_frame_conversation_cb(GtkWidget *w _U_, gpointer d _U_)
516 goto_conversation_frame(FALSE);
520 goto_previous_frame_conversation_cb(GtkWidget *w _U_, gpointer d _U_)
522 goto_conversation_frame(TRUE);
524 #endif /* MAIN_MENU_USE_UIMANAGER */
531 tree_view_menu_apply_selected_cb(GtkAction *action _U_, gpointer user_data)
533 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/Selected");
534 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_REPLACE|MATCH_SELECTED_APPLY_NOW);
538 tree_view_menu_apply_not_selected_cb(GtkAction *action _U_, gpointer user_data)
540 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/NotSelected");
541 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_NOT|MATCH_SELECTED_APPLY_NOW);
545 tree_view_menu_apply_and_selected_cb(GtkAction *action _U_, gpointer user_data)
547 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/AndSelected");
548 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_AND|MATCH_SELECTED_APPLY_NOW);
552 tree_view_menu_apply_or_selected_cb(GtkAction *action _U_, gpointer user_data)
554 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/OrSelected");
555 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_OR|MATCH_SELECTED_APPLY_NOW);
559 tree_view_menu_apply_and_not_selected_cb(GtkAction *action _U_, gpointer user_data)
561 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/AndNotSelected");
562 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_AND_NOT|MATCH_SELECTED_APPLY_NOW);
566 tree_view_menu_apply_or_not_selected_cb(GtkAction *action _U_, gpointer user_data)
568 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter/OrNotSelected");
569 match_selected_ptree_cb( widget , user_data,MATCH_SELECTED_OR_NOT|MATCH_SELECTED_APPLY_NOW);
571 /* Prepare a filter */
573 tree_view_menu_prepare_selected_cb(GtkAction *action _U_, gpointer user_data)
575 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/Selected");
576 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_REPLACE);
580 tree_view_menu_prepare_not_selected_cb(GtkAction *action _U_, gpointer user_data)
582 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/NotSelected");
583 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_NOT);
587 tree_view_menu_prepare_and_selected_cb(GtkAction *action _U_, gpointer user_data)
589 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/AndSelected");
590 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_AND);
594 tree_view_menu_prepare_or_selected_cb(GtkAction *action _U_, gpointer user_data)
596 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/OrSelected");
597 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_OR);
601 tree_view_menu_prepare_and_not_selected_cb(GtkAction *action _U_, gpointer user_data)
603 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/AndNotSelected");
604 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_AND_NOT);
608 tree_view_menu_prepare_or_not_selected_cb(GtkAction *action _U_, gpointer user_data)
610 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter/OrNotSelected");
611 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_OR_NOT);
614 /* Prepare for use of GTKUImanager */
615 #ifdef MAIN_MENU_USE_UIMANAGER
618 copy_description_cb(GtkAction *action _U_, gpointer user_data)
620 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_DESCRIPTION);
624 copy_fieldname_cb(GtkAction *action _U_, gpointer user_data)
626 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_FIELDNAME);
630 copy_value_cb(GtkAction *action _U_, gpointer user_data)
632 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_VALUE);
636 copy_as_filter_cb(GtkAction *action _U_, gpointer user_data)
638 match_selected_ptree_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_REPLACE|MATCH_SELECTED_COPY_ONLY);
642 set_reftime_cb(GtkAction *action _U_, gpointer user_data)
644 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_TOGGLE);
648 find_next_ref_time_cb(GtkAction *action _U_, gpointer user_data)
650 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_FIND_NEXT);
654 find_previous_ref_time_cb(GtkAction *action _U_, gpointer user_data)
656 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_FIND_PREV);
660 menus_prefs_cb(GtkAction *action _U_, gpointer user_data)
662 prefs_page_cb( NULL /* widget _U_ */ , user_data, PREFS_PAGE_USER_INTERFACE);
666 main_toolbar_show_hide_cb(GtkAction *action _U_, gpointer user_data)
668 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/MainToolbar");
671 g_warning("main_toolbar_show_hide_cb: No widget found");
673 show_hide_cb( widget, user_data, SHOW_HIDE_MAIN_TOOLBAR);
678 filter_toolbar_show_hide_cb(GtkAction * action _U_, gpointer user_data)
680 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/FilterToolbar");
682 g_warning("filter_toolbar_show_hide_cb: No widget found");
684 show_hide_cb( widget, user_data, SHOW_HIDE_FILTER_TOOLBAR);
690 wireless_toolbar_show_hide_cb(GtkAction *action _U_, gpointer user_data)
692 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/WirelessToolbar");
694 g_warning("wireless_toolbar_show_hide_cb: No widget found");
696 show_hide_cb( widget, user_data, SHOW_HIDE_AIRPCAP_TOOLBAR);
699 #endif /* HAVE_AIRPCAP */
702 status_bar_show_hide_cb(GtkAction *action _U_, gpointer user_data)
704 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/Statusbar");
706 g_warning("status_bar_show_hide_cb: No widget found");
708 show_hide_cb( widget, user_data, SHOW_HIDE_STATUSBAR);
712 packet_list_show_hide_cb(GtkAction *action _U_, gpointer user_data)
714 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketList");
716 g_warning("packet_list_show_hide_cb: No widget found");
718 show_hide_cb( widget, user_data, SHOW_HIDE_PACKET_LIST);
722 packet_details_show_hide_cb(GtkAction *action _U_, gpointer user_data)
724 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketDetails");
726 g_warning("packet_details_show_hide_cb: No widget found");
728 show_hide_cb( widget, user_data, SHOW_HIDE_TREE_VIEW);
732 packet_bytes_show_hide_cb(GtkAction *action _U_, gpointer user_data)
734 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketBytes");
736 g_warning("packet_bytes_show_hide_cb: No widget found");
738 show_hide_cb( widget, user_data, SHOW_HIDE_BYTE_VIEW);
743 timestamp_format_new_cb (GtkRadioAction *action, GtkRadioAction *current _U_, gpointer user_data _U_)
747 value = gtk_radio_action_get_current_value (action);
748 g_warning("timestamp_format_new_cb, value %u, recent.gui_time_format %u",value, recent.gui_time_format);
749 if (recent.gui_time_format != value) {
750 timestamp_set_type(value);
751 recent.gui_time_format = value;
752 /* This call adjusts column width */
753 cf_timestamp_auto_precision(&cfile);
754 new_packet_list_queue_draw();
760 timestamp_precision_new_cb (GtkRadioAction *action, GtkRadioAction *current _U_, gpointer user_data _U_)
764 value = gtk_radio_action_get_current_value (action);
765 g_warning("timestamp_precision_new_cb, value %u, recent.gui_time_precision %u",value, recent.gui_time_precision);
766 if (recent.gui_time_precision != value) {
767 /* the actual precision will be set in new_packet_list_queue_draw() below */
768 if (value == TS_PREC_AUTO) {
769 timestamp_set_precision(TS_PREC_AUTO_SEC);
771 timestamp_set_precision(value);
773 recent.gui_time_precision = value;
774 /* This call adjusts column width */
775 cf_timestamp_auto_precision(&cfile);
776 new_packet_list_queue_draw();
782 view_menu_seconds_time_cb(GtkAction *action _U_, gpointer user_data)
784 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes");
786 g_warning("view_menu_seconds_time_cb: No widget found");
788 timestamp_seconds_time_cb(widget, user_data, 0);
793 view_menu_en_for_MAC_cb(GtkAction *action _U_, gpointer user_data)
795 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforMACLayer");
797 g_warning("view_menu_en_for_MAC_cb: No widget found");
799 name_resolution_cb( widget , user_data, RESOLV_MAC);
804 view_menu_en_for_network_cb(GtkAction *action _U_, gpointer user_data)
806 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforNetworkLayer");
808 g_warning("view_menu_en_for_network_cb: No widget found");
810 name_resolution_cb( widget , user_data, RESOLV_NETWORK);
815 view_menu_en_for_transport_cb(GtkAction *action _U_, gpointer user_data)
817 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforTransportLayer");
819 g_warning("view_menu_en_for_transport_cb: No widget found");
821 name_resolution_cb( widget , user_data, RESOLV_TRANSPORT);
826 view_menu_colorize_pkt_lst_cb(GtkAction *action _U_, gpointer user_data)
828 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizePacketList");
830 g_warning("view_menu_colorize_pkt_lst_cb: No widget found");
832 colorize_cb( widget , user_data);
839 view_menu_auto_scroll_live_cb(GtkAction *action _U_, gpointer user_data _U_)
841 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/AutoScrollinLiveCapture");
844 g_warning("view_menu_auto_scroll_live_cb: No widget found");
846 menu_auto_scroll_live_changed(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)));
852 view_menu_color_conv_color1_cb(GtkAction *action _U_, gpointer user_data)
854 colorize_conversation_cb( NULL /* widget _U_*/ , user_data, 1*256);
858 view_menu_color_conv_color2_cb(GtkAction *action _U_, gpointer user_data)
860 colorize_conversation_cb( NULL /* widget _U_*/ , user_data, 2*256);
864 view_menu_color_conv_color3_cb(GtkAction *action _U_, gpointer user_data)
866 colorize_conversation_cb( NULL /* widget _U_*/ , user_data, 3*256);
870 view_menu_color_conv_color4_cb(GtkAction *action _U_, gpointer user_data)
872 colorize_conversation_cb( NULL /* widget _U_*/ , user_data, 4*256);
876 view_menu_color_conv_color5_cb(GtkAction *action _U_, gpointer user_data)
878 colorize_conversation_cb( NULL /* widget _U_*/ , user_data, 5*256);
882 view_menu_color_conv_color6_cb(GtkAction *action _U_, gpointer user_data)
884 colorize_conversation_cb( NULL /* widget _U_*/ , user_data, 6*256);
888 view_menu_color_conv_color7_cb(GtkAction *action _U_, gpointer user_data)
890 colorize_conversation_cb( NULL /* widget _U_*/ , user_data, 7*256);
894 view_menu_color_conv_color8_cb(GtkAction *action _U_, gpointer user_data)
896 colorize_conversation_cb( NULL /* widget _U_*/ , user_data, 8*256);
900 view_menu_color_conv_color9_cb(GtkAction *action _U_, gpointer user_data)
902 colorize_conversation_cb( NULL /* widget _U_*/ , user_data, 9*256);
906 view_menu_color_conv_color10_cb(GtkAction *action _U_, gpointer user_data)
908 colorize_conversation_cb( NULL /* widget _U_*/ , user_data, 10*256);
912 view_menu_color_conv_new_rule_cb(GtkAction *action _U_, gpointer user_data)
914 colorize_conversation_cb( NULL /* widget _U_*/ , user_data, 0);
918 view_menu_reset_coloring_cb(GtkAction *action _U_, gpointer user_data)
920 colorize_conversation_cb( NULL /* widget _U_*/ , user_data, 255*256);
924 help_menu_cont_cb(GtkAction *action _U_, gpointer user_data _U_)
926 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(HELP_CONTENT));
930 help_menu_faq_cb(GtkAction *action _U_, gpointer user_data _U_)
932 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_FAQ));
936 help_menu_wireshark_cb(GtkAction *action _U_, gpointer user_data _U_)
938 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_WIRESHARK));
942 help_menu_wireshark_flt_cb(GtkAction *action _U_, gpointer user_data _U_)
944 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_WIRESHARK_FILTER));
948 help_menu_Tshark_cb(GtkAction *action _U_, gpointer user_data _U_)
950 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_TSHARK));
954 help_menu_RawShark_cb(GtkAction *action _U_, gpointer user_data _U_)
956 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_RAWSHARK));
960 help_menu_Dumpcap_cb(GtkAction *action _U_, gpointer user_data _U_)
962 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_DUMPCAP));
966 help_menu_Mergecap_cb(GtkAction *action _U_, gpointer user_data _U_)
968 topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_MERGECAP));
972 help_menu_Editcap_cb(GtkAction *action _U_, gpointer user_data _U_)
974 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_EDITCAP));
978 help_menu_Text2pcap_cb(GtkAction *action _U_, gpointer user_data _U_)
980 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_TEXT2PCAP));
984 help_menu_Website_cb(GtkAction *action _U_, gpointer user_data _U_)
986 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_HOME));
990 help_menu_Wiki_cb(GtkAction *action _U_, gpointer user_data _U_)
992 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_WIKI));
996 help_menu_Downloads_cb(GtkAction *action _U_, gpointer user_data _U_)
998 topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_DOWNLOAD));
1002 help_menu_SampleCaptures_cb(GtkAction *action _U_, gpointer user_data _U_)
1004 topic_menu_cb( NULL/* widget_U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_SAMPLE_FILES));
1007 static const char *ui_desc_menubar =
1009 " <menubar name ='Menubar'>\n"
1010 " <menu name= 'FileMenu' action='/File'>\n"
1011 " <menuitem name='Open' action='/File/Open'/>\n"
1012 " <menu name='OpenRecent' action='/File/OpenRecent'>\n"
1013 " <placeholder name='RecentFiles'/>\n"
1015 " <menuitem name='Merge' action='/File/Merge'/>\n"
1016 " <menuitem name='Import' action='/File/Import'/>\n"
1017 " <menuitem name='Close' action='/File/Close'/>\n"
1019 " <menuitem name='Save' action='/File/Save'/>\n"
1020 " <menuitem name='SaveAs' action='/File/SaveAs'/>\n"
1022 " <menu name= 'Set' action='/File/Set'>\n"
1023 " <menuitem name='ListFiles' action='/File/Set/ListFiles'/>\n"
1024 " <menuitem name='NextFile' action='/File/Set/NextFile'/>\n"
1025 " <menuitem name='PreviousFile' action='/File/Set/PreviousFile'/>\n"
1028 " <menu name= 'Export' action='/File/Export'>\n"
1030 " <menuitem name='File' action='/File/Export/File'/>\n"
1032 " <menu name= 'File' action='/File/Export/File'>\n"
1033 " <menuitem name='AsTxt' action='/File/Export/File/Text'/>\n"
1034 " <menuitem name='AsPostScript' action='/File/Export/File/PostScript'/>\n"
1035 " <menuitem name='AsCSV' action='/File/Export/File/CSV'/>\n"
1036 " <menuitem name='AsCArrays' action='/File/Export/File/CArrays'/>\n"
1038 " <menuitem name='AsPSML' action='/File/Export/File/PSML'/>\n"
1039 " <menuitem name='AsPDML' action='/File/Export/File/PDML'/>\n"
1043 " <menuitem name='SelectedPacketBytes' action='/File/Export/SelectedPacketBytes'/>\n"
1044 " <menu name= 'Objects' action='/File/Export/Objects'>\n"
1045 " <menuitem name='HTTP' action='/File/Export/Objects/HTTP'/>\n"
1046 " <menuitem name='DICOM' action='/File/Export/Objects/DICOM'/>\n"
1047 " <menuitem name='SMB' action='/File/Export/Objects/SMB'/>\n"
1051 " <menuitem name='Print' action='/File/Print'/>\n"
1053 " <menuitem name='Quit' action='/File/Quit'/>\n"
1055 " <menu name= 'EditMenu' action='/Edit'>\n"
1056 " <menu name= 'Copy' action='/Edit/Copy'>\n"
1057 " <menuitem name='Description' action='/Edit/Copy/Description'/>\n"
1058 " <menuitem name='Fieldname' action='/Edit/Copy/Fieldname'/>\n"
1059 " <menuitem name='Value' action='/Edit/Copy/Value'/>\n"
1061 " <menuitem name='AsFilter' action='/Edit/Copy/AsFilter'/>\n"
1063 " <menuitem name='FindPacket' action='/Edit/FindPacket'/>\n"
1064 " <menuitem name='FindNext' action='/Edit/FindNext'/>\n"
1065 " <menuitem name='FindPrevious' action='/Edit/FindPrevious'/>\n"
1067 " <menuitem name='MarkPacket' action='/Edit/MarkPacket'/>\n"
1068 " <menuitem name='MarkAllDisplayedPackets' action='/Edit/MarkAllDisplayedPackets'/>\n"
1069 " <menuitem name='UnmarkAllDisplayedPackets' action='/Edit/UnmarkAllDisplayedPackets'/>\n"
1070 " <menuitem name='FindNextMark' action='/Edit/FindNextMark'/>\n"
1071 " <menuitem name='FindPreviousMark' action='/Edit/FindPreviousMark'/>\n"
1073 " <menuitem name='IgnorePacket' action='/Edit/IgnorePacket'/>\n"
1074 " <menuitem name='IgnoreAllDisplayedPackets' action='/Edit/IgnoreAllDisplayedPackets'/>\n"
1075 " <menuitem name='Un-IgnoreAllPackets' action='/Edit/Un-IgnoreAllPackets'/>\n"
1077 " <menuitem name='SetTimeReference' action='/Edit/SetTimeReference'/>\n"
1078 " <menuitem name='Un-TimeReferenceAllPackets' action='/Edit/Un-TimeReferenceAllPackets'/>\n"
1079 " <menuitem name='TimeShift' action='/Edit/TimeShift'/>\n"
1080 " <menuitem name='FindNextTimeReference' action='/Edit/FindNextTimeReference'/>\n"
1081 " <menuitem name='FindPreviousTimeReference' action='/Edit/FindPreviousTimeReference'/>\n"
1083 #ifdef WANT_PACKET_EDITOR
1084 " <menuitem name='EditPacket' action='/Edit/EditPacket'/>\n"
1087 " <menuitem name='ConfigurationProfiles' action='/Edit/ConfigurationProfiles'/>\n"
1088 " <menuitem name='Preferences' action='/Edit/Preferences'/>\n"
1090 " <menu name= 'ViewMenu' action='/View'>\n"
1091 " <menuitem name='MainToolbar' action='/View/MainToolbar'/>\n"
1092 " <menuitem name='FilterToolbar' action='/View/FilterToolbar'/>\n"
1094 " <menuitem name='WirelessToolbar' action='/View/WirelessToolbar'/>\n"
1096 " <menuitem name='Statusbar' action='/View/Statusbar'/>\n"
1098 " <menuitem name='PacketList' action='/View/PacketList'/>\n"
1099 " <menuitem name='PacketDetails' action='/View/PacketDetails'/>\n"
1100 " <menuitem name='PacketBytes' action='/View/PacketBytes'/>\n"
1102 " <menu name= 'TimeDisplayFormat' action='/View/TimeDisplayFormat'>\n"
1103 " <menuitem name='DateandTimeofDay' action='/View/TimeDisplayFormat/DateandTimeofDay'/>\n"
1104 " <menuitem name='TimeofDay' action='/View/TimeDisplayFormat/TimeofDay'/>\n"
1105 " <menuitem name='SecondsSinceEpoch' action='/View/TimeDisplayFormat/SecondsSinceEpoch'/>\n"
1106 " <menuitem name='SecondsSinceBeginningofCapture' action='/View/TimeDisplayFormat/SecondsSinceBeginningofCapture'/>\n"
1107 " <menuitem name='SecondsSincePreviousCapturedPacket' action='/View/TimeDisplayFormat/SecondsSincePreviousCapturedPacket'/>\n"
1108 " <menuitem name='SecondsSincePreviousDisplayedPacket' action='/View/TimeDisplayFormat/SecondsSincePreviousDisplayedPacket'/>\n"
1110 " <menuitem name='FileFormatPrecision-Automatic' action='/View/TimeDisplayFormat/FileFormatPrecision-Automatic'/>\n"
1111 " <menuitem name='FileFormatPrecision-Seconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Seconds'/>\n"
1112 " <menuitem name='FileFormatPrecision-Deciseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Deciseconds'/>\n"
1113 " <menuitem name='FileFormatPrecision-Centiseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Centiseconds'/>\n"
1114 " <menuitem name='FileFormatPrecision-Milliseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Milliseconds'/>\n"
1115 " <menuitem name='FileFormatPrecision-Microseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Microseconds'/>\n"
1116 " <menuitem name='FileFormatPrecision-Nanoseconds' action='/View/TimeDisplayFormat/FileFormatPrecision-Nanoseconds'/>\n"
1118 " <menuitem name='DisplaySecondsWithHoursAndMinutes' action='/View/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes'/>\n"
1120 " <menu name= 'NameResolution' action='/View/NameResolution'>\n"
1121 " <menuitem name='ResolveName' action='/View/NameResolution/ResolveName'/>\n"
1123 " <menuitem name='EnableforMACLayer' action='/View/NameResolution/EnableforMACLayer'/>\n"
1124 " <menuitem name='EnableforNetworkLayer' action='/View/NameResolution/EnableforNetworkLayer'/>\n"
1125 " <menuitem name='EnableforTransportLayer' action='/View/NameResolution/EnableforTransportLayer'/>\n"
1127 " <menuitem name='ColorizePacketList' action='/View/ColorizePacketList'/>\n"
1128 " <menuitem name='AutoScrollinLiveCapture' action='/View/AutoScrollinLiveCapture'/>\n"
1130 " <menuitem name='ZoomIn' action='/View/ZoomIn'/>\n"
1131 " <menuitem name='ZoomOut' action='/View/ZoomOut'/>\n"
1132 " <menuitem name='NormalSize' action='/View/NormalSize'/>\n"
1134 " <menuitem name='ResizeAllColumns' action='/View/ResizeAllColumns'/>\n"
1135 " <menuitem name='DisplayedColumns' action='/View/DisplayedColumns'/>\n"
1137 " <menuitem name='ExpandSubtrees' action='/View/ExpandSubtrees'/>\n"
1138 " <menuitem name='ExpandAll' action='/View/ExpandAll'/>\n"
1139 " <menuitem name='CollapseAll' action='/View/CollapseAll'/>\n"
1141 " <menu name= 'ColorizeConversation' action='/View/ColorizeConversation'>\n"
1142 " <menuitem name='Color1' action='/View/ColorizeConversation/Color 1'/>\n"
1143 " <menuitem name='Color2' action='/View/ColorizeConversation/Color 2'/>\n"
1144 " <menuitem name='Color3' action='/View/ColorizeConversation/Color 3'/>\n"
1145 " <menuitem name='Color4' action='/View/ColorizeConversation/Color 4'/>\n"
1146 " <menuitem name='Color5' action='/View/ColorizeConversation/Color 5'/>\n"
1147 " <menuitem name='Color6' action='/View/ColorizeConversation/Color 6'/>\n"
1148 " <menuitem name='Color7' action='/View/ColorizeConversation/Color 7'/>\n"
1149 " <menuitem name='Color8' action='/View/ColorizeConversation/Color 8'/>\n"
1150 " <menuitem name='Color9' action='/View/ColorizeConversation/Color 9'/>\n"
1151 " <menuitem name='Color10' action='/View/ColorizeConversation/Color 10'/>\n"
1152 " <menuitem name='NewColoringRule' action='/View/ColorizeConversation/NewColoringRule'/>\n"
1155 " <menuitem name='ResetColoring1-10' action='/View/ResetColoring1-10'/>\n"
1156 " <menuitem name='ColoringRules' action='/View/ColoringRules'/>\n"
1158 " <menuitem name='ShowPacketinNewWindow' action='/View/ShowPacketinNewWindow'/>\n"
1159 " <menuitem name='Reload' action='/View/Reload'/>\n"
1161 " <menu name= 'GoMenu' action='/Go'>\n"
1162 " <menuitem name='Back' action='/Go/Back'/>\n"
1163 " <menuitem name='Forward' action='/Go/Forward'/>\n"
1164 " <menuitem name='Goto' action='/Go/Goto'/>\n"
1165 " <menuitem name='GotoCorrespondingPacket' action='/Go/GotoCorrespondingPacket'/>\n"
1167 " <menuitem name='PreviousPacket' action='/Go/PreviousPacket'/>\n"
1168 " <menuitem name='NextPacket' action='/Go/NextPacket'/>\n"
1169 " <menuitem name='FirstPacket' action='/Go/FirstPacket'/>\n"
1170 " <menuitem name='LastPacket' action='/Go/LastPacket'/>\n"
1171 " <menuitem name='PreviousPacketInConversation' action='/Go/PreviousPacketInConversation'/>\n"
1172 " <menuitem name='NextPacketInConversation' action='/Go/NextPacketInConversation'/>\n"
1175 " <menu name= 'CaptureMenu' action='/Capture'>\n"
1176 " <menuitem name='Interfaces' action='/Capture/Interfaces'/>\n"
1177 " <menuitem name='Options' action='/Capture/Options'/>\n"
1178 " <menuitem name='Start' action='/Capture/Start'/>\n"
1179 " <menuitem name='Stop' action='/Capture/Stop'/>\n"
1180 " <menuitem name='Restart' action='/Capture/Restart'/>\n"
1181 " <menuitem name='CaptureFilters' action='/Capture/CaptureFilters'/>\n"
1183 #endif /* HAVE_LIBPCAP */
1184 " <menu name= 'AnalyzeMenu' action='/Analyze'>\n"
1185 " <menuitem name='DisplayFilters' action='/Analyze/DisplayFilters'/>\n"
1186 " <menuitem name='DisplayFilterMacros' action='/Analyze/DisplayFilterMacros'/>\n"
1188 " <menuitem name='ApplyasColumn' action='/Analyze/ApplyasColumn'/>\n"
1189 " <menu name= 'ApplyAsFilter' action='/Analyze/ApplyasFilter'>\n"
1190 " <menuitem name='Selected' action='/Analyze/ApplyasFilter/Selected'/>\n"
1191 " <menuitem name='NotSelected' action='/Analyze/ApplyasFilter/NotSelected'/>\n"
1192 " <menuitem name='AndSelected' action='/Analyze/ApplyasFilter/AndSelected'/>\n"
1193 " <menuitem name='OrSelected' action='/Analyze/ApplyasFilter/OrSelected'/>\n"
1194 " <menuitem name='AndNotSelected' action='/Analyze/ApplyasFilter/AndNotSelected'/>\n"
1195 " <menuitem name='OrNotSelected' action='/Analyze/ApplyasFilter/OrNotSelected'/>\n"
1197 " <menu name= 'PrepareaFilter' action='/Analyze/PrepareaFilter'>\n"
1198 " <menuitem name='Selected' action='/Analyze/PrepareaFilter/Selected'/>\n"
1199 " <menuitem name='NotSelected' action='/Analyze/PrepareaFilter/NotSelected'/>\n"
1200 " <menuitem name='AndSelected' action='/Analyze/PrepareaFilter/AndSelected'/>\n"
1201 " <menuitem name='OrSelected' action='/Analyze/PrepareaFilter/OrSelected'/>\n"
1202 " <menuitem name='AndNotSelected' action='/Analyze/PrepareaFilter/AndNotSelected'/>\n"
1203 " <menuitem name='OrNotSelected' action='/Analyze/PrepareaFilter/OrNotSelected'/>\n"
1206 " <menuitem name='EnabledProtocols' action='/Analyze/EnabledProtocols'/>\n"
1207 " <menuitem name='DecodeAs' action='/Analyze/DecodeAs'/>\n"
1208 " <menuitem name='UserSpecifiedDecodes' action='/Analyze/UserSpecifiedDecodes'/>\n"
1210 " <menuitem name='FollowTCPStream' action='/Analyze/FollowTCPStream'/>\n"
1211 " <menuitem name='FollowUDPStream' action='/Analyze/FollowUDPStream'/>\n"
1212 " <menuitem name='FollowSSLStream' action='/Analyze/FollowSSLStream'/>\n"
1213 " <menuitem name='ExpertInfoComposite' action='/Analyze/ExpertInfoComposite'/>\n"
1214 " <menu name= 'ConversationFilterMenu' action='/Analyze/ConversationFilter'>\n"
1215 " <placeholder name='Filters'/>\n"
1218 " <menu name= 'StatisticsMenu' action='/Statistics'>\n"
1219 " <menuitem name='Summary' action='/Statistics/Summary'/>\n"
1220 " <menuitem name='ProtocolHierarchy' action='/Statistics/ProtocolHierarchy'/>\n"
1221 " <menuitem name='Conversations' action='/Statistics/Conversations'/>\n"
1222 " <menuitem name='Endpoints' action='/Statistics/Endpoints'/>\n"
1223 " <menuitem name='IOGraphs' action='/Statistics/IOGraphs'/>\n"
1225 " <menu name= 'ConversationListMenu' action='/Analyze/ConversationList'>\n"
1226 " <menuitem name='Ethernet' action='/Analyze/ConversationList/Ethernet'/>\n"
1227 " <menuitem name='FibreChannel' action='/Analyze/ConversationList/FibreChannel'/>\n"
1228 " <menuitem name='FDDI' action='/Analyze/ConversationList/FDDI'/>\n"
1229 " <menuitem name='IP' action='/Analyze/ConversationList/IP'/>\n"
1230 " <menuitem name='IPv6' action='/Analyze/ConversationList/IPv6'/>\n"
1231 " <menuitem name='JXTA' action='/Analyze/ConversationList/JXTA'/>\n"
1232 " <menuitem name='NCP' action='/Analyze/ConversationList/NCP'/>\n"
1233 " <menuitem name='RSVP' action='/Analyze/ConversationList/RSVP'/>\n"
1234 " <menuitem name='SCTP' action='/Analyze/ConversationList/SCTP'/>\n"
1235 " <menuitem name='TCPIP' action='/Analyze/ConversationList/TCPIP'/>\n"
1236 " <menuitem name='TR' action='/Analyze/ConversationList/TR'/>\n"
1237 " <menuitem name='UDPIP' action='/Analyze/ConversationList/UDPIP'/>\n"
1238 " <menuitem name='USB' action='/Analyze/ConversationList/USB'/>\n"
1239 " <menuitem name='WLAN' action='/Analyze/ConversationList/WLAN'/>\n"
1241 " <menu name= 'EndpointListMenu' action='/Analyze/EndpointList'>\n"
1242 " <menuitem name='Ethernet' action='/Analyze/EndpointList/Ethernet'/>\n"
1243 " <menuitem name='FibreChannel' action='/Analyze/EndpointList/FibreChannel'/>\n"
1244 " <menuitem name='FDDI' action='/Analyze/EndpointList/FDDI'/>\n"
1245 " <menuitem name='IP' action='/Analyze/EndpointList/IP'/>\n"
1246 " <menuitem name='IPv6' action='/Analyze/EndpointList/IPv6'/>\n"
1247 " <menuitem name='JXTA' action='/Analyze/EndpointList/JXTA'/>\n"
1248 " <menuitem name='RSVP' action='/Analyze/EndpointList/RSVP'/>\n"
1249 " <menuitem name='SCTP' action='/Analyze/ConversationList/SCTP'/>\n"
1250 " <menuitem name='TCPIP' action='/Analyze/ConversationList/TCPIP'/>\n"
1251 " <menuitem name='TR' action='/Analyze/ConversationList/TR'/>\n"
1252 " <menuitem name='UDPIP' action='/Analyze/ConversationList/UDPIP'/>\n"
1253 " <menuitem name='USB' action='/Analyze/ConversationList/USB'/>\n"
1254 " <menuitem name='WLAN' action='/Analyze/ConversationList/WLAN'/>\n"
1256 " <menu name= 'ServiceResponseTimeMenu' action='/Analyze/ServiceResponseTime'>\n"
1257 " <menuitem name='ONC-RPC' action='/Analyze/ServiceResponseTime/ONC-RPC'/>\n"
1260 " <placeholder name='ANCP'/>\n"
1261 " <menu name= 'BACnetMenu' action='/Analyze/BACnet'>\n"
1262 " <placeholder name='BACnet-List-item'/>\n"
1264 " <menuitem name='FlowGraph' action='/Analyze/StatisticsMenu/FlowGraph'/>\n"
1265 " <menu name= 'HTTPMenu' action='/Analyze/StatisticsMenu/HTTP'>\n"
1266 " <placeholder name='HTTP-List-item'/>\n"
1268 " <menu name= 'TCPStreamGraphMenu' action='/Analyze/StatisticsMenu/TCPStreamGraphMenu'>\n"
1269 " <menuitem name='Sequence-Graph-Stevens' action='/Analyze/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-Stevens'/>\n"
1270 " <menuitem name='Sequence-Graph-tcptrace' action='/Analyze/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-tcptrace'/>\n"
1271 " <menuitem name='Throughput-Graph' action='/Analyze/StatisticsMenu/TCPStreamGraphMenu/Throughput-Graph'/>\n"
1272 " <menuitem name='RTT-Graph' action='/Analyze/StatisticsMenu/TCPStreamGraphMenu/RTT-Graph'/>\n"
1273 " <menuitem name='Window-Scaling-Graph' action='/Analyze/StatisticsMenu/TCPStreamGraphMenu/Window-Scaling-Graph'/>\n"
1275 " <menuitem name='ONC-RPC-Programs' action='/Analyze/StatisticsMenu/ONC-RPC-Programs'/>\n"
1276 " <menuitem name='UDPMulticastStreams' action='/Analyze/StatisticsMenu/UDPMulticastStreams'/>\n"
1277 " <menuitem name='WLANTraffic' action='/Analyze/StatisticsMenu/WLANTraffic'/>\n"
1279 " <menu name= 'TelephonyMenu' action='/Telephony'>\n"
1280 " <menu name= 'ANSI' action='/Telephony/ANSI'>\n"
1281 " <menuitem name='BSMAP' action='/Telephony/ANSI/BSMAP'/>\n"
1282 " <menuitem name='DTAP' action='/Telephony/ANSI/DTAP'/>\n"
1283 " <menuitem name='MAP-OP' action='/Telephony/ANSI/MAP-OP'/>\n"
1285 " <menu name= 'GSM' action='/Telephony/GSM'>\n"
1286 " <menuitem name='BSSMAP' action='/Telephony/GSM/BSSMAP'/>\n"
1287 " <menu name='GSM-DTAP' action='/Telephony/GSM/DTAP'>\n"
1288 " <menuitem name='CallControl' action='/Telephony/GSM/DTAP/CC'/>\n"
1289 " <menuitem name='GPRS-MM' action='/Telephony/GSM/DTAP/GMM'/>\n"
1290 " <menuitem name='GPRS-SM' action='/Telephony/GSM/DTAP/SM'/>\n"
1291 " <menuitem name='MM' action='/Telephony/GSM/DTAP/MM'/>\n"
1292 " <menuitem name='RR' action='/Telephony/GSM/DTAP/RR'/>\n"
1293 " <menuitem name='SMS' action='/Telephony/GSM/DTAP/SMS'/>\n"
1294 " <menuitem name='TP' action='/Telephony/GSM/DTAP/TP'/>\n"
1295 " <menuitem name='SS' action='/Telephony/GSM/DTAP/SS'/>\n"
1297 " <menuitem name='SACCH' action='/Telephony/GSM/SACCH'/>\n"
1298 " <menuitem name='MAP-OP' action='/Telephony/GSM/MAP-OP'/>\n"
1299 " <menuitem name='MAP-Summary' action='/Telephony/GSM/MAPSummary'/>\n"
1301 " <menu name= 'IAX2menu' action='/Telephony/IAX2'>\n"
1302 " <menuitem name='StreamAnalysis' action='/Telephony/IAX2/StreamAnalysis'/>\n"
1304 " <menuitem name='VoIPCalls' action='/Telephony/VoIPCalls'/>\n"
1306 " <menu name= 'ToolsMenu' action='/Tools'>\n"
1307 " <menuitem name='FirewallACLRules' action='/Tools/FirewallACLRules'/>\n"
1309 " <menu name= 'InternalsMenu' action='/Internals'>\n"
1310 " <menuitem name='Dissectortables' action='/Internals/Dissectortables'/>\n"
1311 " <menuitem name='SupportedProtocols' action='/Internals/SupportedProtocols'/>\n"
1313 " <menu name= 'HelpMenu' action='/Help'>\n"
1314 " <menuitem name='Contents' action='/Help/Contents'/>\n"
1315 " <menu name= 'ManualPages' action='/Help/ManualPages'>\n"
1316 " <menuitem name='Wireshark' action='/Help/ManualPages/Wireshark'/>\n"
1317 " <menuitem name='WiresharkFilter' action='/Help/ManualPages/WiresharkFilter'/>\n"
1319 " <menuitem name='TShark' action='/Help/ManualPages/TShark'/>\n"
1320 " <menuitem name='RawShark' action='/Help/ManualPages/RawShark'/>\n"
1321 " <menuitem name='Dumpcap' action='/Help/ManualPages/Dumpcap'/>\n"
1322 " <menuitem name='Mergecap' action='/Help/ManualPages/Mergecap'/>\n"
1323 " <menuitem name='Editcap' action='/Help/ManualPages/Editcap'/>\n"
1324 " <menuitem name='Text2pcap' action='/Help/ManualPages/Text2pcap'/>\n"
1327 " <menuitem name='Website' action='/Help/Website'/>\n"
1328 " <menuitem name='FAQs' action='/Help/FAQs'/>\n"
1329 " <menuitem name='Downloads' action='/Help/Downloads'/>\n"
1331 " <menuitem name='Wiki' action='/Help/Wiki'/>\n"
1332 " <menuitem name='SampleCaptures' action='/Help/SampleCaptures'/>\n"
1334 " <menuitem name='AboutWireshark' action='/Help/AboutWireshark'/>\n"
1343 * Please do not use keystrokes that are used as "universal" shortcuts in
1344 * various desktop environments:
1347 * http://support.microsoft.com/kb/126449
1350 * http://library.gnome.org/users/user-guide/nightly/keyboard-skills.html.en
1353 * http://developer.kde.org/documentation/standards/kde/style/keys/shortcuts.html
1355 * In particular, do not use the following <control> sequences for anything
1356 * other than their standard purposes:
1358 * <control>O File->Open
1359 * <control>S File->Save
1360 * <control>P File->Print
1361 * <control>W File->Close
1362 * <control>Q File->Quit
1363 * <control>Z Edit->Undo (which we don't currently have)
1364 * <control>X Edit->Cut (which we don't currently have)
1365 * <control>C Edit->Copy (which we don't currently have)
1366 * <control>V Edit->Paste (which we don't currently have)
1367 * <control>A Edit->Select All (which we don't currently have)
1369 * Note that some if not all of the Edit keys above already perform those
1370 * functions in text boxes, such as the Filter box. Do no, under any
1371 * circumstances, make a change that keeps them from doing so.
1377 * const gchar *name;
1378 * const gchar *stock_id;
1379 * const gchar *label;
1380 * const gchar *accelerator;
1381 * const gchar *tooltip;
1382 * GCallback callback;
1384 * const gchar *name; The name of the action.
1385 * const gchar *stock_id; The stock id for the action, or the name of an icon from the icon theme.
1386 * const gchar *label; The label for the action. This field should typically be marked for translation,
1387 * see gtk_action_group_set_translation_domain().
1388 * If label is NULL, the label of the stock item with id stock_id is used.
1389 * const gchar *accelerator; The accelerator for the action, in the format understood by gtk_accelerator_parse().
1390 * const gchar *tooltip; The tooltip for the action. This field should typically be marked for translation,
1391 * see gtk_action_group_set_translation_domain().
1392 * GCallback callback; The function to call when the action is activated.
1395 static const GtkActionEntry main_menu_bar_entries[] = {
1397 { "/File", NULL, "_File", NULL, NULL, NULL },
1398 { "/Edit", NULL, "_Edit", NULL, NULL, NULL },
1399 { "/View", NULL, "_View", NULL, NULL, NULL },
1400 { "/Go", NULL, "_Go", NULL, NULL, NULL },
1402 { "/Capture", NULL, "_Capture", NULL, NULL, NULL },
1404 { "/Analyze", NULL, "_Analyze", NULL, NULL, NULL },
1405 { "/Statistics", NULL, "_Statistics", NULL, NULL, NULL },
1406 { "/Telephony", NULL, "Telephon_y", NULL, NULL, NULL },
1407 { "/Tools", NULL, "_Tools", NULL, NULL, NULL },
1408 { "/Internals", NULL, "_Internals", NULL, NULL, NULL },
1409 { "/Help", NULL, "_Help", NULL, NULL, NULL },
1411 { "/File/Open", GTK_STOCK_OPEN, "_Open...", "<control>O", "Open a file", G_CALLBACK(file_open_cmd_cb) },
1412 { "/File/OpenRecent", NULL, "Open _Recent", NULL, NULL, NULL },
1413 { "/File/Merge", NULL, "_Merge...", NULL, NULL, G_CALLBACK(file_merge_cmd_cb) },
1414 { "/File/Import", NULL, "_Import...", NULL, NULL, G_CALLBACK(file_import_cmd_cb) },
1415 { "/File/Close", GTK_STOCK_CLOSE, "_Close", "<control>W", NULL, G_CALLBACK(file_close_cmd_cb) },
1417 { "/File/Save", GTK_STOCK_SAVE, "_Save", "<control>S", NULL, G_CALLBACK(file_save_cmd_cb) },
1418 { "/File/SaveAs", GTK_STOCK_SAVE_AS, "Save _As...", "<shift><control>S", NULL, G_CALLBACK(file_save_as_cmd_cb) },
1420 { "/File/Set", NULL, "File Set", NULL, NULL, NULL },
1421 { "/File/Export", NULL, "Export", NULL, NULL, NULL },
1422 { "/File/Print", GTK_STOCK_PRINT, "_Print...", "<control>P", NULL, G_CALLBACK(file_print_cmd_cb) },
1423 { "/File/Quit", GTK_STOCK_QUIT, "_Quit", "<control>Q", NULL, G_CALLBACK(file_quit_cmd_cb) },
1425 { "/File/Set/ListFiles", WIRESHARK_STOCK_FILE_SET_LIST, "List Files", NULL, NULL, G_CALLBACK(fileset_cb) },
1426 { "/File/Set/NextFile", WIRESHARK_STOCK_FILE_SET_NEXT, "Next File", NULL, NULL, G_CALLBACK(fileset_next_cb) },
1427 { "/File/Set/PreviousFile",WIRESHARK_STOCK_FILE_SET_PREVIOUS, "Previous File", NULL, NULL, G_CALLBACK(fileset_previous_cb) },
1430 { "/File/Export/File", NULL, "File...", NULL, NULL, G_CALLBACK(export_text_cmd_cb) },
1432 { "/File/Export/File", NULL, "File...", NULL, NULL, NULL },
1433 { "/File/Export/File/Text", NULL, "as \"Plain _Text\" file...", NULL, NULL, G_CALLBACK(export_text_cmd_cb) },
1434 { "/File/Export/File/PostScript", NULL, "as \"_PostScript\" file...", NULL, NULL, G_CALLBACK(export_ps_cmd_cb) },
1435 { "/File/Export/File/CSV", NULL, "as \"_CSV\" (Comma Separated Values packet summary) file...",
1436 NULL, NULL, G_CALLBACK(export_csv_cmd_cb) },
1437 { "/File/Export/File/CArrays", NULL, "as \"C _Arrays\" (packet bytes) file...",
1438 NULL, NULL, G_CALLBACK(export_carrays_cmd_cb) },
1439 { "/File/Export/File/PSML", NULL, "as XML - \"P_SML\" (packet summary) file...",
1440 NULL, NULL, G_CALLBACK(export_psml_cmd_cb) },
1441 { "/File/Export/File/PDML", NULL, "as XML - \"P_DML\" (packet details) file...",
1442 NULL, NULL, G_CALLBACK(export_pdml_cmd_cb) },
1444 { "/File/Export/SelectedPacketBytes", NULL, "Selected Packet _Bytes...", "<control>H", NULL, G_CALLBACK(savehex_cb) },
1445 { "/File/Export/SslSessionKeys", NULL, "SSL Session Keys...", NULL, NULL, G_CALLBACK(savesslkeys_cb) },
1446 { "/File/Export/Objects", NULL, "Objects", NULL, NULL, NULL },
1447 { "/File/Export/Objects/HTTP", NULL, "_HTTP", NULL, NULL, G_CALLBACK(eo_http_cb) },
1448 { "/File/Export/Objects/DICOM", NULL, "_DICOM", NULL, NULL, G_CALLBACK(eo_dicom_cb) },
1449 { "/File/Export/Objects/SMB", NULL, "_SMB", NULL, NULL, G_CALLBACK(eo_smb_cb) },
1452 { "/Edit/Copy", NULL, "Copy", NULL, NULL, NULL },
1454 { "/Edit/Copy/Description", NULL, "Description", "<shift><control>D", NULL, G_CALLBACK(copy_description_cb) },
1455 { "/Edit/Copy/Fieldname", NULL, "Fieldname", "<shift><control>F", NULL, G_CALLBACK(copy_fieldname_cb) },
1456 { "/Edit/Copy/Value", NULL, "Value", "<shift><control>V", NULL, G_CALLBACK(copy_value_cb) },
1457 { "/Edit/Copy/AsFilter", NULL, "As Filter", "<shift><control>C", NULL, G_CALLBACK(copy_as_filter_cb) },
1461 * Un-#if this when we actually implement Cut/Copy/Paste for the
1462 * packet list and packet detail windows.
1464 * Note: when we implement Cut/Copy/Paste in those windows, we
1465 * will almost certainly want to allow multiple packets to be
1466 * selected in the packet list pane and multiple packet detail
1467 * items to be selected in the packet detail pane, so that
1468 * the user can, for example, copy the summaries of multiple
1469 * packets to the clipboard from the packet list pane and multiple
1470 * packet detail items - perhaps *all* packet detail items - from
1471 * the packet detail pane. Given that, we'll also want to
1472 * implement Select All.
1474 * If multiple packets are selected, we would probably display nothing
1475 * in the packet detail pane, just as we do if no packet is selected,
1476 * and any menu items etc. that would pertain only to a single packet
1477 * would be disabled.
1479 * If multiple packet detail items are selected, we would probably
1480 * disable all items that pertain only to a single packet detail
1481 * item, such as some items in the status bar.
1483 * XXX - the actions for these will be different depending on what
1484 * widget we're in; ^C should copy from the filter text widget if
1485 * we're in that widget, the packet list if we're in that widget
1486 * (presumably copying the summaries of selected packets to the
1487 * clipboard, e.g. the text copy would be the text of the columns),
1488 * the packet detail if we're in that widget (presumably copying
1489 * the contents of selected protocol tree items to the clipboard,
1490 * e.g. the text copy would be the text displayed for those items),
1493 * Given that those menu items should also affect text widgets
1494 * such as the filter box, we would again want Select All, and,
1495 * at least for the filter box, we would also want Undo and Redo.
1496 * We would only want Cut, Paste, Undo, and Redo for the packet
1497 * list and packet detail panes if we support modifying them.
1499 {"/Edit/_Undo", "<control>Z", NULL,
1500 0, "<StockItem>", GTK_STOCK_UNDO,},
1501 {"/Edit/_Redo", "<shift><control>Z", NULL,
1502 0, "<StockItem>", GTK_STOCK_REDO,},
1503 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1504 {"/Edit/Cu_t", "<control>X", NULL,
1505 0, "<StockItem>", GTK_STOCK_CUT,},
1506 {"/Edit/_Copy", "<control>C", NULL,
1507 0, "<StockItem>", GTK_STOCK_COPY,},
1508 {"/Edit/_Paste", "<control>V", NULL,
1509 0, "<StockItem>", GTK_STOCK_PASTE,},
1510 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1511 {"/Edit/Select _All", "<control>A", NULL, 0,
1512 #ifdef GTK_STOCK_SELECT_ALL /* first appeared in 2.10 */
1513 "<StockItem>", GTK_STOCK_SELECT_ALL,
1516 #endif /* GTK_STOCK_SELECT_ALL */
1518 { "/Edit/FindPacket", GTK_STOCK_FIND, "_Find Packet...", "<control>F", NULL, G_CALLBACK(find_frame_cb) },
1519 { "/Edit/FindNext", NULL, "Find Ne_xt", "<control>N", NULL, G_CALLBACK(find_next_cb) },
1520 { "/Edit/FindPrevious", NULL, "Find Pre_vious", "<control>B", NULL, G_CALLBACK(find_previous_cb) },
1522 { "/Edit/MarkPacket", NULL, "_Mark Packet (toggle)", "<control>M", NULL, G_CALLBACK(new_packet_list_mark_frame_cb) },
1523 { "/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) },
1524 { "/Edit/MarkAllDisplayedPackets", NULL, "Mark All Displayed Packets", "<shift><control>M", NULL, G_CALLBACK(new_packet_list_mark_all_displayed_frames_cb) },
1525 { "/Edit/UnmarkAllDisplayedPackets", NULL, "_Unmark All Displayed Packets", "<alt><control>M", NULL, G_CALLBACK(new_packet_list_unmark_all_displayed_frames_cb) },
1526 { "/Edit/FindNextMark", NULL, "Find Next Mark", "<shift><control>N", NULL, G_CALLBACK(find_next_mark_cb) },
1527 { "/Edit/FindPreviousMark", NULL, "Find Next Mark", "<shift><control>B", NULL, G_CALLBACK(find_prev_mark_cb) },
1529 { "/Edit/IgnorePacket", NULL, "_Ignore Packet (toggle)", "<control>X", NULL, G_CALLBACK(new_packet_list_ignore_frame_cb) },
1531 * XXX - this next one overrides /Edit/Copy/Description
1533 { "/Edit/IgnoreAllDisplayedPackets", NULL, "_Ignore All Displayed Packets (toggle)","<alt><shift><control>X", NULL, G_CALLBACK(new_packet_list_ignore_all_displayed_frames_cb) },
1534 { "/Edit/Un-IgnoreAllPackets", NULL, "U_n-Ignore All Packets", "<shift><control>X", NULL, G_CALLBACK(new_packet_list_unignore_all_frames_cb) },
1535 { "/Edit/SetTimeReference", WIRESHARK_STOCK_TIME, "Set Time Reference (toggle)", "<control>T", NULL, G_CALLBACK(set_reftime_cb) },
1536 { "/Edit/Un-TimeReferenceAllPackets",NULL, "Un-Time Reference All Packets", "<alt><control>T", NULL, G_CALLBACK(new_packet_list_untime_reference_all_frames_cb) },
1537 { "/Edit/TimeShift", NULL, "Time Shift...", "<control>A", NULL, G_CALLBACK(set_time_shift_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) },
1541 { "/Edit/ConfigurationProfiles", NULL, "_Configuration Profiles...", "<shift><control>A", NULL, G_CALLBACK(profile_dialog_cb) },
1542 { "/Edit/Preferences", GTK_STOCK_PREFERENCES, "_Preferences...", "<shift><control>P", NULL, G_CALLBACK(menus_prefs_cb) },
1543 #ifdef WANT_PACKET_EDITOR
1544 { "/Edit/EditPacket", NULL, "_Edit Packet", NULL, NULL, G_CALLBACK(edit_window_cb) },
1548 { "/View/TimeDisplayFormat", NULL, "_Time Display Format", NULL, NULL, NULL },
1550 { "/View/NameResolution", NULL, "Name Resol_ution", NULL, NULL, NULL },
1551 { "/View/ZoomIn", GTK_STOCK_ZOOM_IN, "_Zoom In", "<control>plus", NULL, G_CALLBACK(view_zoom_in_cb) },
1552 { "/View/ZoomOut", GTK_STOCK_ZOOM_OUT, "Zoom _Out", "<control>minus", NULL, G_CALLBACK(view_zoom_out_cb) },
1553 { "/View/NormalSize", GTK_STOCK_ZOOM_100, "_Normal Size", "<control>equal", NULL, G_CALLBACK(view_zoom_100_cb) },
1554 { "/View/ResizeAllColumns", WIRESHARK_STOCK_RESIZE_COLUMNS, "Resize All Columns", "<shift><control>R", NULL, G_CALLBACK(new_packet_list_resize_columns_cb) },
1555 { "/View/DisplayedColumns", NULL, "Displayed Columns", NULL, NULL, NULL },
1556 { "/View/ExpandSubtrees", NULL, "Expand Subtrees", NULL, NULL, G_CALLBACK(expand_tree_cb) },
1557 { "/View/ExpandAll", NULL, "Expand All", NULL, NULL, G_CALLBACK(expand_all_cb) },
1558 { "/View/CollapseAll", NULL, "Collapse All", NULL, NULL, G_CALLBACK(collapse_all_cb) },
1559 { "/View/ColorizeConversation", NULL, "Colorize Conversation",NULL, NULL, NULL },
1561 { "/View/ColorizeConversation/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(view_menu_color_conv_color1_cb) },
1562 { "/View/ColorizeConversation/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(view_menu_color_conv_color2_cb) },
1563 { "/View/ColorizeConversation/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(view_menu_color_conv_color3_cb) },
1564 { "/View/ColorizeConversation/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(view_menu_color_conv_color4_cb) },
1565 { "/View/ColorizeConversation/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(view_menu_color_conv_color5_cb) },
1566 { "/View/ColorizeConversation/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(view_menu_color_conv_color6_cb) },
1567 { "/View/ColorizeConversation/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(view_menu_color_conv_color7_cb) },
1568 { "/View/ColorizeConversation/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(view_menu_color_conv_color8_cb) },
1569 { "/View/ColorizeConversation/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(view_menu_color_conv_color9_cb) },
1570 { "/View/ColorizeConversation/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(view_menu_color_conv_color10_cb) },
1571 { "/View/ColorizeConversation/NewColoringRule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(view_menu_color_conv_new_rule_cb) },
1573 { "/View/ResetColoring1-10", NULL, "Reset Coloring 1-10", "<control>space", NULL, G_CALLBACK(view_menu_reset_coloring_cb) },
1574 { "/View/ColoringRules", GTK_STOCK_SELECT_COLOR, "_Coloring Rules...", NULL, NULL, G_CALLBACK(color_display_cb) },
1575 { "/View/ShowPacketinNewWindow", NULL, "Show Packet in New _Window", NULL, NULL, G_CALLBACK(new_window_cb) },
1576 { "/View/Reload", GTK_STOCK_REFRESH, "_Reload", "<control>R", NULL, G_CALLBACK(file_reload_cmd_cb) },
1579 { "/Go/Back", GTK_STOCK_GO_BACK, "_Back", "<alt>Left", NULL, G_CALLBACK(history_back_cb) },
1580 { "/Go/Forward", GTK_STOCK_GO_FORWARD, "_Forward", "<alt>Right", NULL, G_CALLBACK(history_forward_cb) },
1581 { "/Go/Goto", GTK_STOCK_JUMP_TO, "_Go to Packet...", "<control>G", NULL, G_CALLBACK(goto_frame_cb) },
1582 { "/Go/GotoCorrespondingPacket", NULL, "Go to _Corresponding Packet", NULL, NULL, G_CALLBACK(goto_framenum_cb) },
1583 { "/Go/PreviousPacket", GTK_STOCK_GO_UP, "Previous Packet", "<control>Up", NULL, G_CALLBACK(goto_previous_frame_cb) },
1584 { "/Go/NextPacket", GTK_STOCK_GO_DOWN, "Next Packet", "<control>Down", NULL, G_CALLBACK(goto_next_frame_cb) },
1585 { "/Go/FirstPacket", GTK_STOCK_GOTO_TOP, "F_irst Packet", "<control>Home", NULL, G_CALLBACK(goto_top_frame_cb) },
1586 { "/Go/LastPacket", GTK_STOCK_GOTO_BOTTOM, "_Last Packet", "<control>End", NULL, G_CALLBACK(goto_bottom_frame_cb) },
1587 { "/Go/PreviousPacketInConversation", GTK_STOCK_GO_UP, "Previous Packet In Conversation", "<control>comma", NULL, G_CALLBACK(goto_previous_frame_conversation_cb) },
1588 { "/Go/NextPacketInConversation", GTK_STOCK_GO_DOWN, "Next Packet In Conversation", "<control>period", NULL, G_CALLBACK(goto_next_frame_conversation_cb) },
1591 { "/Capture/Interfaces", WIRESHARK_STOCK_CAPTURE_INTERFACES, "_Interfaces...", "<control>I", NULL, G_CALLBACK(capture_if_cb) },
1592 { "/Capture/Options", WIRESHARK_STOCK_CAPTURE_OPTIONS, "_Options...", "<control>K", NULL, G_CALLBACK(capture_prep_cb) },
1593 { "/Capture/Start", WIRESHARK_STOCK_CAPTURE_START, "_Start", "<control>E", NULL, G_CALLBACK(capture_start_cb) },
1594 { "/Capture/Stop", WIRESHARK_STOCK_CAPTURE_STOP, "S_top", "<control>E", NULL, G_CALLBACK(capture_stop_cb) },
1595 { "/Capture/Restart", WIRESHARK_STOCK_CAPTURE_RESTART, "_Restart", "<control>R", NULL, G_CALLBACK(capture_restart_cb) },
1596 { "/Capture/CaptureFilters", WIRESHARK_STOCK_CAPTURE_FILTER, "Capture _Filters...", NULL, NULL, G_CALLBACK(cfilter_dialog_cb) },
1598 #endif /* HAVE_LIBPCAP */
1599 { "/Analyze/DisplayFilters", WIRESHARK_STOCK_DISPLAY_FILTER, "_Display Filters...", NULL, NULL, G_CALLBACK(dfilter_dialog_cb) },
1601 { "/Analyze/DisplayFilterMacros", NULL, "Display Filter _Macros...", NULL, NULL, G_CALLBACK(macros_dialog_cb) },
1602 { "/Analyze/ApplyasColumn", NULL, "Apply as Column", NULL, NULL, G_CALLBACK(apply_as_custom_column_cb) },
1603 { "/Analyze/ApplyasFilter", NULL, "Apply as Filter", NULL, NULL, NULL },
1605 { "/Analyze/ApplyasFilter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(tree_view_menu_apply_selected_cb) },
1606 { "/Analyze/ApplyasFilter/NotSelected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_not_selected_cb) },
1607 { "/Analyze/ApplyasFilter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_and_selected_cb) },
1608 { "/Analyze/ApplyasFilter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_or_selected_cb) },
1609 { "/Analyze/ApplyasFilter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_and_not_selected_cb) },
1610 { "/Analyze/ApplyasFilter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_or_not_selected_cb) },
1612 { "/Analyze/PrepareaFilter", NULL, "Prepare a Filter", NULL, NULL, NULL },
1613 { "/Analyze/PrepareaFilter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(tree_view_menu_prepare_selected_cb) },
1614 { "/Analyze/PrepareaFilter/NotSelected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_not_selected_cb) },
1615 { "/Analyze/PrepareaFilter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_and_selected_cb) },
1616 { "/Analyze/PrepareaFilter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_or_selected_cb) },
1617 { "/Analyze/PrepareaFilter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_and_not_selected_cb) },
1618 { "/Analyze/PrepareaFilter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_or_not_selected_cb) },
1620 { "/Analyze/EnabledProtocols", WIRESHARK_STOCK_CHECKBOX, "_Enabled Protocols...", "<shift><control>E", NULL, G_CALLBACK(proto_cb) },
1621 { "/Analyze/DecodeAs", WIRESHARK_STOCK_DECODE_AS, "Decode _As...", NULL, NULL, G_CALLBACK(decode_as_cb) },
1622 { "/Analyze/UserSpecifiedDecodes", WIRESHARK_STOCK_DECODE_AS, "_User Specified Decodes...", NULL, NULL, G_CALLBACK(decode_show_cb) },
1624 { "/Analyze/FollowTCPStream", NULL, "Follow TCP Stream", NULL, NULL, G_CALLBACK(follow_tcp_stream_cb) },
1625 { "/Analyze/FollowUDPStream", NULL, "Follow UDP Stream", NULL, NULL, G_CALLBACK(follow_udp_stream_cb) },
1626 { "/Analyze/FollowSSLStream", NULL, "Follow SSL Stream", NULL, NULL, G_CALLBACK(follow_ssl_stream_cb) },
1628 { "/Analyze/ExpertInfoComposite",WIRESHARK_STOCK_EXPERT_INFO, "Expert Info _Composite", NULL, NULL, G_CALLBACK(expert_comp_dlg_launch) },
1630 { "/Analyze/ConversationFilter", NULL, "Conversation Filter", NULL, NULL, NULL },
1631 { "/Analyze/ConversationList", NULL, "_Conversation List", NULL, NULL, NULL },
1632 { "/Analyze/ConversationList/Ethernet", WIRESHARK_STOCK_CONVERSATIONS, "Ethernet", NULL, NULL, G_CALLBACK(eth_endpoints_cb) },
1633 { "/Analyze/ConversationList/FibreChannel", WIRESHARK_STOCK_CONVERSATIONS, "Fibre Channel", NULL, NULL, G_CALLBACK(fc_endpoints_cb) },
1634 { "/Analyze/ConversationList/FDDI", WIRESHARK_STOCK_CONVERSATIONS, "FDDI", NULL, NULL, G_CALLBACK(fddi_endpoints_cb) },
1635 { "/Analyze/ConversationList/IP", WIRESHARK_STOCK_CONVERSATIONS, "IPv4", NULL, NULL, G_CALLBACK(ip_endpoints_cb) },
1636 { "/Analyze/ConversationList/IPv6", WIRESHARK_STOCK_CONVERSATIONS, "IPv6", NULL, NULL, G_CALLBACK(ipv6_endpoints_cb) },
1637 { "/Analyze/ConversationList/IPX", WIRESHARK_STOCK_CONVERSATIONS, "IPX", NULL, NULL, G_CALLBACK(ipx_endpoints_cb) },
1638 { "/Analyze/ConversationList/JXTA", WIRESHARK_STOCK_CONVERSATIONS, "JXTA", NULL, NULL, G_CALLBACK(jxta_conversation_cb) },
1639 { "/Analyze/ConversationList/NCP", WIRESHARK_STOCK_CONVERSATIONS, "NCP", NULL, NULL, G_CALLBACK(ncp_endpoints_cb) },
1640 { "/Analyze/ConversationList/RSVP", WIRESHARK_STOCK_CONVERSATIONS, "RSVP", NULL, NULL, G_CALLBACK(rsvp_endpoints_cb) },
1641 { "/Analyze/ConversationList/SCTP", WIRESHARK_STOCK_CONVERSATIONS, "SCTP", NULL, NULL, G_CALLBACK(sctp_conversation_cb) },
1642 { "/Analyze/ConversationList/TCPIP", WIRESHARK_STOCK_CONVERSATIONS, "TCP (IPv4 & IPv6)", NULL, NULL, G_CALLBACK(tcpip_conversation_cb) },
1643 { "/Analyze/ConversationList/TR", WIRESHARK_STOCK_CONVERSATIONS, "Token Ring", NULL, NULL, G_CALLBACK(tr_conversation_cb) },
1644 { "/Analyze/ConversationList/UDPIP", WIRESHARK_STOCK_CONVERSATIONS, "UDP (IPv4 & IPv6)", NULL, NULL, G_CALLBACK(udpip_conversation_cb) },
1645 { "/Analyze/ConversationList/USB", WIRESHARK_STOCK_CONVERSATIONS, "USB", NULL, NULL, G_CALLBACK(usb_endpoints_cb) },
1646 { "/Analyze/ConversationList/WLAN", WIRESHARK_STOCK_CONVERSATIONS, "WLAN", NULL, NULL, G_CALLBACK(wlan_endpoints_cb) },
1648 { "/Analyze/EndpointList", NULL, "_Endpoint List", NULL, NULL, NULL },
1649 { "/Analyze/EndpointList/Ethernet", WIRESHARK_STOCK_ENDPOINTS, "Ethernet", NULL, NULL, G_CALLBACK(gtk_eth_hostlist_cb) },
1650 { "/Analyze/EndpointList/FibreChannel", WIRESHARK_STOCK_ENDPOINTS, "Fibre Channel", NULL, NULL, G_CALLBACK(gtk_fc_hostlist_cb) },
1651 { "/Analyze/EndpointList/FDDI", WIRESHARK_STOCK_ENDPOINTS, "FDDI", NULL, NULL, G_CALLBACK(gtk_fddi_hostlist_cb) },
1652 { "/Analyze/EndpointList/IP", WIRESHARK_STOCK_ENDPOINTS, "IPv4", NULL, NULL, G_CALLBACK(gtk_ip_hostlist_cb) },
1653 { "/Analyze/EndpointList/IPv6", WIRESHARK_STOCK_ENDPOINTS, "IPv6", NULL, NULL, G_CALLBACK(gtk_ipv6_hostlist_cb) },
1654 { "/Analyze/EndpointList/IPX", WIRESHARK_STOCK_ENDPOINTS, "IPX", NULL, NULL, G_CALLBACK(gtk_ipx_hostlist_cb) },
1655 { "/Analyze/EndpointList/JXTA", WIRESHARK_STOCK_ENDPOINTS, "JXTA", NULL, NULL, G_CALLBACK(gtk_jxta_hostlist_cb) },
1656 { "/Analyze/EndpointList/NCP", WIRESHARK_STOCK_ENDPOINTS, "NCP", NULL, NULL, G_CALLBACK(gtk_ncp_hostlist_cb) },
1657 { "/Analyze/EndpointList/RSVP", WIRESHARK_STOCK_ENDPOINTS, "RSVP", NULL, NULL, G_CALLBACK(gtk_rsvp_hostlist_cb) },
1658 { "/Analyze/EndpointList/SCTP", WIRESHARK_STOCK_ENDPOINTS, "SCTP", NULL, NULL, G_CALLBACK(gtk_sctp_hostlist_cb) },
1659 { "/Analyze/EndpointList/TCPIP", WIRESHARK_STOCK_ENDPOINTS, "TCP (IPv4 & IPv6)", NULL, NULL, G_CALLBACK(gtk_tcpip_hostlist_cb) },
1660 { "/Analyze/EndpointList/TR", WIRESHARK_STOCK_ENDPOINTS, "Token Ring", NULL, NULL, G_CALLBACK(gtk_tr_hostlist_cb) },
1661 { "/Analyze/EndpointList/UDPIP", WIRESHARK_STOCK_ENDPOINTS, "UDP (IPv4 & IPv6)", NULL, NULL, G_CALLBACK(gtk_udpip_hostlist_cb) },
1662 { "/Analyze/EndpointList/USB", WIRESHARK_STOCK_ENDPOINTS, "USB", NULL, NULL, G_CALLBACK(gtk_usb_hostlist_cb) },
1663 { "/Analyze/EndpointList/WLAN", WIRESHARK_STOCK_ENDPOINTS, "WLAN", NULL, NULL, G_CALLBACK(gtk_wlan_hostlist_cb) },
1665 { "/Analyze/ServiceResponseTime", NULL, "Service _Response Time", NULL, NULL, NULL },
1666 { "/Analyze/ServiceResponseTime/ONC-RPC", WIRESHARK_STOCK_TIME, "ONC-RPC...", NULL, NULL, G_CALLBACK(gtk_rpcstat_cb) },
1668 { "/Analyze/BACnet", NULL, "BACnet", NULL, NULL, NULL },
1670 { "/Analyze/StatisticsMenu/FlowGraph", WIRESHARK_STOCK_FLOW_GRAPH, "Flo_w Graph...", NULL, NULL, G_CALLBACK(flow_graph_launch) },
1671 { "/Analyze/StatisticsMenu/HTTP", NULL, "HTTP", NULL, NULL, NULL },
1672 { "/Analyze/StatisticsMenu/TCPStreamGraphMenu", NULL, "TCP StreamGraph", NULL, NULL, NULL },
1673 { "/Analyze/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-Stevens", NULL, "Time-Sequence Graph (Stevens)", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1674 { "/Analyze/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-tcptrace", NULL, "Time-Sequence Graph (tcptrace)", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1675 { "/Analyze/StatisticsMenu/TCPStreamGraphMenu/Throughput-Graph", NULL, "Throughput Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1676 { "/Analyze/StatisticsMenu/TCPStreamGraphMenu/RTT-Graph", NULL, "Round Trip Time Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1677 { "/Analyze/StatisticsMenu/TCPStreamGraphMenu/Window-Scaling-Graph", NULL, "Window Scaling Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
1679 { "/Analyze/StatisticsMenu/ONC-RPC-Programs", NULL, "ONC-RPC Programs", NULL, NULL, G_CALLBACK(gtk_rpcprogs_cb) },
1680 { "/Analyze/StatisticsMenu/UDPMulticastStreams", NULL, "UDP Multicast Streams", NULL, NULL, G_CALLBACK(mcaststream_launch) },
1681 { "/Analyze/StatisticsMenu/WLANTraffic", NULL, "WLAN Traffic", NULL, NULL, G_CALLBACK(wlanstat_launch) },
1683 { "/Statistics/Summary", GTK_STOCK_PROPERTIES, "_Summary", NULL, NULL, G_CALLBACK(summary_open_cb) },
1684 { "/Statistics/ProtocolHierarchy", NULL, "_Protocol Hierarchy", NULL, NULL, G_CALLBACK(proto_hier_stats_cb) },
1685 { "/Statistics/Conversations", WIRESHARK_STOCK_CONVERSATIONS, "Conversations", NULL, NULL, G_CALLBACK(init_conversation_notebook_cb) },
1686 { "/Statistics/Endpoints", WIRESHARK_STOCK_ENDPOINTS, "Endpoints", NULL, NULL, G_CALLBACK(init_hostlist_notebook_cb) },
1687 { "/Statistics/IOGraphs", WIRESHARK_STOCK_GRAPHS, "_IO Graph", NULL, NULL, G_CALLBACK(gui_iostat_cb) },
1689 { "/Telephony/ANSI", NULL, "ANSI", NULL, NULL, NULL },
1690 { "/Telephony/ANSI/BSMAP", NULL, "A-Interface BSMAP", NULL, NULL, G_CALLBACK(ansi_a_stat_gtk_bsmap_cb) },
1691 { "/Telephony/ANSI/DTAP", NULL, "A-Interface DTAP", NULL, NULL, G_CALLBACK(ansi_a_stat_gtk_dtap_cb) },
1692 { "/Telephony/ANSI/MAP-OP", NULL, "MAP Operation", NULL, NULL, G_CALLBACK(ansi_map_stat_gtk_cb) },
1694 { "/Telephony/GSM", NULL, "GSM", NULL, NULL, NULL },
1695 { "/Telephony/GSM/BSSMAP", NULL, "_GSM/A-Interface BSSMAP", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_bssmap_cb) },
1697 { "/Telephony/GSM/DTAP", NULL, "_GSM/A-Interface DTAP", NULL, NULL, NULL },
1698 { "/Telephony/GSM/DTAP/CC", NULL, "Call Control", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_cc_cb) },
1699 { "/Telephony/GSM/DTAP/GMM", NULL, "GPRS Mobility Management", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_gmm_cb) },
1700 { "/Telephony/GSM/DTAP/SM", NULL, "GPRS Session Management", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_sm_cb) },
1701 { "/Telephony/GSM/DTAP/MM", NULL, "Mobility Management", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_mm_cb) },
1702 { "/Telephony/GSM/DTAP/RR", NULL, "Radio Resource Management",NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_rr_cb) },
1703 { "/Telephony/GSM/DTAP/SMS", NULL, "Short Message Service", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_sms_cb) },
1704 { "/Telephony/GSM/DTAP/TP", NULL, "Special Conformance Testing Functions", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_tp_cb) },
1705 { "/Telephony/GSM/DTAP/SS", NULL, "Supplementary Services", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_dtap_ss_cb) },
1707 { "/Telephony/GSM/SACCH", NULL, "_GSM/A-Interface SACCH", NULL, NULL, G_CALLBACK(gsm_a_stat_gtk_sacch_rr_cb) },
1708 { "/Telephony/GSM/MAP-OP", NULL, "_GSM/MAP Operation", NULL, NULL, G_CALLBACK(gsm_map_stat_gtk_cb) },
1709 { "/Telephony/GSM/MAPSummary", NULL, "MAP Summary", NULL, NULL, G_CALLBACK(gsm_map_stat_gtk_sum_cb) },
1711 { "/Telephony/IAX2", NULL, "IA_X2", NULL, NULL, NULL },
1712 { "/Telephony/IAX2/StreamAnalysis", NULL, "Stream Analysis...", NULL, NULL, G_CALLBACK(iax2_analysis_cb) },
1713 { "/Telephony/VoIPCalls", WIRESHARK_STOCK_TELEPHONE, "_VoIP Calls", NULL, NULL, G_CALLBACK(voip_calls_launch) },
1715 { "/Tools/FirewallACLRules", NULL, "Firewall ACL Rules", NULL, NULL, G_CALLBACK(firewall_rule_cb) },
1717 { "/Internals/Dissectortables", NULL, "_Dissector tables", NULL, NULL, G_CALLBACK(dissector_tables_dlg_cb) },
1718 { "/Internals/SupportedProtocols", NULL, "_Supported Protocols (slow!)", NULL, NULL, G_CALLBACK(supported_cb) },
1720 { "/Help/Contents", GTK_STOCK_HELP, "_Contents", "F1", NULL, G_CALLBACK(help_menu_cont_cb) },
1721 { "/Help/ManualPages", NULL, "ManualPages", NULL, NULL, NULL },
1722 { "/Help/ManualPages/Wireshark", NULL, "Wireshark", NULL, NULL, G_CALLBACK(help_menu_wireshark_cb) },
1723 { "/Help/ManualPages/WiresharkFilter", NULL, "Wireshark Filter", NULL, NULL, G_CALLBACK(help_menu_wireshark_flt_cb) },
1724 { "/Help/ManualPages/TShark", NULL, "Wireshark", NULL, NULL, G_CALLBACK(help_menu_Tshark_cb) },
1725 { "/Help/ManualPages/RawShark", NULL, "RawShark", NULL, NULL, G_CALLBACK(help_menu_RawShark_cb) },
1726 { "/Help/ManualPages/Dumpcap", NULL, "Dumpcap", NULL, NULL, G_CALLBACK(help_menu_Dumpcap_cb) },
1727 { "/Help/ManualPages/Mergecap", NULL, "Mergecap", NULL, NULL, G_CALLBACK(help_menu_Mergecap_cb) },
1728 { "/Help/ManualPages/Editcap", NULL, "Editcap", NULL, NULL, G_CALLBACK(help_menu_Editcap_cb) },
1729 { "/Help/ManualPages/Text2pcap", NULL, "Text2pcap", NULL, NULL, G_CALLBACK(help_menu_Text2pcap_cb) },
1731 { "/Help/Website", GTK_STOCK_HOME, "Website", NULL, NULL, G_CALLBACK(help_menu_Website_cb) },
1732 { "/Help/FAQs", NULL, "FAQ's", NULL, NULL, G_CALLBACK(help_menu_faq_cb) },
1733 { "/Help/Downloads", NULL, "Downloads", NULL, NULL, G_CALLBACK(help_menu_Downloads_cb) },
1734 { "/Help/Wiki", WIRESHARK_STOCK_WIKI, "Wiki", NULL, NULL, G_CALLBACK(help_menu_Wiki_cb) },
1735 { "/Help/SampleCaptures", NULL, "Sample Captures", NULL, NULL, G_CALLBACK(help_menu_SampleCaptures_cb) },
1736 { "/Help/AboutWireshark", WIRESHARK_STOCK_ABOUT, "_About Wireshark", NULL, NULL, G_CALLBACK(about_wireshark_cb) },
1739 static const GtkToggleActionEntry main_menu_bar_toggle_action_entries[] =
1741 /* name, stock id, label, accel, tooltip, callback, is_active */
1742 {"/View/MainToolbar", NULL, "_Main Toolbar", NULL, NULL, G_CALLBACK(main_toolbar_show_hide_cb), TRUE},
1743 {"/View/FilterToolbar", NULL, "_FilterToolbar", NULL, NULL, G_CALLBACK(filter_toolbar_show_hide_cb), TRUE},
1745 {"/View/WirelessToolbar", NULL, "_WirelessToolbar", NULL, NULL, G_CALLBACK(wireless_toolbar_show_hide_cb), TRUE},
1746 #endif /* HAVE_AIRPCAP */
1747 {"/View/Statusbar", NULL, "_Statusbar", NULL, NULL, G_CALLBACK(status_bar_show_hide_cb), TRUE},
1748 {"/View/PacketList", NULL, "Packet _List", NULL, NULL, G_CALLBACK(packet_list_show_hide_cb), TRUE},
1749 {"/View/PacketDetails", NULL, "Packet _Details", NULL, NULL, G_CALLBACK(packet_details_show_hide_cb), TRUE},
1750 {"/View/PacketBytes", NULL, "Packet _Bytes", NULL, NULL, G_CALLBACK(packet_bytes_show_hide_cb), TRUE},
1751 {"/View/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes", NULL, "Display Seconds with hours and minutes", NULL, NULL, G_CALLBACK(view_menu_seconds_time_cb), FALSE},
1752 {"/View/NameResolution/ResolveName", NULL, "_Resolve Name", NULL, NULL, G_CALLBACK(resolve_name_cb), FALSE},
1753 {"/View/NameResolution/EnableforMACLayer", NULL, "Enable for _MAC Layer", NULL, NULL, G_CALLBACK(view_menu_en_for_MAC_cb), TRUE},
1754 {"/View/NameResolution/EnableforNetworkLayer", NULL, "Enable for _Network Layer", NULL, NULL, G_CALLBACK(view_menu_en_for_network_cb), TRUE },
1755 {"/View/NameResolution/EnableforTransportLayer", NULL, "Enable for _Transport Layer", NULL, NULL, G_CALLBACK(view_menu_en_for_transport_cb), TRUE },
1756 {"/View/ColorizePacketList", NULL, "Colorize Packet List", NULL, NULL, G_CALLBACK(view_menu_colorize_pkt_lst_cb), TRUE },
1758 {"/View/AutoScrollinLiveCapture", NULL, "Auto Scroll in Li_ve Capture", NULL, NULL, G_CALLBACK(view_menu_auto_scroll_live_cb), TRUE },
1764 static const GtkRadioActionEntry main_menu_bar_radio_view_time_entries [] =
1766 /* name, stock id, label, accel, tooltip, value */
1767 { "/View/TimeDisplayFormat/DateandTimeofDay", NULL, "Date and Time of Day: 1970-01-01 01:02:03.123456", "<alt><control>1", NULL, TS_ABSOLUTE_WITH_DATE },
1768 { "/View/TimeDisplayFormat/TimeofDay", NULL, "Time of Day: 01:02:03.123456", "<alt><control>2", NULL, TS_ABSOLUTE },
1769 { "/View/TimeDisplayFormat/SecondsSinceEpoch", NULL, "Seconds Since Epoch (1970-01-01): 1234567890.123456", "<alt><control>3", NULL, TS_EPOCH },
1770 { "/View/TimeDisplayFormat/SecondsSinceBeginningofCapture", NULL, "Seconds Since Beginning of Capture: 123.123456", "<alt><control>4", NULL, TS_RELATIVE },
1771 { "/View/TimeDisplayFormat/SecondsSincePreviousCapturedPacket", NULL, "Seconds Since Previous Captured Packet: 1.123456", "<alt><control>5", NULL, TS_DELTA },
1772 { "/View/TimeDisplayFormat/SecondsSincePreviousDisplayedPacket",NULL, "Seconds Since Previous Displayed Packet: 1.123456", "<alt><control>6", NULL, TS_DELTA_DIS },
1775 static const GtkRadioActionEntry main_menu_bar_radio_view_time_fileformat_prec_entries [] =
1777 /* name, stock id, label, accel, tooltip, value */
1778 { "/View/TimeDisplayFormat/FileFormatPrecision-Automatic", NULL, "Automatic (File Format Precision)", NULL, NULL, TS_PREC_AUTO },
1779 { "/View/TimeDisplayFormat/FileFormatPrecision-Seconds", NULL, "Seconds: 0", NULL, NULL, TS_PREC_FIXED_SEC },
1780 { "/View/TimeDisplayFormat/FileFormatPrecision-Deciseconds", NULL, "Deciseconds: 0.1", NULL, NULL, TS_PREC_FIXED_DSEC },
1781 { "/View/TimeDisplayFormat/FileFormatPrecision-Centiseconds", NULL, "Centiseconds: 0.12", NULL, NULL, TS_PREC_FIXED_CSEC },
1782 { "/View/TimeDisplayFormat/FileFormatPrecision-Milliseconds", NULL, "Milliseconds: 0.123", NULL, NULL, TS_PREC_FIXED_MSEC },
1783 { "/View/TimeDisplayFormat/FileFormatPrecision-Microseconds", NULL, "Microseconds: 0.123456", NULL, NULL, TS_PREC_FIXED_USEC },
1784 { "/View/TimeDisplayFormat/FileFormatPrecision-Nanoseconds", NULL, "Nanoseconds: 0.123456789", NULL, NULL, TS_PREC_FIXED_NSEC },
1786 #else /* MAIN_MENU_USE_UIMANAGER */
1790 * Please do not use keystrokes that are used as "universal" shortcuts in
1791 * various desktop environments:
1794 * http://support.microsoft.com/kb/126449
1797 * http://library.gnome.org/users/user-guide/nightly/keyboard-skills.html.en
1800 * http://developer.kde.org/documentation/standards/kde/style/keys/shortcuts.html
1802 * In particular, do not use the following <control> sequences for anything
1803 * other than their standard purposes:
1805 * <control>O File->Open
1806 * <control>S File->Save
1807 * <control>P File->Print
1808 * <control>W File->Close
1809 * <control>Q File->Quit
1810 * <control>Z Edit->Undo (which we don't currently have)
1811 * <control>X Edit->Cut (which we don't currently have)
1812 * <control>C Edit->Copy (which we don't currently have)
1813 * <control>V Edit->Paste (which we don't currently have)
1814 * <control>A Edit->Select All (which we don't currently have)
1816 * Note that some if not all of the Edit keys above already perform those
1817 * functions in text boxes, such as the Filter box. Do no, under any
1818 * circumstances, make a change that keeps them from doing so.
1821 /* This is the GtkItemFactoryEntry structure used to generate new menus.
1822 Item 1: The menu path. The letter after the underscore indicates an
1823 accelerator key once the menu is open.
1824 Item 2: The accelerator key for the entry
1825 Item 3: The callback function.
1826 Item 4: The callback action. This changes the parameters with
1827 which the function is called. The default is 0.
1828 Item 5: The item type, used to define what kind of an item it is.
1829 Here are the possible values:
1833 "<Title>" -> create a title item
1834 "<Item>" -> create a simple item
1835 "<ImageItem>" -> create an item holding an image
1836 "<StockItem>" -> create an item holding a stock image
1837 "<CheckItem>" -> create a check item
1838 "<ToggleItem>" -> create a toggle item
1839 "<RadioItem>" -> create a radio item
1840 <path> -> path of a radio item to link against
1841 "<Separator>" -> create a separator
1842 "<Tearoff>" -> create a tearoff separator
1843 "<Branch>" -> create an item to hold sub items (optional)
1844 "<LastBranch>" -> create a right justified branch
1845 Item 6: extra data needed for ImageItem and StockItem
1847 static GtkItemFactoryEntry menu_items[] =
1849 {"/_File", NULL, NULL, 0, "<Branch>", NULL,},
1850 {"/File/_Open...", "<control>O", GTK_MENU_FUNC(file_open_cmd_cb),
1851 0, "<StockItem>", GTK_STOCK_OPEN,},
1852 {"/File/Open _Recent", NULL, NULL, 0, "<Branch>", NULL,},
1853 {"/File/_Merge...", NULL, GTK_MENU_FUNC(file_merge_cmd_cb), 0, NULL, NULL,},
1854 {"/File/_Import...", NULL, GTK_MENU_FUNC(file_import_cmd_cb), 0, NULL, NULL,},
1855 {"/File/_Close", "<control>W", GTK_MENU_FUNC(file_close_cmd_cb),
1856 0, "<StockItem>", GTK_STOCK_CLOSE,},
1857 {"/File/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1858 {"/File/_Save", "<control>S", GTK_MENU_FUNC(file_save_cmd_cb),
1859 0, "<StockItem>", GTK_STOCK_SAVE,},
1860 {"/File/Save _As...", "<shift><control>S", GTK_MENU_FUNC(file_save_as_cmd_cb),
1861 0, "<StockItem>", GTK_STOCK_SAVE_AS,},
1862 {"/File/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1863 {"/File/File Set", NULL, NULL, 0, "<Branch>", NULL,},
1864 {"/File/File Set/List Files", NULL, GTK_MENU_FUNC(fileset_cb), 0, "<StockItem>", WIRESHARK_STOCK_FILE_SET_LIST,},
1865 {"/File/File Set/Next File", NULL, GTK_MENU_FUNC(fileset_next_cb), 0, "<StockItem>", WIRESHARK_STOCK_FILE_SET_NEXT,},
1866 {"/File/File Set/Previous File", NULL, GTK_MENU_FUNC(fileset_previous_cb), 0, "<StockItem>", WIRESHARK_STOCK_FILE_SET_PREVIOUS,},
1867 {"/File/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1868 {"/File/_Export", NULL, NULL, 0, "<Branch>", NULL,},
1870 {"/File/Export/File...", NULL, GTK_MENU_FUNC(export_text_cmd_cb),
1873 {"/File/Export/as \"Plain _Text\" file...", NULL, GTK_MENU_FUNC(export_text_cmd_cb),
1875 {"/File/Export/as \"_PostScript\" file...", NULL, GTK_MENU_FUNC(export_ps_cmd_cb),
1877 {"/File/Export/as \"_CSV\" (Comma Separated Values packet summary) file...",
1878 NULL, GTK_MENU_FUNC(export_csv_cmd_cb), 0, NULL, NULL,},
1879 {"/File/Export/as \"C _Arrays\" (packet bytes) file...", NULL, GTK_MENU_FUNC(export_carrays_cmd_cb),
1881 {"/File/Export/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1882 {"/File/Export/as XML - \"P_SML\" (packet summary) file...", NULL, GTK_MENU_FUNC(export_psml_cmd_cb),
1884 {"/File/Export/as XML - \"P_DML\" (packet details) file...", NULL, GTK_MENU_FUNC(export_pdml_cmd_cb),
1886 {"/File/Export/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1888 {"/File/Export/Selected Packet _Bytes...", "<control>H", GTK_MENU_FUNC(savehex_cb),
1890 {"/File/Export/SSL Session Keys...", NULL, GTK_MENU_FUNC(savesslkeys_cb),
1892 {"/File/Export/_Objects/_HTTP", NULL, GTK_MENU_FUNC(eo_http_cb), 0, NULL, NULL,},
1893 {"/File/Export/_Objects/_DICOM", NULL, GTK_MENU_FUNC(eo_dicom_cb), 0, NULL, NULL,},
1894 {"/File/Export/_Objects/_SMB", NULL, GTK_MENU_FUNC(eo_smb_cb), 0, NULL, NULL,},
1895 {"/File/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1896 {"/File/_Print...", "<control>P", GTK_MENU_FUNC(file_print_cmd_cb),
1897 0, "<StockItem>", GTK_STOCK_PRINT,},
1898 {"/File/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1899 {"/File/_Quit", "<control>Q", GTK_MENU_FUNC(file_quit_cmd_cb),
1900 0, "<StockItem>", GTK_STOCK_QUIT,},
1901 {"/_Edit", NULL, NULL, 0, "<Branch>", NULL,},
1902 {"/Edit/Copy", NULL, NULL, 0, "<Branch>", NULL,},
1903 {"/Edit/Copy/Description", "<shift><control>D", GTK_MENU_FUNC(copy_selected_plist_cb), COPY_SELECTED_DESCRIPTION, NULL, NULL,},
1904 {"/Edit/Copy/Fieldname", "<shift><control>F", GTK_MENU_FUNC(copy_selected_plist_cb), COPY_SELECTED_FIELDNAME, NULL, NULL,},
1905 {"/Edit/Copy/Value", "<shift><control>V", GTK_MENU_FUNC(copy_selected_plist_cb), COPY_SELECTED_VALUE, NULL, NULL,},
1906 {"/Edit/Copy/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1907 {"/Edit/Copy/As Filter", "<shift><control>C", GTK_MENU_FUNC(match_selected_ptree_cb),
1908 MATCH_SELECTED_REPLACE|MATCH_SELECTED_COPY_ONLY, NULL, NULL,},
1911 * Un-#if this when we actually implement Cut/Copy/Paste for the
1912 * packet list and packet detail windows.
1914 * Note: when we implement Cut/Copy/Paste in those windows, we
1915 * will almost certainly want to allow multiple packets to be
1916 * selected in the packet list pane and multiple packet detail
1917 * items to be selected in the packet detail pane, so that
1918 * the user can, for example, copy the summaries of multiple
1919 * packets to the clipboard from the packet list pane and multiple
1920 * packet detail items - perhaps *all* packet detail items - from
1921 * the packet detail pane. Given that, we'll also want to
1922 * implement Select All.
1924 * If multiple packets are selected, we would probably display nothing
1925 * in the packet detail pane, just as we do if no packet is selected,
1926 * and any menu items etc. that would pertain only to a single packet
1927 * would be disabled.
1929 * If multiple packet detail items are selected, we would probably
1930 * disable all items that pertain only to a single packet detail
1931 * item, such as some items in the status bar.
1933 * XXX - the actions for these will be different depending on what
1934 * widget we're in; ^C should copy from the filter text widget if
1935 * we're in that widget, the packet list if we're in that widget
1936 * (presumably copying the summaries of selected packets to the
1937 * clipboard, e.g. the text copy would be the text of the columns),
1938 * the packet detail if we're in that widget (presumably copying
1939 * the contents of selected protocol tree items to the clipboard,
1940 * e.g. the text copy would be the text displayed for those items),
1943 * Given that those menu items should also affect text widgets
1944 * such as the filter box, we would again want Select All, and,
1945 * at least for the filter box, we would also want Undo and Redo.
1946 * We would only want Cut, Paste, Undo, and Redo for the packet
1947 * list and packet detail panes if we support modifying them.
1949 {"/Edit/_Undo", "<control>Z", NULL,
1950 0, "<StockItem>", GTK_STOCK_UNDO,},
1951 {"/Edit/_Redo", "<shift><control>Z", NULL,
1952 0, "<StockItem>", GTK_STOCK_REDO,},
1953 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1954 {"/Edit/Cu_t", "<control>X", NULL,
1955 0, "<StockItem>", GTK_STOCK_CUT,},
1956 {"/Edit/_Copy", "<control>C", NULL,
1957 0, "<StockItem>", GTK_STOCK_COPY,},
1958 {"/Edit/_Paste", "<control>V", NULL,
1959 0, "<StockItem>", GTK_STOCK_PASTE,},
1960 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1961 {"/Edit/Select _All", "<control>A", NULL, 0,
1962 #ifdef GTK_STOCK_SELECT_ALL /* first appeared in 2.10 */
1963 "<StockItem>", GTK_STOCK_SELECT_ALL,
1966 #endif /* GTK_STOCK_SELECT_ALL */
1969 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1970 {"/Edit/_Find Packet...", "<control>F", GTK_MENU_FUNC(find_frame_cb), 0, "<StockItem>", GTK_STOCK_FIND,},
1971 {"/Edit/Find Ne_xt", "<control>N", GTK_MENU_FUNC(find_next_cb), 0, NULL, NULL,},
1972 {"/Edit/Find Pre_vious", "<control>B", GTK_MENU_FUNC(find_previous_cb), 0, NULL, NULL,},
1973 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1974 {"/Edit/_Mark Packet (toggle)", "<control>M", GTK_MENU_FUNC(new_packet_list_mark_frame_cb),0, NULL, NULL,},
1975 {"/Edit/Toggle Marking Of All Displayed Packets", "<shift><alt><control>M", GTK_MENU_FUNC(new_packet_list_toggle_mark_all_displayed_frames_cb), 0, NULL, NULL,},
1976 {"/Edit/Mark All Displayed Packets", "<shift><control>M", GTK_MENU_FUNC(new_packet_list_mark_all_displayed_frames_cb), 0, NULL, NULL,},
1977 {"/Edit/Unmark All Displayed Packets", "<alt><control>M", GTK_MENU_FUNC(new_packet_list_unmark_all_displayed_frames_cb), 0, NULL, NULL,},
1978 {"/Edit/Find Next Mark", "<shift><control>N", GTK_MENU_FUNC(find_next_mark_cb), 0, NULL, NULL,},
1979 {"/Edit/Find Previous Mark", "<shift><control>B", GTK_MENU_FUNC(find_prev_mark_cb), 0, NULL, NULL,},
1980 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1981 {"/Edit/_Ignore Packet (toggle)", "<control>D", GTK_MENU_FUNC(new_packet_list_ignore_frame_cb), 0, NULL, NULL,},
1983 * XXX - this next one overrides /Edit/Copy/Description
1985 {"/Edit/Ignore All Displayed Packets (toggle)","<shift><control>D", GTK_MENU_FUNC(new_packet_list_ignore_all_displayed_frames_cb), 0, NULL, NULL,},
1986 {"/Edit/U_n-Ignore All Packets", "<alt><control>D", GTK_MENU_FUNC(new_packet_list_unignore_all_frames_cb), 0, NULL, NULL,},
1987 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1988 {"/Edit/Set Time Reference (toggle)", "<control>T", GTK_MENU_FUNC(reftime_frame_cb), REFTIME_TOGGLE, "<StockItem>", WIRESHARK_STOCK_TIME,},
1989 {"/Edit/Un-Time Reference All Packets", "<alt><control>T", GTK_MENU_FUNC(new_packet_list_untime_reference_all_frames_cb), 0, NULL, NULL,},
1990 {"/Edit/Time Shift...", "<control>A", GTK_MENU_FUNC(time_shift_cb), 0, "<StockItem>", WIRESHARK_STOCK_TIME,},
1991 {"/Edit/Find Next Time Reference", "<alt><control>N", GTK_MENU_FUNC(reftime_frame_cb), REFTIME_FIND_NEXT, NULL, NULL,},
1992 {"/Edit/Find Previous Time Reference", "<alt><control>B", GTK_MENU_FUNC(reftime_frame_cb), REFTIME_FIND_PREV, NULL, NULL,},
1993 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1994 #ifdef WANT_PACKET_EDITOR
1995 {"/Edit/Edit packet", NULL, GTK_MENU_FUNC(edit_window_cb), 0, NULL, NULL, },
1996 {"/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
1998 {"/Edit/_Configuration Profiles...", "<shift><control>A", GTK_MENU_FUNC(profile_dialog_cb), 0, NULL, NULL,},
1999 {"/Edit/_Preferences...", "<shift><control>P", GTK_MENU_FUNC(prefs_page_cb),
2000 PREFS_PAGE_USER_INTERFACE, "<StockItem>", GTK_STOCK_PREFERENCES,},
2001 {"/_View", NULL, NULL, 0, "<Branch>", NULL,},
2002 {"/View/_Main Toolbar", NULL, GTK_MENU_FUNC(show_hide_cb), SHOW_HIDE_MAIN_TOOLBAR, "<CheckItem>", NULL,},
2003 {"/View/_Filter Toolbar", NULL, GTK_MENU_FUNC(show_hide_cb), SHOW_HIDE_FILTER_TOOLBAR, "<CheckItem>", NULL,},
2005 {"/View/_Wireless Toolbar", NULL, GTK_MENU_FUNC(show_hide_cb), SHOW_HIDE_AIRPCAP_TOOLBAR, "<CheckItem>", NULL,},
2007 {"/View/_Statusbar", NULL, GTK_MENU_FUNC(show_hide_cb), SHOW_HIDE_STATUSBAR, "<CheckItem>", NULL,},
2008 {"/View/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2009 {"/View/Packet _List", NULL, GTK_MENU_FUNC(show_hide_cb), SHOW_HIDE_PACKET_LIST, "<CheckItem>", NULL,},
2010 {"/View/Packet _Details", NULL, GTK_MENU_FUNC(show_hide_cb), SHOW_HIDE_TREE_VIEW, "<CheckItem>", NULL,},
2011 {"/View/Packet _Bytes", NULL, GTK_MENU_FUNC(show_hide_cb), SHOW_HIDE_BYTE_VIEW, "<CheckItem>", NULL,},
2012 {"/View/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2013 {"/View/_Time Display Format", NULL, NULL, 0, "<Branch>", NULL,},
2014 {"/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", "<alt><control>1", GTK_MENU_FUNC(timestamp_format_cb),
2015 TS_ABSOLUTE_WITH_DATE, "<RadioItem>", NULL,},
2016 {"/View/Time Display Format/Time of Day: 01:02:03.123456", "<alt><control>2", GTK_MENU_FUNC(timestamp_format_cb),
2017 TS_ABSOLUTE, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL,},
2018 {"/View/Time Display Format/Seconds Since Epoch (1970-01-01): 1234567890.123456", "<alt><control>3", GTK_MENU_FUNC(timestamp_format_cb),
2019 TS_EPOCH, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL,},
2020 {"/View/Time Display Format/Seconds Since Beginning of Capture: 123.123456", "<alt><control>4", GTK_MENU_FUNC(timestamp_format_cb),
2021 TS_RELATIVE, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL,},
2022 {"/View/Time Display Format/Seconds Since Previous Captured Packet: 1.123456", "<alt><control>5", GTK_MENU_FUNC(timestamp_format_cb),
2023 TS_DELTA, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL,},
2024 {"/View/Time Display Format/Seconds Since Previous Displayed Packet: 1.123456", "<alt><control>6", GTK_MENU_FUNC(timestamp_format_cb),
2025 TS_DELTA_DIS, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL,},
2026 {"/View/Time Display Format/UTC Date and Time of Day: 1970-01-01 01:02:03.123456", "<alt><control>7", GTK_MENU_FUNC(timestamp_format_cb),
2027 TS_UTC_WITH_DATE, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL,},
2028 {"/View/Time Display Format/UTC Time of Day: 01:02:03.123456", "<alt><control>8", GTK_MENU_FUNC(timestamp_format_cb),
2029 TS_UTC, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL,},
2030 {"/View/Time Display Format/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2031 {"/View/Time Display Format/Automatic (File Format Precision)", NULL, GTK_MENU_FUNC(timestamp_precision_cb),
2032 TS_PREC_AUTO, "<RadioItem>", NULL,},
2033 {"/View/Time Display Format/Seconds: 0", NULL, GTK_MENU_FUNC(timestamp_precision_cb),
2034 TS_PREC_FIXED_SEC, "/View/Time Display Format/Automatic (File Format Precision)", NULL,},
2035 {"/View/Time Display Format/Deciseconds: 0.1", NULL, GTK_MENU_FUNC(timestamp_precision_cb),
2036 TS_PREC_FIXED_DSEC, "/View/Time Display Format/Automatic (File Format Precision)", NULL,},
2037 {"/View/Time Display Format/Centiseconds: 0.12", NULL, GTK_MENU_FUNC(timestamp_precision_cb),
2038 TS_PREC_FIXED_CSEC, "/View/Time Display Format/Automatic (File Format Precision)", NULL,},
2039 {"/View/Time Display Format/Milliseconds: 0.123", NULL, GTK_MENU_FUNC(timestamp_precision_cb),
2040 TS_PREC_FIXED_MSEC, "/View/Time Display Format/Automatic (File Format Precision)", NULL,},
2041 {"/View/Time Display Format/Microseconds: 0.123456", NULL, GTK_MENU_FUNC(timestamp_precision_cb),
2042 TS_PREC_FIXED_USEC, "/View/Time Display Format/Automatic (File Format Precision)", NULL,},
2043 {"/View/Time Display Format/Nanoseconds: 0.123456789", NULL, GTK_MENU_FUNC(timestamp_precision_cb),
2044 TS_PREC_FIXED_NSEC, "/View/Time Display Format/Automatic (File Format Precision)", NULL,},
2045 {"/View/Time Display Format/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2046 {"/View/Time Display Format/Display Seconds with hours and minutes", "<alt><control>0", GTK_MENU_FUNC(timestamp_seconds_time_cb), 0, "<CheckItem>", NULL,},
2047 {"/View/Name Resol_ution", NULL, NULL, 0, "<Branch>", NULL,},
2048 {"/View/Name Resolution/_Resolve Name", NULL, GTK_MENU_FUNC(resolve_name_cb), 0, NULL, NULL,},
2049 {"/View/Name Resolution/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2050 {"/View/Name Resolution/Enable for _MAC Layer", NULL, GTK_MENU_FUNC(name_resolution_cb), RESOLV_MAC, "<CheckItem>", NULL,},
2051 {"/View/Name Resolution/Enable for _Network Layer", NULL, GTK_MENU_FUNC(name_resolution_cb), RESOLV_NETWORK, "<CheckItem>", NULL,},
2052 {"/View/Name Resolution/Enable for _Transport Layer", NULL, GTK_MENU_FUNC(name_resolution_cb), RESOLV_TRANSPORT, "<CheckItem>", NULL,},
2053 {"/View/Colorize Packet List", NULL, colorize_cb, 0, "<CheckItem>", NULL,},
2055 {"/View/Auto Scroll in Li_ve Capture", NULL, GTK_MENU_FUNC(auto_scroll_live_cb), 0, "<CheckItem>", NULL,},
2057 {"/View/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2058 {"/View/_Zoom In", "<control>plus", GTK_MENU_FUNC(view_zoom_in_cb),
2059 0, "<StockItem>", GTK_STOCK_ZOOM_IN,},
2060 {"/View/Zoom _Out", "<control>minus", GTK_MENU_FUNC(view_zoom_out_cb),
2061 0, "<StockItem>", GTK_STOCK_ZOOM_OUT,},
2062 {"/View/_Normal Size", "<control>equal", GTK_MENU_FUNC(view_zoom_100_cb),
2063 0, "<StockItem>", GTK_STOCK_ZOOM_100,},
2064 {"/View/Resize All Columns", "<shift><control>R", GTK_MENU_FUNC(new_packet_list_resize_columns_cb),
2065 0, "<StockItem>", WIRESHARK_STOCK_RESIZE_COLUMNS,},
2066 {"/View/Displayed Columns", NULL, NULL, 0, NULL, NULL,},
2067 {"/View/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2068 {"/View/E_xpand Subtrees", "<shift>Right", GTK_MENU_FUNC(expand_tree_cb), 0, NULL, NULL,},
2069 {"/View/_Expand All", "<control>Right", GTK_MENU_FUNC(expand_all_cb),
2071 {"/View/Collapse _All", "<control>Left", GTK_MENU_FUNC(collapse_all_cb),
2073 {"/View/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2074 {"/View/Colorize Conversation", NULL, NULL, 0, "<Branch>",NULL,},
2075 {"/View/Colorize Conversation/Color 1", "<control>1",
2076 GTK_MENU_FUNC(colorize_conversation_cb), 1*256, "<StockItem>", WIRESHARK_STOCK_COLOR1,},
2077 {"/View/Colorize Conversation/Color 2", "<control>2",
2078 GTK_MENU_FUNC(colorize_conversation_cb), 2*256, "<StockItem>", WIRESHARK_STOCK_COLOR2,},
2079 {"/View/Colorize Conversation/Color 3", "<control>3",
2080 GTK_MENU_FUNC(colorize_conversation_cb), 3*256, "<StockItem>", WIRESHARK_STOCK_COLOR3,},
2081 {"/View/Colorize Conversation/Color 4", "<control>4",
2082 GTK_MENU_FUNC(colorize_conversation_cb), 4*256, "<StockItem>", WIRESHARK_STOCK_COLOR4,},
2083 {"/View/Colorize Conversation/Color 5", "<control>5",
2084 GTK_MENU_FUNC(colorize_conversation_cb), 5*256, "<StockItem>", WIRESHARK_STOCK_COLOR5,},
2085 {"/View/Colorize Conversation/Color 6", "<control>6",
2086 GTK_MENU_FUNC(colorize_conversation_cb), 6*256, "<StockItem>", WIRESHARK_STOCK_COLOR6,},
2087 {"/View/Colorize Conversation/Color 7", "<control>7",
2088 GTK_MENU_FUNC(colorize_conversation_cb), 7*256, "<StockItem>", WIRESHARK_STOCK_COLOR7,},
2089 {"/View/Colorize Conversation/Color 8", "<control>8",
2090 GTK_MENU_FUNC(colorize_conversation_cb), 8*256, "<StockItem>", WIRESHARK_STOCK_COLOR8,},
2091 {"/View/Colorize Conversation/Color 9", "<control>9",
2092 GTK_MENU_FUNC(colorize_conversation_cb), 9*256, "<StockItem>", WIRESHARK_STOCK_COLOR9,},
2093 {"/View/Colorize Conversation/Color 10", "<control>0",
2094 GTK_MENU_FUNC(colorize_conversation_cb), 10*256, "<StockItem>", WIRESHARK_STOCK_COLOR0,},
2095 {"/View/Colorize Conversation/<separator>", NULL,
2096 NULL, 0, "<Separator>",NULL,},
2097 {"/View/Colorize Conversation/New Coloring Rule...", NULL,
2098 GTK_MENU_FUNC(colorize_conversation_cb), 0, "<StockItem>", GTK_STOCK_SELECT_COLOR,},
2099 {"/View/Reset Coloring 1-10", "<control>space",
2100 GTK_MENU_FUNC(colorize_conversation_cb), 255*256, NULL, NULL,},
2101 {"/View/_Coloring Rules...", NULL, color_display_cb,
2102 0, "<StockItem>", GTK_STOCK_SELECT_COLOR,},
2103 {"/View/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2106 {"/View/Show Packet in New _Window", NULL,
2107 GTK_MENU_FUNC(new_window_cb), 0, NULL, NULL,},
2108 {"/View/_Reload", "<control>R", GTK_MENU_FUNC(file_reload_cmd_cb),
2109 0, "<StockItem>", GTK_STOCK_REFRESH,},
2110 {"/_Go", NULL, NULL, 0, "<Branch>", NULL,},
2111 {"/Go/_Back", "<alt>Left",
2112 GTK_MENU_FUNC(history_back_cb), 0, "<StockItem>", GTK_STOCK_GO_BACK,},
2113 {"/Go/_Forward", "<alt>Right",
2114 GTK_MENU_FUNC(history_forward_cb), 0, "<StockItem>", GTK_STOCK_GO_FORWARD,},
2115 {"/Go/_Go to Packet...", "<control>G",
2116 GTK_MENU_FUNC(goto_frame_cb), 0, "<StockItem>", GTK_STOCK_JUMP_TO,},
2117 {"/Go/Go to _Corresponding Packet", NULL, GTK_MENU_FUNC(goto_framenum_cb),
2119 {"/Go/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2120 {"/Go/Previous Packet", "<control>Up",
2121 GTK_MENU_FUNC(goto_previous_frame_cb), 0, "<StockItem>", GTK_STOCK_GO_UP,},
2122 {"/Go/Next Packet", "<control>Down",
2123 GTK_MENU_FUNC(goto_next_frame_cb), 0, "<StockItem>", GTK_STOCK_GO_DOWN,},
2124 {"/Go/F_irst Packet", "<control>Home",
2125 GTK_MENU_FUNC(goto_top_frame_cb), 0, "<StockItem>", GTK_STOCK_GOTO_TOP,},
2126 {"/Go/_Last Packet", "<control>End",
2127 GTK_MENU_FUNC(goto_bottom_frame_cb), 0, "<StockItem>", GTK_STOCK_GOTO_BOTTOM,},
2128 {"/Go/Previous Packet In Conversation", "<control>comma",
2129 GTK_MENU_FUNC(goto_previous_frame_conversation_cb), 0, NULL, NULL,},
2130 {"/Go/Next Packet In Conversation", "<control>period",
2131 GTK_MENU_FUNC(goto_next_frame_conversation_cb), 0, NULL, NULL,},
2133 {"/_Capture", NULL, NULL, 0, "<Branch>", NULL,},
2134 {"/Capture/_Interfaces...", "<control>I",
2135 GTK_MENU_FUNC(capture_if_cb), 0, "<StockItem>", WIRESHARK_STOCK_CAPTURE_INTERFACES,},
2136 {"/Capture/_Options...", "<control>K",
2137 GTK_MENU_FUNC(capture_prep_cb), 0, "<StockItem>", WIRESHARK_STOCK_CAPTURE_OPTIONS,},
2138 {"/Capture/_Start", "<control>E",
2139 GTK_MENU_FUNC(capture_start_cb), 0, "<StockItem>", WIRESHARK_STOCK_CAPTURE_START,},
2140 {"/Capture/S_top", "<control>E", GTK_MENU_FUNC(capture_stop_cb),
2141 0, "<StockItem>", WIRESHARK_STOCK_CAPTURE_STOP,},
2142 {"/Capture/_Restart", "<control>R", GTK_MENU_FUNC(capture_restart_cb),
2143 0, "<StockItem>", WIRESHARK_STOCK_CAPTURE_RESTART,},
2144 {"/Capture/Capture _Filters...", NULL, GTK_MENU_FUNC(cfilter_dialog_cb),
2145 0, "<StockItem>", WIRESHARK_STOCK_CAPTURE_FILTER,},
2146 #endif /* HAVE_LIBPCAP */
2147 {"/_Analyze", NULL, NULL, 0, "<Branch>", NULL,},
2148 {"/Analyze/_Display Filters...", NULL, GTK_MENU_FUNC(dfilter_dialog_cb),
2149 0, "<StockItem>", WIRESHARK_STOCK_DISPLAY_FILTER,},
2150 {"/Analyze/Display Filter _Macros...", NULL, GTK_MENU_FUNC(macros_dialog_cb), 0, NULL, NULL,},
2151 {"/Analyze/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2152 {"/Analyze/Apply as Column", NULL, GTK_MENU_FUNC(apply_as_custom_column_cb), 0, NULL, NULL},
2153 {"/Analyze/Appl_y as Filter", NULL, NULL, 0, "<Branch>", NULL,},
2154 {"/Analyze/Apply as Filter/_Selected", NULL, GTK_MENU_FUNC(match_selected_ptree_cb),
2155 MATCH_SELECTED_REPLACE|MATCH_SELECTED_APPLY_NOW, NULL, NULL,},
2156 {"/Analyze/Apply as Filter/_Not Selected", NULL, GTK_MENU_FUNC(match_selected_ptree_cb),
2157 MATCH_SELECTED_NOT|MATCH_SELECTED_APPLY_NOW, NULL, NULL,},
2158 {"/Analyze/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, GTK_MENU_FUNC(match_selected_ptree_cb),
2159 MATCH_SELECTED_AND|MATCH_SELECTED_APPLY_NOW, NULL, NULL,},
2160 {"/Analyze/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, GTK_MENU_FUNC(match_selected_ptree_cb),
2161 MATCH_SELECTED_OR|MATCH_SELECTED_APPLY_NOW, NULL, NULL,},
2162 {"/Analyze/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, GTK_MENU_FUNC(match_selected_ptree_cb),
2163 MATCH_SELECTED_AND_NOT|MATCH_SELECTED_APPLY_NOW, NULL, NULL,},
2164 {"/Analyze/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, GTK_MENU_FUNC(match_selected_ptree_cb),
2165 MATCH_SELECTED_OR_NOT|MATCH_SELECTED_APPLY_NOW, NULL, NULL,},
2166 {"/Analyze/_Prepare a Filter", NULL, NULL, 0, "<Branch>", NULL,},
2167 {"/Analyze/Prepare a Filter/_Selected", NULL, GTK_MENU_FUNC(match_selected_ptree_cb),
2168 MATCH_SELECTED_REPLACE, NULL, NULL,},
2169 {"/Analyze/Prepare a Filter/_Not Selected", NULL, GTK_MENU_FUNC(match_selected_ptree_cb),
2170 MATCH_SELECTED_NOT, NULL, NULL,},
2171 {"/Analyze/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, GTK_MENU_FUNC(match_selected_ptree_cb),
2172 MATCH_SELECTED_AND, NULL, NULL,},
2173 {"/Analyze/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, GTK_MENU_FUNC(match_selected_ptree_cb),
2174 MATCH_SELECTED_OR, NULL, NULL,},
2175 {"/Analyze/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, GTK_MENU_FUNC(match_selected_ptree_cb),
2176 MATCH_SELECTED_AND_NOT, NULL, NULL,},
2177 {"/Analyze/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, GTK_MENU_FUNC(match_selected_ptree_cb),
2178 MATCH_SELECTED_OR_NOT, NULL, NULL,},
2179 {"/Analyze/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2180 {"/Analyze/_Enabled Protocols...", "<shift><control>E", GTK_MENU_FUNC(proto_cb),
2181 0, "<StockItem>", WIRESHARK_STOCK_CHECKBOX,},
2182 {"/Analyze/Decode _As...", NULL, GTK_MENU_FUNC(decode_as_cb),
2183 0, "<StockItem>", WIRESHARK_STOCK_DECODE_AS,},
2184 {"/Analyze/_User Specified Decodes...", NULL,
2185 GTK_MENU_FUNC(decode_show_cb), 0, "<StockItem>", WIRESHARK_STOCK_DECODE_AS,},
2186 {"/Analyze/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2187 {"/Analyze/_Follow TCP Stream", NULL,
2188 GTK_MENU_FUNC(follow_tcp_stream_cb), 0, NULL, NULL,},
2189 {"/Analyze/_Follow UDP Stream", NULL,
2190 GTK_MENU_FUNC(follow_udp_stream_cb), 0, NULL, NULL,},
2191 {"/Analyze/_Follow SSL Stream", NULL,
2192 GTK_MENU_FUNC(follow_ssl_stream_cb), 0, NULL, NULL,},
2193 {"/_Statistics", NULL, NULL, 0, "<Branch>", NULL,},
2194 {"/Statistics/_Summary", NULL, GTK_MENU_FUNC(summary_open_cb), 0, "<StockItem>", GTK_STOCK_PROPERTIES,},
2195 {"/Statistics/_Protocol Hierarchy", NULL,
2196 GTK_MENU_FUNC(proto_hier_stats_cb), 0, NULL, NULL,},
2197 {"/Statistics/Conversations", NULL,
2198 GTK_MENU_FUNC(init_conversation_notebook_cb), 0, "<StockItem>", WIRESHARK_STOCK_CONVERSATIONS,},
2199 {"/Statistics/Endpoints", NULL,
2200 GTK_MENU_FUNC(init_hostlist_notebook_cb), 0, "<StockItem>", WIRESHARK_STOCK_ENDPOINTS,},
2201 {"/Telephon_y", NULL, NULL, 0, "<Branch>", NULL,},
2202 {"/_Tools", NULL, NULL, 0, "<Branch>", NULL,},
2203 {"/Tools/Firewall ACL Rules", NULL,
2204 firewall_rule_cb, 0, NULL, NULL,},
2205 {"/_Internals", NULL, NULL, 0, "<Branch>", NULL,},
2206 {"/Internals/_Dissector tables", NULL, GTK_MENU_FUNC(dissector_tables_dlg_cb), 0, NULL, NULL,},
2207 {"/Internals/_Supported Protocols (slow!)", NULL, GTK_MENU_FUNC(supported_cb), 0, NULL, NULL,},
2208 {"/_Help", NULL, NULL, 0, "<Branch>", NULL,},
2209 {"/Help/_Contents", "F1", GTK_MENU_FUNC(topic_menu_cb), HELP_CONTENT, "<StockItem>", GTK_STOCK_HELP,},
2210 {"/Help/Manual Pages", NULL, NULL, 0, "<Branch>", NULL,},
2211 {"/Help/Manual Pages/Wireshark", NULL, GTK_MENU_FUNC(topic_menu_cb), LOCALPAGE_MAN_WIRESHARK, NULL, NULL,},
2212 {"/Help/Manual Pages/Wireshark Filter", NULL, GTK_MENU_FUNC(topic_menu_cb), LOCALPAGE_MAN_WIRESHARK_FILTER, NULL, NULL,},
2213 {"/Help/Manual Pages/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2214 {"/Help/Manual Pages/TShark", NULL, GTK_MENU_FUNC(topic_menu_cb), LOCALPAGE_MAN_TSHARK, NULL, NULL,},
2215 {"/Help/Manual Pages/RawShark", NULL, GTK_MENU_FUNC(topic_menu_cb), LOCALPAGE_MAN_RAWSHARK, NULL, NULL,},
2216 {"/Help/Manual Pages/Dumpcap", NULL, GTK_MENU_FUNC(topic_menu_cb), LOCALPAGE_MAN_DUMPCAP, NULL, NULL,},
2217 {"/Help/Manual Pages/Mergecap", NULL, GTK_MENU_FUNC(topic_menu_cb), LOCALPAGE_MAN_MERGECAP, NULL, NULL,},
2218 {"/Help/Manual Pages/Editcap", NULL, GTK_MENU_FUNC(topic_menu_cb), LOCALPAGE_MAN_EDITCAP, NULL, NULL,},
2219 {"/Help/Manual Pages/Text2pcap", NULL, GTK_MENU_FUNC(topic_menu_cb), LOCALPAGE_MAN_TEXT2PCAP, NULL, NULL,},
2220 {"/Help/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2221 {"/Help/Website", NULL, GTK_MENU_FUNC(topic_menu_cb), ONLINEPAGE_HOME, "<StockItem>", GTK_STOCK_HOME,},
2222 {"/Help/FAQ's", NULL, GTK_MENU_FUNC(topic_menu_cb), ONLINEPAGE_FAQ, NULL, NULL,},
2223 {"/Help/Downloads", NULL, GTK_MENU_FUNC(topic_menu_cb), ONLINEPAGE_DOWNLOAD, NULL, NULL,},
2224 {"/Help/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2225 {"/Help/Wiki", NULL, GTK_MENU_FUNC(topic_menu_cb), ONLINEPAGE_WIKI, "<StockItem>", WIRESHARK_STOCK_WIKI,},
2226 {"/Help/Sample Captures", NULL, GTK_MENU_FUNC(topic_menu_cb), ONLINEPAGE_SAMPLE_FILES, NULL, NULL,},
2227 {"/Help/<separator>", NULL, NULL, 0, "<Separator>", NULL,},
2228 {"/Help/_About Wireshark", NULL, GTK_MENU_FUNC(about_wireshark_cb),
2229 0, "<StockItem>", WIRESHARK_STOCK_ABOUT}
2232 /* calculate the number of menu_items */
2233 static int nmenu_items = sizeof(menu_items) / sizeof(menu_items[0]);
2234 #endif /* MAIN_MENU_USE_UIMANAGER */
2238 select_bytes_view_cb (GtkRadioAction *action, GtkRadioAction *current _U_, gpointer user_data _U_)
2242 value = gtk_radio_action_get_current_value (action);
2244 select_bytes_view( NULL, NULL, value);
2248 sort_ascending_cb(GtkAction *action _U_, gpointer user_data)
2250 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortAscending");
2251 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_SORT_ASCENDING);
2255 sort_descending_cb(GtkAction *action _U_, gpointer user_data)
2257 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortDescending");
2258 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_SORT_DESCENDING);
2262 no_sorting_cb(GtkAction *action _U_, gpointer user_data)
2264 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/NoSorting");
2265 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_SORT_NONE);
2269 packet_list_heading_show_resolved_cb(GtkAction *action _U_, gpointer user_data _U_)
2271 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ShowResolved");
2273 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_TOGGLE_RESOLVED);
2277 packet_list_heading_align_left_cb(GtkAction *action _U_, gpointer user_data)
2279 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/AlignLeft");
2280 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_ALIGN_LEFT);
2284 packet_list_heading_align_center_cb(GtkAction *action _U_, gpointer user_data)
2286 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/AlignCenter");
2287 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_ALIGN_CENTER);
2291 packet_list_heading_align_right_cb(GtkAction *action _U_, gpointer user_data)
2293 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/AlignRight");
2294 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_ALIGN_RIGHT);
2298 packet_list_heading_col_pref_cb(GtkAction *action _U_, gpointer user_data)
2300 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ColumnPreferences");
2301 prefs_page_cb( widget , user_data, PREFS_PAGE_COLUMNS);
2305 packet_list_heading_resize_col_cb(GtkAction *action _U_, gpointer user_data)
2307 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ResizeColumn");
2308 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_RESIZE);
2312 packet_list_heading_change_col_cb(GtkAction *action _U_, gpointer user_data)
2314 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/EditColumnDetails");
2315 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_CHANGE);
2319 packet_list_heading_activate_all_columns_cb(GtkAction *action _U_, gpointer user_data _U_)
2321 new_packet_list_set_all_columns_visible ();
2325 packet_list_heading_hide_col_cb(GtkAction *action _U_, gpointer user_data)
2327 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/HideColumn");
2328 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_HIDE);
2332 packet_list_heading_remove_col_cb(GtkAction *action _U_, gpointer user_data)
2334 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/RemoveColumn");
2335 new_packet_list_column_menu_cb( widget , user_data, COLUMN_SELECTED_REMOVE);
2339 packet_list_menu_set_ref_time_cb(GtkAction *action _U_, gpointer user_data)
2341 reftime_frame_cb( NULL /* widget _U_ */ , user_data, REFTIME_TOGGLE);
2346 packet_list_menu_apply_selected_cb(GtkAction *action _U_, gpointer user_data)
2348 match_selected_plist_cb( NULL /* widget _U_ */, user_data, MATCH_SELECTED_REPLACE|MATCH_SELECTED_APPLY_NOW);
2352 packet_list_menu_apply_not_selected_cb(GtkAction *action _U_, gpointer user_data)
2354 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_NOT|MATCH_SELECTED_APPLY_NOW);
2358 packet_list_menu_apply_and_selected_cb(GtkAction *action _U_, gpointer user_data)
2360 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_AND|MATCH_SELECTED_APPLY_NOW);
2364 packet_list_menu_apply_or_selected_cb(GtkAction *action _U_, gpointer user_data)
2366 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_OR|MATCH_SELECTED_APPLY_NOW);
2370 packet_list_menu_apply_and_not_selected_cb(GtkAction *action _U_, gpointer user_data)
2372 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_AND_NOT|MATCH_SELECTED_APPLY_NOW);
2376 packet_list_menu_apply_or_not_selected_cb(GtkAction *action _U_, gpointer user_data)
2378 match_selected_plist_cb( NULL /* widget _U_ */ , user_data,MATCH_SELECTED_OR_NOT|MATCH_SELECTED_APPLY_NOW);
2380 /* Prepare a filter */
2382 packet_list_menu_prepare_selected_cb(GtkAction *action _U_, gpointer user_data)
2384 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_REPLACE);
2388 packet_list_menu_prepare_not_selected_cb(GtkAction *action _U_, gpointer user_data)
2390 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_NOT);
2394 packet_list_menu_prepare_and_selected_cb(GtkAction *action _U_, gpointer user_data)
2396 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_AND);
2400 packet_list_menu_prepare_or_selected_cb(GtkAction *action _U_, gpointer user_data)
2402 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_OR);
2406 packet_list_menu_prepare_and_not_selected_cb(GtkAction *action _U_, gpointer user_data)
2408 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_AND_NOT);
2412 packet_list_menu_prepare_or_not_selected_cb(GtkAction *action _U_, gpointer user_data)
2414 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_OR_NOT);
2418 packet_list_menu_conversation_ethernet_cb(GtkAction *action, gpointer user_data)
2420 conversation_cb( action, user_data, CONV_ETHER);
2424 packet_list_menu_conversation_ip_cb(GtkAction *action _U_, gpointer user_data)
2426 conversation_cb( action, user_data, CONV_IP);
2430 packet_list_menu_conversation_tcp_cb(GtkAction *action _U_, gpointer user_data)
2432 conversation_cb( action, user_data, CONV_TCP);
2436 packet_list_menu_conversation_udp_cb(GtkAction *action _U_, gpointer user_data)
2438 conversation_cb( action, user_data, CONV_UDP);
2442 packet_list_menu_conversation_pn_cba_cb(GtkAction *action _U_, gpointer user_data)
2444 conversation_cb( action, user_data, CONV_CBA);
2450 packet_list_menu_color_conv_ethernet_color1_cb(GtkAction *action _U_, gpointer user_data)
2452 colorize_conversation_cb( NULL /* widget _U_ */, user_data, CONV_ETHER+1*256);
2456 packet_list_menu_color_conv_ethernet_color2_cb(GtkAction *action _U_, gpointer user_data)
2458 colorize_conversation_cb( NULL/* widget _U_ */ , user_data, CONV_ETHER+1*256);
2462 packet_list_menu_color_conv_ethernet_color3_cb(GtkAction *action _U_, gpointer user_data)
2464 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_ETHER+3*256);
2468 packet_list_menu_color_conv_ethernet_color4_cb(GtkAction *action _U_, gpointer user_data)
2470 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_ETHER+4*256);
2474 packet_list_menu_color_conv_ethernet_color5_cb(GtkAction *action _U_, gpointer user_data)
2476 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_ETHER+5*256);
2480 packet_list_menu_color_conv_ethernet_color6_cb(GtkAction *action _U_, gpointer user_data)
2482 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_ETHER+6*256);
2486 packet_list_menu_color_conv_ethernet_color7_cb(GtkAction *action _U_, gpointer user_data)
2488 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_ETHER+7*256);
2492 packet_list_menu_color_conv_ethernet_color8_cb(GtkAction *action _U_, gpointer user_data)
2494 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_ETHER+8*256);
2498 packet_list_menu_color_conv_ethernet_color9_cb(GtkAction *action _U_, gpointer user_data)
2500 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_ETHER+9*256);
2504 packet_list_menu_color_conv_ethernet_color10_cb(GtkAction *action _U_, gpointer user_data)
2506 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_ETHER+10*256);
2510 packet_list_menu_color_conv_ethernet_new_rule_cb(GtkAction *action _U_, gpointer user_data)
2512 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_ETHER);
2518 packet_list_menu_color_conv_ip_color1_cb(GtkAction *action _U_, gpointer user_data)
2520 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_IP+1*256);
2524 packet_list_menu_color_conv_ip_color2_cb(GtkAction *action _U_, gpointer user_data)
2526 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_IP+1*256);
2530 packet_list_menu_color_conv_ip_color3_cb(GtkAction *action _U_, gpointer user_data)
2532 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_IP+3*256);
2536 packet_list_menu_color_conv_ip_color4_cb(GtkAction *action _U_, gpointer user_data)
2538 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_IP+4*256);
2542 packet_list_menu_color_conv_ip_color5_cb(GtkAction *action _U_, gpointer user_data)
2544 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_IP+5*256);
2548 packet_list_menu_color_conv_ip_color6_cb(GtkAction *action _U_, gpointer user_data)
2550 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_IP+6*256);
2554 packet_list_menu_color_conv_ip_color7_cb(GtkAction *action _U_, gpointer user_data)
2556 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_IP+7*256);
2560 packet_list_menu_color_conv_ip_color8_cb(GtkAction *action _U_, gpointer user_data)
2562 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_IP+8*256);
2566 packet_list_menu_color_conv_ip_color9_cb(GtkAction *action _U_, gpointer user_data)
2568 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_IP+9*256);
2572 packet_list_menu_color_conv_ip_color10_cb(GtkAction *action _U_, gpointer user_data)
2574 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_IP+10*256);
2578 packet_list_menu_color_conv_ip_new_rule_cb(GtkAction *action _U_, gpointer user_data)
2580 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_TCP);
2586 packet_list_menu_color_conv_tcp_color1_cb(GtkAction *action _U_, gpointer user_data)
2588 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_TCP+1*256);
2592 packet_list_menu_color_conv_tcp_color2_cb(GtkAction *action _U_, gpointer user_data)
2594 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_TCP+1*256);
2598 packet_list_menu_color_conv_tcp_color3_cb(GtkAction *action _U_, gpointer user_data)
2600 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_TCP+3*256);
2604 packet_list_menu_color_conv_tcp_color4_cb(GtkAction *action _U_, gpointer user_data)
2606 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_TCP+4*256);
2610 packet_list_menu_color_conv_tcp_color5_cb(GtkAction *action _U_, gpointer user_data)
2612 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_TCP+5*256);
2616 packet_list_menu_color_conv_tcp_color6_cb(GtkAction *action _U_, gpointer user_data)
2618 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_TCP+6*256);
2622 packet_list_menu_color_conv_tcp_color7_cb(GtkAction *action _U_, gpointer user_data)
2624 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_TCP+7*256);
2628 packet_list_menu_color_conv_tcp_color8_cb(GtkAction *action _U_, gpointer user_data)
2630 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_TCP+8*256);
2634 packet_list_menu_color_conv_tcp_color9_cb(GtkAction *action _U_, gpointer user_data)
2636 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_TCP+9*256);
2640 packet_list_menu_color_conv_tcp_color10_cb(GtkAction *action _U_, gpointer user_data)
2642 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_TCP+10*256);
2646 packet_list_menu_color_conv_tcp_new_rule_cb(GtkAction *action _U_, gpointer user_data)
2648 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_TCP);
2654 packet_list_menu_color_conv_udp_color1_cb(GtkAction *action _U_, gpointer user_data)
2656 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_UDP+1*256);
2660 packet_list_menu_color_conv_udp_color2_cb(GtkAction *action _U_, gpointer user_data)
2662 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_UDP+1*256);
2666 packet_list_menu_color_conv_udp_color3_cb(GtkAction *action _U_, gpointer user_data)
2668 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_UDP+3*256);
2672 packet_list_menu_color_conv_udp_color4_cb(GtkAction *action _U_, gpointer user_data)
2674 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_UDP+4*256);
2678 packet_list_menu_color_conv_udp_color5_cb(GtkAction *action _U_, gpointer user_data)
2680 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_UDP+5*256);
2684 packet_list_menu_color_conv_udp_color6_cb(GtkAction *action _U_, gpointer user_data)
2686 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_UDP+6*256);
2690 packet_list_menu_color_conv_udp_color7_cb(GtkAction *action _U_, gpointer user_data)
2692 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_UDP+7*256);
2696 packet_list_menu_color_conv_udp_color8_cb(GtkAction *action _U_, gpointer user_data)
2698 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_UDP+8*256);
2702 packet_list_menu_color_conv_udp_color9_cb(GtkAction *action _U_, gpointer user_data)
2704 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_UDP+9*256);
2708 packet_list_menu_color_conv_udp_color10_cb(GtkAction *action _U_, gpointer user_data)
2710 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_UDP+10*256);
2714 packet_list_menu_color_conv_udp_new_rule_cb(GtkAction *action _U_, gpointer user_data)
2716 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_UDP);
2722 packet_list_menu_color_conv_cba_color1_cb(GtkAction *action _U_, gpointer user_data)
2724 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_CBA+1*256);
2728 packet_list_menu_color_conv_cba_color2_cb(GtkAction *action _U_, gpointer user_data)
2730 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_CBA+1*256);
2734 packet_list_menu_color_conv_cba_color3_cb(GtkAction *action _U_, gpointer user_data)
2736 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_CBA+3*256);
2740 packet_list_menu_color_conv_cba_color4_cb(GtkAction *action _U_, gpointer user_data)
2742 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_CBA+4*256);
2746 packet_list_menu_color_conv_cba_color5_cb(GtkAction *action _U_, gpointer user_data)
2748 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_CBA+5*256);
2752 packet_list_menu_color_conv_cba_color6_cb(GtkAction *action _U_, gpointer user_data)
2754 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_CBA+6*256);
2758 packet_list_menu_color_conv_cba_color7_cb(GtkAction *action _U_, gpointer user_data)
2760 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_CBA+7*256);
2764 packet_list_menu_color_conv_cba_color8_cb(GtkAction *action _U_, gpointer user_data)
2766 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_CBA+8*256);
2770 packet_list_menu_color_conv_cba_color9_cb(GtkAction *action _U_, gpointer user_data)
2772 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_CBA+9*256);
2776 packet_list_menu_color_conv_cba_color10_cb(GtkAction *action _U_, gpointer user_data)
2778 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_CBA+10*256);
2782 packet_list_menu_color_conv_cba_new_rule_cb(GtkAction *action _U_, gpointer user_data)
2784 colorize_conversation_cb( NULL /* widget _U_ */ , user_data, CONV_CBA);
2788 packet_list_menu_copy_sum_txt(GtkAction *action _U_, gpointer user_data)
2790 new_packet_list_copy_summary_cb( NULL /* widget _U_ */ , user_data, CS_TEXT);
2794 packet_list_menu_copy_sum_csv(GtkAction *action _U_, gpointer user_data)
2796 new_packet_list_copy_summary_cb( NULL /* widget _U_ */ , user_data, CS_CSV);
2800 packet_list_menu_copy_as_flt(GtkAction *action _U_, gpointer user_data)
2802 match_selected_plist_cb( NULL /* widget _U_ */ , user_data, MATCH_SELECTED_REPLACE|MATCH_SELECTED_COPY_ONLY);
2806 packet_list_menu_copy_bytes_oht_cb(GtkAction *action _U_, gpointer user_data)
2808 copy_hex_cb( NULL /* widget _U_ */ , user_data, CD_ALLINFO | CD_FLAGS_SELECTEDONLY);
2812 packet_list_menu_copy_bytes_oh_cb(GtkAction *action _U_, gpointer user_data)
2814 copy_hex_cb( NULL /* widget _U_ */ , user_data, CD_HEXCOLUMNS | CD_FLAGS_SELECTEDONLY);
2818 packet_list_menu_copy_bytes_text_cb(GtkAction *action _U_, gpointer user_data)
2820 copy_hex_cb( NULL /* widget _U_ */ , user_data, CD_TEXTONLY | CD_FLAGS_SELECTEDONLY);
2824 packet_list_menu_copy_bytes_hex_strm_cb(GtkAction *action _U_, gpointer user_data)
2826 copy_hex_cb( NULL /* widget _U_ */ , user_data, CD_HEX | CD_FLAGS_SELECTEDONLY);
2830 packet_list_menu_copy_bytes_bin_strm_cb(GtkAction *action _U_, gpointer user_data)
2832 copy_hex_cb( NULL /* widget _U_ */ , user_data, CD_BINARY | CD_FLAGS_SELECTEDONLY);
2838 tree_view_menu_color_with_flt_color1_cb(GtkAction *action _U_, gpointer user_data)
2840 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 1);
2844 tree_view_menu_color_with_flt_color2_cb(GtkAction *action _U_, gpointer user_data)
2846 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 2);
2850 tree_view_menu_color_with_flt_color3_cb(GtkAction *action _U_, gpointer user_data)
2852 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 3);
2856 tree_view_menu_color_with_flt_color4_cb(GtkAction *action _U_, gpointer user_data)
2858 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 4);
2862 tree_view_menu_color_with_flt_color5_cb(GtkAction *action _U_, gpointer user_data)
2864 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 5);
2868 tree_view_menu_color_with_flt_color6_cb(GtkAction *action _U_, gpointer user_data)
2870 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 6);
2874 tree_view_menu_color_with_flt_color7_cb(GtkAction *action _U_, gpointer user_data)
2876 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 7);
2880 tree_view_menu_color_with_flt_color8_cb(GtkAction *action _U_, gpointer user_data)
2882 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 8);
2886 tree_view_menu_color_with_flt_color9_cb(GtkAction *action _U_, gpointer user_data)
2888 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 9);
2892 tree_view_menu_color_with_flt_color10_cb(GtkAction *action _U_, gpointer user_data)
2894 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 10);
2898 tree_view_menu_color_with_flt_new_rule_cb(GtkAction *action _U_, gpointer user_data)
2900 colorize_selected_ptree_cb( NULL /* widget _U_ */ , user_data, 0);
2905 tree_view_menu_copy_desc(GtkAction *action _U_, gpointer user_data)
2907 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_DESCRIPTION);
2911 tree_view_menu_copy_field(GtkAction *action _U_, gpointer user_data)
2913 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_FIELDNAME);
2917 tree_view_menu_copy_value(GtkAction *action _U_, gpointer user_data)
2919 copy_selected_plist_cb( NULL /* widget _U_ */ , user_data, COPY_SELECTED_VALUE);
2923 tree_view_menu_copy_as_flt(GtkAction *action _U_, gpointer user_data)
2925 GtkWidget *widget = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/Copy/AsFilter");
2926 match_selected_ptree_cb( widget , user_data, MATCH_SELECTED_REPLACE|MATCH_SELECTED_COPY_ONLY);
2929 static const char *ui_desc_packet_list_heading_menu_popup =
2931 " <popup name='PacketListHeadingPopup' action='PopupAction'>\n"
2932 " <menuitem name='SortAscending' action='/Sort Ascending'/>\n"
2933 " <menuitem name='SortDescending' action='/Sort Descending'/>\n"
2934 " <menuitem name='NoSorting' action='/No Sorting'/>\n"
2936 " <menuitem name='ShowResolved' action='/Show Resolved'/>\n"
2938 " <menuitem name='AlignLeft' action='/Align Left'/>\n"
2939 " <menuitem name='AlignCenter' action='/Align Center'/>\n"
2940 " <menuitem name='AlignRight' action='/Align Right'/>\n"
2942 " <menuitem name='ColumnPreferences' action='/Column Preferences'/>\n"
2943 " <menuitem name='EditColumnDetails' action='/Edit Column Details'/>\n"
2944 " <menuitem name='ResizeColumn' action='/Resize Column'/>\n"
2946 " <menu name='DisplayedColumns' action='/Displayed Columns'>\n"
2947 " <menuitem name='Display All' action='/Displayed Columns/Display All'/>\n"
2949 " <menuitem name='HideColumn' action='/Hide Column'/>\n"
2950 " <menuitem name='RemoveColumn' action='/Remove Column'/>\n"
2954 static const GtkActionEntry packet_list_heading_menu_popup_action_entries[] = {
2955 { "/Sort Ascending", GTK_STOCK_SORT_ASCENDING, "Sort Ascending", NULL, NULL, G_CALLBACK(sort_ascending_cb) },
2956 { "/Sort Descending", GTK_STOCK_SORT_DESCENDING, "Sort Descending", NULL, NULL, G_CALLBACK(sort_descending_cb) },
2957 { "/No Sorting", NULL, "No Sorting", NULL, NULL, G_CALLBACK(no_sorting_cb) },
2958 { "/Align Left", GTK_STOCK_JUSTIFY_LEFT, "Align Left", NULL, NULL, G_CALLBACK(packet_list_heading_align_left_cb) },
2959 { "/Align Center", GTK_STOCK_JUSTIFY_CENTER, "Align Center", NULL, NULL, G_CALLBACK(packet_list_heading_align_center_cb) },
2960 { "/Align Right", GTK_STOCK_JUSTIFY_RIGHT, "Align Right", NULL, NULL, G_CALLBACK(packet_list_heading_align_right_cb) },
2961 { "/Column Preferences", GTK_STOCK_PREFERENCES, "Column Preferences...", NULL, NULL, G_CALLBACK(packet_list_heading_col_pref_cb) },
2962 { "/Edit Column Details", WIRESHARK_STOCK_EDIT, "Edit Column Details...", NULL, NULL, G_CALLBACK(packet_list_heading_change_col_cb) },
2963 { "/Resize Column", WIRESHARK_STOCK_RESIZE_COLUMNS, "Resize Column", NULL, NULL, G_CALLBACK(packet_list_heading_resize_col_cb) },
2964 { "/Displayed Columns", NULL, "Displayed Columns", NULL, NULL, NULL },
2965 { "/Displayed Columns/Display All", NULL, "Display All", NULL, NULL, G_CALLBACK(packet_list_heading_activate_all_columns_cb) },
2966 { "/Hide Column", NULL, "Hide Column", NULL, NULL, G_CALLBACK(packet_list_heading_hide_col_cb) },
2967 { "/Remove Column", GTK_STOCK_DELETE, "Remove Column", NULL, NULL, G_CALLBACK(packet_list_heading_remove_col_cb) },
2970 static const GtkToggleActionEntry packet_list_heading_menu_toggle_action_entries[] =
2972 /* name, stock id, label, accel, tooltip, callback, is_active */
2973 {"/Show Resolved", NULL, "Show Resolved", NULL, NULL, G_CALLBACK(packet_list_heading_show_resolved_cb), FALSE},
2976 static const char *ui_desc_packet_list_menu_popup =
2978 " <popup name='PacketListMenuPopup' action='PopupAction'>\n"
2979 " <menuitem name='MarkPacket' action='/MarkPacket'/>\n"
2980 " <menuitem name='IgnorePacket' action='/IgnorePacket'/>\n"
2981 " <menuitem name='SetTimeReference' action='/Set Time Reference'/>\n"
2982 " <menuitem name='TimeShift' action='/TimeShift'/>\n"
2984 " <menuitem name='ManuallyResolveAddress' action='/ManuallyResolveAddress'/>\n"
2986 " <menu name= 'ApplyAsFilter' action='/Apply as Filter'>\n"
2987 " <menuitem name='Selected' action='/Apply as Filter/Selected'/>\n"
2988 " <menuitem name='NotSelected' action='/Apply as Filter/Not Selected'/>\n"
2989 " <menuitem name='AndSelected' action='/Apply as Filter/AndSelected'/>\n"
2990 " <menuitem name='OrSelected' action='/Apply as Filter/OrSelected'/>\n"
2991 " <menuitem name='AndNotSelected' action='/Apply as Filter/AndNotSelected'/>\n"
2992 " <menuitem name='OrNotSelected' action='/Apply as Filter/OrNotSelected'/>\n"
2994 " <menu name= 'PrepareaFilter' action='/Prepare a Filter'>\n"
2995 " <menuitem name='Selected' action='/Prepare a Filter/Selected'/>\n"
2996 " <menuitem name='NotSelected' action='/Prepare a Filter/Not Selected'/>\n"
2997 " <menuitem name='AndSelected' action='/Prepare a Filter/AndSelected'/>\n"
2998 " <menuitem name='OrSelected' action='/Prepare a Filter/OrSelected'/>\n"
2999 " <menuitem name='AndNotSelected' action='/Prepare a Filter/AndNotSelected'/>\n"
3000 " <menuitem name='OrNotSelected' action='/Prepare a Filter/OrNotSelected'/>\n"
3002 " <menu name= 'ConversationFilter' action='/Conversation Filter'>\n"
3003 " <menuitem name='Ethernet' action='/Conversation Filter/Ethernet'/>\n"
3004 " <menuitem name='IP' action='/Conversation Filter/IP'/>\n"
3005 " <menuitem name='TCP' action='/Conversation Filter/TCP'/>\n"
3006 " <menuitem name='UDP' action='/Conversation Filter/UDP'/>\n"
3007 " <menuitem name='PN-CBA' action='/Conversation Filter/PN-CBA'/>\n"
3009 " <menu name= 'ColorizeConversation' action='/Colorize Conversation'>\n"
3010 " <menu name= 'Ethernet' action='/Colorize Conversation/Ethernet'>\n"
3011 " <menuitem name='Color1' action='/Colorize Conversation/Ethernet/Color 1'/>\n"
3012 " <menuitem name='Color2' action='/Colorize Conversation/Ethernet/Color 2'/>\n"
3013 " <menuitem name='Color3' action='/Colorize Conversation/Ethernet/Color 3'/>\n"
3014 " <menuitem name='Color4' action='/Colorize Conversation/Ethernet/Color 4'/>\n"
3015 " <menuitem name='Color5' action='/Colorize Conversation/Ethernet/Color 5'/>\n"
3016 " <menuitem name='Color6' action='/Colorize Conversation/Ethernet/Color 6'/>\n"
3017 " <menuitem name='Color7' action='/Colorize Conversation/Ethernet/Color 7'/>\n"
3018 " <menuitem name='Color8' action='/Colorize Conversation/Ethernet/Color 8'/>\n"
3019 " <menuitem name='Color9' action='/Colorize Conversation/Ethernet/Color 9'/>\n"
3020 " <menuitem name='Color10' action='/Colorize Conversation/Ethernet/Color 10'/>\n"
3021 " <menuitem name='NewColoringRule' action='/Colorize Conversation/Ethernet/New Coloring Rule'/>\n"
3023 " <menu name= 'IP' action='/Colorize Conversation/IP'>\n"
3024 " <menuitem name='Color1' action='/Colorize Conversation/IP/Color 1'/>\n"
3025 " <menuitem name='Color2' action='/Colorize Conversation/IP/Color 2'/>\n"
3026 " <menuitem name='Color3' action='/Colorize Conversation/IP/Color 3'/>\n"
3027 " <menuitem name='Color4' action='/Colorize Conversation/IP/Color 4'/>\n"
3028 " <menuitem name='Color5' action='/Colorize Conversation/IP/Color 5'/>\n"
3029 " <menuitem name='Color6' action='/Colorize Conversation/IP/Color 6'/>\n"
3030 " <menuitem name='Color7' action='/Colorize Conversation/IP/Color 7'/>\n"
3031 " <menuitem name='Color8' action='/Colorize Conversation/IP/Color 8'/>\n"
3032 " <menuitem name='Color9' action='/Colorize Conversation/IP/Color 9'/>\n"
3033 " <menuitem name='Color10' action='/Colorize Conversation/IP/Color 10'/>\n"
3034 " <menuitem name='NewColoringRule' action='/Colorize Conversation/IP/New Coloring Rule'/>\n"
3036 " <menu name= 'TCP' action='/Colorize Conversation/TCP'>\n"
3037 " <menuitem name='Color1' action='/Colorize Conversation/TCP/Color 1'/>\n"
3038 " <menuitem name='Color2' action='/Colorize Conversation/TCP/Color 2'/>\n"
3039 " <menuitem name='Color3' action='/Colorize Conversation/TCP/Color 3'/>\n"
3040 " <menuitem name='Color4' action='/Colorize Conversation/TCP/Color 4'/>\n"
3041 " <menuitem name='Color5' action='/Colorize Conversation/TCP/Color 5'/>\n"
3042 " <menuitem name='Color6' action='/Colorize Conversation/TCP/Color 6'/>\n"
3043 " <menuitem name='Color7' action='/Colorize Conversation/TCP/Color 7'/>\n"
3044 " <menuitem name='Color8' action='/Colorize Conversation/TCP/Color 8'/>\n"
3045 " <menuitem name='Color9' action='/Colorize Conversation/TCP/Color 9'/>\n"
3046 " <menuitem name='Color10' action='/Colorize Conversation/TCP/Color 10'/>\n"
3047 " <menuitem name='NewColoringRule' action='/Colorize Conversation/TCP/New Coloring Rule'/>\n"
3049 " <menu name= 'UDP' action='/Colorize Conversation/UDP'>\n"
3050 " <menuitem name='Color1' action='/Colorize Conversation/UDP/Color 1'/>\n"
3051 " <menuitem name='Color2' action='/Colorize Conversation/UDP/Color 2'/>\n"
3052 " <menuitem name='Color3' action='/Colorize Conversation/UDP/Color 3'/>\n"
3053 " <menuitem name='Color4' action='/Colorize Conversation/UDP/Color 4'/>\n"
3054 " <menuitem name='Color5' action='/Colorize Conversation/UDP/Color 5'/>\n"
3055 " <menuitem name='Color6' action='/Colorize Conversation/UDP/Color 6'/>\n"
3056 " <menuitem name='Color7' action='/Colorize Conversation/UDP/Color 7'/>\n"
3057 " <menuitem name='Color8' action='/Colorize Conversation/UDP/Color 8'/>\n"
3058 " <menuitem name='Color9' action='/Colorize Conversation/UDP/Color 9'/>\n"
3059 " <menuitem name='Color10' action='/Colorize Conversation/UDP/Color 10'/>\n"
3060 " <menuitem name='NewColoringRule' action='/Colorize Conversation/UDP/New Coloring Rule'/>\n"
3062 " <menu name= 'PN-CBA' action='/Colorize Conversation/PN-CBA'>\n"
3063 " <menuitem name='Color1' action='/Colorize Conversation/PN-CBA/Color 1'/>\n"
3064 " <menuitem name='Color2' action='/Colorize Conversation/PN-CBA/Color 2'/>\n"
3065 " <menuitem name='Color3' action='/Colorize Conversation/PN-CBA/Color 3'/>\n"
3066 " <menuitem name='Color4' action='/Colorize Conversation/PN-CBA/Color 4'/>\n"
3067 " <menuitem name='Color5' action='/Colorize Conversation/PN-CBA/Color 5'/>\n"
3068 " <menuitem name='Color6' action='/Colorize Conversation/PN-CBA/Color 6'/>\n"
3069 " <menuitem name='Color7' action='/Colorize Conversation/PN-CBA/Color 7'/>\n"
3070 " <menuitem name='Color8' action='/Colorize Conversation/PN-CBA/Color 8'/>\n"
3071 " <menuitem name='Color9' action='/Colorize Conversation/PN-CBA/Color 9'/>\n"
3072 " <menuitem name='Color10' action='/Colorize Conversation/PN-CBA/Color 10'/>\n"
3073 " <menuitem name='NewColoringRule' action='/Colorize Conversation/PN-CBA/New Coloring Rule'/>\n"
3076 " <menu name= 'SCTP' action='/SCTP'>\n"
3077 " <menuitem name='AnalysethisAssociation' action='/SCTP/Analyse this Association'/>\n"
3078 " <menuitem name='PrepareFilterforthisAssociation' action='/SCTP/Prepare Filter for this Association'/>\n"
3080 " <menuitem name='FollowTCPStream' action='/Follow TCP Stream'/>\n"
3081 " <menuitem name='FollowUDPStream' action='/Follow UDP Stream'/>\n"
3082 " <menuitem name='FollowSSLStream' action='/Follow SSL Stream'/>\n"
3084 " <menu name= 'Copy' action='/Copy'>\n"
3085 " <menuitem name='SummaryTxt' action='/Copy/SummaryTxt'/>\n"
3086 " <menuitem name='SummaryCSV' action='/Copy/SummaryCSV'/>\n"
3087 " <menuitem name='AsFilter' action='/Copy/AsFilter'/>\n"
3089 " <menu name= 'Bytes' action='/Copy/Bytes'>\n"
3090 " <menuitem name='OffsetHexText' action='/Copy/Bytes/OffsetHexText'/>\n"
3091 " <menuitem name='OffsetHex' action='/Copy/Bytes/OffsetHex'/>\n"
3092 " <menuitem name='PrintableTextOnly' action='/Copy/Bytes/PrintableTextOnly'/>\n"
3094 " <menuitem name='HexStream' action='/Copy/Bytes/HexStream'/>\n"
3095 " <menuitem name='BinaryStream' action='/Copy/Bytes/BinaryStream'/>\n"
3099 " <menuitem name='DecodeAs' action='/DecodeAs'/>\n"
3100 " <menuitem name='Print' action='/Print'/>\n"
3101 " <menuitem name='ShowPacketinNewWindow' action='/ShowPacketinNewWindow'/>\n"
3105 static const GtkActionEntry packet_list_menu_popup_action_entries[] = {
3106 { "/MarkPacket", NULL, "Mark Packet (toggle)", NULL, NULL, G_CALLBACK(new_packet_list_mark_frame_cb) },
3107 { "/IgnorePacket", NULL, "Ignore Packet (toggle)", NULL, NULL, G_CALLBACK(new_packet_list_ignore_frame_cb) },
3108 { "/Set Time Reference", WIRESHARK_STOCK_TIME, "Set Time Reference (toggle)", NULL, NULL, G_CALLBACK(packet_list_menu_set_ref_time_cb) },
3109 { "/TimeShift", WIRESHARK_STOCK_TIME, "Time Shift...", NULL, NULL, G_CALLBACK(time_shift_cb) },
3110 { "/ManuallyResolveAddress", NULL, "Manually Resolve Address", NULL, NULL, G_CALLBACK(manual_addr_resolv_dlg) },
3111 { "/Apply as Filter", NULL, "Apply as Filter", NULL, NULL, NULL },
3113 { "/Apply as Filter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(packet_list_menu_apply_selected_cb) },
3114 { "/Apply as Filter/Not Selected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_apply_not_selected_cb) },
3115 { "/Apply as Filter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(packet_list_menu_apply_and_selected_cb) },
3116 { "/Apply as Filter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(packet_list_menu_apply_or_selected_cb) },
3117 { "/Apply as Filter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_apply_and_not_selected_cb) },
3118 { "/Apply as Filter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_apply_or_not_selected_cb) },
3120 { "/Prepare a Filter", NULL, "Prepare a Filter", NULL, NULL, NULL },
3121 { "/Prepare a Filter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(packet_list_menu_prepare_selected_cb) },
3122 { "/Prepare a Filter/Not Selected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_prepare_not_selected_cb) },
3123 { "/Prepare a Filter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(packet_list_menu_prepare_and_selected_cb) },
3124 { "/Prepare a Filter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(packet_list_menu_prepare_or_selected_cb) },
3125 { "/Prepare a Filter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_prepare_and_not_selected_cb) },
3126 { "/Prepare a Filter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(packet_list_menu_prepare_or_not_selected_cb) },
3128 { "/Conversation Filter", NULL, "Conversation Filter", NULL, NULL, NULL },
3129 { "/Conversation Filter/Ethernet", NULL, "Ethernet", NULL, NULL, G_CALLBACK(packet_list_menu_conversation_ethernet_cb) },
3130 { "/Conversation Filter/IP", NULL, "IP", NULL, NULL, G_CALLBACK(packet_list_menu_conversation_ip_cb) },
3131 { "/Conversation Filter/TCP", NULL, "TCP", NULL, NULL, G_CALLBACK(packet_list_menu_conversation_tcp_cb) },
3132 { "/Conversation Filter/UDP", NULL, "UDP", NULL, NULL, G_CALLBACK(packet_list_menu_conversation_udp_cb) },
3133 { "/Conversation Filter/PN-CBA", NULL, "PN-CBA", NULL, NULL, G_CALLBACK(packet_list_menu_conversation_pn_cba_cb) },
3135 { "/Colorize Conversation", NULL, "Colorize Conversation", NULL, NULL, NULL },
3137 { "/Colorize Conversation/Ethernet", NULL, "Ethernet", NULL, NULL, NULL },
3139 { "/Colorize Conversation/Ethernet/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color1_cb) },
3140 { "/Colorize Conversation/Ethernet/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color2_cb) },
3141 { "/Colorize Conversation/Ethernet/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color3_cb) },
3142 { "/Colorize Conversation/Ethernet/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color4_cb) },
3143 { "/Colorize Conversation/Ethernet/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color5_cb) },
3144 { "/Colorize Conversation/Ethernet/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color6_cb) },
3145 { "/Colorize Conversation/Ethernet/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color7_cb) },
3146 { "/Colorize Conversation/Ethernet/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color8_cb) },
3147 { "/Colorize Conversation/Ethernet/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color9_cb) },
3148 { "/Colorize Conversation/Ethernet/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_color10_cb) },
3149 { "/Colorize Conversation/Ethernet/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ethernet_new_rule_cb) },
3151 { "/Colorize Conversation/IP", NULL, "IP", NULL, NULL, NULL },
3153 { "/Colorize Conversation/IP/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color1_cb) },
3154 { "/Colorize Conversation/IP/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color2_cb) },
3155 { "/Colorize Conversation/IP/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color3_cb) },
3156 { "/Colorize Conversation/IP/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color4_cb) },
3157 { "/Colorize Conversation/IP/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color5_cb) },
3158 { "/Colorize Conversation/IP/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color6_cb) },
3159 { "/Colorize Conversation/IP/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color7_cb) },
3160 { "/Colorize Conversation/IP/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color8_cb) },
3161 { "/Colorize Conversation/IP/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color9_cb) },
3162 { "/Colorize Conversation/IP/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_color10_cb) },
3163 { "/Colorize Conversation/IP/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_ip_new_rule_cb) },
3165 { "/Colorize Conversation/TCP", NULL, "TCP", NULL, NULL, NULL },
3167 { "/Colorize Conversation/TCP/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color1_cb) },
3168 { "/Colorize Conversation/TCP/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color2_cb) },
3169 { "/Colorize Conversation/TCP/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color3_cb) },
3170 { "/Colorize Conversation/TCP/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color4_cb) },
3171 { "/Colorize Conversation/TCP/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color5_cb) },
3172 { "/Colorize Conversation/TCP/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color6_cb) },
3173 { "/Colorize Conversation/TCP/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color7_cb) },
3174 { "/Colorize Conversation/TCP/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color8_cb) },
3175 { "/Colorize Conversation/TCP/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color9_cb) },
3176 { "/Colorize Conversation/TCP/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_color10_cb) },
3177 { "/Colorize Conversation/TCP/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_tcp_new_rule_cb) },
3179 { "/Colorize Conversation/UDP", NULL, "UDP", NULL, NULL, NULL },
3181 { "/Colorize Conversation/UDP/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color1_cb) },
3182 { "/Colorize Conversation/UDP/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color2_cb) },
3183 { "/Colorize Conversation/UDP/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color3_cb) },
3184 { "/Colorize Conversation/UDP/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color4_cb) },
3185 { "/Colorize Conversation/UDP/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color5_cb) },
3186 { "/Colorize Conversation/UDP/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color6_cb) },
3187 { "/Colorize Conversation/UDP/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color7_cb) },
3188 { "/Colorize Conversation/UDP/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color8_cb) },
3189 { "/Colorize Conversation/UDP/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color9_cb) },
3190 { "/Colorize Conversation/UDP/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_color10_cb) },
3191 { "/Colorize Conversation/UDP/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_udp_new_rule_cb) },
3193 { "/Colorize Conversation/PN-CBA", NULL, "PN-CBA Server", NULL, NULL, NULL },
3195 { "/Colorize Conversation/PN-CBA/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color1_cb) },
3196 { "/Colorize Conversation/PN-CBA/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color2_cb) },
3197 { "/Colorize Conversation/PN-CBA/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color3_cb) },
3198 { "/Colorize Conversation/PN-CBA/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color4_cb) },
3199 { "/Colorize Conversation/PN-CBA/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color5_cb) },
3200 { "/Colorize Conversation/PN-CBA/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color6_cb) },
3201 { "/Colorize Conversation/PN-CBA/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color7_cb) },
3202 { "/Colorize Conversation/PN-CBA/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color8_cb) },
3203 { "/Colorize Conversation/PN-CBA/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color9_cb) },
3204 { "/Colorize Conversation/PN-CBA/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_color10_cb) },
3205 { "/Colorize Conversation/PN-CBA/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(packet_list_menu_color_conv_cba_new_rule_cb) },
3207 { "/SCTP", NULL, "SCTP", NULL, NULL, NULL },
3208 { "/SCTP/Analyse this Association", NULL, "Analyse this Association", NULL, NULL, G_CALLBACK(sctp_analyse_start) },
3209 { "/SCTP/Prepare Filter for this Association", NULL, "Prepare Filter for this Association", NULL, NULL, G_CALLBACK(sctp_set_assoc_filter) },
3212 { "/Follow TCP Stream", NULL, "Follow TCP Stream", NULL, NULL, G_CALLBACK(follow_tcp_stream_cb) },
3213 { "/Follow UDP Stream", NULL, "Follow UDP Stream", NULL, NULL, G_CALLBACK(follow_udp_stream_cb) },
3214 { "/Follow SSL Stream", NULL, "Follow SSL Stream", NULL, NULL, G_CALLBACK(follow_ssl_stream_cb) },
3216 { "/Copy", NULL, "Copy", NULL, NULL, NULL },
3217 { "/Copy/SummaryTxt", NULL, "Summary (Text)", NULL, NULL, G_CALLBACK(packet_list_menu_copy_sum_txt) },
3218 { "/Copy/SummaryCSV", NULL, "Summary (CSV)", NULL, NULL, G_CALLBACK(packet_list_menu_copy_sum_csv) },
3219 { "/Copy/AsFilter", NULL, "As Filter", NULL, NULL, G_CALLBACK(packet_list_menu_copy_as_flt) },
3222 { "/Copy/Bytes", NULL, "Bytes", NULL, NULL, NULL },
3223 { "/Copy/Bytes/OffsetHexText", NULL, "Offset Hex Text", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oht_cb) },
3224 { "/Copy/Bytes/OffsetHex", NULL, "Offset Hex", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oh_cb) },
3225 { "/Copy/Bytes/PrintableTextOnly", NULL, "Printable Text Only", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_text_cb) },
3227 { "/Copy/Bytes/HexStream", NULL, "Hex Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_hex_strm_cb) },
3228 { "/Copy/Bytes/BinaryStream", NULL, "Binary Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_bin_strm_cb) },
3230 { "/DecodeAs", WIRESHARK_STOCK_DECODE_AS, "Decode As...", NULL, NULL, G_CALLBACK(decode_as_cb) },
3231 { "/Print", GTK_STOCK_PRINT, "Print...", NULL, NULL, G_CALLBACK(file_print_selected_cmd_cb) },
3232 { "/ShowPacketinNewWindow", NULL, "Show Packet in New Window", NULL, NULL, G_CALLBACK(new_window_cb) },
3236 static const char *ui_desc_tree_view_menu_popup =
3238 " <popup name='TreeViewPopup' action='PopupAction'>\n"
3239 " <menuitem name='ExpandSubtrees' action='/ExpandSubtrees'/>\n"
3240 " <menuitem name='ExpandAll' action='/ExpandAll'/>\n"
3241 " <menuitem name='CollapseAll' action='/CollapseAll'/>\n"
3243 " <menuitem name='ApplyasColumn' action='/Apply as Column'/>\n"
3245 " <menu name= 'ApplyAsFilter' action='/Apply as Filter'>\n"
3246 " <menuitem name='Selected' action='/Apply as Filter/Selected'/>\n"
3247 " <menuitem name='NotSelected' action='/Apply as Filter/Not Selected'/>\n"
3248 " <menuitem name='AndSelected' action='/Apply as Filter/AndSelected'/>\n"
3249 " <menuitem name='OrSelected' action='/Apply as Filter/OrSelected'/>\n"
3250 " <menuitem name='AndNotSelected' action='/Apply as Filter/AndNotSelected'/>\n"
3251 " <menuitem name='OrNotSelected' action='/Apply as Filter/OrNotSelected'/>\n"
3253 " <menu name= 'PrepareaFilter' action='/Prepare a Filter'>\n"
3254 " <menuitem name='Selected' action='/Prepare a Filter/Selected'/>\n"
3255 " <menuitem name='NotSelected' action='/Prepare a Filter/Not Selected'/>\n"
3256 " <menuitem name='AndSelected' action='/Prepare a Filter/AndSelected'/>\n"
3257 " <menuitem name='OrSelected' action='/Prepare a Filter/OrSelected'/>\n"
3258 " <menuitem name='AndNotSelected' action='/Prepare a Filter/AndNotSelected'/>\n"
3259 " <menuitem name='OrNotSelected' action='/Prepare a Filter/OrNotSelected'/>\n"
3261 " <menu name= 'ColorizewithFilter' action='/Colorize with Filter'>\n"
3262 " <menuitem name='Color1' action='/Colorize with Filter/Color 1'/>\n"
3263 " <menuitem name='Color2' action='/Colorize with Filter/Color 2'/>\n"
3264 " <menuitem name='Color3' action='/Colorize with Filter/Color 3'/>\n"
3265 " <menuitem name='Color4' action='/Colorize with Filter/Color 4'/>\n"
3266 " <menuitem name='Color5' action='/Colorize with Filter/Color 5'/>\n"
3267 " <menuitem name='Color6' action='/Colorize with Filter/Color 6'/>\n"
3268 " <menuitem name='Color7' action='/Colorize with Filter/Color 7'/>\n"
3269 " <menuitem name='Color8' action='/Colorize with Filter/Color 8'/>\n"
3270 " <menuitem name='Color9' action='/Colorize with Filter/Color 9'/>\n"
3271 " <menuitem name='Color10' action='/Colorize with Filter/Color 10'/>\n"
3272 " <menuitem name='NewColoringRule' action='/Colorize with Filter/New Coloring Rule'/>\n"
3274 " <menuitem name='FollowTCPStream' action='/Follow TCP Stream'/>\n"
3275 " <menuitem name='FollowUDPStream' action='/Follow UDP Stream'/>\n"
3276 " <menuitem name='FollowSSLStream' action='/Follow SSL Stream'/>\n"
3278 " <menu name= 'Copy' action='/Copy'>\n"
3279 " <menuitem name='Description' action='/Copy/Description'/>\n"
3280 " <menuitem name='Fieldname' action='/Copy/Fieldname'/>\n"
3281 " <menuitem name='Value' action='/Copy/Value'/>\n"
3283 " <menuitem name='AsFilter' action='/Copy/AsFilter'/>\n"
3285 " <menu name= 'Bytes' action='/Copy/Bytes'>\n"
3286 " <menuitem name='OffsetHexText' action='/Copy/Bytes/OffsetHexText'/>\n"
3287 " <menuitem name='OffsetHex' action='/Copy/Bytes/OffsetHex'/>\n"
3288 " <menuitem name='PrintableTextOnly' action='/Copy/Bytes/PrintableTextOnly'/>\n"
3290 " <menuitem name='HexStream' action='/Copy/Bytes/HexStream'/>\n"
3291 " <menuitem name='BinaryStream' action='/Copy/Bytes/BinaryStream'/>\n"
3294 " <menuitem name='ExportSelectedPacketBytes' action='/ExportSelectedPacketBytes'/>\n"
3296 " <menuitem name='WikiProtocolPage' action='/WikiProtocolPage'/>\n"
3297 " <menuitem name='FilterFieldReference' action='/FilterFieldReference'/>\n"
3298 " <menuitem name='ProtocolHelp' action='/ProtocolHelp'/>\n"
3299 " <menuitem name='ProtocolPreferences' action='/ProtocolPreferences'/>\n"
3301 " <menuitem name='DecodeAs' action='/DecodeAs'/>\n"
3302 " <menuitem name='DisableProtocol' action='/DisableProtocol'/>\n"
3303 " <menuitem name='ResolveName' action='/ResolveName'/>\n"
3304 " <menuitem name='GotoCorrespondingPacket' action='/GotoCorrespondingPacket'/>\n"
3308 static const GtkActionEntry tree_view_menu_popup_action_entries[] = {
3309 { "/ExpandSubtrees", NULL, "Expand Subtrees", NULL, NULL, G_CALLBACK(expand_tree_cb) },
3310 { "/ExpandAll", NULL, "Expand All", NULL, NULL, G_CALLBACK(expand_all_cb) },
3311 { "/CollapseAll", NULL, "Collapse All", NULL, NULL, G_CALLBACK(collapse_all_cb) },
3312 { "/Apply as Column", NULL, "Apply as Column", NULL, NULL, G_CALLBACK(apply_as_custom_column_cb) },
3313 { "/Apply as Filter", NULL, "Apply as Filter", NULL, NULL, NULL },
3315 { "/Apply as Filter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(tree_view_menu_apply_selected_cb) },
3316 { "/Apply as Filter/Not Selected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_not_selected_cb) },
3317 { "/Apply as Filter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_and_selected_cb) },
3318 { "/Apply as Filter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_or_selected_cb) },
3319 { "/Apply as Filter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_and_not_selected_cb) },
3320 { "/Apply as Filter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_apply_or_not_selected_cb) },
3322 { "/Prepare a Filter", NULL, "Prepare a Filter", NULL, NULL, NULL },
3323 { "/Prepare a Filter/Selected", NULL, "_Selected" , NULL, NULL, G_CALLBACK(tree_view_menu_prepare_selected_cb) },
3324 { "/Prepare a Filter/Not Selected", NULL, "_Not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_not_selected_cb) },
3325 { "/Prepare a Filter/AndSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _and Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_and_selected_cb) },
3326 { "/Prepare a Filter/OrSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " _or Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_or_selected_cb) },
3327 { "/Prepare a Filter/AndNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " a_nd not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_and_not_selected_cb) },
3328 { "/Prepare a Filter/OrNotSelected", NULL, UTF8_HORIZONTAL_ELLIPSIS " o_r not Selected", NULL, NULL, G_CALLBACK(tree_view_menu_prepare_or_not_selected_cb) },
3330 { "/Colorize with Filter", NULL, "Colorize with Filter", NULL, NULL, NULL },
3331 { "/Colorize with Filter/Color 1", WIRESHARK_STOCK_COLOR1, "Color 1", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color1_cb) },
3332 { "/Colorize with Filter/Color 2", WIRESHARK_STOCK_COLOR2, "Color 2", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color2_cb) },
3333 { "/Colorize with Filter/Color 3", WIRESHARK_STOCK_COLOR3, "Color 3", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color3_cb) },
3334 { "/Colorize with Filter/Color 4", WIRESHARK_STOCK_COLOR4, "Color 4", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color4_cb) },
3335 { "/Colorize with Filter/Color 5", WIRESHARK_STOCK_COLOR5, "Color 5", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color5_cb) },
3336 { "/Colorize with Filter/Color 6", WIRESHARK_STOCK_COLOR6, "Color 6", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color6_cb) },
3337 { "/Colorize with Filter/Color 7", WIRESHARK_STOCK_COLOR7, "Color 7", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color7_cb) },
3338 { "/Colorize with Filter/Color 8", WIRESHARK_STOCK_COLOR8, "Color 8", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color8_cb) },
3339 { "/Colorize with Filter/Color 9", WIRESHARK_STOCK_COLOR9, "Color 9", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color9_cb) },
3340 { "/Colorize with Filter/Color 10", WIRESHARK_STOCK_COLOR0, "Color 10", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_color10_cb) },
3341 { "/Colorize with Filter/New Coloring Rule", NULL, "New Coloring Rule...", NULL, NULL, G_CALLBACK(tree_view_menu_color_with_flt_new_rule_cb) },
3343 { "/Follow TCP Stream", NULL, "Follow TCP Stream", NULL, NULL, G_CALLBACK(follow_tcp_stream_cb) },
3344 { "/Follow UDP Stream", NULL, "Follow UDP Stream", NULL, NULL, G_CALLBACK(follow_udp_stream_cb) },
3345 { "/Follow SSL Stream", NULL, "Follow SSL Stream", NULL, NULL, G_CALLBACK(follow_ssl_stream_cb) },
3347 { "/Copy", NULL, "Copy", NULL, NULL, NULL },
3348 { "/Copy/Description", NULL, "Description", NULL, NULL, G_CALLBACK(tree_view_menu_copy_desc) },
3349 { "/Copy/Fieldname", NULL, "Fieldname", NULL, NULL, G_CALLBACK(tree_view_menu_copy_field) },
3350 { "/Copy/Value", NULL, "Value", NULL, NULL, G_CALLBACK(tree_view_menu_copy_value) },
3352 { "/Copy/AsFilter", NULL, "As Filter", NULL, NULL, G_CALLBACK(tree_view_menu_copy_as_flt) },
3354 { "/Copy/Bytes", NULL, "Bytes", NULL, NULL, NULL },
3355 { "/Copy/Bytes/OffsetHexText", NULL, "Offset Hex Text", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oht_cb) },
3356 { "/Copy/Bytes/OffsetHex", NULL, "Offset Hex", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_oh_cb) },
3357 { "/Copy/Bytes/PrintableTextOnly", NULL, "Printable Text Only", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_text_cb) },
3359 { "/Copy/Bytes/HexStream", NULL, "Hex Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_hex_strm_cb) },
3360 { "/Copy/Bytes/BinaryStream", NULL, "Binary Stream", NULL, NULL, G_CALLBACK(packet_list_menu_copy_bytes_bin_strm_cb) },
3362 { "/ExportSelectedPacketBytes", NULL, "Export Selected Packet Bytes...", NULL, NULL, G_CALLBACK(savehex_cb) },
3364 { "/WikiProtocolPage", WIRESHARK_STOCK_WIKI, "Wiki Protocol Page", NULL, NULL, G_CALLBACK(selected_ptree_info_cb) },
3365 { "/FilterFieldReference", WIRESHARK_STOCK_INTERNET, "Filter Field Reference", NULL, NULL, G_CALLBACK(selected_ptree_ref_cb) },
3366 { "/ProtocolHelp", NULL, "Protocol Help", NULL, NULL, NULL },
3367 { "/ProtocolPreferences", NULL, "Protocol Preferences", NULL, NULL, NULL },
3368 { "/DecodeAs", WIRESHARK_STOCK_DECODE_AS, "Decode As...", NULL, NULL, G_CALLBACK(decode_as_cb) },
3369 { "/DisableProtocol", WIRESHARK_STOCK_CHECKBOX, "Disable Protocol...", NULL, NULL, G_CALLBACK(proto_disable_cb) },
3370 { "/ResolveName", NULL, "_Resolve Name", NULL, NULL, G_CALLBACK(resolve_name_cb) },
3371 { "/GotoCorrespondingPacket", NULL, "_Go to Corresponding Packet", NULL, NULL, G_CALLBACK(goto_framenum_cb) },
3374 static const char *ui_desc_bytes_menu_popup =
3376 " <popup name='BytesMenuPopup' action='PopupAction'>\n"
3377 " <menuitem name='HexView' action='/HexView'/>\n"
3378 " <menuitem name='BitsView' action='/BitsView'/>\n"
3381 static const GtkRadioActionEntry bytes_menu_radio_action_entries [] =
3383 /* name, stock id, label, accel, tooltip, value */
3384 { "/HexView", NULL, "Hex View", NULL, NULL, BYTES_HEX },
3385 { "/BitsView", NULL, "Bits View", NULL, NULL, BYTES_BITS },
3388 static const char *ui_statusbar_profiles_menu_popup =
3390 " <popup name='ProfilesMenuPopup' action='PopupAction'>\n"
3391 " <menuitem name='Profiles' action='/Profiles'/>\n"
3393 " <menuitem name='New' action='/New'/>\n"
3394 " <menuitem name='Edit' action='/Edit'/>\n"
3395 " <menuitem name='Delete' action='/Delete'/>\n"
3397 " <menu name='Change' action='/Change'>\n"
3398 " <menuitem name='Default' action='/Change/Default'/>\n"
3402 static const GtkActionEntry statusbar_profiles_menu_action_entries [] =
3404 { "/Profiles", NULL, "Configuration Profiles...", NULL, NULL, G_CALLBACK(profile_dialog_cb) },
3405 { "/New", GTK_STOCK_NEW, "New...", NULL, NULL, G_CALLBACK(profile_new_cb) },
3406 { "/Edit", GTK_STOCK_EDIT, "Edit...", NULL, NULL, G_CALLBACK(profile_edit_cb) },
3407 { "/Delete", GTK_STOCK_DELETE, "Delete", NULL, NULL, G_CALLBACK(profile_delete_cb) },
3408 { "/Change", NULL, "Change", NULL, NULL, NULL },
3409 { "/Change/Default", NULL, "Default", NULL, NULL, NULL },
3413 main_menu_new(GtkAccelGroup ** table) {
3415 #ifdef HAVE_IGE_MAC_INTEGRATION
3416 GtkWidget *quit_item, *about_item, *preferences_item;
3417 IgeMacMenuGroup *group;
3419 #ifdef HAVE_GTKOSXAPPLICATION
3420 GtkOSXApplication *theApp;
3422 GtkOSXApplicationMenuGroup *group;
3423 GtkWidget * dock_menu;
3426 grp = gtk_accel_group_new();
3431 #ifdef MAIN_MENU_USE_UIMANAGER
3432 menubar = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar");
3434 menubar = main_menu_factory->widget;
3436 #ifdef HAVE_IGE_MAC_INTEGRATION
3437 if(prefs.gui_macosx_style) {
3438 ige_mac_menu_set_menu_bar(GTK_MENU_SHELL(menubar));
3439 ige_mac_menu_set_global_key_handler_enabled(TRUE);
3441 /* Create menu items to populate the application menu with. We have to
3442 * do this because we are still using the old GtkItemFactory API for
3444 group = ige_mac_menu_add_app_menu_group();
3445 about_item = gtk_menu_item_new_with_label("About");
3446 g_signal_connect(about_item, "activate", G_CALLBACK(about_wireshark_cb),
3448 ige_mac_menu_add_app_menu_item(group, GTK_MENU_ITEM(about_item), NULL);
3450 group = ige_mac_menu_add_app_menu_group();
3451 preferences_item = gtk_menu_item_new_with_label("Preferences");
3452 g_signal_connect(preferences_item, "activate", G_CALLBACK(prefs_cb),
3454 ige_mac_menu_add_app_menu_item(group, GTK_MENU_ITEM(preferences_item),
3458 /* The quit item in the application menu shows up whenever ige mac
3459 * integration is enabled, even if the OS X UI style in Wireshark isn't
3461 quit_item = gtk_menu_item_new_with_label("Quit");
3462 g_signal_connect(quit_item, "activate", G_CALLBACK(file_quit_cmd_cb), NULL);
3463 ige_mac_menu_set_quit_menu_item(GTK_MENU_ITEM(quit_item));
3466 #ifdef HAVE_GTKOSXAPPLICATION
3467 theApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
3469 if(prefs.gui_macosx_style) {
3470 gtk_osxapplication_set_menu_bar(theApp, GTK_MENU_SHELL(menubar));
3471 gtk_osxapplication_set_use_quartz_accelerators(theApp, TRUE);
3473 group = gtk_osxapplication_add_app_menu_group (theApp);
3474 item = gtk_item_factory_get_item(main_menu_factory,"/Help/About Wireshark");
3475 gtk_osxapplication_add_app_menu_item(theApp, group,GTK_MENU_ITEM (item));
3477 group = gtk_osxapplication_add_app_menu_group (theApp);
3478 item = gtk_item_factory_get_item(main_menu_factory,"/Edit/Preferences...");
3479 gtk_osxapplication_add_app_menu_item(theApp, group,GTK_MENU_ITEM (item));
3481 group = gtk_osxapplication_add_app_menu_group (theApp);
3482 item = gtk_item_factory_get_item(main_menu_factory,"/Help");
3483 gtk_osxapplication_set_help_menu(theApp,GTK_MENU_ITEM(item));
3485 /* Quit item is not needed */
3486 gtk_item_factory_delete_item(main_menu_factory,"/File/Quit");
3489 /* generate dock menu */
3490 dock_menu = gtk_menu_new();
3492 item = gtk_menu_item_new_with_label("Start");
3493 g_signal_connect(item, "activate", G_CALLBACK (capture_start_cb), NULL);
3494 gtk_menu_shell_append(GTK_MENU_SHELL(dock_menu), item);
3496 item = gtk_menu_item_new_with_label("Stop");
3497 g_signal_connect(item, "activate", G_CALLBACK (capture_stop_cb), NULL);
3498 gtk_menu_shell_append(GTK_MENU_SHELL(dock_menu), item);
3500 item = gtk_menu_item_new_with_label("Restart");
3501 g_signal_connect(item, "activate", G_CALLBACK (capture_restart_cb), NULL);
3502 gtk_menu_shell_append(GTK_MENU_SHELL(dock_menu), item);
3504 gtk_osxapplication_set_dock_menu(theApp, GTK_MENU_SHELL(dock_menu));
3513 #ifdef MAIN_MENU_USE_UIMANAGER
3515 menu_dissector_filter_cb( GtkAction *action _U_, gpointer callback_data)
3519 menu_dissector_filter_cb( GtkWidget *widget _U_,
3520 gpointer callback_data,
3521 guint callback_action _U_)
3524 dissector_filter_t *filter_entry = callback_data;
3525 GtkWidget *filter_te;
3528 filter_te = gtk_bin_get_child(GTK_BIN(g_object_get_data(G_OBJECT(top_level), E_DFILTER_CM_KEY)));
3530 /* XXX - this gets the packet_info of the last dissected packet, */
3531 /* which is not necessarily the last selected packet */
3532 /* e.g. "Update list of packets in real time" won't work correct */
3533 buf = filter_entry->build_filter_string(&cfile.edt->pi);
3535 gtk_entry_set_text(GTK_ENTRY(filter_te), buf);
3537 /* Run the display filter so it goes in effect - even if it's the
3538 same as the previous display filter. */
3539 main_filter_packets(&cfile, buf, TRUE);
3541 g_free( (void *) buf);
3544 static gboolean menu_dissector_filter_spe_cb(frame_data *fd _U_, epan_dissect_t *edt, gpointer callback_data) {
3545 dissector_filter_t *filter_entry = callback_data;
3547 /* XXX - this gets the packet_info of the last dissected packet, */
3548 /* which is not necessarily the last selected packet */
3549 /* e.g. "Update list of packets in real time" won't work correct */
3550 return (edt != NULL) ? filter_entry->is_filter_valid(&edt->pi) : FALSE;
3553 static void menu_dissector_filter(void) {
3554 GList *list_entry = dissector_filter_list;
3555 dissector_filter_t *filter_entry;
3557 while(list_entry != NULL) {
3558 filter_entry = list_entry->data;
3560 #ifdef MAIN_MENU_USE_UIMANAGER
3561 register_stat_menu_item_stock(
3562 REGISTER_ANALYZE_GROUP_CONVERSATION_FILTER, /* Group */
3563 "/Menubar/AnalyzeMenu/ConversationFilterMenu/Filters", /* GUI path */
3564 filter_entry->name, /* Name */
3565 NULL, /* stock_id */
3566 filter_entry->name, /* label */
3567 NULL, /* accelerator */
3569 G_CALLBACK(menu_dissector_filter_cb), /* callback */
3570 FALSE, /* enabled */
3571 menu_dissector_filter_spe_cb, /* selected_packet_enabled */
3572 NULL, /* selected_tree_row_enabled */
3573 filter_entry); /* callback_data */
3575 register_stat_menu_item(filter_entry->name, REGISTER_ANALYZE_GROUP_CONVERSATION_FILTER,
3576 menu_dissector_filter_cb,
3577 menu_dissector_filter_spe_cb,
3578 NULL /* selected_tree_row_enabled */,
3582 list_entry = g_list_next(list_entry);
3589 GtkActionGroup *packet_list_heading_action_group, *packet_list_action_group,
3590 *packet_list_details_action_group, *packet_list_byte_menu_action_group,
3591 *statusbar_profiles_action_group;
3592 GError *error = NULL;
3593 #ifdef MAIN_MENU_USE_UIMANAGER
3595 #endif /* MAIN_MENU_USE_UIMANAGER */
3601 popup_menu_object = gtk_menu_new();
3603 /* packet list heading pop-up menu */
3604 packet_list_heading_action_group = gtk_action_group_new ("PacketListHeadingPopUpMenuActionGroup");
3606 gtk_action_group_add_actions (packet_list_heading_action_group, /* the action group */
3607 (gpointer)packet_list_heading_menu_popup_action_entries, /* an array of action descriptions */
3608 G_N_ELEMENTS(packet_list_heading_menu_popup_action_entries), /* the number of entries */
3609 popup_menu_object); /* data to pass to the action callbacks */
3611 gtk_action_group_add_toggle_actions(packet_list_heading_action_group, /* the action group */
3612 (gpointer)packet_list_heading_menu_toggle_action_entries, /* an array of action descriptions */
3613 G_N_ELEMENTS(packet_list_heading_menu_toggle_action_entries), /* the number of entries */
3614 NULL); /* data to pass to the action callbacks */
3616 ui_manager_packet_list_heading = gtk_ui_manager_new ();
3617 gtk_ui_manager_insert_action_group (ui_manager_packet_list_heading,
3618 packet_list_heading_action_group,
3619 0); /* the position at which the group will be inserted. */
3621 gtk_ui_manager_add_ui_from_string (ui_manager_packet_list_heading,ui_desc_packet_list_heading_menu_popup, -1, &error);
3624 fprintf (stderr, "Warning: building Packet List Heading Pop-Up failed: %s\n",
3626 g_error_free (error);
3630 g_object_set_data(G_OBJECT(popup_menu_object), PM_PACKET_LIST_COL_KEY,
3631 gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup"));
3633 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_packet_list_heading);
3635 /* packet list pop-up menu */
3636 packet_list_action_group = gtk_action_group_new ("PacketListPopUpMenuActionGroup");
3638 gtk_action_group_add_actions (packet_list_action_group, /* the action group */
3639 (gpointer)packet_list_menu_popup_action_entries, /* an array of action descriptions */
3640 G_N_ELEMENTS(packet_list_menu_popup_action_entries), /* the number of entries */
3641 popup_menu_object); /* data to pass to the action callbacks */
3643 ui_manager_packet_list_menu = gtk_ui_manager_new ();
3645 gtk_ui_manager_insert_action_group (ui_manager_packet_list_menu,
3646 packet_list_action_group,
3647 0); /* the position at which the group will be inserted. */
3649 gtk_ui_manager_add_ui_from_string (ui_manager_packet_list_menu, ui_desc_packet_list_menu_popup, -1, &error);
3652 fprintf (stderr, "Warning: building Packet List Pop-Up menu failed: %s\n",
3654 g_error_free (error);
3658 g_object_set_data(G_OBJECT(popup_menu_object), PM_PACKET_LIST_KEY,
3659 gtk_ui_manager_get_widget(ui_manager_packet_list_menu, "/PacketListMenuPopup"));
3661 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_packet_list_menu);
3664 /* packet detail pop-up menu */
3665 packet_list_details_action_group = gtk_action_group_new ("PacketListDetailsMenuPopUpActionGroup");
3667 gtk_action_group_add_actions (packet_list_details_action_group, /* the action group */
3668 (gpointer)tree_view_menu_popup_action_entries, /* an array of action descriptions */
3669 G_N_ELEMENTS(tree_view_menu_popup_action_entries), /* the number of entries */
3670 popup_menu_object); /* data to pass to the action callbacks */
3672 ui_manager_tree_view_menu = gtk_ui_manager_new ();
3674 gtk_ui_manager_insert_action_group (ui_manager_tree_view_menu,
3675 packet_list_details_action_group,
3676 0); /* the position at which the group will be inserted. */
3678 gtk_ui_manager_add_ui_from_string (ui_manager_tree_view_menu, ui_desc_tree_view_menu_popup, -1, &error);
3681 fprintf (stderr, "Warning: building TreeWiew Pop-Up menu failed: %s\n",
3683 g_error_free (error);
3687 g_object_set_data(G_OBJECT(popup_menu_object), PM_TREE_VIEW_KEY,
3688 gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup"));
3690 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_tree_view_menu);
3693 * Hex dump pop-up menu.
3694 * We provide our own empty menu to suppress the default pop-up menu
3697 packet_list_byte_menu_action_group = gtk_action_group_new ("PacketListByteMenuPopUpActionGroup");
3700 gtk_action_group_add_radio_actions (packet_list_byte_menu_action_group, /* the action group */
3701 (gpointer)bytes_menu_radio_action_entries, /* an array of radio action descriptions */
3702 G_N_ELEMENTS(bytes_menu_radio_action_entries), /* the number of entries */
3703 recent.gui_bytes_view, /* the value of the action to activate initially, or -1 if no action should be activated */
3704 G_CALLBACK(select_bytes_view_cb), /* the callback to connect to the changed signal */
3705 popup_menu_object); /* data to pass to the action callbacks */
3707 ui_manager_bytes_menu = gtk_ui_manager_new ();
3709 gtk_ui_manager_insert_action_group (ui_manager_bytes_menu,
3710 packet_list_byte_menu_action_group,
3711 0); /* the position at which the group will be inserted. */
3713 gtk_ui_manager_add_ui_from_string (ui_manager_bytes_menu, ui_desc_bytes_menu_popup, -1, &error);
3716 fprintf (stderr, "Warning: building Bytes Pop-Up menu failed: %s\n",
3718 g_error_free (error);
3722 g_object_unref(packet_list_byte_menu_action_group);
3724 g_object_set_data(G_OBJECT(popup_menu_object), PM_BYTES_VIEW_KEY,
3725 gtk_ui_manager_get_widget(ui_manager_bytes_menu, "/BytesMenuPopup"));
3727 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_bytes_menu);
3730 #ifdef MAIN_MENU_USE_UIMANAGER
3731 main_menu_bar_action_group = gtk_action_group_new ("MenuActionGroup");
3732 gtk_action_group_add_actions (main_menu_bar_action_group, /* the action group */
3733 main_menu_bar_entries, /* an array of action descriptions */
3734 G_N_ELEMENTS(main_menu_bar_entries), /* the number of entries */
3735 NULL); /* data to pass to the action callbacks */
3737 gtk_action_group_add_toggle_actions(main_menu_bar_action_group, /* the action group */
3738 main_menu_bar_toggle_action_entries, /* an array of action descriptions */
3739 G_N_ELEMENTS(main_menu_bar_toggle_action_entries), /* the number of entries */
3740 NULL); /* data to pass to the action callbacks */
3742 gtk_action_group_add_radio_actions (main_menu_bar_action_group, /* the action group */
3743 main_menu_bar_radio_view_time_entries, /* an array of radio action descriptions */
3744 G_N_ELEMENTS(main_menu_bar_radio_view_time_entries), /* the number of entries */
3745 recent.gui_time_format, /* the value of the action to activate initially, or -1 if no action should be activated */
3746 G_CALLBACK(timestamp_format_new_cb), /* the callback to connect to the changed signal */
3747 NULL); /* data to pass to the action callbacks */
3749 gtk_action_group_add_radio_actions (main_menu_bar_action_group, /* the action group */
3750 main_menu_bar_radio_view_time_fileformat_prec_entries, /* an array of radio action descriptions */
3751 G_N_ELEMENTS(main_menu_bar_radio_view_time_fileformat_prec_entries), /* the number of entries */
3752 recent.gui_time_precision, /* the value of the action to activate initially, or -1 if no action should be activated */
3753 G_CALLBACK(timestamp_precision_new_cb), /* the callback to connect to the changed signal */
3754 NULL); /* data to pass to the action callbacks */
3758 ui_manager_main_menubar = gtk_ui_manager_new ();
3759 gtk_ui_manager_insert_action_group (ui_manager_main_menubar, main_menu_bar_action_group, 0);
3760 gtk_ui_manager_add_ui_from_string (ui_manager_main_menubar,ui_desc_menubar, -1, &error);
3763 fprintf (stderr, "Warning: building main menubar failed: %s\n",
3765 g_error_free (error);
3768 g_object_unref(main_menu_bar_action_group);
3769 gtk_window_add_accel_group (GTK_WINDOW(top_level),
3770 gtk_ui_manager_get_accel_group(ui_manager_main_menubar));
3773 /* Add the recent files items to the menu
3774 * use place holders and
3775 * gtk_ui_manager_add_ui().
3777 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
3778 add_recent_items (merge_id, ui_manager_main_menubar);
3779 #else /* MAIN_MENU_USE_UIMANAGER */
3780 main_menu_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<main>", grp);
3781 gtk_item_factory_create_items_ac(main_menu_factory, nmenu_items, menu_items, NULL, 2);
3782 #endif /* MAIN_MENU_USE_UIMANAGER */
3784 statusbar_profiles_action_group = gtk_action_group_new ("StatusBarProfilesPopUpMenuActionGroup");
3786 gtk_action_group_add_actions (statusbar_profiles_action_group, /* the action group */
3787 (gpointer)statusbar_profiles_menu_action_entries, /* an array of action descriptions */
3788 G_N_ELEMENTS(statusbar_profiles_menu_action_entries), /* the number of entries */
3789 popup_menu_object); /* data to pass to the action callbacks */
3791 ui_manager_statusbar_profiles_menu = gtk_ui_manager_new ();
3792 gtk_ui_manager_insert_action_group (ui_manager_statusbar_profiles_menu,
3793 statusbar_profiles_action_group,
3794 0); /* the position at which the group will be inserted. */
3796 gtk_ui_manager_add_ui_from_string (ui_manager_statusbar_profiles_menu,ui_statusbar_profiles_menu_popup, -1, &error);
3799 fprintf (stderr, "Warning: building Statusbar Profiles Pop-Up failed: %s\n",
3801 g_error_free (error);
3805 g_object_unref(statusbar_profiles_action_group);
3807 g_object_set_data(G_OBJECT(popup_menu_object), PM_STATUSBAR_PROFILES_KEY,
3808 gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup"));
3810 popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_statusbar_profiles_menu);
3812 menu_dissector_filter();
3813 merge_all_tap_menus(tap_menu_tree_root);
3815 /* Initialize enabled/disabled state of menu items */
3816 set_menus_for_capture_file(NULL);
3818 /* Un-#if this when we actually implement Cut/Copy/Paste.
3819 Then make sure you enable them when they can be done. */
3820 set_menu_sensitivity_old("/Edit/Cut", FALSE);
3821 set_menu_sensitivity_old("/Edit/Copy", FALSE);
3822 set_menu_sensitivity_old("/Edit/Paste", FALSE);
3825 set_menus_for_captured_packets(FALSE);
3826 set_menus_for_selected_packet(&cfile);
3827 set_menus_for_selected_tree_row(&cfile);
3828 set_menus_for_capture_in_progress(FALSE);
3829 set_menus_for_file_set(/* dialog */TRUE, /* previous file */ FALSE, /* next_file */ FALSE);
3831 #ifndef MAIN_MENU_USE_UIMANAGER
3832 /* Init with an empty recent files list */
3833 clear_menu_recent_capture_file_cmd_cb(NULL, NULL);
3834 /* Protocol help links */
3835 proto_help_menu_init(gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup"));
3836 #endif /* MAIN_MENU_USE_UIMANAGER */
3841 static gint tap_menu_item_add_compare(gconstpointer a, gconstpointer b)
3844 ((const menu_item_t *) a)->name,
3845 ((const menu_item_t *) b)->name);
3849 /* add a menuitem below the current node */
3850 static GList * tap_menu_item_add(
3852 const char *gui_path,
3855 const char *stock_id,
3856 const char *accelerator,
3857 const char *tooltip,
3858 #ifdef MAIN_MENU_USE_UIMANAGER
3861 GtkItemFactoryCallback callback,
3864 gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data),
3865 gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data),
3866 gpointer callback_data,
3872 child = g_malloc(sizeof (menu_item_t));
3873 child->group = group;
3874 child->gui_path = gui_path;
3876 child->label = label;
3877 child->stock_id = stock_id;
3878 child->accelerator = accelerator;
3879 child->stock_id = stock_id;
3880 child->tooltip = tooltip;
3881 child->callback = callback;
3882 child->enabled = enabled;
3883 child->selected_packet_enabled = selected_packet_enabled;
3884 child->selected_tree_row_enabled = selected_tree_row_enabled;
3885 child->callback_data = callback_data;
3886 child->children = NULL;
3888 /* insert the new child node into the parent */
3889 curr = curnode->data;
3890 curr->children = g_list_insert_sorted(curr->children, child, tap_menu_item_add_compare);
3892 /* return the new node */
3893 /* XXX: improve this */
3894 return g_list_find(curr->children, child);
3898 * Add a new menu item for a tap.
3899 * This must be called after we've created the main menu, so it can't
3900 * be called from the routine that registers taps - we have to introduce
3901 * another per-tap registration routine.
3903 * "callback" gets called when the menu item is selected; it should do
3904 * the work of creating the tap window.
3906 * "selected_packet_enabled" gets called by "set_menus_for_selected_packet()";
3907 * it's passed a Boolean that's TRUE if a packet is selected and FALSE
3908 * otherwise, and should return TRUE if the tap will work now (which
3909 * might depend on whether a packet is selected and, if one is, on the
3910 * packet) and FALSE if not.
3912 * "selected_tree_row_enabled" gets called by
3913 * "set_menus_for_selected_tree_row()"; it's passed a Boolean that's TRUE if
3914 * a protocol tree row is selected and FALSE otherwise, and should return
3915 * TRUE if the tap will work now (which might depend on whether a tree row
3916 * is selected and, if one is, on the tree row) and FALSE if not.
3920 register_stat_menu_item_stock(
3921 #ifdef MAIN_MENU_USE_UIMANAGER
3922 register_stat_group_t group,
3923 const char *gui_path,
3925 const char *stock_id,
3927 const char *accelerator,
3928 const char *tooltip,
3931 gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data),
3932 gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data),
3933 gpointer callback_data)
3936 register_stat_group_t group,
3937 const char *stock_id,
3938 GtkItemFactoryCallback callback,
3939 gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data),
3940 gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data),
3941 gpointer callback_data)
3944 #ifdef MAIN_MENU_USE_UIMANAGER
3946 const char *gui_path = NULL;
3947 const char *label = name;
3948 const char *accelerator = NULL;
3949 const char *tooltip = NULL;
3950 gboolean enabled = FALSE;
3952 /*static const char toolspath[] = "/Statistics/";*/
3953 const char *toolspath;
3962 * The menu path must be relative.
3964 g_assert(*name != '/');
3965 #ifdef MAIN_MENU_USE_UIMANAGER
3967 case(REGISTER_STAT_GROUP_GENERIC): toolspath = "/Menubar/StatisticsMenu/"; break;
3968 case(REGISTER_STAT_GROUP_CONVERSATION_LIST): toolspath = "/Menubar/StatisticsMenu/ConversationListMenu/"; break;
3969 case(REGISTER_STAT_GROUP_ENDPOINT_LIST): toolspath = "/Menubar/StatisticsMenu/EndpointListMenu/"; break;
3970 case(REGISTER_STAT_GROUP_RESPONSE_TIME): toolspath = "/Menubar/StatisticsMenu/ServiceResponseTimeMenu/"; break;
3971 case(REGISTER_STAT_GROUP_UNSORTED): toolspath = "/Menubar/StatisticsMenu/"; break;
3972 case(REGISTER_ANALYZE_GROUP_UNSORTED): toolspath = "/Menubar/AnalyzeMenu/"; break;
3973 case(REGISTER_ANALYZE_GROUP_CONVERSATION_FILTER): toolspath = "/Menubar/AnalyzeMenu/ConversationFilterMenu/"; break;
3974 case(REGISTER_STAT_GROUP_TELEPHONY): toolspath = "/Menubar/TelephonyMenu/"; break;
3975 case(REGISTER_TOOLS_GROUP_UNSORTED): toolspath = "/Menubar/ToolsMenu/"; break;
3977 g_assert(!"no such menu group");
3981 gui_path = toolspath;
3985 case(REGISTER_STAT_GROUP_GENERIC): toolspath = "/Statistics/"; break;
3986 case(REGISTER_STAT_GROUP_CONVERSATION_LIST): toolspath = "/Statistics/_Conversation List/"; break;
3987 case(REGISTER_STAT_GROUP_ENDPOINT_LIST): toolspath = "/Statistics/_Endpoint List/"; break;
3988 case(REGISTER_STAT_GROUP_RESPONSE_TIME): toolspath = "/Statistics/Service _Response Time/"; break;
3989 case(REGISTER_STAT_GROUP_UNSORTED): toolspath = "/Statistics/"; break;
3990 case(REGISTER_ANALYZE_GROUP_UNSORTED): toolspath = "/Analyze/"; break;
3991 case(REGISTER_ANALYZE_GROUP_CONVERSATION_FILTER): toolspath = "/Analyze/Conversation Filter/"; break;
3992 case(REGISTER_STAT_GROUP_TELEPHONY): toolspath = "/Telephony/"; break;
3993 case(REGISTER_TOOLS_GROUP_UNSORTED): toolspath = "/Tools/"; break;
3995 g_assert(!"no such menu group");
3999 /* add the (empty) root node, if not already done */
4000 if(tap_menu_tree_root == NULL) {
4001 child = g_malloc0(sizeof (menu_item_t));
4002 tap_menu_tree_root = g_list_append(NULL, child);
4006 * Create any submenus required.
4008 curnode = tap_menu_tree_root;
4010 while ((p = strchr(p, '/')) != NULL) {
4012 * OK, everything between "name" and "p" is
4013 * a menu relative subtree into which the menu item
4016 * Construct the absolute path name of that subtree.
4018 menupathlen = strlen(toolspath) + 1 + (p - name);
4019 menupath = g_malloc(menupathlen);
4020 g_strlcpy(menupath, toolspath, menupathlen);
4021 g_strlcat(menupath, name, menupathlen);
4024 * Does there exist an entry with that path at this
4025 * level of the Analyze menu tree?
4027 child = curnode->data;
4028 for (childnode = child->children; childnode != NULL; childnode = childnode->next) {
4029 child = childnode->data;
4030 if (strcmp(child->gui_path, menupath) == 0)
4033 if (childnode == NULL) {
4035 * No. Create such an item as a subtree, and
4036 * add it to the Tools menu tree.
4038 #ifdef MAIN_MENU_USE_UIMANAGER
4039 childnode = tap_menu_item_add(
4040 group, gui_path, name, label, NULL, NULL, NULL, NULL ,FALSE, NULL, NULL, NULL, curnode);
4042 childnode = tap_menu_item_add(
4043 group, (const char*)menupath, name, name, NULL, NULL, NULL, NULL ,FALSE, NULL, NULL, NULL, curnode);
4047 * Yes. We don't need this "menupath" any longer.
4051 curnode = childnode;
4054 * Skip over the '/' we found.
4060 * Construct the main menu path for the menu item.
4062 menupathlen = strlen(toolspath) + 1 + strlen(name);
4063 menupath = g_malloc(menupathlen);
4064 g_strlcpy(menupath, toolspath, menupathlen);
4065 g_strlcat(menupath, name, menupathlen);
4067 #ifdef MAIN_MENU_USE_UIMANAGER
4069 gui_path = menupath;
4072 * Construct an item factory entry for the item, and add it to
4076 group, gui_path, name, label, stock_id,
4077 accelerator, tooltip, callback, enabled,
4078 selected_packet_enabled, selected_tree_row_enabled,
4079 callback_data, curnode);
4083 * Add a new menu item for a stat.
4084 * This must be called after we've created the main menu, so it can't
4085 * be called from the routine that registers stats - we have to introduce
4086 * another per-stat registration routine.
4088 * @param name the menu label
4090 * @param group the menu group this stat should be registered to
4092 * @param callback gets called when the menu item is selected; it should do
4093 * the work of creating the stat window.
4095 * @param selected_packet_enabled gets called by set_menus_for_selected_packet();
4096 * it's passed a pointer to the "frame_data" structure for the current frame,
4097 * if any, and to the "epan_dissect_t" structure for that frame, if any, and
4098 * should return TRUE if the stat will work now (which might depend on whether
4099 * a frame is selected and, if one is, on the frame) and FALSE if not.
4101 * @param selected_tree_row_enabled gets called by
4102 * set_menus_for_selected_tree_row(); it's passed a pointer to the
4103 * "field_info" structure for the currently selected field, if any,
4104 * and should return TRUE if the stat will work now (which might depend on
4105 * whether a tree row is selected and, if one is, on the tree row) and
4108 * @param callback_data data for callback function
4110 #ifdef MAIN_MENU_USE_UIMANAGER
4112 register_stat_menu_item(
4113 const char *name _U_,
4114 register_stat_group_t group _U_,
4115 gpointer callback _U_,
4116 gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data) _U_,
4117 gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data) _U_,
4118 gpointer callback_data _U_)
4122 register_stat_menu_item_stock(
4124 NULL, /* gui_path */
4126 NULL, /* stock_id */
4128 NULL, /* accelerator */
4130 G_CALLBACK(callback),
4132 selected_packet_enabled,
4133 selected_tree_row_enabled,
4138 register_stat_menu_item(
4140 register_stat_group_t group,
4141 GtkItemFactoryCallback callback,
4142 gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data),
4143 gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data),
4144 gpointer callback_data)
4146 register_stat_menu_item_stock(
4149 NULL, /* stock_id */
4151 selected_packet_enabled,
4152 selected_tree_row_enabled,
4157 #ifdef MAIN_MENU_USE_UIMANAGER
4160 add_menu_item(menu_item_t *node_data){
4161 GtkActionGroup *action_group = NULL;
4163 GList *action_groups, *l;
4166 g_warning("path '%s', node_data->name '%s'",node_data->gui_path,node_data->name);
4167 if(node_data->stock_id){
4168 g_warning("node_data->stock_id %s",node_data->stock_id);
4171 action_groups = gtk_ui_manager_get_action_groups (ui_manager_main_menubar);
4172 for (l = action_groups; l != NULL; l = l->next)
4174 GtkActionGroup *group = l->data;
4176 if (strcmp (gtk_action_group_get_name (group), "MenuActionGroup") == 0){
4177 /* This unrefs the action group and all of its actions */
4178 action_group = group;
4183 g_warning("Failed to find the action group");
4186 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
4188 action = g_object_new (GTK_TYPE_ACTION,
4189 "name", node_data->name,
4190 "label", node_data->label,
4191 "stock_id", node_data->stock_id,
4192 "sensitive", node_data->enabled,
4194 gtk_action_group_add_action (action_group, action);
4195 g_signal_connect (action, "activate",
4196 G_CALLBACK (node_data->callback), node_data->callback_data);
4198 g_object_unref (action);
4200 gtk_ui_manager_add_ui (ui_manager_main_menubar, merge_id,
4201 node_data->gui_path,
4202 node_data->name, /* XXX is this ok, the name for the added UI element */
4203 node_data->name, /* the name of the action to be proxied, or NULL to add a separator */
4204 GTK_UI_MANAGER_MENUITEM,
4210 static guint merge_tap_menus_layered(GList *node, gint group) {
4211 /*GtkItemFactoryEntry *entry;*/
4214 menu_item_t *node_data = node->data;
4217 * Is this a leaf node or an interior node?
4219 if (node_data->children == NULL) {
4225 * The root node doesn't correspond to a menu tree item; it
4226 * has a null name pointer.
4228 if (node_data->gui_path != NULL && group == node_data->group) {
4229 /* entry = g_malloc0(sizeof (GtkItemFactoryEntry));*/
4230 /*entry->path = node_data->name;*/
4231 /* entry->callback = node_data->callback;*/
4233 case(REGISTER_STAT_GROUP_UNSORTED):
4234 /*add_menu_item(node_data);*/
4236 case(REGISTER_STAT_GROUP_GENERIC):
4237 /*add_menu_item(node_data);*/
4239 case(REGISTER_STAT_GROUP_CONVERSATION_LIST):
4240 /*entry->item_type = "<StockItem>";*/
4241 /*entry->extra_data = WIRESHARK_STOCK_CONVERSATIONS;*/
4242 /*add_menu_item(node_data);*/
4244 case(REGISTER_STAT_GROUP_ENDPOINT_LIST):
4245 /*entry->item_type = "<StockItem>";*/
4246 /*entry->extra_data = WIRESHARK_STOCK_ENDPOINTS;*/
4247 /*add_menu_item(node_data);*/
4249 case(REGISTER_STAT_GROUP_RESPONSE_TIME):
4250 /*entry->item_type = "<StockItem>";*/
4251 /*entry->extra_data = WIRESHARK_STOCK_TIME;*/
4252 /*add_menu_item(node_data);*/
4254 case(REGISTER_STAT_GROUP_TELEPHONY):
4255 /*add_menu_item(node_data);*/
4257 case(REGISTER_ANALYZE_GROUP_UNSORTED):
4258 /*add_menu_item(node_data);*/
4260 case(REGISTER_ANALYZE_GROUP_CONVERSATION_FILTER):
4261 /*add_menu_item(node_data);*/
4263 case(REGISTER_TOOLS_GROUP_UNSORTED):
4266 g_assert_not_reached();
4271 * It's an interior node; call
4272 * "merge_tap_menus_layered()" on all its children
4276 * The root node doesn't correspond to a menu tree item; it
4277 * has a null name pointer.
4279 if (node_data->gui_path != NULL && group == node_data->group) {
4280 /* We don't create the sub-menus */
4283 for (child = node_data->children; child != NULL; child =
4285 added += merge_tap_menus_layered(child, group);
4292 static guint merge_tap_menus_layered(GList *node, gint group) {
4293 GtkItemFactoryEntry *entry;
4297 menu_item_t *node_data = node->data;
4301 * Is this a leaf node or an interior node?
4303 if (node_data->children == NULL) {
4309 * The root node doesn't correspond to a menu tree item; it
4310 * has a null name pointer.
4312 if (node_data->gui_path != NULL && group == node_data->group) {
4313 entry = g_malloc0(sizeof (GtkItemFactoryEntry));
4314 namelen = strlen(node_data->gui_path) + 1;
4315 entry->path = g_malloc(namelen);
4316 g_strlcpy(entry->path, node_data->gui_path, namelen);
4317 entry->callback = node_data->callback;
4319 case(REGISTER_STAT_GROUP_UNSORTED):
4321 case(REGISTER_STAT_GROUP_GENERIC):
4323 case(REGISTER_STAT_GROUP_CONVERSATION_LIST):
4324 entry->item_type = "<StockItem>";
4325 entry->extra_data = WIRESHARK_STOCK_CONVERSATIONS;
4327 case(REGISTER_STAT_GROUP_ENDPOINT_LIST):
4328 entry->item_type = "<StockItem>";
4329 entry->extra_data = WIRESHARK_STOCK_ENDPOINTS;
4331 case(REGISTER_STAT_GROUP_RESPONSE_TIME):
4332 entry->item_type = "<StockItem>";
4333 entry->extra_data = WIRESHARK_STOCK_TIME;
4335 case(REGISTER_STAT_GROUP_TELEPHONY):
4337 case(REGISTER_ANALYZE_GROUP_UNSORTED):
4339 case(REGISTER_ANALYZE_GROUP_CONVERSATION_FILTER):
4341 case(REGISTER_TOOLS_GROUP_UNSORTED):
4344 g_assert_not_reached();
4346 if(node_data->stock_id!= NULL) {
4347 entry->item_type = "<StockItem>";
4348 entry->extra_data = node_data->stock_id;
4350 gtk_item_factory_create_item(main_menu_factory, entry, node_data->callback_data, /* callback_type */ 2);
4351 set_menu_sensitivity_old(node_data->gui_path, FALSE); /* no capture file yet */
4357 * It's an interior node; call
4358 * "merge_tap_menus_layered()" on all its children
4362 * The root node doesn't correspond to a menu tree item; it
4363 * has a null name pointer.
4365 if (node_data->gui_path != NULL && group == node_data->group) {
4366 entry = g_malloc0(sizeof (GtkItemFactoryEntry));
4367 namelen = strlen(node_data->gui_path) + 1;
4368 entry->path = g_malloc(namelen);
4369 g_strlcpy(entry->path, node_data->gui_path, namelen);
4370 entry->item_type = "<Branch>";
4372 gtk_item_factory_create_item(main_menu_factory, entry,
4374 set_menu_sensitivity_old(node_data->gui_path, FALSE); /* no children yet */
4379 for (child = node_data->children; child != NULL; child =
4381 added += merge_tap_menus_layered(child, group);
4387 #endif /* MAIN_MENU_USE_UIMANAGER */
4391 static void merge_all_tap_menus(GList *node) {
4392 #ifdef MAIN_MENU_USE_UIMANAGER
4394 GtkItemFactoryEntry *sep_entry;
4396 sep_entry = g_malloc0(sizeof (GtkItemFactoryEntry));
4397 sep_entry->item_type = "<Separator>";
4398 sep_entry->path = "/Statistics/";
4400 #ifdef MAIN_MENU_USE_UIMANAGER
4401 /* build the new menus */
4403 merge_id = gtk_ui_manager_new_merge_id (ui_manager_main_menubar);
4407 * merge only the menu items of the specific group,
4408 * and then append a seperator
4410 if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_GENERIC)) {
4411 #ifdef MAIN_MENU_USE_UIMANAGER
4414 gtk_item_factory_create_item(main_menu_factory, sep_entry, NULL, 2);
4415 #endif /* MAIN_MENU_USE_UIMANAGER */
4417 if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_CONVERSATION_LIST)) {
4418 /*gtk_item_factory_create_item(main_menu_factory, sep_entry, NULL, 2);*/
4420 if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_ENDPOINT_LIST)) {
4421 /*gtk_item_factory_create_item(main_menu_factory, sep_entry, NULL, 2);*/
4423 if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_RESPONSE_TIME)) {
4424 #ifdef MAIN_MENU_USE_UIMANAGER
4427 gtk_item_factory_create_item(main_menu_factory, sep_entry, NULL, 2);
4428 #endif /* MAIN_MENU_USE_UIMANAGER */
4430 if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_TELEPHONY)) {
4431 /*gtk_item_factory_create_item(main_menu_factory, sep_entry, NULL, 2);*/
4433 if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_UNSORTED)) {
4434 /*gtk_item_factory_create_item(main_menu_factory, sep_entry, NULL, 2);*/
4436 if (merge_tap_menus_layered(node, REGISTER_ANALYZE_GROUP_UNSORTED)) {
4437 /* sep_entry->path = "/Analyze/";*/
4438 /*gtk_item_factory_create_item(main_menu_factory, sep_entry, NULL, 2);*/
4440 if (merge_tap_menus_layered(node, REGISTER_ANALYZE_GROUP_CONVERSATION_FILTER)) {
4441 /*sep_entry->path = "/Analyze/Conversation Filter/";*/
4442 /*gtk_item_factory_create_item(main_menu_factory, sep_entry, NULL, 2);*/
4444 if (merge_tap_menus_layered(node, REGISTER_TOOLS_GROUP_UNSORTED)) {
4445 /*gtk_item_factory_create_item(main_menu_factory, sep_entry, NULL, 2);*/
4447 #ifdef MAIN_MENU_USE_UIMANAGER
4454 * Enable/disable menu sensitivity.
4457 set_menu_sensitivity(GtkUIManager *ui_manager, const gchar *path, gint val)
4461 action = gtk_ui_manager_get_action(ui_manager, path);
4464 fprintf (stderr, "Warning: couldn't find action path= %s\n",
4469 gtk_action_set_sensitive (action,
4470 val); /* TRUE to make the action sensitive */
4473 #ifndef MAIN_MENU_USE_UIMANAGER
4475 * Enable/disable menu sensitivity for the old menubar code.
4478 set_menu_sensitivity_old(const gchar *path, gint val)
4480 GtkWidget *menu_item;
4483 /* the underscore character regularly confuses things, as it will prevent finding
4484 * the menu_item, so it has to be removed first */
4485 dup = g_strdup(path);
4496 if ((menu_item = gtk_item_factory_get_widget(main_menu_factory, dup)) != NULL) {
4497 if (GTK_IS_MENU(menu_item)) {
4499 * "dup" refers to a submenu; "gtk_item_factory_get_widget()"
4500 * gets the menu, not the item that, when selected, pops up
4503 * We have to change the latter item's sensitivity, so that
4504 * it shows up normally if sensitive and grayed-out if
4507 menu_item = gtk_menu_get_attach_widget(GTK_MENU(menu_item));
4509 gtk_widget_set_sensitive(menu_item, val);
4515 #endif /* MAIN_MENU_USE_UIMANAGER */
4518 set_menu_object_data_meat(GtkUIManager *ui_manager, const gchar *path, const gchar *key, gpointer data)
4520 GtkWidget *menu = NULL;
4522 if ((menu = gtk_ui_manager_get_widget(ui_manager, path)) != NULL){
4523 g_object_set_data(G_OBJECT(menu), key, data);
4526 g_warning("set_menu_object_data_meat: no menu, path: %s",path);
4531 #ifndef MAIN_MENU_USE_UIMANAGER
4533 set_menu_object_data_meat_old(const gchar *path, const gchar *key, gpointer data)
4535 GtkWidget *menu = NULL;
4537 if ((menu = gtk_item_factory_get_widget(main_menu_factory, path)) != NULL){
4538 g_object_set_data(G_OBJECT(menu), key, data);
4544 set_menu_object_data_old (const gchar *path, const gchar *key, gpointer data) {
4546 set_menu_object_data_meat_old(path, key, data);
4550 set_menu_object_data (const gchar *path, const gchar *key, gpointer data) {
4552 if (strncmp (path,"/Menubar",8) == 0){
4553 set_menu_object_data_meat(ui_manager_main_menubar, path, key, data);
4554 }else if (strncmp (path,"/PacketListMenuPopup",20) == 0){
4555 set_menu_object_data_meat(ui_manager_packet_list_menu, path, key, data);
4556 }else if (strncmp (path,"/TreeViewPopup",14) == 0){
4557 set_menu_object_data_meat(ui_manager_tree_view_menu, path, key, data);
4558 }else if (strncmp (path,"/BytesMenuPopup",15) == 0){
4559 set_menu_object_data_meat(ui_manager_bytes_menu, path, key, data);
4560 }else if (strncmp (path,"/ProfilesMenuPopup",18) == 0){
4561 set_menu_object_data_meat(ui_manager_statusbar_profiles_menu, path, key, data);
4566 /* Recently used capture files submenu:
4567 * Submenu containing the recently used capture files.
4568 * The capture filenames are always kept with the absolute path, to be independant
4569 * of the current path.
4570 * They are only stored inside the labels of the submenu (no separate list). */
4572 #define MENU_RECENT_FILES_PATH_OLD "/File/Open Recent"
4573 #define MENU_RECENT_FILES_PATH "/Menubar/FileMenu/OpenRecent"
4574 #define MENU_RECENT_FILES_KEY "Recent File Name"
4577 #ifndef MAIN_MENU_USE_UIMANAGER
4579 update_menu_recent_capture_file1(GtkWidget *widget, gpointer cnt) {
4580 gchar *widget_cf_name;
4582 widget_cf_name = g_object_get_data(G_OBJECT(widget), MENU_RECENT_FILES_KEY);
4584 /* if this menu item is a file, count it */
4585 if (widget_cf_name) {
4587 gtk_widget_set_sensitive(widget, FALSE);
4588 main_welcome_add_recent_capture_file(widget_cf_name, G_OBJECT(widget));
4592 /* update the menu */
4594 update_menu_recent_capture_file(GtkWidget *submenu_recent_files) {
4596 GtkWidget *menu_item;
4599 main_welcome_reset_recent_capture_files();
4601 gtk_container_foreach(GTK_CONTAINER(submenu_recent_files),
4602 update_menu_recent_capture_file1, &cnt);
4606 menu_item = gtk_menu_item_new_with_label("No recently used files");
4607 gtk_menu_shell_append (GTK_MENU_SHELL(submenu_recent_files), menu_item);
4608 gtk_widget_set_sensitive(menu_item, FALSE);
4609 gtk_widget_show (menu_item);
4613 #endif /* MAIN_MENU_USE_UIMANAGER */
4615 #ifndef MAIN_MENU_USE_UIMANAGER
4616 /* remove the capture filename from the "Recent Files" menu */
4618 remove_menu_recent_capture_filename(gchar *cf_name) {
4619 GtkWidget *submenu_recent_files;
4621 GList* child_list_item;
4622 GtkWidget *menu_item_child;
4623 const gchar *menu_item_cf_name;
4625 /* get the submenu container item */
4626 #ifdef MAIN_MENU_USE_UIMANAGER
4627 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
4628 if(!submenu_recent_files){
4629 g_warning("remove_menu_recent_capture_filename: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
4632 submenu_recent_files = gtk_item_factory_get_widget(main_menu_factory, MENU_RECENT_FILES_PATH_OLD);
4634 /* find the corresponding menu item to be removed */
4635 child_list = gtk_container_get_children(GTK_CONTAINER(submenu_recent_files));
4636 child_list_item = child_list;
4637 while(child_list_item) {
4638 menu_item_child = gtk_bin_get_child(GTK_BIN(child_list_item->data));
4639 if (menu_item_child != NULL) { /* Note: there are two "extra" items on the end of the child_list: */
4640 /* - a separator (with no menu_item_child and thus no text label) */
4641 /* - a 2nd item with a menu_child with text label "Clear" */
4642 /* [See add_menu_recent_capture_file_absolute() ] */
4643 /* 'if (menu_item_child != NULL)' skips the separator item; */
4644 /* An absolute filename in cf_name will never match "Clear". */
4645 menu_item_cf_name = gtk_label_get_text(GTK_LABEL(menu_item_child));
4646 if(strcmp(menu_item_cf_name, cf_name) == 0) {
4647 /* XXX: is this all we need to do, to free the menu item and its label?
4648 The reference count of widget will go to 0, so it'll be freed;
4649 will that free the label? */
4650 gtk_container_remove(GTK_CONTAINER(submenu_recent_files), child_list_item->data);
4653 child_list_item = g_list_next(child_list_item);
4655 g_list_free(child_list);
4657 update_menu_recent_capture_file(submenu_recent_files);
4660 /* remove the capture filename from the "Recent Files" menu */
4662 remove_menu_recent_capture_file(GtkWidget *widget, gpointer unused _U_) {
4663 GtkWidget *submenu_recent_files;
4664 gchar *widget_cf_name;
4667 widget_cf_name = g_object_get_data(G_OBJECT(widget), MENU_RECENT_FILES_KEY);
4668 g_free(widget_cf_name);
4670 /* get the submenu container item */
4671 #ifdef MAIN_MENU_USE_UIMANAGER
4672 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
4673 if(!submenu_recent_files){
4674 g_warning("remove_menu_recent_capture_file: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
4677 submenu_recent_files = gtk_item_factory_get_widget(main_menu_factory, MENU_RECENT_FILES_PATH_OLD);
4679 /* XXX: is this all we need to do, to free the menu item and its label?
4680 The reference count of widget will go to 0, so it'll be freed;
4681 will that free the label? */
4682 gtk_container_remove(GTK_CONTAINER(submenu_recent_files), widget);
4686 #ifdef MAIN_MENU_USE_UIMANAGER
4687 /* Add a file name to the top of the list, if its allrady present remove it first */
4689 remove_present_file_name(GList *recent_files_list, const gchar *cf_name){
4691 gchar *widget_cf_name;
4693 for (li = g_list_first(recent_files_list); li; li = li->next) {
4694 widget_cf_name = li->data;
4697 /* do a case insensitive compare on win32 */
4698 g_ascii_strncasecmp(widget_cf_name, cf_name, 1000) == 0){
4700 /* do a case sensitive compare on unix */
4701 strncmp(widget_cf_name, cf_name, 1000) == 0 ){
4703 recent_files_list = g_list_remove(recent_files_list,widget_cf_name);
4707 return recent_files_list;
4711 recent_changed_cb (GtkUIManager *ui_manager,
4712 gpointer user_data _U_)
4715 GList *action_groups, *l;
4718 merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (ui_manager),
4719 "recent-files-merge-id"));
4722 gtk_ui_manager_remove_ui (ui_manager, merge_id);
4724 /* remove the action group; gtk_ui_manager_remove_action_group()
4725 * should really take the action group's name instead of its
4728 action_groups = gtk_ui_manager_get_action_groups (ui_manager);
4729 for (l = action_groups; l != NULL; l = l->next)
4731 GtkActionGroup *group = l->data;
4733 if (strcmp (gtk_action_group_get_name (group), "recent-files-group") == 0){
4734 /* this unrefs the action group and all of its actions */
4735 gtk_ui_manager_remove_action_group (ui_manager, group);
4740 /* generate a new merge id and re-add everything */
4741 merge_id = gtk_ui_manager_new_merge_id (ui_manager);
4742 add_recent_items (merge_id, ui_manager);
4746 recent_clear_cb(GtkAction *action _U_, gpointer user_data _U_)
4748 GtkWidget *submenu_recent_files;
4749 GList *recent_files_list;
4751 /* Get the list of recent files, free the list and store the empty list with the widget */
4752 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
4753 recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
4754 /* Free the name strings ?? */
4755 g_list_free(recent_files_list);
4756 recent_files_list = NULL;
4757 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
4758 /* Calling recent_changed_cb will rebuild the GUI call add_recent_items which will in turn call
4759 * main_welcome_reset_recent_capture_files
4761 recent_changed_cb(ui_manager_main_menubar, NULL);
4765 add_recent_items (guint merge_id, GtkUIManager *ui_manager)
4767 GtkActionGroup *action_group;
4769 GtkWidget *submenu_recent_files;
4774 /* Reset the recent files list in the welcome screen */
4775 main_welcome_reset_recent_capture_files();
4777 action_group = gtk_action_group_new ("recent-files-group");
4779 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
4780 if(!submenu_recent_files){
4781 g_warning("add_recent_items: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
4783 items = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
4785 gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
4786 g_object_set_data (G_OBJECT (ui_manager),
4787 "recent-files-merge-id", GUINT_TO_POINTER (merge_id));
4792 action = g_object_new (GTK_TYPE_ACTION,
4793 "name", "recent-info-empty",
4794 "label", "No recently used files",
4797 gtk_action_group_add_action (action_group, action);
4798 gtk_action_set_sensitive(action, FALSE);
4799 g_object_unref (action);
4801 gtk_ui_manager_add_ui (ui_manager, merge_id,
4802 "/Menubar/FileMenu/OpenRecent/RecentFiles",
4803 "recent-info-empty",
4804 "recent-info-empty",
4805 GTK_UI_MANAGER_MENUITEM,
4811 for (i = 0, l = items;
4812 i < prefs.gui_recent_files_count_max && l != NULL;
4815 gchar *item_name = l->data;
4816 action_name = g_strdup_printf ("recent-info-%u", i);
4818 action = g_object_new (GTK_TYPE_ACTION,
4819 "name", action_name,
4821 "stock_id", WIRESHARK_STOCK_FILE,
4823 g_signal_connect (action, "activate",
4824 G_CALLBACK (menu_open_recent_file_cmd_cb), NULL);
4825 gtk_action_group_add_action (action_group, action);
4826 g_object_unref (action);
4828 gtk_ui_manager_add_ui (ui_manager, merge_id,
4829 "/Menubar/FileMenu/OpenRecent/RecentFiles",
4832 GTK_UI_MANAGER_MENUITEM,
4835 /* Add the file name to the recent files list on the Welcome screen */
4836 main_welcome_add_recent_capture_file(item_name, G_OBJECT(action));
4838 g_free (action_name);
4840 /* Add a Separator */
4841 gtk_ui_manager_add_ui (ui_manager, merge_id,
4842 "/Menubar/FileMenu/OpenRecent/RecentFiles",
4843 "separator-recent-info",
4845 GTK_UI_MANAGER_SEPARATOR,
4848 /* Add a clear Icon */
4849 action = g_object_new (GTK_TYPE_ACTION,
4850 "name", "clear-recent-info",
4851 "label", "Clear the recent files list",
4852 "stock_id", GTK_STOCK_CLEAR,
4855 g_signal_connect (action, "activate",
4856 G_CALLBACK (recent_clear_cb), NULL);
4858 gtk_action_group_add_action (action_group, action);
4859 g_object_unref (action);
4861 gtk_ui_manager_add_ui (ui_manager, merge_id,
4862 "/Menubar/FileMenu/OpenRecent/RecentFiles",
4863 "clear-recent-info",
4864 "clear-recent-info",
4865 GTK_UI_MANAGER_MENUITEM,
4869 #endif /* MAIN_MENU_USE_UIMANAGER */
4871 #ifndef MAIN_MENU_USE_UIMANAGER
4872 /* callback, if the user pushed the <Clear> menu item */
4874 clear_menu_recent_capture_file_cmd_cb(GtkWidget *w _U_, gpointer unused _U_) {
4875 GtkWidget *submenu_recent_files;
4877 submenu_recent_files = gtk_item_factory_get_widget(main_menu_factory, MENU_RECENT_FILES_PATH_OLD);
4879 gtk_container_foreach(GTK_CONTAINER(submenu_recent_files),
4880 remove_menu_recent_capture_file, NULL);
4882 update_menu_recent_capture_file(submenu_recent_files);
4884 #endif /* MAIN_MENU_USE_UIMANAGER */
4886 /* Open a file by it's name
4887 (Beware: will not ask to close existing capture file!) */
4889 menu_open_filename(gchar *cf_name)
4891 GtkWidget *submenu_recent_files;
4893 #ifdef MAIN_MENU_USE_UIMANAGER
4894 GList *recent_files_list;
4897 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
4898 if(!submenu_recent_files){
4899 g_warning("menu_open_filename: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
4901 recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
4902 /* XXX: ask user to remove item, it's maybe only a temporary problem */
4903 /* open and read the capture file (this will close an existing file) */
4904 if (cf_open(&cfile, cf_name, FALSE, &err) == CF_OK) {
4905 cf_read(&cfile, FALSE);
4907 recent_files_list = remove_present_file_name(recent_files_list, cf_name);
4908 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
4909 /* Calling recent_changed_cb will rebuild the GUI call add_recent_items which will in turn call
4910 * main_welcome_reset_recent_capture_files
4912 recent_changed_cb(ui_manager_main_menubar, NULL);
4915 submenu_recent_files = gtk_item_factory_get_widget(main_menu_factory, MENU_RECENT_FILES_PATH_OLD);
4916 /* open and read the capture file (this will close an existing file) */
4917 if (cf_open(&cfile, cf_name, FALSE, &err) == CF_OK) {
4918 cf_read(&cfile, FALSE);
4920 /* the capture file apparently no longer exists; remove menu item */
4921 /* XXX: ask user to remove item, it's maybe only a temporary problem */
4922 remove_menu_recent_capture_filename(cf_name);
4925 update_menu_recent_capture_file(submenu_recent_files);
4926 #endif /* MAIN_MENU_USE_UIMANAGER */
4929 #ifdef MAIN_MENU_USE_UIMANAGER
4931 menu_open_recent_file_cmd(GtkAction *action)
4933 GtkWidget *submenu_recent_files;
4934 GList *recent_files_list;
4935 const gchar *cf_name;
4938 cf_name = gtk_action_get_label(action);
4940 /* open and read the capture file (this will close an existing file) */
4941 if (cf_open(&cfile, cf_name, FALSE, &err) == CF_OK) {
4942 cf_read(&cfile, FALSE);
4944 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
4945 recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
4947 recent_files_list = remove_present_file_name(recent_files_list, cf_name);
4948 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
4949 /* Calling recent_changed_cb will rebuild the GUI call add_recent_items which will in turn call
4950 * main_welcome_reset_recent_capture_files
4952 recent_changed_cb(ui_manager_main_menubar, NULL);
4956 /* callback, if the user pushed a recent file submenu item */
4958 menu_open_recent_file_cmd(GtkWidget *w)
4960 GtkWidget *submenu_recent_files;
4961 GtkWidget *menu_item_child;
4962 const gchar *cf_name;
4966 submenu_recent_files = gtk_item_factory_get_widget(main_menu_factory, MENU_RECENT_FILES_PATH_OLD);
4968 /* get capture filename from the menu item label */
4969 menu_item_child = gtk_bin_get_child(GTK_BIN(w));
4970 cf_name = gtk_label_get_text(GTK_LABEL(menu_item_child));
4972 /* open and read the capture file (this will close an existing file) */
4973 if (cf_open(&cfile, cf_name, FALSE, &err) == CF_OK) {
4974 cf_read(&cfile, FALSE);
4976 /* the capture file apparently no longer exists; remove menu item */
4977 /* XXX: ask user to remove item, it's maybe only a temporary problem */
4978 remove_menu_recent_capture_file(w, NULL);
4981 update_menu_recent_capture_file(submenu_recent_files);
4983 #endif /* MAIN_MENU_USE_UIMANAGER */
4985 static void menu_open_recent_file_answered_cb(gpointer dialog _U_, gint btn, gpointer data)
4989 /* save file first */
4990 file_save_as_cmd(after_save_open_recent_file, data);
4994 menu_open_recent_file_cmd(data);
4996 case(ESD_BTN_CANCEL):
4999 g_assert_not_reached();
5002 #ifdef MAIN_MENU_USE_UIMANAGER
5004 menu_open_recent_file_cmd_cb(GtkAction *action, gpointer data _U_) {
5008 if((cfile.state != FILE_CLOSED) && !cfile.user_saved && prefs.gui_ask_unsaved) {
5009 /* user didn't saved his current file, ask him */
5010 dialog = simple_dialog(ESD_TYPE_CONFIRMATION, ESD_BTNS_YES_NO_CANCEL,
5011 "%sSave capture file before opening a new one?%s\n\n"
5012 "If you open a new capture file without saving, your current capture data will be discarded.",
5013 simple_dialog_primary_start(), simple_dialog_primary_end());
5014 simple_dialog_set_cb(dialog, menu_open_recent_file_answered_cb, action);
5016 /* unchanged file */
5017 menu_open_recent_file_cmd(action);
5022 menu_open_recent_file_cmd_cb(GtkWidget *widget, gpointer data _U_) {
5026 if((cfile.state != FILE_CLOSED) && !cfile.user_saved && prefs.gui_ask_unsaved) {
5027 /* user didn't saved his current file, ask him */
5028 dialog = simple_dialog(ESD_TYPE_CONFIRMATION, ESD_BTNS_YES_NO_CANCEL,
5029 "%sSave capture file before opening a new one?%s\n\n"
5030 "If you open a new capture file without saving, your current capture data will be discarded.",
5031 simple_dialog_primary_start(), simple_dialog_primary_end());
5032 simple_dialog_set_cb(dialog, menu_open_recent_file_answered_cb, widget);
5034 /* unchanged file */
5035 menu_open_recent_file_cmd(widget);
5038 #endif /* MAIN_MENU_USE_UIMANAGER */
5040 #ifdef MAIN_MENU_USE_UIMANAGER
5042 add_menu_recent_capture_file_absolute(gchar *cf_name) {
5043 GtkWidget *submenu_recent_files;
5045 gchar *widget_cf_name;
5046 gchar *normalized_cf_name;
5048 GList *recent_files_list;
5050 normalized_cf_name = g_strdup(cf_name);
5052 /* replace all slashes by backslashes */
5053 g_strdelimit(normalized_cf_name, "/", '\\');
5056 /* get the submenu container item */
5057 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
5058 if(!submenu_recent_files){
5059 g_warning("add_menu_recent_capture_file_absolute: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
5062 recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
5064 for (li = g_list_first(recent_files_list); li; li = li->next, cnt++) {
5065 widget_cf_name = li->data;
5068 /* do a case insensitive compare on win32 */
5069 g_ascii_strncasecmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
5071 /* do a case sensitive compare on unix */
5072 strncmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
5074 cnt >= prefs.gui_recent_files_count_max) {
5075 recent_files_list = g_list_remove(recent_files_list,widget_cf_name);
5079 recent_files_list = g_list_prepend(recent_files_list, normalized_cf_name);
5080 g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
5081 recent_changed_cb( ui_manager_main_menubar, NULL);
5084 #else /* MAIN_MENU_USE_UIMANAGER */
5086 /* add the capture filename (with an absolute path) to the "Recent Files" menu */
5088 add_menu_recent_capture_file_absolute(gchar *cf_name) {
5089 GtkWidget *submenu_recent_files;
5090 GList *menu_item_list_old;
5092 gchar *widget_cf_name;
5093 gchar *normalized_cf_name;
5094 GtkWidget *menu_item;
5097 normalized_cf_name = g_strdup(cf_name);
5099 /* replace all slashes by backslashes */
5100 g_strdelimit(normalized_cf_name, "/", '\\');
5102 submenu_recent_files = gtk_item_factory_get_widget(main_menu_factory, MENU_RECENT_FILES_PATH_OLD);
5103 /* convert container to a GList */
5104 menu_item_list_old = gtk_container_get_children(GTK_CONTAINER(submenu_recent_files));
5106 /* iterate through list items of menu_item_list,
5107 * removing special items, a maybe duplicate entry and every item above count_max */
5109 for (li = g_list_first(menu_item_list_old); li; li = li->next, cnt++) {
5110 /* get capture filename */
5111 menu_item = GTK_WIDGET(li->data);
5112 widget_cf_name = g_object_get_data(G_OBJECT(menu_item), MENU_RECENT_FILES_KEY);
5114 /* if this element string is one of our special items (seperator, ...) or
5115 * already in the list or
5116 * this element is above maximum count (too old), remove it
5118 if (!widget_cf_name ||
5120 /* do a case insensitive compare on win32 */
5121 g_ascii_strncasecmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
5123 /* do a case sensitive compare on unix */
5124 strncmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
5126 cnt >= prefs.gui_recent_files_count_max) {
5127 remove_menu_recent_capture_file(li->data, NULL);
5132 g_list_free(menu_item_list_old);
5134 /* add new item at latest position */
5135 menu_item = gtk_menu_item_new_with_label(normalized_cf_name);
5136 g_object_set_data(G_OBJECT(menu_item), MENU_RECENT_FILES_KEY, normalized_cf_name);
5137 gtk_menu_shell_prepend (GTK_MENU_SHELL(submenu_recent_files), menu_item);
5138 g_signal_connect_swapped(G_OBJECT(menu_item), "activate",
5139 G_CALLBACK(menu_open_recent_file_cmd_cb), (GObject *) menu_item);
5140 gtk_widget_show (menu_item);
5142 /* add seperator at last position */
5143 menu_item = gtk_menu_item_new();
5144 gtk_menu_shell_append (GTK_MENU_SHELL(submenu_recent_files), menu_item);
5145 gtk_widget_show (menu_item);
5147 /* add new "clear list" item at last position */
5148 menu_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_CLEAR, NULL);
5149 gtk_menu_shell_append (GTK_MENU_SHELL(submenu_recent_files), menu_item);
5150 g_signal_connect_swapped(G_OBJECT(menu_item), "activate",
5151 G_CALLBACK(clear_menu_recent_capture_file_cmd_cb), (GObject *) menu_item);
5152 gtk_widget_show (menu_item);
5154 update_menu_recent_capture_file(submenu_recent_files);
5156 #endif /* MAIN_MENU_USE_UIMANAGER */
5158 /* add the capture filename to the "Recent Files" menu */
5159 /* (will change nothing, if this filename is already in the menu) */
5161 * XXX - We might want to call SHAddToRecentDocs under Windows 7:
5162 * http://stackoverflow.com/questions/437212/how-do-you-register-a-most-recently-used-list-with-windows-in-preparation-for-win
5165 add_menu_recent_capture_file(gchar *cf_name) {
5170 /* if this filename is an absolute path, we can use it directly */
5171 if (g_path_is_absolute(cf_name)) {
5172 add_menu_recent_capture_file_absolute(cf_name);
5176 /* this filename is not an absolute path, prepend the current dir */
5177 curr = g_get_current_dir();
5178 absolute = g_strdup_printf("%s%s%s", curr, G_DIR_SEPARATOR_S, cf_name);
5179 add_menu_recent_capture_file_absolute(absolute);
5185 /* write all capture filenames of the menu to the user's recent file */
5187 menu_recent_file_write_all(FILE *rf) {
5188 GtkWidget *submenu_recent_files;
5192 #ifdef MAIN_MENU_USE_UIMANAGER
5193 GList *recent_files_list, *list;
5195 submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
5196 if(!submenu_recent_files){
5197 g_warning("menu_recent_file_write_all: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
5199 recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
5200 list = g_list_last(recent_files_list);
5201 while(list != NULL) {
5202 cf_name = list->data;
5205 fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", u3_contract_device_path(cf_name));
5207 fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", cf_name);
5209 list = g_list_previous(list);
5211 g_list_free(recent_files_list);
5215 submenu_recent_files = gtk_item_factory_get_widget(main_menu_factory, MENU_RECENT_FILES_PATH_OLD);
5217 /* we have to iterate backwards through the children's list,
5218 * so we get the latest item last in the file.
5219 * (don't use gtk_container_foreach() here, it will return the wrong iteration order) */
5220 children = gtk_container_get_children(GTK_CONTAINER(submenu_recent_files));
5221 child = g_list_last(children);
5222 while(child != NULL) {
5223 /* get capture filename from the menu item label */
5224 cf_name = g_object_get_data(G_OBJECT(child->data), MENU_RECENT_FILES_KEY);
5227 fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", u3_contract_device_path(cf_name));
5229 fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", cf_name);
5232 child = g_list_previous(child);
5235 g_list_free(children);
5240 show_hide_cb(GtkWidget *w, gpointer data _U_, gint action)
5243 /* save current setting in recent */
5245 case(SHOW_HIDE_MAIN_TOOLBAR):
5246 recent.main_toolbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
5248 case(SHOW_HIDE_FILTER_TOOLBAR):
5249 recent.filter_toolbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
5252 case(SHOW_HIDE_AIRPCAP_TOOLBAR):
5253 recent.airpcap_toolbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
5256 case(SHOW_HIDE_STATUSBAR):
5257 recent.statusbar_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
5259 case(SHOW_HIDE_PACKET_LIST):
5260 recent.packet_list_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
5262 case(SHOW_HIDE_TREE_VIEW):
5263 recent.tree_view_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
5265 case(SHOW_HIDE_BYTE_VIEW):
5266 recent.byte_view_show = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
5269 g_assert_not_reached();
5272 main_widgets_show_or_hide();
5275 #ifndef MAIN_MENU_USE_UIMANAGER
5277 timestamp_format_cb(GtkWidget *w _U_, gpointer d _U_, gint action)
5279 if (recent.gui_time_format != action) {
5280 timestamp_set_type(action);
5281 recent.gui_time_format = action;
5282 /* This call adjusts column width */
5283 cf_timestamp_auto_precision(&cfile);
5284 new_packet_list_queue_draw();
5290 timestamp_precision_cb(GtkWidget *w _U_, gpointer d _U_, gint action)
5292 if (recent.gui_time_precision != action) {
5293 /* the actual precision will be set in new_packet_list_queue_draw() below */
5294 if (action == TS_PREC_AUTO) {
5295 timestamp_set_precision(TS_PREC_AUTO_SEC);
5297 timestamp_set_precision(action);
5299 recent.gui_time_precision = action;
5300 /* This call adjusts column width */
5301 cf_timestamp_auto_precision(&cfile);
5302 new_packet_list_queue_draw();
5308 timestamp_seconds_time_cb(GtkWidget *w, gpointer d _U_, gint action _U_)
5310 if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w))) {
5311 recent.gui_seconds_format = TS_SECONDS_HOUR_MIN_SEC;
5313 recent.gui_seconds_format = TS_SECONDS_DEFAULT;
5315 timestamp_set_seconds_type (recent.gui_seconds_format);
5317 /* This call adjusts column width */
5318 cf_timestamp_auto_precision(&cfile);
5319 new_packet_list_queue_draw();
5323 menu_name_resolution_changed(void)
5325 GtkWidget *menu = NULL;
5326 #ifdef MAIN_MENU_USE_UIMANAGER
5327 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforMACLayer");
5329 g_warning("menu_name_resolution_changed: No menu found, path= /Menubar/ViewMenu/NameResolution/EnableforMACLayer");
5331 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags & RESOLV_MAC);
5333 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforNetworkLayer");
5335 g_warning("menu_name_resolution_changed: No menu found, path= /Menubar/ViewMenu/NameResolution/EnableforNetworkLayer");
5337 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags & RESOLV_NETWORK);
5339 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/EnableforTransportLayer");
5341 g_warning("menu_name_resolution_changed: No menu found, path= /Menubar/ViewMenu/NameResolution/EnableforTransportLayer");
5343 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags & RESOLV_TRANSPORT);
5346 menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Name Resolution/Enable for MAC Layer");
5347 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags & RESOLV_MAC);
5349 menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Name Resolution/Enable for Network Layer");
5350 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags & RESOLV_NETWORK);
5352 menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Name Resolution/Enable for Transport Layer");
5353 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), gbl_resolv_flags & RESOLV_TRANSPORT);
5354 #endif /* MAIN_MENU_USE_UIMANAGER */
5358 name_resolution_cb(GtkWidget *w, gpointer d _U_, gint action)
5360 if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w))) {
5361 gbl_resolv_flags |= action;
5363 gbl_resolv_flags &= ~action;
5369 menu_auto_scroll_live_changed(gboolean auto_scroll_live_in) {
5373 /* tell menu about it */
5374 #ifdef MAIN_MENU_USE_UIMANAGER
5375 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/AutoScrollinLiveCapture");
5377 g_warning("menu_auto_scroll_live_changed: No menu found, path= /Menubar/ViewMenu/AutoScrollinLiveCapture");
5380 menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Auto Scroll in Live Capture");
5381 #endif /* MAIN_MENU_USE_UIMANAGER */
5382 if( ((gboolean) gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu)) != auto_scroll_live_in) ) {
5383 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), auto_scroll_live_in);
5386 /* tell toolbar about it */
5387 toolbar_auto_scroll_live_changed(auto_scroll_live_in);
5389 /* change auto scroll */
5390 if(auto_scroll_live_in != auto_scroll_live) {
5391 auto_scroll_live = auto_scroll_live_in;
5395 #ifndef MAIN_MENU_USE_UIMANAGER
5397 auto_scroll_live_cb(GtkWidget *w _U_, gpointer d _U_)
5399 menu_auto_scroll_live_changed(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w)));
5401 #endif /* MAIN_MENU_USE_UIMANAGER */
5403 #endif /*HAVE_LIBPCAP */
5407 menu_colorize_changed(gboolean packet_list_colorize) {
5411 /* tell menu about it */
5412 #ifdef MAIN_MENU_USE_UIMANAGER
5413 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizePacketList");
5415 g_warning("menu_colorize_changed: No menu found, path= /Menubar/ViewMenu/ColorizePacketList");
5418 menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Colorize Packet List");
5419 #endif /* MAIN_MENU_USE_UIMANAGER */
5420 if( (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu)) != packet_list_colorize) ) {
5421 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), packet_list_colorize);
5424 /* tell toolbar about it */
5425 toolbar_colorize_changed(packet_list_colorize);
5427 /* change colorization */
5428 if(packet_list_colorize != recent.packet_list_colorize) {
5429 recent.packet_list_colorize = packet_list_colorize;
5430 color_filters_enable(packet_list_colorize);
5431 new_packet_list_colorize_packets();
5436 colorize_cb(GtkWidget *w, gpointer d _U_)
5438 menu_colorize_changed(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w)));
5442 /* the recent file read has finished, update the menu corresponding */
5444 menu_recent_read_finished(void) {
5445 GtkWidget *menu = NULL;
5447 #ifdef MAIN_MENU_USE_UIMANAGER
5448 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/MainToolbar");
5450 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/MainToolbar");
5452 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.main_toolbar_show);
5454 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/FilterToolbar");
5456 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/FilterToolbar");
5458 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.filter_toolbar_show);
5460 #else /* MAIN_MENU_USE_UIMANAGER */
5461 menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Main Toolbar");
5462 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.main_toolbar_show);
5464 menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Filter Toolbar");
5465 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.filter_toolbar_show);
5466 #endif /* MAIN_MENU_USE_UIMANAGER*/
5468 #ifdef MAIN_MENU_USE_UIMANAGER
5469 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/WirelessToolbar");
5471 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/WirelessToolbar");
5473 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.airpcap_toolbar_show);
5475 #else /* MAIN_MENU_USE_UIMANAGER */
5476 menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Wireless Toolbar");
5477 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.airpcap_toolbar_show);
5478 #endif /* MAIN_MENU_USE_UIMANAGER */
5479 #endif /* HAVE_AIRPCAP */
5481 #ifdef MAIN_MENU_USE_UIMANAGER
5483 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/Statusbar");
5485 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/Statusbar");
5487 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.statusbar_show);
5490 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketList");
5492 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/PacketList");
5494 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.packet_list_show);
5497 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketDetails");
5499 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/PacketDetails");
5501 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.tree_view_show);
5504 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/PacketBytes");
5506 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/PacketBytes");
5508 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.byte_view_show);
5511 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizePacketList");
5513 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/ColorizePacketList");
5515 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.packet_list_colorize);
5517 #else /* MAIN_MENU_USE_UIMANAGER */
5518 menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Statusbar");
5519 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.statusbar_show);
5521 menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Packet List");
5522 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.packet_list_show);
5524 menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Packet Details");
5525 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.tree_view_show);
5527 menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Packet Bytes");
5528 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.byte_view_show);
5530 menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Colorize Packet List");
5531 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.packet_list_colorize);
5532 #endif /* MAIN_MENU_USE_UIMANAGER*/
5534 menu_name_resolution_changed();
5537 #ifdef MAIN_MENU_USE_UIMANAGER
5538 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/AutoScrollinLiveCapture");
5540 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/AutoScrollinLiveCapture");
5542 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), auto_scroll_live);
5544 #else /* MAIN_MENU_USE_UIMANAGER */
5545 menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Auto Scroll in Live Capture");
5546 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), auto_scroll_live);
5547 #endif /* MAIN_MENU_USE_UIMANAGER*/
5548 #endif /* HAVE_LIBPCAP */
5550 main_widgets_rearrange();
5552 /* don't change the time format, if we had a command line value */
5553 if (timestamp_get_type() != TS_NOT_SET) {
5554 recent.gui_time_format = timestamp_get_type();
5557 #ifdef MAIN_MENU_USE_UIMANAGER
5559 timestamp_set_type(recent.gui_time_format);
5560 /* This call adjusts column width */
5561 cf_timestamp_auto_precision(&cfile);
5562 new_packet_list_queue_draw();
5564 /* This should not be needed as we set the active radioItem when we crate the actiongroup */
5565 switch(recent.gui_time_format) {
5566 case(TS_ABSOLUTE_WITH_DATE):
5567 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/DateandTimeofDay");
5569 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/DateandTimeofDay");
5573 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/TimeofDay");
5575 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/TimeofDay");
5579 g_warning("TS_RELATIVE");
5580 action = gtk_ui_manager_get_action(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/SecondsSinceBeginningofCapture");
5581 gtk_action_activate(action);
5582 if(gtk_action_is_sensitive(action))
5583 g_warning("ACTION IS SENSIBLE");
5585 g_warning("NO ACTION");
5588 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/SecondsSinceBeginningofCapture");
5590 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/SecondsSinceBeginningofCapture");
5594 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/SecondsSincePreviousCapturedPacket");
5596 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/SecondsSincePreviousCapturedPacket");
5600 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/SecondsSincePreviousDisplayedPacket");
5602 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/SecondsSincePreviousDisplayedPacket");
5606 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/SecondsSinceEpoch");
5608 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/SecondsSinceEpoch");
5612 g_assert_not_reached();
5614 /* set_active will not trigger the callback when activating an active item! */
5615 recent.gui_time_format = -1;
5616 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
5617 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
5619 #else /* MAIN_MENU_USE_UIMANAGER */
5620 switch(recent.gui_time_format) {
5621 case(TS_ABSOLUTE_WITH_DATE):
5622 menu = gtk_item_factory_get_widget(main_menu_factory,
5623 "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456");
5626 menu = gtk_item_factory_get_widget(main_menu_factory,
5627 "/View/Time Display Format/Time of Day: 01:02:03.123456");
5630 menu = gtk_item_factory_get_widget(main_menu_factory,
5631 "/View/Time Display Format/Seconds Since Beginning of Capture: 123.123456");
5634 menu = gtk_item_factory_get_widget(main_menu_factory,
5635 "/View/Time Display Format/Seconds Since Previous Captured Packet: 1.123456");
5638 menu = gtk_item_factory_get_widget(main_menu_factory,
5639 "/View/Time Display Format/Seconds Since Previous Displayed Packet: 1.123456");
5642 menu = gtk_item_factory_get_widget(main_menu_factory,
5643 "/View/Time Display Format/Seconds Since Epoch (1970-01-01): 1234567890.123456");
5645 case(TS_UTC_WITH_DATE):
5646 menu = gtk_item_factory_get_widget(main_menu_factory,
5647 "/View/Time Display Format/UTC Date and Time of Day: 1970-01-01 01:02:03.123456");
5650 menu = gtk_item_factory_get_widget(main_menu_factory,
5651 "/View/Time Display Format/UTC Time of Day: 01:02:03.123456");
5654 g_assert_not_reached();
5656 /* set_active will not trigger the callback when activating an active item! */
5657 recent.gui_time_format = -1;
5658 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
5659 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
5660 #endif /* MAIN_MENU_USE_UIMANAGER */
5661 #ifdef MAIN_MENU_USE_UIMANAGER
5662 /* the actual precision will be set in new_packet_list_queue_draw() below */
5663 if (recent.gui_time_precision == TS_PREC_AUTO) {
5664 timestamp_set_precision(TS_PREC_AUTO_SEC);
5666 timestamp_set_precision(recent.gui_time_precision);
5668 /* This call adjusts column width */
5669 cf_timestamp_auto_precision(&cfile);
5670 new_packet_list_queue_draw();
5671 #else /* MAIN_MENU_USE_UIMANAGER */
5672 switch(recent.gui_time_precision) {
5674 menu = gtk_item_factory_get_widget(main_menu_factory,
5675 "/View/Time Display Format/Automatic (File Format Precision)");
5677 case(TS_PREC_FIXED_SEC):
5678 menu = gtk_item_factory_get_widget(main_menu_factory,
5679 "/View/Time Display Format/Seconds: 0");
5681 case(TS_PREC_FIXED_DSEC):
5682 menu = gtk_item_factory_get_widget(main_menu_factory,
5683 "/View/Time Display Format/Deciseconds: 0.1");
5685 case(TS_PREC_FIXED_CSEC):
5686 menu = gtk_item_factory_get_widget(main_menu_factory,
5687 "/View/Time Display Format/Centiseconds: 0.12");
5689 case(TS_PREC_FIXED_MSEC):
5690 menu = gtk_item_factory_get_widget(main_menu_factory,
5691 "/View/Time Display Format/Milliseconds: 0.123");
5693 case(TS_PREC_FIXED_USEC):
5694 menu = gtk_item_factory_get_widget(main_menu_factory,
5695 "/View/Time Display Format/Microseconds: 0.123456");
5697 case(TS_PREC_FIXED_NSEC):
5698 menu = gtk_item_factory_get_widget(main_menu_factory,
5699 "/View/Time Display Format/Nanoseconds: 0.123456789");
5702 g_assert_not_reached();
5705 /* set_active will not trigger the callback when activating an active item! */
5706 recent.gui_time_precision = -1;
5707 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
5708 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
5709 #endif /* MAIN_MENU_USE_UIMANAGER */
5711 /* don't change the seconds format, if we had a command line value */
5712 if (timestamp_get_seconds_type() != TS_SECONDS_NOT_SET) {
5713 recent.gui_seconds_format = timestamp_get_seconds_type();
5715 #ifdef MAIN_MENU_USE_UIMANAGER
5716 menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes");
5718 g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes");
5720 #else /* MAIN_MENU_USE_UIMANAGER */
5721 menu = gtk_item_factory_get_widget(main_menu_factory,
5722 "/View/Time Display Format/Display Seconds with hours and minutes");
5723 #endif /* MAIN_MENU_USE_UIMANAGER */
5725 switch (recent.gui_seconds_format) {
5726 case TS_SECONDS_DEFAULT:
5727 recent.gui_seconds_format = -1;
5728 /* set_active will not trigger the callback when deactivating an inactive item! */
5729 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
5730 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
5732 case TS_SECONDS_HOUR_MIN_SEC:
5733 recent.gui_seconds_format = -1;
5734 /* set_active will not trigger the callback when activating an active item! */
5735 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
5736 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
5739 g_assert_not_reached();
5742 menu_colorize_changed(recent.packet_list_colorize);
5747 popup_menu_handler(GtkWidget *widget, GdkEvent *event, gpointer data)
5749 GtkWidget *menu = (GtkWidget *)data;
5750 GdkEventButton *event_button = NULL;
5753 if(widget == NULL || event == NULL || data == NULL) {
5758 * If we ever want to make the menu differ based on what row
5759 * and/or column we're above, we'd use "eth_clist_get_selection_info()"
5760 * to find the row and column number for the coordinates; a CTree is,
5761 * I guess, like a CList with one column(?) and the expander widget
5764 /* Check if we are on packet_list object */
5765 if (widget == g_object_get_data(G_OBJECT(popup_menu_object), E_MPACKET_LIST_KEY) &&
5766 ((GdkEventButton *)event)->button != 1) {
5768 if (new_packet_list_get_event_row_column((GdkEventButton *)event, &physical_row, &row, &column)) {
5769 g_object_set_data(G_OBJECT(popup_menu_object), E_MPACKET_LIST_ROW_KEY,
5770 GINT_TO_POINTER(row));
5771 g_object_set_data(G_OBJECT(popup_menu_object), E_MPACKET_LIST_COL_KEY,
5772 GINT_TO_POINTER(column));
5773 new_packet_list_set_selected_row(row);
5777 /* Check if we are on tree_view object */
5778 if (widget == tree_view_gbl) {
5779 tree_view_select(widget, (GdkEventButton *) event);
5782 /* context menu handler */
5783 if(event->type == GDK_BUTTON_PRESS) {
5784 event_button = (GdkEventButton *) event;
5786 /* To quote the "Gdk Event Structures" doc:
5787 * "Normally button 1 is the left mouse button, 2 is the middle button, and 3 is the right button" */
5788 if(event_button->button == 3) {
5789 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
5790 event_button->button,
5791 event_button->time);
5792 g_signal_stop_emission_by_name(widget, "button_press_event");
5797 /* Check if we are on byte_view object */
5798 if(widget == get_notebook_bv_ptr(byte_nb_ptr_gbl)) {
5799 byte_view_select(widget, (GdkEventButton *) event);
5802 /* GDK_2BUTTON_PRESS is a doubleclick -> expand/collapse tree row */
5803 /* GTK version 1 seems to be doing this automatically */
5804 if (widget == tree_view_gbl && event->type == GDK_2BUTTON_PRESS) {
5807 if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget),
5808 (gint) (((GdkEventButton *)event)->x),
5809 (gint) (((GdkEventButton *)event)->y),
5810 &path, NULL, NULL, NULL))
5812 if (gtk_tree_view_row_expanded(GTK_TREE_VIEW(widget), path))
5813 gtk_tree_view_collapse_row(GTK_TREE_VIEW(widget), path);
5815 gtk_tree_view_expand_row(GTK_TREE_VIEW(widget), path,
5817 gtk_tree_path_free(path);
5823 /* Enable or disable menu items based on whether you have a capture file
5824 you've finished reading and, if you have one, whether it's been saved
5825 and whether it could be saved except by copying the raw packet data. */
5827 set_menus_for_capture_file(capture_file *cf)
5830 /* We have no capture file */
5831 #ifdef MAIN_MENU_USE_UIMANAGER
5832 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Merge", FALSE);
5833 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Close", FALSE);
5834 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Save", FALSE);
5835 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/SaveAs", FALSE);
5836 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Export", FALSE);
5837 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/Reload", FALSE);
5838 #else /* MAIN_MENU_USE_UIMANAGER */
5839 set_menu_sensitivity_old("/File/Merge...", FALSE);
5840 set_menu_sensitivity_old("/File/Close", FALSE);
5841 set_menu_sensitivity_old("/File/Save", FALSE);
5842 set_menu_sensitivity_old("/File/Save As...", FALSE);
5843 set_menu_sensitivity_old("/File/Export", FALSE);
5844 set_menu_sensitivity_old("/View/Reload", FALSE);
5845 #endif /* MAIN_MENU_USE_UIMANAGER */
5847 set_toolbar_for_capture_file(FALSE);
5848 set_toolbar_for_unsaved_capture_file(FALSE);
5850 #ifdef MAIN_MENU_USE_UIMANAGER
5851 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Merge", TRUE);
5852 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Close", TRUE);
5853 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Save", !cf->user_saved);
5855 * "Save As..." works only if we can write the file out in at least
5856 * one format (so we can save the whole file or just a subset) or
5857 * if we have an unsaved capture (so writing the whole file out
5858 * with a raw data copy makes sense).
5860 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/SaveAs",
5861 cf_can_save_as(cf) || !cf->user_saved);
5862 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Export", TRUE);
5863 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/Reload", TRUE);
5864 #else /* MAIN_MENU_USE_UIMANAGER */
5865 set_menu_sensitivity_old("/File/Merge...", TRUE);
5866 set_menu_sensitivity_old("/File/Close", TRUE);
5867 set_menu_sensitivity_old("/File/Save", !cf->user_saved);
5869 * "Save As..." works only if we can write the file out in at least
5870 * one format (so we can save the whole file or just a subset) or
5871 * if we have an unsaved capture (so writing the whole file out
5872 * with a raw data copy makes sense).
5874 set_menu_sensitivity_old("/File/Save As...",
5875 cf_can_save_as(cf) || !cf->user_saved);
5876 set_menu_sensitivity_old("/File/Export", TRUE);
5877 set_menu_sensitivity_old("/View/Reload", TRUE);
5878 #endif /* MAIN_MENU_USE_UIMANAGER */
5879 set_toolbar_for_unsaved_capture_file(!cf->user_saved);
5880 set_toolbar_for_capture_file(TRUE);
5884 /* Enable or disable menu items based on whether there's a capture in
5887 set_menus_for_capture_in_progress(gboolean capture_in_progress)
5889 #ifdef MAIN_MENU_USE_UIMANAGER
5890 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Open",
5891 !capture_in_progress);
5892 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/OpenRecent",
5893 !capture_in_progress);
5894 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Export",
5895 capture_in_progress);
5896 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set",
5897 !capture_in_progress);
5898 #else /* MAIN_MENU_USE_UIMANAGER */
5899 set_menu_sensitivity_old("/File/Open...",
5900 !capture_in_progress);
5901 set_menu_sensitivity_old("/File/Open Recent",
5902 !capture_in_progress);
5903 set_menu_sensitivity_old("/File/Export",
5904 capture_in_progress);
5905 set_menu_sensitivity_old("/File/File Set",
5906 !capture_in_progress);
5907 #endif /* MAIN_MENU_USE_UIMANAGER */
5908 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortAscending",
5909 !capture_in_progress);
5910 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/SortDescending",
5911 !capture_in_progress);
5912 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/NoSorting",
5913 !capture_in_progress);
5916 #ifdef MAIN_MENU_USE_UIMANAGER
5917 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Options",
5918 !capture_in_progress);
5919 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Start",
5920 !capture_in_progress);
5921 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Stop",
5922 capture_in_progress);
5923 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/CaptureMenu/Restart",
5924 capture_in_progress);
5925 #else /* MAIN_MENU_USE_UIMANAGER */
5926 set_menu_sensitivity_old("/Capture/Options...",
5927 !capture_in_progress);
5928 set_menu_sensitivity_old("/Capture/Start",
5929 !capture_in_progress);
5930 set_menu_sensitivity_old("/Capture/Stop",
5931 capture_in_progress);
5932 set_menu_sensitivity_old("/Capture/Restart",
5933 capture_in_progress);
5934 #endif /* MAIN_MENU_USE_UIMANAGER */
5935 set_toolbar_for_capture_in_progress(capture_in_progress);
5937 set_capture_if_dialog_for_capture_in_progress(capture_in_progress);
5938 #endif /* HAVE_LIBPCAP */
5941 /* Enable or disable menu items based on whether you have some captured
5944 walk_menu_tree_for_captured_packets(GList *node,
5945 gboolean have_captured_packets)
5947 gboolean is_enabled;
5949 menu_item_t *node_data = node->data;
5952 * Is this a leaf node or an interior node?
5954 if (node_data->children == NULL) {
5958 * If it has no "selected_packet_enabled()" or
5959 * "selected_tree_row_enabled()" routines, we enable
5960 * it. This allows tap windows to be popped up even
5961 * if you have no capture file; this is done to let
5962 * the user pop up multiple tap windows before reading
5963 * in a capture file, so that they can be processed in
5964 * parallel while the capture file is being read rather
5965 * than one at at time as you pop up the windows, and to
5966 * let the user pop up tap windows before starting an
5967 * "Update list of packets in real time" capture, so that
5968 * the statistics can be displayed while the capture is
5971 * If it has either of those routines, we disable it for
5972 * now - as long as, when a capture is first available,
5973 * we don't get called after a packet or tree row is
5974 * selected, that's OK.
5975 * XXX - that should be done better.
5977 if (node_data->selected_packet_enabled == NULL &&
5978 node_data->selected_tree_row_enabled == NULL)
5979 node_data->enabled = TRUE;
5981 node_data->enabled = FALSE;
5984 * It's an interior node; call
5985 * "walk_menu_tree_for_captured_packets()" on all its
5986 * children and, if any of them are enabled, enable
5987 * this node, otherwise disable it.
5989 * XXX - should we just leave all interior nodes enabled?
5990 * Which is a better UI choice?
5993 for (child = node_data->children; child != NULL; child =
5995 if (walk_menu_tree_for_captured_packets(child,
5996 have_captured_packets))
5999 node_data->enabled = is_enabled;
6003 * The root node doesn't correspond to a menu tree item; it
6004 * has a null name pointer.
6006 if (node_data->gui_path != NULL) {
6007 #ifdef MAIN_MENU_USE_UIMANAGER
6008 set_menu_sensitivity(ui_manager_main_menubar, node_data->gui_path,
6009 node_data->enabled);
6011 set_menu_sensitivity_old(node_data->gui_path,
6012 node_data->enabled);
6015 return node_data->enabled;
6019 set_menus_for_captured_packets(gboolean have_captured_packets)
6021 #ifdef MAIN_MENU_USE_UIMANAGER
6022 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Print",
6023 have_captured_packets);
6024 #else /* MAIN_MENU_USE_UIMANAGER */
6025 set_menu_sensitivity_old("/File/Print...",
6026 have_captured_packets);
6027 #endif /* MAIN_MENU_USE_UIMANAGER */
6028 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/Print",
6029 have_captured_packets);
6031 #ifdef MAIN_MENU_USE_UIMANAGER
6032 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPacket",
6033 have_captured_packets);
6034 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindNext",
6035 have_captured_packets);
6036 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPrevious",
6037 have_captured_packets);
6038 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ZoomIn",
6039 have_captured_packets);
6040 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ZoomOut",
6041 have_captured_packets);
6042 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/NormalSize",
6043 have_captured_packets);
6044 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/GotoCorrespondingPacket",
6045 have_captured_packets);
6046 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/PreviousPacket",
6047 have_captured_packets);
6048 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/NextPacket",
6049 have_captured_packets);
6050 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/FirstPacket",
6051 have_captured_packets);
6052 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/LastPacket",
6053 have_captured_packets);
6054 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/PreviousPacketInConversation",
6055 have_captured_packets);
6056 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/NextPacketInConversation",
6057 have_captured_packets);
6058 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/StatisticsMenu/Summary",
6059 have_captured_packets);
6060 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/StatisticsMenu/ProtocolHierarchy",
6061 have_captured_packets);
6062 #else /* MAIN_MENU_USE_UIMANAGER */
6063 set_menu_sensitivity_old("/Edit/Find Packet...",
6064 have_captured_packets);
6065 set_menu_sensitivity_old("/Edit/Find Next",
6066 have_captured_packets);
6067 set_menu_sensitivity_old("/Edit/Find Previous",
6068 have_captured_packets);
6069 set_menu_sensitivity_old("/View/Zoom In",
6070 have_captured_packets);
6071 set_menu_sensitivity_old("/View/Zoom Out",
6072 have_captured_packets);
6073 set_menu_sensitivity_old("/View/Normal Size",
6074 have_captured_packets);
6075 set_menu_sensitivity_old("/Go/Go to Packet...",
6076 have_captured_packets);
6077 set_menu_sensitivity_old("/Go/Previous Packet",
6078 have_captured_packets);
6079 set_menu_sensitivity_old("/Go/Next Packet",
6080 have_captured_packets);
6081 set_menu_sensitivity_old("/Go/First Packet",
6082 have_captured_packets);
6083 set_menu_sensitivity_old("/Go/Last Packet",
6084 have_captured_packets);
6085 set_menu_sensitivity_old("/Go/Previous Packet In Conversation",
6086 have_captured_packets);
6087 set_menu_sensitivity_old("/Go/Next Packet In Conversation",
6088 have_captured_packets);
6089 set_menu_sensitivity_old("/Statistics/Summary",
6090 have_captured_packets);
6091 set_menu_sensitivity_old("/Statistics/Protocol Hierarchy",
6092 have_captured_packets);
6093 #endif /* MAIN_MENU_USE_UIMANAGER */
6094 walk_menu_tree_for_captured_packets(tap_menu_tree_root,
6095 have_captured_packets);
6096 set_toolbar_for_captured_packets(have_captured_packets);
6099 /* Enable or disable menu items based on whether a packet is selected and,
6100 if so, on the properties of the packet. */
6102 walk_menu_tree_for_selected_packet(GList *node, frame_data *fd,
6103 epan_dissect_t *edt)
6105 gboolean is_enabled;
6107 menu_item_t *node_data = node->data;
6110 * Is this a leaf node or an interior node?
6112 if (node_data->children == NULL) {
6116 * If it has no "selected_packet_enabled()" routine,
6117 * leave its enabled/disabled status alone - it
6118 * doesn't depend on whether we have a packet selected
6119 * or not or on the selected packet.
6121 * If it has a "selected_packet_enabled()" routine,
6122 * call it and set the item's enabled/disabled status
6123 * based on its return value.
6125 if (node_data->selected_packet_enabled != NULL)
6126 node_data->enabled = node_data->selected_packet_enabled(fd, edt, node_data->callback_data);
6129 * It's an interior node; call
6130 * "walk_menu_tree_for_selected_packet()" on all its
6131 * children and, if any of them are enabled, enable
6132 * this node, otherwise disable it.
6134 * XXX - should we just leave all interior nodes enabled?
6135 * Which is a better UI choice?
6138 for (child = node_data->children; child != NULL; child =
6140 if (walk_menu_tree_for_selected_packet(child, fd, edt))
6143 node_data->enabled = is_enabled;
6147 * The root node doesn't correspond to a menu tree item; it
6148 * has a null name pointer.
6150 if (node_data->gui_path != NULL) {
6151 #ifdef MAIN_MENU_USE_UIMANAGER
6152 set_menu_sensitivity(ui_manager_main_menubar, node_data->gui_path,
6153 node_data->enabled);
6154 #else /* MAIN_MENU_USE_UIMANAGER */
6155 set_menu_sensitivity_old(node_data->gui_path,
6156 node_data->enabled);
6157 #endif /* MAIN_MENU_USE_UIMANAGER */
6159 return node_data->enabled;
6163 packet_is_ssl(epan_dissect_t* edt)
6169 if (!edt || !edt->tree)
6171 ssl_id = proto_get_id_by_filter_name("ssl");
6174 array = proto_find_finfo(edt->tree, ssl_id);
6175 is_ssl = (array->len > 0) ? TRUE : FALSE;
6176 g_ptr_array_free(array, TRUE);
6181 set_menus_for_selected_packet(capture_file *cf)
6183 /* Making the menu context-sensitive allows for easier selection of the
6184 desired item and has the added benefit, with large captures, of
6185 avoiding needless looping through huge lists for marked, ignored,
6186 or time-referenced packets. */
6187 gboolean is_ssl = packet_is_ssl(cf->edt);
6188 gboolean frame_selected = cf->current_frame != NULL;
6189 /* A frame is selected */
6190 gboolean have_marked = frame_selected && cf->marked_count > 0;
6191 /* We have marked frames. (XXX - why check frame_selected?) */
6192 gboolean another_is_marked = have_marked &&
6193 !(cf->marked_count == 1 && cf->current_frame->flags.marked);
6194 /* We have a marked frame other than the current frame (i.e.,
6195 we have at least one marked frame, and either there's more
6196 than one marked frame or the current frame isn't marked). */
6197 gboolean have_time_ref = cf->ref_time_count > 0;
6198 gboolean another_is_time_ref = frame_selected && have_time_ref &&
6199 !(cf->ref_time_count == 1 && cf->current_frame->flags.ref_time);
6200 /* We have a time reference frame other than the current frame (i.e.,
6201 we have at least one time reference frame, and either there's more
6202 than one time reference frame or the current frame isn't a
6203 time reference frame). (XXX - why check frame_selected?) */
6205 #ifdef MAIN_MENU_USE_UIMANAGER
6206 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/MarkPacket",
6208 #else /* MAIN_MENU_USE_UIMANAGER */
6209 set_menu_sensitivity_old("/Edit/Mark Packet (toggle)",
6211 #endif /* MAIN_MENU_USE_UIMANAGER */
6212 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/MarkPacket",
6214 #ifdef MAIN_MENU_USE_UIMANAGER
6215 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/MarkAllDisplayedPackets",
6216 cf->displayed_count > 0);
6217 /* Unlike un-ignore, do not allow unmark of all frames when no frames are displayed */
6218 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/UnmarkAllDisplayedPackets",
6220 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindNextMark",
6222 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPreviousMark",
6225 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/IgnorePacket",
6227 #ifdef WANT_PACKET_EDITOR
6228 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/EditPacket",
6230 #endif /* WANT_PACKET_EDITOR */
6231 #else /* MAIN_MENU_USE_UIMANAGER */
6232 set_menu_sensitivity_old("/Edit/Mark All Displayed Packets (toggle)",
6233 cf->displayed_count > 0);
6234 /* Unlike un-ignore, do not allow unmark of all frames when no frames are displayed */
6235 set_menu_sensitivity_old("/Edit/Unmark All Packets",
6237 set_menu_sensitivity_old("/Edit/Find Next Mark",
6239 set_menu_sensitivity_old("/Edit/Find Previous Mark",
6242 set_menu_sensitivity_old("/Edit/Ignore Packet (toggle)",
6244 set_menu_sensitivity_old("/Edit/Edit packet",
6246 #endif /* MAIN_MENU_USE_UIMANAGER */
6247 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/IgnorePacket",
6249 #ifdef MAIN_MENU_USE_UIMANAGER
6250 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/IgnoreAllDisplayedPackets",
6251 cf->displayed_count > 0 && cf->displayed_count != cf->count);
6252 /* Allow un-ignore of all frames even with no frames currently displayed */
6253 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Un-IgnoreAllPackets",
6254 cf->ignored_count > 0);
6256 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/SetTimeReference",
6258 #else /* MAIN_MENU_USE_UIMANAGER */
6259 set_menu_sensitivity_old("/Edit/Ignore All Displayed Packets (toggle)",
6260 cf->displayed_count > 0 && cf->displayed_count != cf->count);
6261 /* Allow un-ignore of all frames even with no frames currently displayed */
6262 set_menu_sensitivity_old("/Edit/Un-Ignore All Packets",
6263 cf->ignored_count > 0);
6265 set_menu_sensitivity_old("/Edit/Set Time Reference (toggle)",
6267 #endif /* MAIN_MENU_USE_UIMANAGER */
6268 #ifdef MAIN_MENU_USE_UIMANAGER
6269 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Un-TimeReferenceAllPackets",
6271 #else /* MAIN_MENU_USE_UIMANAGER */
6272 set_menu_sensitivity_old("/Edit/Un-Time Reference All Packets",
6274 #endif /* MAIN_MENU_USE_UIMANAGER */
6275 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/SetTimeReference",
6277 #ifdef MAIN_MENU_USE_UIMANAGER
6278 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindNextTimeReference",
6279 another_is_time_ref);
6280 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/FindPreviousTimeReference",
6281 another_is_time_ref);
6283 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ResizeAllColumns",
6285 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/CollapseAll",
6287 #else /* MAIN_MENU_USE_UIMANAGER */
6288 set_menu_sensitivity_old("/Edit/Find Next Time Reference",
6289 another_is_time_ref);
6290 set_menu_sensitivity_old("/Edit/Find Previous Time Reference",
6291 another_is_time_ref);
6293 set_menu_sensitivity_old("/View/Resize All Columns",
6295 set_menu_sensitivity_old("/View/Collapse All",
6297 #endif /* MAIN_MENU_USE_UIMANAGER */
6298 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/CollapseAll",
6300 #ifdef MAIN_MENU_USE_UIMANAGER
6301 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ExpandAll",
6303 #else /* MAIN_MENU_USE_UIMANAGER */
6304 set_menu_sensitivity_old("/View/Expand All",
6306 #endif /* MAIN_MENU_USE_UIMANAGER */
6307 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ExpandAll",
6309 #ifdef MAIN_MENU_USE_UIMANAGER
6310 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ColorizeConversation",
6312 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ResetColoring1-10",
6313 tmp_color_filters_used());
6314 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ShowPacketinNewWindow",
6316 #else /* MAIN_MENU_USE_UIMANAGER */
6317 set_menu_sensitivity_old("/View/Colorize Conversation",
6319 set_menu_sensitivity_old("/View/Reset Coloring 1-10",
6320 tmp_color_filters_used());
6321 set_menu_sensitivity_old("/View/Show Packet in New Window",
6323 #endif /* MAIN_MENU_USE_UIMANAGER */
6324 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ShowPacketinNewWindow",
6326 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ManuallyResolveAddress",
6327 frame_selected ? ((cf->edt->pi.ethertype == ETHERTYPE_IP)||(cf->edt->pi.ethertype == ETHERTYPE_IPv6)) : FALSE);
6328 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/SCTP",
6329 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_SCTP) : FALSE);
6330 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/FollowTCPStream",
6331 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
6332 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FollowTCPStream",
6333 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
6334 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/FollowUDPStream",
6335 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
6336 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/FollowSSLStream",
6337 frame_selected ? is_ssl : FALSE);
6338 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FollowSSLStream",
6339 frame_selected ? is_ssl : FALSE);
6340 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter",
6342 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter/Ethernet",
6343 frame_selected ? (cf->edt->pi.dl_src.type == AT_ETHER) : FALSE);
6344 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter/IP",
6345 frame_selected ? ((cf->edt->pi.ethertype == ETHERTYPE_IP)||(cf->edt->pi.ethertype == ETHERTYPE_IPv6)) : FALSE);
6346 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter/TCP",
6347 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
6348 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter/UDP",
6349 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
6350 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FollowUDPStream",
6351 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
6352 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ConversationFilter/PN-CBA",
6353 frame_selected ? (cf->edt->pi.profinet_type != 0 && cf->edt->pi.profinet_type < 10) : FALSE);
6354 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation",
6356 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation/Ethernet",
6357 frame_selected ? (cf->edt->pi.dl_src.type == AT_ETHER) : FALSE);
6358 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation/IP",
6359 frame_selected ? ((cf->edt->pi.ethertype == ETHERTYPE_IP)||(cf->edt->pi.ethertype == ETHERTYPE_IPv6)) : FALSE);
6360 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation/TCP",
6361 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
6362 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation/UDP",
6363 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
6364 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ColorizeConversation/PN-CBA",
6365 frame_selected ? (cf->edt->pi.profinet_type != 0 && cf->edt->pi.profinet_type < 10) : FALSE);
6366 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/DecodeAs",
6367 frame_selected && decode_as_ok());
6368 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/DecodeAs",
6369 frame_selected && decode_as_ok());
6370 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/Copy",
6372 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ApplyAsFilter",
6374 set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/PrepareaFilter",
6376 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ResolveName",
6377 frame_selected && (gbl_resolv_flags & RESOLV_ALL_ADDRS) != RESOLV_ALL_ADDRS);
6378 #ifdef MAIN_MENU_USE_UIMANAGER
6379 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/FollowTCPStream",
6380 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
6381 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/FollowUDPStream",
6382 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
6383 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/FollowSSLStream",
6384 frame_selected ? is_ssl : FALSE);
6385 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/DecodeAs",
6386 frame_selected && decode_as_ok());
6387 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/NameResolution/ResolveName",
6388 frame_selected && (gbl_resolv_flags & RESOLV_ALL_ADDRS) != RESOLV_ALL_ADDRS);
6389 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ToolsMenu/FirewallACLRules",
6391 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/StatisticsMenu/TCPStreamGraphMenu",
6392 tcp_graph_selected_packet_enabled(cf->current_frame,cf->edt, NULL));
6395 #else /* MAIN_MENU_USE_UIMANAGER */
6396 set_menu_sensitivity_old("/Analyze/Follow TCP Stream",
6397 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
6398 set_menu_sensitivity_old("/Analyze/Follow UDP Stream",
6399 frame_selected ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
6400 set_menu_sensitivity_old("/Analyze/Follow SSL Stream",
6401 frame_selected ? is_ssl : FALSE);
6402 set_menu_sensitivity_old("/Analyze/Decode As...",
6403 frame_selected && decode_as_ok());
6404 set_menu_sensitivity_old("/View/Name Resolution/Resolve Name",
6405 frame_selected && (gbl_resolv_flags & RESOLV_ALL_ADDRS) != RESOLV_ALL_ADDRS);
6406 set_menu_sensitivity_old("/Tools/Firewall ACL Rules",
6408 #endif /* MAIN_MENU_USE_UIMANAGER */
6409 walk_menu_tree_for_selected_packet(tap_menu_tree_root, cf->current_frame,
6413 /* Enable or disable menu items based on whether a tree row is selected
6414 and, if so, on the properties of the tree row. */
6416 walk_menu_tree_for_selected_tree_row(GList *node, field_info *fi)
6418 gboolean is_enabled;
6420 menu_item_t *node_data = node->data;
6423 * Is this a leaf node or an interior node?
6425 if (node_data->children == NULL) {
6429 * If it has no "selected_tree_row_enabled()" routine,
6430 * leave its enabled/disabled status alone - it
6431 * doesn't depend on whether we have a tree row selected
6432 * or not or on the selected tree row.
6434 * If it has a "selected_tree_row_enabled()" routine,
6435 * call it and set the item's enabled/disabled status
6436 * based on its return value.
6438 if (node_data->selected_tree_row_enabled != NULL)
6439 node_data->enabled = node_data->selected_tree_row_enabled(fi, node_data->callback_data);
6442 * It's an interior node; call
6443 * "walk_menu_tree_for_selected_tree_row()" on all its
6444 * children and, if any of them are enabled, enable
6445 * this node, otherwise disable it.
6447 * XXX - should we just leave all interior nodes enabled?
6448 * Which is a better UI choice?
6451 for (child = node_data->children; child != NULL; child =
6453 if (walk_menu_tree_for_selected_tree_row(child, fi))
6456 node_data->enabled = is_enabled;
6460 * The root node doesn't correspond to a menu tree item; it
6461 * has a null name pointer.
6463 if (node_data->gui_path != NULL) {
6464 #ifdef MAIN_MENU_USE_UIMANAGER
6465 set_menu_sensitivity(ui_manager_main_menubar, node_data->gui_path,
6466 node_data->enabled);
6467 #else /* MAIN_MENU_USE_UIMANAGER */
6468 set_menu_sensitivity_old(node_data->gui_path,
6469 node_data->enabled);
6470 #endif /* MAIN_MENU_USE_UIMANAGER */
6472 return node_data->enabled;
6476 menu_prefs_toggle_bool (GtkWidget *w, gpointer data)
6478 gboolean *value = data;
6479 module_t *module = g_object_get_data (G_OBJECT(w), "module");
6481 module->prefs_changed = TRUE;
6484 prefs_apply (module);
6485 if (!prefs.gui_use_pref_save) {
6488 redissect_packets();
6492 menu_prefs_change_enum (GtkWidget *w, gpointer data)
6495 module_t *module = g_object_get_data (G_OBJECT(w), "module");
6496 gint new_value = GPOINTER_TO_INT(g_object_get_data (G_OBJECT(w), "enumval"));
6498 if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM(w)))
6501 if (*value != new_value) {
6502 module->prefs_changed = TRUE;
6505 prefs_apply (module);
6506 if (!prefs.gui_use_pref_save) {
6509 redissect_packets();
6514 menu_prefs_reset(void)
6516 g_free (g_object_get_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev"));
6517 g_object_set_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev", NULL);
6521 menu_prefs_change_ok (GtkWidget *w, gpointer parent_w)
6523 GtkWidget *entry = g_object_get_data (G_OBJECT(w), "entry");
6524 module_t *module = g_object_get_data (G_OBJECT(w), "module");
6525 pref_t *pref = g_object_get_data (G_OBJECT(w), "pref");
6526 const gchar *new_value = gtk_entry_get_text(GTK_ENTRY(entry));
6531 switch (pref->type) {
6533 uval = strtoul(new_value, &p, pref->info.base);
6534 if (p == new_value || *p != '\0') {
6535 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
6536 "The value \"%s\" isn't a valid number.",
6540 if (*pref->varp.uint != uval) {
6541 module->prefs_changed = TRUE;
6542 *pref->varp.uint = uval;
6546 if (strcmp (*pref->varp.string, new_value) != 0) {
6547 module->prefs_changed = TRUE;
6548 g_free((void*)*pref->varp.string);
6549 *pref->varp.string = g_strdup(new_value);
6553 if (range_convert_str(&newrange, new_value, pref->info.max_value) != CVT_NO_ERROR) {
6554 simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
6555 "The value \"%s\" isn't a valid range.",
6559 if (!ranges_are_equal(*pref->varp.range, newrange)) {
6560 module->prefs_changed = TRUE;
6561 g_free(*pref->varp.range);
6562 *pref->varp.range = newrange;
6568 g_assert_not_reached();
6572 if (module->prefs_changed) {
6573 /* Ensure we reload the sub menu */
6575 prefs_apply (module);
6576 if (!prefs.gui_use_pref_save) {
6579 redissect_packets();
6582 window_destroy(GTK_WIDGET(parent_w));
6586 menu_prefs_change_cancel (GtkWidget *w _U_, gpointer parent_w)
6588 window_destroy(GTK_WIDGET(parent_w));
6592 menu_prefs_edit_dlg (GtkWidget *w, gpointer data)
6594 pref_t *pref = data;
6595 module_t *module = g_object_get_data (G_OBJECT(w), "module");
6596 gchar *value = NULL;
6598 GtkWidget *win, *main_tb, *main_vb, *bbox, *cancel_bt, *ok_bt;
6599 GtkWidget *entry, *label;
6601 switch (pref->type) {
6603 switch (pref->info.base) {
6605 value = g_strdup_printf("%o", *pref->varp.uint);
6608 value = g_strdup_printf("%u", *pref->varp.uint);
6611 value = g_strdup_printf("%x", *pref->varp.uint);
6614 g_assert_not_reached();
6619 value = g_strdup(*pref->varp.string);
6622 value = g_strdup(range_convert_range (*pref->varp.range));
6625 g_assert_not_reached();
6629 win = dlg_window_new(module->description);
6631 gtk_window_set_resizable(GTK_WINDOW(win),FALSE);
6632 gtk_window_resize(GTK_WINDOW(win), 400, 100);
6634 main_vb = gtk_vbox_new(FALSE, 5);
6635 gtk_container_add(GTK_CONTAINER(win), main_vb);
6636 gtk_container_set_border_width(GTK_CONTAINER(main_vb), 6);
6638 main_tb = gtk_table_new(2, 2, FALSE);
6639 gtk_box_pack_start(GTK_BOX(main_vb), main_tb, FALSE, FALSE, 0);
6640 gtk_table_set_col_spacings(GTK_TABLE(main_tb), 10);
6642 label = gtk_label_new(ep_strdup_printf("%s:", pref->title));
6643 gtk_table_attach_defaults(GTK_TABLE(main_tb), label, 0, 1, 1, 2);
6644 gtk_misc_set_alignment(GTK_MISC(label), 1.0f, 0.5f);
6645 if (pref->description)
6646 gtk_widget_set_tooltip_text(label, pref->description);
6648 entry = gtk_entry_new();
6649 gtk_table_attach_defaults(GTK_TABLE(main_tb), entry, 1, 2, 1, 2);
6650 gtk_entry_set_text(GTK_ENTRY(entry), value);
6651 if (pref->description)
6652 gtk_widget_set_tooltip_text(entry, pref->description);
6654 bbox = dlg_button_row_new(GTK_STOCK_CANCEL,GTK_STOCK_OK, NULL);
6655 gtk_box_pack_end(GTK_BOX(main_vb), bbox, FALSE, FALSE, 0);
6657 ok_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_OK);
6658 g_object_set_data (G_OBJECT(ok_bt), "module", module);
6659 g_object_set_data (G_OBJECT(ok_bt), "entry", entry);
6660 g_object_set_data (G_OBJECT(ok_bt), "pref", pref);
6661 g_signal_connect(ok_bt, "clicked", G_CALLBACK(menu_prefs_change_ok), win);
6663 dlg_set_activate(entry, ok_bt);
6665 cancel_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CANCEL);
6666 g_signal_connect(cancel_bt, "clicked", G_CALLBACK(menu_prefs_change_cancel), win);
6667 window_set_cancel_button(win, cancel_bt, NULL);
6669 gtk_widget_grab_default(ok_bt);
6670 gtk_widget_show_all(win);
6675 add_protocol_prefs_menu (pref_t *pref, gpointer data)
6677 GtkWidget *menu_preferences;
6678 GtkWidget *menu_item, *menu_sub_item, *sub_menu;
6679 GSList *group = NULL;
6680 module_t *module = data;
6681 const enum_val_t *enum_valp;
6682 gchar *label = NULL;
6684 switch (pref->type) {
6686 switch (pref->info.base) {
6688 label = g_strdup_printf ("%s: %o", pref->title, *pref->varp.uint);
6691 label = g_strdup_printf ("%s: %u", pref->title, *pref->varp.uint);
6694 label = g_strdup_printf ("%s: %x", pref->title, *pref->varp.uint);
6697 g_assert_not_reached();
6700 menu_item = gtk_menu_item_new_with_label(label);
6701 g_object_set_data (G_OBJECT(menu_item), "module", module);
6702 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_edit_dlg), pref);
6706 menu_item = gtk_check_menu_item_new_with_label(pref->title);
6707 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(menu_item), *pref->varp.boolp);
6708 g_object_set_data (G_OBJECT(menu_item), "module", module);
6709 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_toggle_bool), pref->varp.boolp);
6712 menu_item = gtk_menu_item_new_with_label(pref->title);
6713 sub_menu = gtk_menu_new();
6714 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_item), sub_menu);
6715 enum_valp = pref->info.enum_info.enumvals;
6716 while (enum_valp->name != NULL) {
6717 menu_sub_item = gtk_radio_menu_item_new_with_label(group, enum_valp->description);
6718 group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_sub_item));
6719 if (enum_valp->value == *pref->varp.enump) {
6720 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(menu_sub_item), TRUE);
6722 g_object_set_data (G_OBJECT(menu_sub_item), "module", module);
6723 g_object_set_data (G_OBJECT(menu_sub_item), "enumval", GINT_TO_POINTER(enum_valp->value));
6724 g_signal_connect(menu_sub_item, "activate", G_CALLBACK(menu_prefs_change_enum), pref->varp.enump);
6725 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_sub_item);
6726 gtk_widget_show (menu_sub_item);
6731 label = g_strdup_printf ("%s: %s", pref->title, *pref->varp.string);
6732 menu_item = gtk_menu_item_new_with_label(label);
6733 g_object_set_data (G_OBJECT(menu_item), "module", module);
6734 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_edit_dlg), pref);
6738 label = g_strdup_printf ("%s: %s", pref->title, range_convert_range (*pref->varp.range));
6739 menu_item = gtk_menu_item_new_with_label(label);
6740 g_object_set_data (G_OBJECT(menu_item), "module", module);
6741 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_prefs_edit_dlg), pref);
6745 label = g_strdup_printf ("%s...", pref->title);
6746 menu_item = gtk_menu_item_new_with_label(label);
6747 g_signal_connect (menu_item, "activate", G_CALLBACK(uat_window_cb), pref->varp.uat);
6750 case PREF_STATIC_TEXT:
6753 /* Nothing to add */
6757 menu_preferences = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences");
6758 if(!menu_preferences)
6759 g_warning("menu_preferences Not found path:TreeViewPopup/ProtocolPreferences");
6760 sub_menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM(menu_preferences));
6761 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
6762 gtk_widget_show (menu_item);
6768 rebuild_protocol_prefs_menu (module_t *prefs_module_p, gboolean preferences)
6770 GtkWidget *menu_preferences, *menu_item;
6771 GtkWidget *sub_menu;
6774 menu_preferences = gtk_ui_manager_get_widget(ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences");
6776 sub_menu = gtk_menu_new();
6777 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_preferences), sub_menu);
6779 label = g_strdup_printf ("%s Preferences...", prefs_module_p->description);
6780 menu_item = gtk_image_menu_item_new_with_label (label);
6781 gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM(menu_item),
6782 gtk_image_new_from_stock(GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_MENU));
6783 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
6784 g_signal_connect_swapped(G_OBJECT(menu_item), "activate",
6785 G_CALLBACK(properties_cb), (GObject *) menu_item);
6786 gtk_widget_show (menu_item);
6789 menu_item = gtk_menu_item_new();
6790 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
6791 gtk_widget_show (menu_item);
6793 prefs_pref_foreach(prefs_module_p, add_protocol_prefs_menu, prefs_module_p);
6795 /* No preferences, remove sub menu */
6796 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_preferences), NULL);
6802 menu_visible_column_toggle (GtkWidget *w _U_, gpointer data)
6804 new_packet_list_toggle_visible_column (GPOINTER_TO_INT(data));
6808 rebuild_visible_columns_menu (void)
6810 GtkWidget *menu_columns[2], *menu_item;
6811 GtkWidget *sub_menu;
6815 gint i, col_id, cur_fmt;
6816 #ifdef MAIN_MENU_USE_UIMANAGER
6817 menu_columns[0] = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/DisplayedColumns");
6818 if(! menu_columns[0]){
6819 fprintf (stderr, "Warning: couldn't find menu_columns[0] path=/Menubar/ViewMenu/DisplayedColumns");
6821 #else /* MAIN_MENU_USE_UIMANAGER */
6822 menu_columns[0] = gtk_item_factory_get_widget(main_menu_factory, "/View/Displayed Columns");
6823 #endif /* MAIN_MENU_USE_UIMANAGER */
6824 menu_columns[1] = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/DisplayedColumns");
6826 if(! menu_columns[1]){
6827 fprintf (stderr, "Warning: couldn't find menu_columns[1] path=/PacketListHeadingPopup/DisplayedColumns");
6830 for (i = 0; i < 2; i++) {
6831 sub_menu = gtk_menu_new();
6832 gtk_menu_item_set_submenu (GTK_MENU_ITEM(menu_columns[i]), sub_menu);
6834 clp = g_list_first (prefs.col_list);
6837 cfmt = (fmt_data *) clp->data;
6838 cur_fmt = get_column_format_from_str(cfmt->fmt);
6839 if (cfmt->title[0]) {
6840 if (cur_fmt == COL_CUSTOM) {
6841 title = g_strdup_printf ("%s (%s)", cfmt->title, cfmt->custom_field);
6843 title = g_strdup_printf ("%s (%s)", cfmt->title, col_format_desc (cur_fmt));
6846 if (cur_fmt == COL_CUSTOM) {
6847 title = g_strdup_printf ("(%s)", cfmt->custom_field);
6849 title = g_strdup_printf ("(%s)", col_format_desc (cur_fmt));
6852 menu_item = gtk_check_menu_item_new_with_label(title);
6854 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(menu_item), cfmt->visible);
6855 g_signal_connect(menu_item, "activate", G_CALLBACK(menu_visible_column_toggle), GINT_TO_POINTER(col_id));
6856 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
6857 gtk_widget_show (menu_item);
6858 clp = g_list_next (clp);
6862 menu_item = gtk_menu_item_new();
6863 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
6864 gtk_widget_show (menu_item);
6866 menu_item = gtk_menu_item_new_with_label ("Display All");
6867 gtk_menu_shell_append (GTK_MENU_SHELL(sub_menu), menu_item);
6868 g_signal_connect(menu_item, "activate", G_CALLBACK(packet_list_heading_activate_all_columns_cb), NULL);
6869 gtk_widget_show (menu_item);
6874 menus_set_column_resolved (gboolean resolved, gboolean can_resolve)
6878 menu = gtk_ui_manager_get_widget(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ShowResolved");
6880 fprintf (stderr, "Warning: couldn't find menu path=/PacketListHeadingPopup/ShowResolved");
6882 g_object_set_data(G_OBJECT(menu), "skip-update", (void *)1);
6883 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), resolved && can_resolve);
6884 set_menu_sensitivity(ui_manager_packet_list_heading, "/PacketListHeadingPopup/ShowResolved", can_resolve);
6885 g_object_set_data(G_OBJECT(menu), "skip-update", NULL);
6889 menus_set_column_align_default (gboolean right_justify)
6891 GtkWidget *submenu, *menu_item_child;
6892 GList *child_list, *child_list_item;
6893 const gchar *menu_item_name;
6894 size_t menu_item_len;
6896 /* get the submenu container item */
6897 submenu = gtk_ui_manager_get_widget (ui_manager_packet_list_heading, "/PacketListHeadingPopup");
6899 fprintf (stderr, "Warning: couldn't find submenu path=/PacketListHeadingPopup");
6902 /* find the corresponding menu items to update */
6903 child_list = gtk_container_get_children(GTK_CONTAINER(submenu));
6904 child_list_item = child_list;
6905 while(child_list_item) {
6906 menu_item_child = gtk_bin_get_child(GTK_BIN(child_list_item->data));
6907 if (menu_item_child != NULL) {
6908 menu_item_name = gtk_label_get_text(GTK_LABEL(menu_item_child));
6909 menu_item_len = strlen (menu_item_name);
6910 if(strncmp(menu_item_name, "Align Left", 10) == 0) {
6911 if (!right_justify && menu_item_len == 10) {
6912 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Left\t(default)");
6913 } else if (right_justify && menu_item_len > 10) {
6914 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Left");
6916 } else if (strncmp (menu_item_name, "Align Right", 11) == 0) {
6917 if (right_justify && menu_item_len == 11) {
6918 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Right\t(default)");
6919 } else if (!right_justify && menu_item_len > 11) {
6920 gtk_label_set_text(GTK_LABEL(menu_item_child), "Align Right");
6924 child_list_item = g_list_next(child_list_item);
6926 g_list_free(child_list);
6930 set_menus_for_selected_tree_row(capture_file *cf)
6932 gboolean properties;
6935 if (cf->finfo_selected != NULL) {
6936 header_field_info *hfinfo = cf->finfo_selected->hfinfo;
6940 if (hfinfo->parent == -1) {
6941 abbrev = hfinfo->abbrev;
6942 id = (hfinfo->type == FT_PROTOCOL) ? proto_get_id((protocol_t *)hfinfo->strings) : -1;
6944 abbrev = proto_registrar_get_abbrev(hfinfo->parent);
6945 id = hfinfo->parent;
6947 properties = prefs_is_registered_protocol(abbrev);
6948 set_menu_sensitivity(ui_manager_tree_view_menu,
6949 "/TreeViewPopup/GotoCorrespondingPacket", hfinfo->type == FT_FRAMENUM);
6950 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/Copy",
6952 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/Copy/AsFilter",
6953 proto_can_match_selected(cf->finfo_selected, cf->edt));
6954 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyasColumn",
6955 hfinfo->type != FT_NONE);
6956 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter",
6957 proto_can_match_selected(cf->finfo_selected, cf->edt));
6958 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter",
6959 proto_can_match_selected(cf->finfo_selected, cf->edt));
6960 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ColorizewithFilter",
6961 proto_can_match_selected(cf->finfo_selected, cf->edt));
6962 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences",
6964 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/DisableProtocol",
6965 (id == -1) ? FALSE : proto_can_toggle_protocol(id));
6966 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ExpandSubtrees",
6967 cf->finfo_selected->tree_type != -1);
6968 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/WikiProtocolPage",
6969 (id == -1) ? FALSE : TRUE);
6970 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FilterFieldReference",
6971 (id == -1) ? FALSE : TRUE);
6972 #ifdef MAIN_MENU_USE_UIMANAGER
6973 set_menu_sensitivity(ui_manager_tree_view_menu,
6974 "/Menubar/FileMenu/Export/SelectedPacketBytes", TRUE);
6975 set_menu_sensitivity(ui_manager_tree_view_menu,
6976 "/Menubar/GoMenu/GotoCorrespondingPacket", hfinfo->type == FT_FRAMENUM);
6977 set_menu_sensitivity(ui_manager_tree_view_menu, "/Menubar/EditMenu/Copy/Description",
6978 proto_can_match_selected(cf->finfo_selected, cf->edt));
6979 set_menu_sensitivity(ui_manager_tree_view_menu, "/Menubar/EditMenu/Copy/Fieldname",
6980 proto_can_match_selected(cf->finfo_selected, cf->edt));
6981 set_menu_sensitivity(ui_manager_tree_view_menu, "/Menubar/EditMenu/Copy/Value",
6982 proto_can_match_selected(cf->finfo_selected, cf->edt));
6983 set_menu_sensitivity(ui_manager_tree_view_menu, "/Menubar/EditMenu/Copy/AsFilter",
6984 proto_can_match_selected(cf->finfo_selected, cf->edt));
6985 set_menu_sensitivity(ui_manager_tree_view_menu, "/Menubar/AnalyzeMenu/ApplyasColumn",
6986 hfinfo->type != FT_NONE);
6987 set_menu_sensitivity(ui_manager_tree_view_menu, "/Menubar/AnalyzeMenu/ApplyAsFilter",
6988 proto_can_match_selected(cf->finfo_selected, cf->edt));
6989 set_menu_sensitivity(ui_manager_tree_view_menu, "/Menubar/AnalyzeMenu/PrepareaFilter",
6990 proto_can_match_selected(cf->finfo_selected, cf->edt));
6991 set_menu_sensitivity(ui_manager_tree_view_menu, "/Menubar/ViewMenu/ExpandSubtrees",
6992 cf->finfo_selected->tree_type != -1);
6994 set_menu_sensitivity_old(
6995 "/File/Export/Selected Packet Bytes...", TRUE);
6996 set_menu_sensitivity_old(
6997 "/Go/Go to Corresponding Packet", hfinfo->type == FT_FRAMENUM);
6998 set_menu_sensitivity_old("/Edit/Copy/Description",
6999 proto_can_match_selected(cf->finfo_selected, cf->edt));
7000 set_menu_sensitivity_old("/Edit/Copy/Fieldname",
7001 proto_can_match_selected(cf->finfo_selected, cf->edt));
7002 set_menu_sensitivity_old("/Edit/Copy/Value",
7003 proto_can_match_selected(cf->finfo_selected, cf->edt));
7004 set_menu_sensitivity_old("/Edit/Copy/As Filter",
7005 proto_can_match_selected(cf->finfo_selected, cf->edt));
7006 set_menu_sensitivity_old("/Analyze/Apply as Column",
7007 hfinfo->type != FT_NONE);
7008 set_menu_sensitivity_old("/Analyze/Apply as Filter",
7009 proto_can_match_selected(cf->finfo_selected, cf->edt));
7010 set_menu_sensitivity_old("/Analyze/Prepare a Filter",
7011 proto_can_match_selected(cf->finfo_selected, cf->edt));
7012 set_menu_sensitivity_old("/View/Expand Subtrees",
7013 cf->finfo_selected->tree_type != -1);
7015 prev_abbrev = g_object_get_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev");
7016 if (!prev_abbrev || (strcmp (prev_abbrev, abbrev) != 0)) {
7017 /* No previous protocol or protocol changed - update Protocol Preferences menu */
7018 module_t *prefs_module_p = prefs_find_module(abbrev);
7019 rebuild_protocol_prefs_menu (prefs_module_p, properties);
7021 g_object_set_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev", g_strdup(abbrev));
7022 g_free (prev_abbrev);
7025 set_menu_sensitivity(ui_manager_tree_view_menu,
7026 "/TreeViewPopup/GotoCorrespondingPacket", FALSE);
7027 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/Copy", FALSE);
7028 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyasColumn", FALSE);
7029 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ApplyAsFilter", FALSE);
7030 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/PrepareaFilter", FALSE);
7031 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ColorizewithFilter", FALSE);
7032 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ProtocolPreferences",
7034 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/DisableProtocol", FALSE);
7035 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/ExpandSubtrees", FALSE);
7036 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/WikiProtocolPage",
7038 set_menu_sensitivity(ui_manager_tree_view_menu, "/TreeViewPopup/FilterFieldReference",
7040 #ifdef MAIN_MENU_USE_UIMANAGER
7041 set_menu_sensitivity(ui_manager_main_menubar,
7042 "/Menubar/FileMenu/Export/SelectedPacketBytes", FALSE);
7043 set_menu_sensitivity(ui_manager_main_menubar,
7044 "/Menubar/GoMenu/GotoCorrespondingPacket", FALSE);
7045 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Description", FALSE);
7046 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Fieldname", FALSE);
7047 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/Value", FALSE);
7048 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/Copy/AsFilter", FALSE);
7049 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ApplyasColumn", FALSE);
7050 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/ApplyAsFilter", FALSE);
7051 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/AnalyzeMenu/PrepareaFilter", FALSE);
7052 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ExpandSubtrees", FALSE);
7053 #else /* MAIN_MENU_USE_UIMANAGER */
7054 set_menu_sensitivity_old("/File/Export/Selected Packet Bytes...", FALSE);
7055 set_menu_sensitivity_old("/Go/Go to Corresponding Packet", FALSE);
7056 set_menu_sensitivity_old("/Edit/Copy/Description", FALSE);
7057 set_menu_sensitivity_old("/Edit/Copy/Fieldname", FALSE);
7058 set_menu_sensitivity_old("/Edit/Copy/Value", FALSE);
7059 set_menu_sensitivity_old("/Edit/Copy/As Filter", FALSE);
7060 set_menu_sensitivity_old("/Analyze/Apply as Column", FALSE);
7061 set_menu_sensitivity_old("/Analyze/Apply as Filter", FALSE);
7062 set_menu_sensitivity_old("/Analyze/Prepare a Filter", FALSE);
7063 set_menu_sensitivity_old("/View/Expand Subtrees", FALSE);
7064 #endif /* MAIN_MENU_USE_UIMANAGER */
7067 walk_menu_tree_for_selected_tree_row(tap_menu_tree_root, cf->finfo_selected);
7070 void set_menus_for_packet_history(gboolean back_history, gboolean forward_history) {
7071 #ifdef MAIN_MENU_USE_UIMANAGER
7072 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/Back", back_history);
7073 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/GoMenu/Forward", forward_history);
7074 #else /* MAIN_MENU_USE_UIMANAGER */
7075 set_menu_sensitivity_old("/Go/Back", back_history);
7076 set_menu_sensitivity_old("/Go/Forward", forward_history);
7077 #endif /* MAIN_MENU_USE_UIMANAGER */
7078 set_toolbar_for_packet_history(back_history, forward_history);
7082 void set_menus_for_file_set(gboolean file_set, gboolean previous_file, gboolean next_file) {
7083 #ifdef MAIN_MENU_USE_UIMANAGER
7084 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set/ListFiles", file_set);
7085 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set/PreviousFile", previous_file);
7086 set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/FileMenu/Set/NextFile", next_file);
7087 #else /* MAIN_MENU_USE_UIMANAGER */
7088 set_menu_sensitivity_old("/File/File Set/List Files", file_set);
7089 set_menu_sensitivity_old("/File/File Set/Previous File", previous_file);
7090 set_menu_sensitivity_old("/File/File Set/Next File", next_file);
7091 #endif /* MAIN_MENU_USE_UIMANAGER */
7094 GtkWidget *menus_get_profiles_edit_menu (void)
7096 return gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Edit");
7099 GtkWidget *menus_get_profiles_delete_menu (void)
7101 return gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Delete");
7104 GtkWidget *menus_get_profiles_change_menu (void)
7106 return gtk_ui_manager_get_widget(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Change");
7109 void set_menus_for_profiles(gboolean default_profile)
7111 set_menu_sensitivity(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Edit", !default_profile);
7112 set_menu_sensitivity(ui_manager_statusbar_profiles_menu, "/ProfilesMenuPopup/Delete", !default_profile);
7121 * indent-tabs-mode: nil
7124 * ex: set shiftwidth=4 tabstop=8 expandtab
7125 * :indentSize=4:tabSize=8:noTabs=true: