*
* $Id$
*
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
#include "main.h"
#include "menu.h"
-#include "tap_menu.h"
+#include "../stat_menu.h"
+#include "gui_stat_menu.h"
#include <epan/packet.h>
#include <epan/addr_resolv.h>
#include <epan/prefs.h>
#include "color_dlg.h"
#include "filter_dlg.h"
#include "dlg_utils.h"
-#include "file_dlg.h"
+#include "capture_file_dlg.h"
+#include "fileset_dlg.h"
#include "find_dlg.h"
#include "goto_dlg.h"
#include "summary_dlg.h"
#include "hostlist_table.h"
#include "simple_dialog.h"
#include "packet_history.h"
+#include "color_filters.h"
+#include "ssl-dlg.h"
+#include "sctp_stat.h"
+#include "firewall_dlg.h"
GtkWidget *popup_menu_object;
static GList *tap_menu_tree_root = NULL;
-static void
+static void
merge_all_tap_menus(GList *node);
#define GTK_MENU_FUNC(a) ((GtkItemFactoryCallback)(a))
static void set_menu_sensitivity (GtkItemFactory *, const gchar *, gint);
static void main_toolbar_show_cb(GtkWidget *w _U_, gpointer d _U_);
static void filter_toolbar_show_cb(GtkWidget *w _U_, gpointer d _U_);
+#ifdef HAVE_AIRPCAP
+static void airpcap_toolbar_show_cb(GtkWidget *w _U_, gpointer d _U_);
+#endif
static void packet_list_show_cb(GtkWidget *w _U_, gpointer d _U_);
static void tree_view_show_cb(GtkWidget *w _U_, gpointer d _U_);
static void byte_view_show_cb(GtkWidget *w _U_, gpointer d _U_);
static void timestamp_absolute_date_cb(GtkWidget *w _U_, gpointer d _U_);
static void timestamp_relative_cb(GtkWidget *w _U_, gpointer d _U_);
static void timestamp_delta_cb(GtkWidget *w _U_, gpointer d _U_);
+static void timestamp_auto_cb(GtkWidget *w _U_, gpointer d _U_);
+static void timestamp_sec_cb(GtkWidget *w _U_, gpointer d _U_);
+static void timestamp_dsec_cb(GtkWidget *w _U_, gpointer d _U_);
+static void timestamp_csec_cb(GtkWidget *w _U_, gpointer d _U_);
+static void timestamp_msec_cb(GtkWidget *w _U_, gpointer d _U_);
+static void timestamp_usec_cb(GtkWidget *w _U_, gpointer d _U_);
+static void timestamp_nsec_cb(GtkWidget *w _U_, gpointer d _U_);
static void name_resolution_mac_cb(GtkWidget *w _U_, gpointer d _U_);
static void name_resolution_network_cb(GtkWidget *w _U_, gpointer d _U_);
static void name_resolution_transport_cb(GtkWidget *w _U_, gpointer d _U_);
#ifdef HAVE_LIBPCAP
static void auto_scroll_live_cb(GtkWidget *w _U_, gpointer d _U_);
#endif
+static void colorize_cb(GtkWidget *w _U_, gpointer d _U_);
/* This is the GtkItemFactoryEntry structure used to generate new menus.
Item 1: The menu path. The letter after the underscore indicates an
/* As a general GUI guideline, we try to follow the Gnome Human Interface Guidelines, which can be found at:
http://developer.gnome.org/projects/gup/hig/1.0/index.html
-
+
Please note: there are some differences between the Gnome HIG menu suggestions and our implementation:
File/Open Recent: the Gnome HIG suggests putting the list of recently used files as elements into the File menuitem.
File/Close: the Gnome HIG suggests putting this item just above the Quit item.
This results in unintuitive behaviour as both Close and Quit items are very near together.
- By putting the Close item near the open item(s), it better suggests that it will close the
+ By putting the Close item near the open item(s), it better suggests that it will close the
currently opened/captured file only.
*/
+#define CONV_ETHER 1
+#define CONV_IP 2
+#define CONV_TCP 3
+#define CONV_UDP 4
+#define CONV_CBA 5
+
+void
+conversation_cb(GtkWidget * w, gpointer data _U_, int action)
+{
+ packet_info *pi = &cfile.edt->pi;
+ char* buf;
+ GtkWidget *filter_te;
+
+
+ switch(action) {
+ case(CONV_CBA):
+ if (pi->profinet_type == 0) {
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
+ "Error filtering conversation. Please make\n"
+ "sure you have a PROFINET CBA packet selected.");
+ return;
+ }
+
+ if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4
+ && pi->ipproto == 6 ) {
+ /* IPv4 */
+ switch(pi->profinet_type) {
+ case(1):
+ 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)",
+ ip_to_str( pi->net_dst.data),
+ ip_to_str( pi->net_src.data),
+ ip_to_str( pi->net_src.data),
+ ip_to_str( pi->net_dst.data));
+ break;
+ case(2):
+ 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)",
+ ip_to_str( pi->net_src.data),
+ ip_to_str( pi->net_dst.data),
+ ip_to_str( pi->net_dst.data),
+ ip_to_str( pi->net_src.data));
+ break;
+ case(3):
+ 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)",
+ ip_to_str( pi->net_dst.data),
+ ip_to_str( pi->net_src.data),
+ ip_to_str( pi->net_src.data),
+ ip_to_str( pi->net_dst.data));
+ break;
+ case(4):
+ 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)",
+ ip_to_str( pi->net_src.data),
+ ip_to_str( pi->net_dst.data),
+ ip_to_str( pi->net_dst.data),
+ ip_to_str( pi->net_src.data));
+ break;
+ default:
+ return;
+ }
+ } else {
+ return;
+ }
+ break;
+ case(CONV_TCP):
+ if (cfile.edt->pi.ipproto != IP_PROTO_TCP) {
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
+ "Error filtering conversation. Please make\n"
+ "sure you have a TCP packet selected.");
+ return;
+ }
+
+ if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4
+ && pi->ipproto == 6 ) {
+ /* TCP over IPv4 */
+ buf = g_strdup_printf(
+ "(ip.addr eq %s and ip.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
+ ip_to_str( pi->net_src.data),
+ ip_to_str( pi->net_dst.data),
+ pi->srcport, pi->destport );
+ }
+ else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6
+ && pi->ipproto == 6 ) {
+ /* TCP over IPv6 */
+ buf = g_strdup_printf(
+ "(ipv6.addr eq %s and ipv6.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
+ ip6_to_str((const struct e_in6_addr *)pi->net_src.data),
+ ip6_to_str((const struct e_in6_addr *)pi->net_dst.data),
+ pi->srcport, pi->destport );
+ }
+ else {
+ return;
+ }
+ break;
+ case(CONV_UDP):
+ if (cfile.edt->pi.ipproto != IP_PROTO_UDP) {
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
+ "Error filtering conversation. Please make\n"
+ "sure you have a UDP packet selected.");
+ return;
+ }
+
+ if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4
+ && pi->ipproto == IP_PROTO_UDP /*6*/ ) {
+ /* UDP over IPv4 */
+ buf = g_strdup_printf(
+ "(ip.addr eq %s and ip.addr eq %s) and (udp.port eq %d and udp.port eq %d)",
+ ip_to_str( pi->net_src.data),
+ ip_to_str( pi->net_dst.data),
+ pi->srcport, pi->destport );
+ }
+ else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6
+ && pi->ipproto == IP_PROTO_UDP /*6*/ ) {
+ /* UDP over IPv6 */
+ buf = g_strdup_printf(
+ "(ipv6.addr eq %s and ipv6.addr eq %s) and (udp.port eq %d and udp.port eq %d)",
+ ip6_to_str((const struct e_in6_addr *)pi->net_src.data),
+ ip6_to_str((const struct e_in6_addr *)pi->net_dst.data),
+ pi->srcport, pi->destport );
+ }
+ else {
+ return;
+ }
+ break;
+ case(CONV_IP):
+ if (cfile.edt->pi.ethertype != 0x800) {
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
+ "Error filtering conversation. Please make\n"
+ "sure you have a IP packet selected.");
+ return;
+ }
+
+ if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4
+ && pi->ipproto == 6 ) {
+ /* IPv4 */
+ buf = g_strdup_printf(
+ "ip.addr eq %s and ip.addr eq %s",
+ ip_to_str( pi->net_src.data),
+ ip_to_str( pi->net_dst.data));
+ }
+ else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6
+ && pi->ipproto == 6 ) {
+ /* IPv6 */
+ buf = g_strdup_printf(
+ "ipv6.addr eq %s and ipv6.addr eq %s",
+ ip6_to_str((const struct e_in6_addr *)pi->net_src.data),
+ ip6_to_str((const struct e_in6_addr *)pi->net_dst.data));
+ }
+ else {
+ return;
+ }
+ break;
+ case(CONV_ETHER):
+ /* XXX - is this the right way to check for Ethernet? */
+ if (cfile.edt->pi.ethertype == 0x0) {
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
+ "Error filtering conversation. Please make\n"
+ "sure you have a Ethernet packet selected.");
+ return;
+ }
+
+ if( pi->dl_src.type == 1 /*AT_IPv4*/ && pi->dl_dst.type == 1 /*AT_IPv4*/) {
+ /* Ethernet */
+ buf = g_strdup_printf(
+ "eth.addr eq %s and eth.addr eq %s",
+ ether_to_str( pi->dl_src.data),
+ ether_to_str( pi->dl_dst.data));
+ }
+ else {
+ return;
+ }
+ break;
+ default:
+ return;
+ }
+
+ filter_te = OBJECT_GET_DATA(w, E_DFILTER_TE_KEY);
+
+ gtk_entry_set_text(GTK_ENTRY(filter_te), buf);
+
+ /* Run the display filter so it goes in effect - even if it's the
+ same as the previous display filter. */
+ main_filter_packets(&cfile, buf, TRUE);
+
+ g_free(buf);
+
+}
+
+
/* main menu */
static GtkItemFactoryEntry menu_items[] =
{
ITEM_FACTORY_STOCK_ENTRY("/File/Save _As...", "<shift><control>S", file_save_as_cmd_cb,
0, GTK_STOCK_SAVE_AS),
ITEM_FACTORY_ENTRY("/File/<separator>", NULL, NULL, 0, "<Separator>", NULL),
+ ITEM_FACTORY_ENTRY("/File/File Set", NULL, NULL, 0, "<Branch>", NULL),
+ ITEM_FACTORY_STOCK_ENTRY("/File/File Set/List Files", NULL, fileset_cb, 0, WIRESHARK_STOCK_FILE_SET_LIST),
+ ITEM_FACTORY_STOCK_ENTRY("/File/File Set/Next File", NULL, fileset_next_cb, 0, WIRESHARK_STOCK_FILE_SET_NEXT),
+ ITEM_FACTORY_STOCK_ENTRY("/File/File Set/Previous File", NULL, fileset_previous_cb, 0, WIRESHARK_STOCK_FILE_SET_PREVIOUS),
+ ITEM_FACTORY_ENTRY("/File/<separator>", NULL, NULL, 0, "<Separator>", NULL),
ITEM_FACTORY_ENTRY("/File/_Export", NULL, NULL, 0, "<Branch>", NULL),
+#if GTK_MAJOR_VERSION >= 2 && _WIN32
+ ITEM_FACTORY_ENTRY("/File/Export/File...", NULL, export_text_cmd_cb,
+ 0, NULL, NULL),
+#else
ITEM_FACTORY_ENTRY("/File/Export/as \"Plain _Text\" file...", NULL, export_text_cmd_cb,
0, NULL, NULL),
ITEM_FACTORY_ENTRY("/File/Export/as \"_PostScript\" file...", NULL, export_ps_cmd_cb,
0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/File/Export/as \"_CSV\" (Comma Separated Values packet summary) file...",
+ NULL, export_csv_cmd_cb, 0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/File/Export/<separator>", NULL, NULL, 0, "<Separator>", NULL),
ITEM_FACTORY_ENTRY("/File/Export/as XML - \"P_SML\" (packet summary) file...", NULL, export_psml_cmd_cb,
0, NULL, NULL),
ITEM_FACTORY_ENTRY("/File/Export/as XML - \"P_DML\" (packet details) file...", NULL, export_pdml_cmd_cb,
0, NULL, NULL),
ITEM_FACTORY_ENTRY("/File/Export/<separator>", NULL, NULL, 0, "<Separator>", NULL),
+#endif
ITEM_FACTORY_ENTRY("/File/Export/Selected Packet _Bytes...", "<control>H", savehex_cb,
0, NULL, NULL),
ITEM_FACTORY_ENTRY("/File/<separator>", NULL, NULL, 0, "<Separator>", NULL),
ITEM_FACTORY_ENTRY("/Edit/Find Ne_xt", "<control>N", find_next_cb, 0, NULL, NULL),
ITEM_FACTORY_ENTRY("/Edit/Find Pre_vious", "<control>B", find_previous_cb, 0, NULL, NULL),
ITEM_FACTORY_ENTRY("/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL),
- ITEM_FACTORY_ENTRY("/Edit/_Time Reference", NULL, NULL, 0, "<Branch>", NULL),
- ITEM_FACTORY_ENTRY("/Edit/Time Reference/Set Time Reference (toggle)", "<control>T", reftime_frame_cb, REFTIME_TOGGLE, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Edit/Time Reference/Find Next", NULL, reftime_frame_cb, REFTIME_FIND_NEXT, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Edit/Time Reference/Find Previous", NULL, reftime_frame_cb, REFTIME_FIND_PREV, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Edit/_Mark Packet", "<control>M", mark_frame_cb,
+ ITEM_FACTORY_ENTRY("/Edit/_Mark Packet (toggle)", "<control>M", packet_list_mark_frame_cb,
0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Edit/Mark _All Packets", NULL, mark_all_frames_cb,
+ ITEM_FACTORY_ENTRY("/Edit/Find Next Mark", "<shift><control>N", find_next_mark_cb,
0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Edit/_Unmark All Packets", NULL, unmark_all_frames_cb,
+ ITEM_FACTORY_ENTRY("/Edit/Find Previous Mark", "<shift><control>B", find_prev_mark_cb,
0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Edit/Mark _All Packets", NULL, packet_list_mark_all_frames_cb,
+ 0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Edit/_Unmark All Packets", NULL, packet_list_unmark_all_frames_cb,
+ 0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL),
+ ITEM_FACTORY_STOCK_ENTRY("/Edit/Set Time Reference (toggle)", "<control>T", reftime_frame_cb,
+ REFTIME_TOGGLE, WIRESHARK_STOCK_TIME),
+ ITEM_FACTORY_ENTRY("/Edit/Find Next Reference", NULL, reftime_frame_cb, REFTIME_FIND_NEXT, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Edit/Find Previous Reference", NULL, reftime_frame_cb, REFTIME_FIND_PREV, NULL, NULL),
ITEM_FACTORY_ENTRY("/Edit/<separator>", NULL, NULL, 0, "<Separator>", NULL),
ITEM_FACTORY_STOCK_ENTRY("/Edit/_Preferences...", "<shift><control>P", prefs_cb,
0, GTK_STOCK_PREFERENCES),
ITEM_FACTORY_ENTRY("/_View", NULL, NULL, 0, "<Branch>", NULL),
ITEM_FACTORY_ENTRY("/View/_Main Toolbar", NULL, main_toolbar_show_cb, 0, "<CheckItem>", NULL),
ITEM_FACTORY_ENTRY("/View/_Filter Toolbar", NULL, filter_toolbar_show_cb, 0, "<CheckItem>", NULL),
+#ifdef HAVE_AIRPCAP
+ ITEM_FACTORY_ENTRY("/View/_Wireless Toolbar", NULL, airpcap_toolbar_show_cb, 0, "<CheckItem>", NULL),
+#endif
ITEM_FACTORY_ENTRY("/View/_Statusbar", NULL, statusbar_show_cb, 0, "<CheckItem>", NULL),
ITEM_FACTORY_ENTRY("/View/<separator>", NULL, NULL, 0, "<Separator>", NULL),
ITEM_FACTORY_ENTRY("/View/Packet _List", NULL, packet_list_show_cb, 0, "<CheckItem>", NULL),
ITEM_FACTORY_ENTRY("/View/Packet _Bytes", NULL, byte_view_show_cb, 0, "<CheckItem>", NULL),
ITEM_FACTORY_ENTRY("/View/<separator>", NULL, NULL, 0, "<Separator>", NULL),
ITEM_FACTORY_ENTRY("/View/_Time Display Format", NULL, NULL, 0, "<Branch>", NULL),
- ITEM_FACTORY_ENTRY("/View/Time Display Format/Time of Day", NULL, timestamp_absolute_cb,
+ ITEM_FACTORY_ENTRY("/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL, timestamp_absolute_date_cb,
+ 0, "<RadioItem>", NULL),
+ ITEM_FACTORY_ENTRY("/View/Time Display Format/Time of Day: 01:02:03.123456", NULL, timestamp_absolute_cb,
+ 0, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL),
+ ITEM_FACTORY_ENTRY("/View/Time Display Format/Seconds Since Beginning of Capture: 123.123456", NULL, timestamp_relative_cb,
+ 0, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL),
+ ITEM_FACTORY_ENTRY("/View/Time Display Format/Seconds Since Previous Packet: 1.123456", NULL, timestamp_delta_cb,
+ 0, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL),
+ ITEM_FACTORY_ENTRY("/View/Time Display Format/<separator>", NULL, NULL, 0, "<Separator>", NULL),
+ ITEM_FACTORY_ENTRY("/View/Time Display Format/Automatic (File Format Precision)", NULL, timestamp_auto_cb,
0, "<RadioItem>", NULL),
- ITEM_FACTORY_ENTRY("/View/Time Display Format/Date and Time of Day", NULL, timestamp_absolute_date_cb,
- 0, "/View/Time Display Format/Time of Day", NULL),
- ITEM_FACTORY_ENTRY("/View/Time Display Format/Seconds Since Beginning of Capture", NULL, timestamp_relative_cb,
- 0, "/View/Time Display Format/Time of Day", NULL),
- ITEM_FACTORY_ENTRY("/View/Time Display Format/Seconds Since Previous Packet", NULL, timestamp_delta_cb,
- 0, "/View/Time Display Format/Time of Day", NULL),
+ ITEM_FACTORY_ENTRY("/View/Time Display Format/Seconds: 0", NULL, timestamp_sec_cb,
+ 0, "/View/Time Display Format/Automatic (File Format Precision)", NULL),
+ ITEM_FACTORY_ENTRY("/View/Time Display Format/Deciseconds: 0.1", NULL, timestamp_dsec_cb,
+ 0, "/View/Time Display Format/Automatic (File Format Precision)", NULL),
+ ITEM_FACTORY_ENTRY("/View/Time Display Format/Centiseconds: 0.12", NULL, timestamp_csec_cb,
+ 0, "/View/Time Display Format/Automatic (File Format Precision)", NULL),
+ ITEM_FACTORY_ENTRY("/View/Time Display Format/Milliseconds: 0.123", NULL, timestamp_msec_cb,
+ 0, "/View/Time Display Format/Automatic (File Format Precision)", NULL),
+ ITEM_FACTORY_ENTRY("/View/Time Display Format/Microseconds: 0.123456", NULL, timestamp_usec_cb,
+ 0, "/View/Time Display Format/Automatic (File Format Precision)", NULL),
+ ITEM_FACTORY_ENTRY("/View/Time Display Format/Nanoseconds: 0.123456789", NULL, timestamp_nsec_cb,
+ 0, "/View/Time Display Format/Automatic (File Format Precision)", NULL),
ITEM_FACTORY_ENTRY("/View/Name Resol_ution", NULL, NULL, 0, "<Branch>", NULL),
ITEM_FACTORY_ENTRY("/View/Name Resolution/_Resolve Name", NULL, resolve_name_cb, 0, NULL, NULL),
ITEM_FACTORY_ENTRY("/View/Name Resolution/<separator>", NULL, NULL, 0, "<Separator>", NULL),
ITEM_FACTORY_ENTRY("/View/Name Resolution/Enable for _MAC Layer", NULL, name_resolution_mac_cb, 0, "<CheckItem>", NULL),
ITEM_FACTORY_ENTRY("/View/Name Resolution/Enable for _Network Layer", NULL, name_resolution_network_cb, 0, "<CheckItem>", NULL),
ITEM_FACTORY_ENTRY("/View/Name Resolution/Enable for _Transport Layer", NULL, name_resolution_transport_cb, 0, "<CheckItem>", NULL),
+ ITEM_FACTORY_ENTRY("/View/Colorize Packet List", NULL, colorize_cb, 0, "<CheckItem>", NULL),
#ifdef HAVE_LIBPCAP
ITEM_FACTORY_ENTRY("/View/Auto Scroll in Li_ve Capture", NULL, auto_scroll_live_cb, 0, "<CheckItem>", NULL),
#endif
0, GTK_STOCK_ZOOM_OUT),
ITEM_FACTORY_STOCK_ENTRY("/View/_Normal Size", "<control>equal", view_zoom_100_cb,
0, GTK_STOCK_ZOOM_100),
+ ITEM_FACTORY_STOCK_ENTRY("/View/Resize All Columns", NULL, packet_list_resize_columns_cb,
+ 0, WIRESHARK_STOCK_RESIZE_COLUMNS),
ITEM_FACTORY_ENTRY("/View/<separator>", NULL, NULL, 0, "<Separator>", NULL),
- ITEM_FACTORY_ENTRY("/View/Collapse _All", NULL, collapse_all_cb,
- 0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/View/E_xpand Subtrees", NULL, expand_tree_cb, 0, NULL, NULL),
ITEM_FACTORY_ENTRY("/View/_Expand All", NULL, expand_all_cb,
0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/View/Expand Tree", NULL, expand_tree_cb, 0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/View/Collapse _All", NULL, collapse_all_cb,
+ 0, NULL, NULL),
ITEM_FACTORY_ENTRY("/View/<separator>", NULL, NULL, 0, "<Separator>", NULL),
ITEM_FACTORY_STOCK_ENTRY("/View/_Coloring Rules...", NULL, color_display_cb,
0, GTK_STOCK_SELECT_COLOR),
goto_bottom_frame_cb, 0, GTK_STOCK_GOTO_BOTTOM),
#ifdef HAVE_LIBPCAP
ITEM_FACTORY_ENTRY("/_Capture", NULL, NULL, 0, "<Branch>", NULL),
- ITEM_FACTORY_STOCK_ENTRY("/Capture/_Start...", "<control>K",
- capture_prep_cb, 0, ETHEREAL_STOCK_CAPTURE_START),
+ ITEM_FACTORY_STOCK_ENTRY("/Capture/_Interfaces...", NULL,
+ capture_if_cb, 0, WIRESHARK_STOCK_CAPTURE_INTERFACES),
+ ITEM_FACTORY_STOCK_ENTRY("/Capture/_Options...", "<control>K",
+ capture_prep_cb, 0, WIRESHARK_STOCK_CAPTURE_OPTIONS),
+ ITEM_FACTORY_STOCK_ENTRY("/Capture/_Start", NULL,
+ capture_start_cb, 0, WIRESHARK_STOCK_CAPTURE_START),
ITEM_FACTORY_STOCK_ENTRY("/Capture/S_top", "<control>E", capture_stop_cb,
- 0, GTK_STOCK_STOP),
- ITEM_FACTORY_ENTRY("/Capture/_Interfaces...", NULL,
- capture_if_cb, 0, NULL, NULL),
- ITEM_FACTORY_STOCK_ENTRY("/Capture/_Capture Filters...", NULL, cfilter_dialog_cb,
- 0, ETHEREAL_STOCK_CAPTURE_FILTER),
+ 0, WIRESHARK_STOCK_CAPTURE_STOP),
+ ITEM_FACTORY_STOCK_ENTRY("/Capture/_Restart", NULL, capture_restart_cb,
+ 0, WIRESHARK_STOCK_CAPTURE_RESTART),
+ ITEM_FACTORY_STOCK_ENTRY("/Capture/Capture _Filters...", NULL, cfilter_dialog_cb,
+ 0, WIRESHARK_STOCK_CAPTURE_FILTER),
#endif /* HAVE_LIBPCAP */
ITEM_FACTORY_ENTRY("/_Analyze", NULL, NULL, 0, "<Branch>", NULL),
ITEM_FACTORY_STOCK_ENTRY("/Analyze/_Display Filters...", NULL, dfilter_dialog_cb,
- 0, ETHEREAL_STOCK_DISPLAY_FILTER),
+ 0, WIRESHARK_STOCK_DISPLAY_FILTER),
ITEM_FACTORY_ENTRY("/Analyze/Appl_y as Filter", NULL, NULL, 0, "<Branch>", NULL),
- ITEM_FACTORY_ENTRY("/Analyze/Apply as Filter/_Selected", NULL, match_selected_ptree_cb,
+ ITEM_FACTORY_ENTRY("/Analyze/Apply as Filter/_Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_REPLACE|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Analyze/Apply as Filter/_Not Selected", NULL, match_selected_ptree_cb,
+ ITEM_FACTORY_ENTRY("/Analyze/Apply as Filter/_Not Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_NOT|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
ITEM_FACTORY_ENTRY("/Analyze/Apply as Filter/... _and Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_AND|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
ITEM_FACTORY_ENTRY("/Analyze/Apply as Filter/... _or Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_OR|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Analyze/Apply as Filter/... a_nd not Selected", NULL, match_selected_ptree_cb,
+ ITEM_FACTORY_ENTRY("/Analyze/Apply as Filter/... a_nd not Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_AND_NOT|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Analyze/Apply as Filter/... o_r not Selected", NULL, match_selected_ptree_cb,
+ ITEM_FACTORY_ENTRY("/Analyze/Apply as Filter/... o_r not Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_OR_NOT|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
ITEM_FACTORY_ENTRY("/Analyze/_Prepare a Filter", NULL, NULL, 0, "<Branch>", NULL),
- ITEM_FACTORY_ENTRY("/Analyze/Prepare a Filter/_Selected", NULL, match_selected_ptree_cb,
+ ITEM_FACTORY_ENTRY("/Analyze/Prepare a Filter/_Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_REPLACE, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Analyze/Prepare a Filter/_Not Selected", NULL, match_selected_ptree_cb,
+ ITEM_FACTORY_ENTRY("/Analyze/Prepare a Filter/_Not Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_NOT, NULL, NULL),
ITEM_FACTORY_ENTRY("/Analyze/Prepare a Filter/... _and Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_AND, NULL, NULL),
ITEM_FACTORY_ENTRY("/Analyze/Prepare a Filter/... _or Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_OR, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Analyze/Prepare a Filter/... a_nd not Selected", NULL, match_selected_ptree_cb,
+ ITEM_FACTORY_ENTRY("/Analyze/Prepare a Filter/... a_nd not Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_AND_NOT, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Analyze/Prepare a Filter/... o_r not Selected", NULL, match_selected_ptree_cb,
+ ITEM_FACTORY_ENTRY("/Analyze/Prepare a Filter/... o_r not Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_OR_NOT, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Analyze/Firewall ACL Rules", NULL,
+ firewall_rule_cb, 0, NULL, NULL),
ITEM_FACTORY_ENTRY("/Analyze/<separator>", NULL, NULL, 0, "<Separator>", NULL),
- ITEM_FACTORY_ENTRY("/Analyze/_Enabled Protocols...", "<shift><control>R", proto_cb, 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Analyze/Decode _As...", NULL, decode_as_cb,
- 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Analyze/_User Specified Decodes...", NULL,
- decode_show_cb, 0, NULL, NULL),
+ ITEM_FACTORY_STOCK_ENTRY("/Analyze/_Enabled Protocols...", "<shift><control>R", proto_cb, 0, WIRESHARK_STOCK_CHECKBOX),
+ ITEM_FACTORY_STOCK_ENTRY("/Analyze/Decode _As...", NULL, decode_as_cb,
+ 0, WIRESHARK_STOCK_DECODE_AS),
+ ITEM_FACTORY_STOCK_ENTRY("/Analyze/_User Specified Decodes...", NULL,
+ decode_show_cb, 0, WIRESHARK_STOCK_DECODE_AS),
ITEM_FACTORY_ENTRY("/Analyze/<separator>", NULL, NULL, 0, "<Separator>", NULL),
ITEM_FACTORY_ENTRY("/Analyze/_Follow TCP Stream", NULL,
- follow_stream_cb, 0, NULL, NULL),
+ follow_stream_cb, 0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Analyze/_Follow SSL Stream", NULL,
+ ssl_stream_cb, 0, NULL, NULL),
ITEM_FACTORY_ENTRY("/_Statistics", NULL, NULL, 0, "<Branch>", NULL),
- ITEM_FACTORY_ENTRY("/Statistics/_Summary", NULL, summary_open_cb, 0, NULL, NULL),
+ ITEM_FACTORY_STOCK_ENTRY("/Statistics/_Summary", NULL, summary_open_cb, 0, GTK_STOCK_PROPERTIES),
ITEM_FACTORY_ENTRY("/Statistics/_Protocol Hierarchy", NULL,
proto_hier_stats_cb, 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Statistics/Conversations", NULL,
- init_conversation_notebook_cb, 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Statistics/Endpoints", NULL,
- init_hostlist_notebook_cb, 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/_Help", NULL, NULL, 0, "<Branch>", NULL),
- ITEM_FACTORY_STOCK_ENTRY("/Help/_Contents", "F1", help_cb, 0, GTK_STOCK_HELP),
+ ITEM_FACTORY_STOCK_ENTRY("/Statistics/Conversations", NULL,
+ init_conversation_notebook_cb, 0, WIRESHARK_STOCK_CONVERSATIONS),
+ ITEM_FACTORY_STOCK_ENTRY("/Statistics/Endpoints", NULL,
+ init_hostlist_notebook_cb, 0, WIRESHARK_STOCK_ENDPOINTS),
+ ITEM_FACTORY_ENTRY("/_Tools", NULL, NULL, 0, "<Branch>", NULL),
+ ITEM_FACTORY_ENTRY("/_Help", NULL, NULL, 0, "<Branch>", NULL),
+ ITEM_FACTORY_STOCK_ENTRY("/Help/_Contents", "F1", topic_menu_cb, HELP_CONTENT, GTK_STOCK_HELP),
ITEM_FACTORY_ENTRY("/Help/_Supported Protocols", NULL, supported_cb, 0, NULL, NULL),
#if (GLIB_MAJOR_VERSION >= 2)
-#ifdef ETHEREAL_EUG_DIR
- ITEM_FACTORY_ENTRY("/Help/User's Guide", NULL, url_page_menu_cb, HELP_CONTENT, NULL, NULL),
+#ifdef ENABLE_WSUG
+ ITEM_FACTORY_ENTRY("/Help/User's Guide", NULL, topic_menu_cb, HELP_CONTENT, NULL, NULL),
#endif
ITEM_FACTORY_ENTRY("/Help/Manual Pages", NULL, NULL, 0, "<Branch>", NULL),
- ITEM_FACTORY_ENTRY("/Help/Manual Pages/Ethereal", NULL, url_page_menu_cb, LOCALPAGE_MAN_ETHEREAL, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Help/Manual Pages/Ethereal Filter", NULL, url_page_menu_cb, LOCALPAGE_MAN_ETHEREAL_FILTER, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Help/Manual Pages/Wireshark", NULL, topic_menu_cb, LOCALPAGE_MAN_WIRESHARK, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Help/Manual Pages/Wireshark Filter", NULL, topic_menu_cb, LOCALPAGE_MAN_WIRESHARK_FILTER, NULL, NULL),
ITEM_FACTORY_ENTRY("/Help/Manual Pages/<separator>", NULL, NULL, 0, "<Separator>", NULL),
- ITEM_FACTORY_ENTRY("/Help/Manual Pages/Tethereal", NULL, url_page_menu_cb, LOCALPAGE_MAN_TETHEREAL, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Help/Manual Pages/Mergecap", NULL, url_page_menu_cb, LOCALPAGE_MAN_MERGECAP, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Help/Manual Pages/Editcap", NULL, url_page_menu_cb, LOCALPAGE_MAN_EDITCAP, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Help/Manual Pages/Text2pcap", NULL, url_page_menu_cb, LOCALPAGE_MAN_TEXT2PCAP, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Help/Ethereal Online", NULL, NULL, 0, "<Branch>", NULL),
- ITEM_FACTORY_STOCK_ENTRY("/Help/Ethereal Online/Home Page", NULL, url_page_menu_cb, ONLINEPAGE_HOME, GTK_STOCK_HOME),
- ITEM_FACTORY_ENTRY("/Help/Ethereal Online/Wiki", NULL, url_page_menu_cb, ONLINEPAGE_WIKI, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Help/Ethereal Online/User's Guide", NULL, url_page_menu_cb, ONLINEPAGE_USERGUIDE, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Help/Ethereal Online/FAQ's", NULL, url_page_menu_cb, ONLINEPAGE_FAQ, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Help/Ethereal Online/Downloads", NULL, url_page_menu_cb, ONLINEPAGE_DOWNLOAD, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Help/Ethereal Online/Example Files", NULL, url_page_menu_cb, ONLINEPAGE_SAMPLE_FILES, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Help/Manual Pages/TShark", NULL, topic_menu_cb, LOCALPAGE_MAN_TSHARK, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Help/Manual Pages/Dumpcap", NULL, topic_menu_cb, LOCALPAGE_MAN_DUMPCAP, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Help/Manual Pages/Mergecap", NULL, topic_menu_cb, LOCALPAGE_MAN_MERGECAP, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Help/Manual Pages/Editcap", NULL, topic_menu_cb, LOCALPAGE_MAN_EDITCAP, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Help/Manual Pages/Text2pcap", NULL, topic_menu_cb, LOCALPAGE_MAN_TEXT2PCAP, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Help/Wireshark Online", NULL, NULL, 0, "<Branch>", NULL),
+ ITEM_FACTORY_STOCK_ENTRY("/Help/Wireshark Online/Home Page", NULL, topic_menu_cb, ONLINEPAGE_HOME, GTK_STOCK_HOME),
+ ITEM_FACTORY_STOCK_ENTRY("/Help/Wireshark Online/Wiki", NULL, topic_menu_cb, ONLINEPAGE_WIKI, WIRESHARK_STOCK_WIKI),
+ ITEM_FACTORY_STOCK_ENTRY("/Help/Wireshark Online/User's Guide", NULL, topic_menu_cb, ONLINEPAGE_USERGUIDE, WIRESHARK_STOCK_WEB_SUPPORT),
+ ITEM_FACTORY_ENTRY("/Help/Wireshark Online/FAQ's", NULL, topic_menu_cb, ONLINEPAGE_FAQ, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Help/Wireshark Online/Downloads", NULL, topic_menu_cb, ONLINEPAGE_DOWNLOAD, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Help/Wireshark Online/Example Files", NULL, topic_menu_cb, ONLINEPAGE_SAMPLE_FILES, NULL, NULL),
#endif
ITEM_FACTORY_ENTRY("/Help/<separator>", NULL, NULL, 0, "<Separator>", NULL),
- ITEM_FACTORY_ENTRY("/Help/_About Ethereal", NULL, about_ethereal_cb,
- 0, NULL, NULL)
+ ITEM_FACTORY_STOCK_ENTRY("/Help/_About Wireshark", NULL, about_wireshark_cb,
+ 0, WIRESHARK_STOCK_ABOUT)
};
/* packet list popup */
static GtkItemFactoryEntry packet_list_menu_items[] =
{
- ITEM_FACTORY_ENTRY("/Follow TCP Stream", NULL, follow_stream_cb,
- 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Decode As...", NULL, decode_as_cb, 0, NULL, NULL),
- ITEM_FACTORY_STOCK_ENTRY("/Display Filters...", NULL, dfilter_dialog_cb,
- 0, ETHEREAL_STOCK_DISPLAY_FILTER),
+ ITEM_FACTORY_ENTRY("/Mark Packet (toggle)", NULL, packet_list_mark_frame_cb, 0, NULL, NULL),
+ ITEM_FACTORY_STOCK_ENTRY("/Set Time Reference (toggle)", NULL, reftime_frame_cb, REFTIME_TOGGLE, WIRESHARK_STOCK_TIME),
+
ITEM_FACTORY_ENTRY("/<separator>", NULL, NULL, 0, "<Separator>", NULL),
- ITEM_FACTORY_ENTRY("/Mark Packet", NULL, mark_frame_cb, 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Time Reference", NULL, NULL, 0, "<Branch>", NULL),
- ITEM_FACTORY_ENTRY("/Time Reference/Set Time Reference (toggle)", NULL, reftime_frame_cb, REFTIME_TOGGLE, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Time Reference/Find Next", NULL, reftime_frame_cb, REFTIME_FIND_NEXT, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Time Reference/Find Previous", NULL, reftime_frame_cb, REFTIME_FIND_PREV, NULL, NULL),
+
ITEM_FACTORY_ENTRY("/Apply as Filter", NULL, NULL, 0, "<Branch>", NULL),
- ITEM_FACTORY_ENTRY("/Apply as Filter/_Selected", NULL, match_selected_plist_cb,
+ ITEM_FACTORY_ENTRY("/Apply as Filter/_Selected", NULL, match_selected_plist_cb,
MATCH_SELECTED_REPLACE|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Apply as Filter/_Not Selected", NULL, match_selected_plist_cb,
+ ITEM_FACTORY_ENTRY("/Apply as Filter/_Not Selected", NULL, match_selected_plist_cb,
MATCH_SELECTED_NOT|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Apply as Filter/... _and Selected", NULL, match_selected_plist_cb,
+ ITEM_FACTORY_ENTRY("/Apply as Filter/... _and Selected", NULL, match_selected_plist_cb,
MATCH_SELECTED_AND|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Apply as Filter/... _or Selected", NULL, match_selected_plist_cb,
+ ITEM_FACTORY_ENTRY("/Apply as Filter/... _or Selected", NULL, match_selected_plist_cb,
MATCH_SELECTED_OR|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Apply as Filter/... a_nd not Selected", NULL, match_selected_plist_cb,
+ ITEM_FACTORY_ENTRY("/Apply as Filter/... a_nd not Selected", NULL, match_selected_plist_cb,
MATCH_SELECTED_AND_NOT|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
ITEM_FACTORY_ENTRY("/Apply as Filter/... o_r not Selected", NULL, match_selected_plist_cb,
MATCH_SELECTED_OR_NOT|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
ITEM_FACTORY_ENTRY("/Prepare a Filter/... o_r not Selected", NULL, match_selected_plist_cb,
MATCH_SELECTED_OR_NOT, NULL, NULL),
- ITEM_FACTORY_ENTRY("/<separator>", NULL, NULL, 0, "<Separator>", NULL),
- ITEM_FACTORY_ENTRY("/Coloring Rules...", NULL, color_display_cb,
+ ITEM_FACTORY_ENTRY("/Conversation Filter", NULL, NULL, 0, "<Branch>",NULL),
+ ITEM_FACTORY_ENTRY("/Conversation Filter/Ethernet", NULL, conversation_cb,
+ CONV_ETHER, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Conversation Filter/IP", NULL, conversation_cb,
+ CONV_IP, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Conversation Filter/TCP", NULL, conversation_cb,
+ CONV_TCP, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Conversation Filter/UDP", NULL, conversation_cb,
+ CONV_UDP, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Conversation Filter/PN-CBA Server", NULL, conversation_cb,
+ CONV_CBA, NULL, NULL),
+
+ ITEM_FACTORY_ENTRY("/SCTP", NULL, NULL, 0, "<Branch>",NULL),
+ ITEM_FACTORY_ENTRY("/SCTP/Analyse this Association", NULL, sctp_analyse_start,
+ 0, NULL,NULL),
+ ITEM_FACTORY_ENTRY("/SCTP/Prepare Filter for this Association", NULL, sctp_set_assoc_filter,
+ 0, NULL,NULL),
+
+ ITEM_FACTORY_ENTRY("/Follow TCP Stream", NULL, follow_stream_cb,
0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Print...", NULL, file_print_cmd_cb, 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Show Packet in New Window", NULL, new_window_cb,
+ ITEM_FACTORY_ENTRY("/Follow SSL Stream", NULL, ssl_stream_cb,
0, NULL, NULL),
+
+ ITEM_FACTORY_ENTRY("/<separator>", NULL, NULL, 0, "<Separator>", NULL),
+
+ ITEM_FACTORY_STOCK_ENTRY("/Decode As...", NULL, decode_as_cb, 0, WIRESHARK_STOCK_DECODE_AS),
+ ITEM_FACTORY_STOCK_ENTRY("/Print...", NULL, file_print_selected_cmd_cb, 0, GTK_STOCK_PRINT),
+ ITEM_FACTORY_ENTRY("/Show Packet in New Window", NULL, new_window_cb,
+ 0, NULL, NULL)
};
static GtkItemFactoryEntry tree_view_menu_items[] =
{
-/* ITEM_FACTORY_STOCK_ENTRY("/Online Protocol Info", NULL, selected_ptree_info_cb,
- 0, GTK_STOCK_DIALOG_QUESTION),
- ITEM_FACTORY_ENTRY("/<separator>", NULL, NULL, 0, "<Separator>", NULL),*/
- ITEM_FACTORY_ENTRY("/Follow TCP Stream", NULL, follow_stream_cb,
- 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Decode As...", NULL, decode_as_cb, 0, NULL, NULL),
- ITEM_FACTORY_STOCK_ENTRY("/Display Filters...", NULL, dfilter_dialog_cb,
- 0, ETHEREAL_STOCK_DISPLAY_FILTER),
+
+ ITEM_FACTORY_ENTRY("/Expand Subtrees", NULL, expand_tree_cb, 0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Expand All", NULL, expand_all_cb, 0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Collapse All", NULL, collapse_all_cb, 0, NULL, NULL),
+
ITEM_FACTORY_ENTRY("/<separator>", NULL, NULL, 0, "<Separator>", NULL),
- ITEM_FACTORY_ENTRY("/_Resolve Name", NULL, resolve_name_cb, 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/_Go to Corresponding Packet", NULL, goto_framenum_cb, 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/_Export Selected Packet Bytes...", NULL, savehex_cb,
- 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Protocol Preferences...", NULL, properties_cb,
- 0, NULL, NULL),
+
+ ITEM_FACTORY_ENTRY("/Copy", NULL, copy_selected_plist_cb, 0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/<separator>", NULL, NULL, 0, "<Separator>", NULL),
+
ITEM_FACTORY_ENTRY("/Apply as Filter", NULL, NULL, 0, "<Branch>", NULL),
- ITEM_FACTORY_ENTRY("/Apply as Filter/_Selected", NULL, match_selected_ptree_cb,
+ ITEM_FACTORY_ENTRY("/Apply as Filter/_Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_REPLACE|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
ITEM_FACTORY_ENTRY("/Apply as Filter/_Not Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_NOT|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
MATCH_SELECTED_AND|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
ITEM_FACTORY_ENTRY("/Apply as Filter/... _or Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_OR|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Apply as Filter/... a_nd not Selected", NULL, match_selected_ptree_cb,
+ ITEM_FACTORY_ENTRY("/Apply as Filter/... a_nd not Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_AND_NOT|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
ITEM_FACTORY_ENTRY("/Apply as Filter/... o_r not Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_OR_NOT|MATCH_SELECTED_APPLY_NOW, NULL, NULL),
ITEM_FACTORY_ENTRY("/Prepare a Filter", NULL, NULL, 0, "<Branch>", NULL),
- ITEM_FACTORY_ENTRY("/Prepare a Filter/_Selected", NULL, match_selected_ptree_cb,
+ ITEM_FACTORY_ENTRY("/Prepare a Filter/_Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_REPLACE, NULL, NULL),
ITEM_FACTORY_ENTRY("/Prepare a Filter/_Not Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_NOT, NULL, NULL),
MATCH_SELECTED_AND, NULL, NULL),
ITEM_FACTORY_ENTRY("/Prepare a Filter/... _or Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_OR, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Prepare a Filter/... a_nd not Selected", NULL, match_selected_ptree_cb,
+ ITEM_FACTORY_ENTRY("/Prepare a Filter/... a_nd not Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_AND_NOT, NULL, NULL),
ITEM_FACTORY_ENTRY("/Prepare a Filter/... o_r not Selected", NULL, match_selected_ptree_cb,
MATCH_SELECTED_OR_NOT, NULL, NULL),
+
+ ITEM_FACTORY_ENTRY("/Follow TCP Stream", NULL, follow_stream_cb,
+ 0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Follow SSL Stream", NULL, ssl_stream_cb,
+ 0, NULL, NULL),
+
ITEM_FACTORY_ENTRY("/<separator>", NULL, NULL, 0, "<Separator>", NULL),
- ITEM_FACTORY_ENTRY("/Collapse All", NULL, collapse_all_cb, 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Expand All", NULL, expand_all_cb, 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Expand Tree", NULL, expand_tree_cb, 0, NULL, NULL)
+
+ ITEM_FACTORY_STOCK_ENTRY("/Wiki Protocol Page", NULL, selected_ptree_info_cb,
+ 0, WIRESHARK_STOCK_WIKI),
+ ITEM_FACTORY_STOCK_ENTRY("/Filter Field Reference", NULL, selected_ptree_ref_cb,
+ 0, WIRESHARK_STOCK_INTERNET),
+ ITEM_FACTORY_ENTRY("/Protocol Preferences...", NULL, properties_cb,
+ 0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/<separator>", NULL, NULL, 0, "<Separator>", NULL),
+ ITEM_FACTORY_STOCK_ENTRY("/Decode As...", NULL, decode_as_cb, 0, WIRESHARK_STOCK_DECODE_AS),
+ ITEM_FACTORY_ENTRY("/_Resolve Name", NULL, resolve_name_cb, 0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/_Go to Corresponding Packet", NULL, goto_framenum_cb, 0, NULL, NULL),
};
static GtkItemFactoryEntry hexdump_menu_items[] =
{
- ITEM_FACTORY_ENTRY("/Follow TCP Stream", NULL, follow_stream_cb,
- 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Decode As...", NULL, decode_as_cb, 0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Display Filters...", NULL, dfilter_dialog_cb,
+ ITEM_FACTORY_ENTRY("/Copy", NULL, NULL, 0, "<Branch>", NULL),
+ ITEM_FACTORY_ENTRY("/Copy/All Information", NULL, copy_hex_cb,
0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/Copy/Text Only", NULL, copy_hex_cb,
+ 1, NULL, NULL),
ITEM_FACTORY_ENTRY("/Export Selected Packet Bytes...", NULL, savehex_cb,
0, NULL, NULL),
- ITEM_FACTORY_ENTRY("/Copy Packet Bytes into Clipboard", NULL, copy_hex_cb,
- 0, NULL, NULL)
};
static int initialize = TRUE;
set_menus_for_captured_packets(FALSE);
set_menus_for_selected_packet(&cfile);
set_menus_for_selected_tree_row(&cfile);
+ set_menus_for_capture_in_progress(FALSE);
+ set_menus_for_file_set(/* dialog */TRUE, /* previous file */ FALSE, /* next_file */ FALSE);
/* init with an empty recent files list */
clear_menu_recent_capture_file_cmd_cb(NULL, NULL);
}
-gint tap_menu_item_add_compare(gconstpointer a, gconstpointer b)
+static gint tap_menu_item_add_compare(gconstpointer a, gconstpointer b)
{
return strcmp(
- ((const menu_item_t *) a)->name,
+ ((const menu_item_t *) a)->name,
((const menu_item_t *) b)->name);
}
/* add a menuitem below the current node */
-GList * tap_menu_item_add(
- char *name,
- gint group,
+static GList * tap_menu_item_add(
+ char *name,
+ gint group,
GtkItemFactoryCallback callback,
gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *),
gboolean (*selected_tree_row_enabled)(field_info *),
* is selected and, if one is, on the tree row) and FALSE if not.
*/
void
-register_tap_menu_item(
- char *name,
- REGISTER_TAP_GROUP_E group,
+register_stat_menu_item(
+ const char *name,
+ register_stat_group_t group,
GtkItemFactoryCallback callback,
gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *),
gboolean (*selected_tree_row_enabled)(field_info *),
gpointer callback_data)
{
/*static const char toolspath[] = "/Statistics/";*/
- char *toolspath;
- char *p;
+ const char *toolspath;
+ const char *p;
char *menupath;
size_t menupathlen;
menu_item_t *child;
g_assert(*name != '/');
switch(group) {
- case(REGISTER_TAP_GROUP_GENERIC): toolspath = "/Statistics/"; break;
- case(REGISTER_TAP_GROUP_CONVERSATION_LIST): toolspath = "/Statistics/_Conversation List/"; break;
- case(REGISTER_TAP_GROUP_ENDPOINT_LIST): toolspath = "/Statistics/_Endpoint List/"; break;
- case(REGISTER_TAP_GROUP_RESPONSE_TIME): toolspath = "/Statistics/Service _Response Time/"; break;
- case(REGISTER_TAP_GROUP_NONE): toolspath = "/Statistics/"; break;
+ case(REGISTER_STAT_GROUP_GENERIC): toolspath = "/Statistics/"; break;
+ case(REGISTER_STAT_GROUP_CONVERSATION_LIST): toolspath = "/Statistics/_Conversation List/"; break;
+ case(REGISTER_STAT_GROUP_ENDPOINT_LIST): toolspath = "/Statistics/_Endpoint List/"; break;
+ case(REGISTER_STAT_GROUP_RESPONSE_TIME): toolspath = "/Statistics/Service _Response Time/"; break;
+ case(REGISTER_STAT_GROUP_TELEPHONY): toolspath = "/Statistics/"; break;
+ case(REGISTER_STAT_GROUP_NONE): toolspath = "/Statistics/"; break;
+ case(REGISTER_ANALYZE_GROUP_NONE): toolspath = "/Analyze/"; break;
+#ifdef HAVE_LUA_5_1
+ case(REGISTER_TOOLS_GROUP_NONE): toolspath = "/Tools/"; break;
+#endif
default:
g_assert(0);
toolspath = NULL;
* the main menu.
*/
tap_menu_item_add(
- menupath, group, callback,
- selected_packet_enabled, selected_tree_row_enabled,
+ menupath, group, callback,
+ selected_packet_enabled, selected_tree_row_enabled,
callback_data, curnode);
}
-guint merge_tap_menus_layered(GList *node, gint group) {
+static guint merge_tap_menus_layered(GList *node, gint group) {
GtkItemFactoryEntry *entry;
GList *child;
guint added = 0;
entry = g_malloc0(sizeof (GtkItemFactoryEntry));
entry->path = node_data->name;
entry->callback = node_data->callback;
+#if GTK_MAJOR_VERSION >= 2
+ switch(group) {
+ case(REGISTER_STAT_GROUP_NONE):
+ break;
+ case(REGISTER_STAT_GROUP_GENERIC):
+ break;
+ case(REGISTER_STAT_GROUP_CONVERSATION_LIST):
+ entry->item_type = "<StockItem>";
+ entry->extra_data = WIRESHARK_STOCK_CONVERSATIONS;
+ break;
+ case(REGISTER_STAT_GROUP_ENDPOINT_LIST):
+ entry->item_type = "<StockItem>";
+ entry->extra_data = WIRESHARK_STOCK_ENDPOINTS;
+ break;
+ case(REGISTER_STAT_GROUP_RESPONSE_TIME):
+ entry->item_type = "<StockItem>";
+ entry->extra_data = WIRESHARK_STOCK_TIME;
+ break;
+ case(REGISTER_STAT_GROUP_TELEPHONY):
+ entry->item_type = "<StockItem>";
+ entry->extra_data = WIRESHARK_STOCK_TELEPHONY;
+ break;
+ case(REGISTER_ANALYZE_GROUP_NONE):
+ break;
+#ifdef HAVE_LUA_5_1
+ case(REGISTER_TOOLS_GROUP_NONE):
+ break;
+#endif
+ default:
+ g_assert_not_reached();
+ }
+#endif
gtk_item_factory_create_item(main_menu_factory, entry, node_data->callback_data, 2);
set_menu_sensitivity(main_menu_factory, node_data->name, FALSE); /* no capture file yet */
added++;
} else {
/*
* It's an interior node; call
- * "merge_tap_menus_layered()" on all its children
+ * "merge_tap_menus_layered()" on all its children
*/
/*
entry->item_type = "<Separator>";
entry->path = "/Statistics/";
- /*
+ /*
* merge only the menu items of the specific group,
* and then append a seperator
*/
- if (merge_tap_menus_layered(node, REGISTER_TAP_GROUP_GENERIC)) {
+ if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_GENERIC)) {
gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);
}
- if (merge_tap_menus_layered(node, REGISTER_TAP_GROUP_CONVERSATION_LIST)) {
+ if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_CONVERSATION_LIST)) {
/*gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);*/
}
- if (merge_tap_menus_layered(node, REGISTER_TAP_GROUP_ENDPOINT_LIST)) {
+ if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_ENDPOINT_LIST)) {
/*gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);*/
}
- if (merge_tap_menus_layered(node, REGISTER_TAP_GROUP_RESPONSE_TIME)) {
+ if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_RESPONSE_TIME)) {
gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);
}
- if (merge_tap_menus_layered(node, REGISTER_TAP_GROUP_NONE)) {
+ if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_TELEPHONY)) {
+ gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);
+ }
+ if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_NONE)) {
+ /*gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);*/
+ }
+ if (merge_tap_menus_layered(node, REGISTER_ANALYZE_GROUP_NONE)) {
+ entry->path = "/Analyze/";
+ /*gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);*/
+ }
+#ifdef HAVE_LUA_5_1
+ if (merge_tap_menus_layered(node, REGISTER_TOOLS_GROUP_NONE)) {
/*gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);*/
}
+#endif
+
}
gchar *dest;
- /* the underscore character regularly confuses things, as it will prevent finding
+ /* the underscore character regularly confuses things, as it will prevent finding
* the menu_item, so it has to be removed first */
dup = g_strdup(path);
dest = dup;
g_free(dup);
}
-void
-set_menu_object_data_meat(GtkItemFactory *ifactory, gchar *path, gchar *key, gpointer data)
+static void
+set_menu_object_data_meat(GtkItemFactory *ifactory, const gchar *path, const gchar *key, gpointer data)
{
GtkWidget *menu = NULL;
}
void
-set_menu_object_data (gchar *path, gchar *key, gpointer data) {
+set_menu_object_data (const gchar *path, const gchar *key, gpointer data) {
GSList *menu_list = popup_menu_list;
gchar *shortpath = strrchr(path, '/');
set_menu_object_data_meat(main_menu_factory, path, key, data);
while (menu_list != NULL) {
set_menu_object_data_meat(menu_list->data, shortpath, key, data);
+ set_menu_object_data_meat(menu_list->data, path, key, data);
menu_list = g_slist_next(menu_list);
}
}
-/* Recently used capture files submenu:
+/* Recently used capture files submenu:
* Submenu containing the recently used capture files.
* The capture filenames are always kept with the absolute path, to be independant
- * of the current path.
+ * of the current path.
* They are only stored inside the labels of the submenu (no separate list). */
#define MENU_RECENT_FILES_PATH "/File/Open Recent"
#define MENU_RECENT_FILES_KEY "Recent File Name"
-void
+static void
update_menu_recent_capture_file1(GtkWidget *widget, gpointer cnt) {
gchar *widget_cf_name;
/* update the menu */
-void
+static void
update_menu_recent_capture_file(GtkWidget *submenu_recent_files) {
guint cnt = 0;
- gtk_container_foreach(GTK_CONTAINER(submenu_recent_files),
+ gtk_container_foreach(GTK_CONTAINER(submenu_recent_files),
update_menu_recent_capture_file1, &cnt);
/* make parent menu item sensitive only, if we have any valid files in the list */
/* remove the capture filename from the "Recent Files" menu */
-void
+static void
remove_menu_recent_capture_file(GtkWidget *widget, gpointer unused _U_) {
GtkWidget *submenu_recent_files;
gchar *widget_cf_name;
submenu_recent_files = gtk_item_factory_get_widget(main_menu_factory, MENU_RECENT_FILES_PATH);
- gtk_container_foreach(GTK_CONTAINER(submenu_recent_files),
+ gtk_container_foreach(GTK_CONTAINER(submenu_recent_files),
remove_menu_recent_capture_file, NULL);
update_menu_recent_capture_file(submenu_recent_files);
gtk_label_get(GTK_LABEL(menu_item_child), &cf_name);
/* open and read the capture file (this will close an existing file) */
- if ((err = cf_open(cf_name, FALSE, &cfile)) == 0) {
+ if (cf_open(&cfile, cf_name, FALSE, &err) == CF_OK) {
cf_read(&cfile);
} else {
/* the capture file isn't existing any longer, remove menu item */
}
}
-void
+static void
menu_open_recent_file_cmd_cb(GtkWidget *widget, gpointer data _U_) {
gpointer dialog;
}
/* add the capture filename (with an absolute path) to the "Recent Files" menu */
-void
+static void
add_menu_recent_capture_file_absolute(gchar *cf_name) {
GtkWidget *submenu_recent_files;
GList *menu_item_list;
/* convert container to a GList */
menu_item_list = gtk_container_children(GTK_CONTAINER(submenu_recent_files));
- /* iterate through list items of menu_item_list,
+ /* iterate through list items of menu_item_list,
* removing special items, a maybe duplicate entry and every item above count_max */
cnt = 1;
for (li = g_list_first(menu_item_list); li; li = li->next, cnt++) {
widget_cf_name = OBJECT_GET_DATA(menu_item, MENU_RECENT_FILES_KEY);
/* if this element string is one of our special items (seperator, ...) or
- * already in the list or
+ * already in the list or
* this element is above maximum count (too old), remove it */
if (!widget_cf_name ||
#ifdef _WIN32
menu_item = gtk_menu_item_new_with_label(normalized_cf_name);
OBJECT_SET_DATA(menu_item, MENU_RECENT_FILES_KEY, normalized_cf_name);
gtk_menu_prepend (GTK_MENU(submenu_recent_files), menu_item);
- SIGNAL_CONNECT_OBJECT(GTK_OBJECT(menu_item), "activate",
+ SIGNAL_CONNECT_OBJECT(GTK_OBJECT(menu_item), "activate",
menu_open_recent_file_cmd_cb, (GtkObject *) menu_item);
gtk_widget_show (menu_item);
menu_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_CLEAR, NULL);
#endif
gtk_menu_append (GTK_MENU(submenu_recent_files), menu_item);
- SIGNAL_CONNECT_OBJECT(GTK_OBJECT(menu_item), "activate",
+ SIGNAL_CONNECT_OBJECT(GTK_OBJECT(menu_item), "activate",
clear_menu_recent_capture_file_cmd_cb, (GtkObject *) menu_item);
gtk_widget_show (menu_item);
add_menu_recent_capture_file(gchar *cf_name) {
gchar *curr;
gchar *absolute;
-
-
+
+
/* if this filename is an absolute path, we can use it directly */
if (g_path_is_absolute(cf_name)) {
add_menu_recent_capture_file_absolute(cf_name);
main_widgets_show_or_hide();
}
+#ifdef HAVE_AIRPCAP
+static void
+airpcap_toolbar_show_cb(GtkWidget *w _U_, gpointer d _U_)
+{
+
+ /* save current setting in recent */
+ recent.airpcap_toolbar_show = GTK_CHECK_MENU_ITEM(w)->active;
+
+ main_widgets_show_or_hide();
+}
+#endif
static void
packet_list_show_cb(GtkWidget *w _U_, gpointer d _U_)
}
-static void
+static void
timestamp_absolute_cb(GtkWidget *w _U_, gpointer d _U_)
{
if (recent.gui_time_format != TS_ABSOLUTE) {
- set_timestamp_setting(TS_ABSOLUTE);
+ timestamp_set_type(TS_ABSOLUTE);
recent.gui_time_format = TS_ABSOLUTE;
- change_time_formats(&cfile);
+ cf_change_time_formats(&cfile);
}
}
-static void
+static void
timestamp_absolute_date_cb(GtkWidget *w _U_, gpointer d _U_)
{
if (recent.gui_time_format != TS_ABSOLUTE_WITH_DATE) {
- set_timestamp_setting(TS_ABSOLUTE_WITH_DATE);
+ timestamp_set_type(TS_ABSOLUTE_WITH_DATE);
recent.gui_time_format = TS_ABSOLUTE_WITH_DATE;
- change_time_formats(&cfile);
+ cf_change_time_formats(&cfile);
}
}
-static void
+static void
timestamp_relative_cb(GtkWidget *w _U_, gpointer d _U_)
{
if (recent.gui_time_format != TS_RELATIVE) {
- set_timestamp_setting(TS_RELATIVE);
+ timestamp_set_type(TS_RELATIVE);
recent.gui_time_format = TS_RELATIVE;
- change_time_formats(&cfile);
+ cf_change_time_formats(&cfile);
}
}
-static void
+static void
timestamp_delta_cb(GtkWidget *w _U_, gpointer d _U_)
{
if (recent.gui_time_format != TS_DELTA) {
- set_timestamp_setting(TS_DELTA);
+ timestamp_set_type(TS_DELTA);
recent.gui_time_format = TS_DELTA;
- change_time_formats(&cfile);
+ cf_change_time_formats(&cfile);
}
}
+static void
+timestamp_auto_cb(GtkWidget *w _U_, gpointer d _U_)
+{
+ if (recent.gui_time_precision != TS_PREC_AUTO) {
+ /* the actual precision will be set in cf_change_time_formats() below */
+ timestamp_set_precision(TS_PREC_AUTO_SEC);
+ recent.gui_time_precision = TS_PREC_AUTO;
+ cf_change_time_formats(&cfile);
+ }
+}
+
+static void
+timestamp_sec_cb(GtkWidget *w _U_, gpointer d _U_)
+{
+ if (recent.gui_time_precision != TS_PREC_FIXED_SEC) {
+ timestamp_set_precision(TS_PREC_FIXED_SEC);
+ recent.gui_time_precision = TS_PREC_FIXED_SEC;
+ cf_change_time_formats(&cfile);
+ }
+}
+
+static void
+timestamp_dsec_cb(GtkWidget *w _U_, gpointer d _U_)
+{
+ if (recent.gui_time_precision != TS_PREC_FIXED_DSEC) {
+ timestamp_set_precision(TS_PREC_FIXED_DSEC);
+ recent.gui_time_precision = TS_PREC_FIXED_DSEC;
+ cf_change_time_formats(&cfile);
+ }
+}
+
+static void
+timestamp_csec_cb(GtkWidget *w _U_, gpointer d _U_)
+{
+ if (recent.gui_time_precision != TS_PREC_FIXED_CSEC) {
+ timestamp_set_precision(TS_PREC_FIXED_CSEC);
+ recent.gui_time_precision = TS_PREC_FIXED_CSEC;
+ cf_change_time_formats(&cfile);
+ }
+}
+
+static void
+timestamp_msec_cb(GtkWidget *w _U_, gpointer d _U_)
+{
+ if (recent.gui_time_precision != TS_PREC_FIXED_MSEC) {
+ timestamp_set_precision(TS_PREC_FIXED_MSEC);
+ recent.gui_time_precision = TS_PREC_FIXED_MSEC;
+ cf_change_time_formats(&cfile);
+ }
+}
+
+static void
+timestamp_usec_cb(GtkWidget *w _U_, gpointer d _U_)
+{
+ if (recent.gui_time_precision != TS_PREC_FIXED_USEC) {
+ timestamp_set_precision(TS_PREC_FIXED_USEC);
+ recent.gui_time_precision = TS_PREC_FIXED_USEC;
+ cf_change_time_formats(&cfile);
+ }
+}
+
+static void
+timestamp_nsec_cb(GtkWidget *w _U_, gpointer d _U_)
+{
+ if (recent.gui_time_precision != TS_PREC_FIXED_NSEC) {
+ timestamp_set_precision(TS_PREC_FIXED_NSEC);
+ recent.gui_time_precision = TS_PREC_FIXED_NSEC;
+ cf_change_time_formats(&cfile);
+ }
+}
+
+
void
menu_name_resolution_changed(void)
{
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), g_resolv_flags & RESOLV_TRANSPORT);
}
-static void
+static void
name_resolution_mac_cb(GtkWidget *w _U_, gpointer d _U_)
{
if (GTK_CHECK_MENU_ITEM(w)->active) {
}
}
-static void
+static void
name_resolution_network_cb(GtkWidget *w _U_, gpointer d _U_)
{
if (GTK_CHECK_MENU_ITEM(w)->active) {
}
}
-static void
+static void
name_resolution_transport_cb(GtkWidget *w _U_, gpointer d _U_)
{
if (GTK_CHECK_MENU_ITEM(w)->active) {
}
#ifdef HAVE_LIBPCAP
-static void
+void
+menu_auto_scroll_live_changed(gboolean auto_scroll_live_in) {
+ GtkWidget *menu;
+
+
+ /* tell menu about it */
+ menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Auto Scroll in Live Capture");
+ if( ((gboolean) GTK_CHECK_MENU_ITEM(menu)->active) != auto_scroll_live_in) {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), auto_scroll_live_in);
+ }
+
+ /* tell toolbar about it */
+ toolbar_auto_scroll_live_changed(auto_scroll_live_in);
+
+ /* change auto scroll */
+ if(auto_scroll_live_in != auto_scroll_live) {
+ auto_scroll_live = auto_scroll_live_in;
+ }
+}
+
+static void
auto_scroll_live_cb(GtkWidget *w _U_, gpointer d _U_)
{
- auto_scroll_live = GTK_CHECK_MENU_ITEM(w)->active;
+ menu_auto_scroll_live_changed(GTK_CHECK_MENU_ITEM(w)->active);
}
#endif
+
+void
+menu_colorize_changed(gboolean packet_list_colorize) {
+ GtkWidget *menu;
+
+
+ /* tell menu about it */
+ menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Colorize Packet List");
+ if( ((gboolean) GTK_CHECK_MENU_ITEM(menu)->active) != packet_list_colorize) {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), packet_list_colorize);
+ }
+
+ /* tell toolbar about it */
+ toolbar_colorize_changed(packet_list_colorize);
+
+ /* change colorization */
+ if(packet_list_colorize != recent.packet_list_colorize) {
+ recent.packet_list_colorize = packet_list_colorize;
+ color_filters_enable(packet_list_colorize);
+ cf_colorize_packets(&cfile);
+ }
+}
+
+static void
+colorize_cb(GtkWidget *w, gpointer d _U_)
+{
+ menu_colorize_changed(GTK_CHECK_MENU_ITEM(w)->active);
+}
+
+
/* the recent file read has finished, update the menu corresponding */
void
menu_recent_read_finished(void) {
menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Filter Toolbar");
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.filter_toolbar_show);
+#ifdef HAVE_AIRPCAP
+ menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Wireless Toolbar");
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.airpcap_toolbar_show);
+#endif
+
menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Statusbar");
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.statusbar_show);
menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Packet Bytes");
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.byte_view_show);
+ menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Colorize Packet List");
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.packet_list_colorize);
+
menu_name_resolution_changed();
#ifdef HAVE_LIBPCAP
main_widgets_rearrange();
/* don't change the time format, if we had a command line value */
- if (get_timestamp_setting() != TS_NOT_SET) {
- recent.gui_time_format = get_timestamp_setting();
+ if (timestamp_get_type() != TS_NOT_SET) {
+ recent.gui_time_format = timestamp_get_type();
}
switch(recent.gui_time_format) {
- case(TS_ABSOLUTE):
- menu = gtk_item_factory_get_widget(main_menu_factory,
- "/View/Time Display Format/Time of Day");
+ case(TS_ABSOLUTE_WITH_DATE):
+ menu = gtk_item_factory_get_widget(main_menu_factory,
+ "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456");
/* set_active will not trigger the callback when activating an active item! */
recent.gui_time_format = -1;
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
break;
- case(TS_ABSOLUTE_WITH_DATE):
- menu = gtk_item_factory_get_widget(main_menu_factory,
- "/View/Time Display Format/Date and Time of Day");
+ case(TS_ABSOLUTE):
+ menu = gtk_item_factory_get_widget(main_menu_factory,
+ "/View/Time Display Format/Time of Day: 01:02:03.123456");
+ /* set_active will not trigger the callback when activating an active item! */
recent.gui_time_format = -1;
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
break;
case(TS_RELATIVE):
- menu = gtk_item_factory_get_widget(main_menu_factory,
- "/View/Time Display Format/Seconds Since Beginning of Capture");
+ menu = gtk_item_factory_get_widget(main_menu_factory,
+ "/View/Time Display Format/Seconds Since Beginning of Capture: 123.123456");
recent.gui_time_format = -1;
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
break;
case(TS_DELTA):
- menu = gtk_item_factory_get_widget(main_menu_factory,
- "/View/Time Display Format/Seconds Since Previous Packet");
+ menu = gtk_item_factory_get_widget(main_menu_factory,
+ "/View/Time Display Format/Seconds Since Previous Packet: 1.123456");
recent.gui_time_format = -1;
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
break;
default:
g_assert_not_reached();
}
+
+ switch(recent.gui_time_precision) {
+ case(TS_PREC_AUTO):
+ menu = gtk_item_factory_get_widget(main_menu_factory,
+ "/View/Time Display Format/Automatic (File Format Precision)");
+ /* set_active will not trigger the callback when activating an active item! */
+ recent.gui_time_precision = -1;
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
+ break;
+ case(TS_PREC_FIXED_SEC):
+ menu = gtk_item_factory_get_widget(main_menu_factory,
+ "/View/Time Display Format/Seconds: 0");
+ recent.gui_time_precision = -1;
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
+ break;
+ case(TS_PREC_FIXED_DSEC):
+ menu = gtk_item_factory_get_widget(main_menu_factory,
+ "/View/Time Display Format/Deciseconds: 0.1");
+ recent.gui_time_precision = -1;
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
+ break;
+ case(TS_PREC_FIXED_CSEC):
+ menu = gtk_item_factory_get_widget(main_menu_factory,
+ "/View/Time Display Format/Centiseconds: 0.12");
+ recent.gui_time_precision = -1;
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
+ break;
+ case(TS_PREC_FIXED_MSEC):
+ menu = gtk_item_factory_get_widget(main_menu_factory,
+ "/View/Time Display Format/Milliseconds: 0.123");
+ recent.gui_time_precision = -1;
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
+ break;
+ case(TS_PREC_FIXED_USEC):
+ menu = gtk_item_factory_get_widget(main_menu_factory,
+ "/View/Time Display Format/Microseconds: 0.123456");
+ recent.gui_time_precision = -1;
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
+ break;
+ case(TS_PREC_FIXED_NSEC):
+ menu = gtk_item_factory_get_widget(main_menu_factory,
+ "/View/Time Display Format/Nanoseconds: 0.123456789");
+ recent.gui_time_precision = -1;
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
+ break;
+ default:
+ g_assert_not_reached();
+ }
+
+ menu_colorize_changed(recent.packet_list_colorize);
}
{
set_menu_sensitivity(main_menu_factory, "/File/Open...",
!capture_in_progress);
- set_menu_sensitivity(main_menu_factory, "/File/Open Recent",
+ set_menu_sensitivity(main_menu_factory, "/File/Open Recent",
!capture_in_progress);
#ifdef HAVE_LIBPCAP
- set_menu_sensitivity(main_menu_factory, "/Capture/Start...",
+ set_menu_sensitivity(main_menu_factory, "/Capture/Options...",
+ !capture_in_progress);
+ set_menu_sensitivity(main_menu_factory, "/Capture/Start",
!capture_in_progress);
set_menu_sensitivity(main_menu_factory, "/Capture/Stop",
capture_in_progress);
+ set_menu_sensitivity(main_menu_factory, "/Capture/Restart",
+ capture_in_progress);
set_toolbar_for_capture_in_progress(capture_in_progress);
set_capture_if_dialog_for_capture_in_progress(capture_in_progress);
have_captured_packets);
set_menu_sensitivity(main_menu_factory, "/View/Normal Size",
have_captured_packets);
- set_menu_sensitivity(packet_list_menu_factory, "/Coloring Rules...",
- have_captured_packets);
set_menu_sensitivity(main_menu_factory, "/Go/Go to Packet...",
have_captured_packets);
set_menu_sensitivity(main_menu_factory, "/Go/First Packet",
have_captured_packets);
set_menu_sensitivity(main_menu_factory, "/Statistics/Summary",
have_captured_packets);
- set_menu_sensitivity(main_menu_factory, "/Statistics/Protocol Hierarchy",
+ set_menu_sensitivity(main_menu_factory, "/Statistics/Protocol Hierarchy",
have_captured_packets);
-
+
walk_menu_tree_for_captured_packets(tap_menu_tree_root,
have_captured_packets);
set_toolbar_for_captured_packets(have_captured_packets);
return node_data->enabled;
}
+int
+packet_is_ssl(epan_dissect_t* edt)
+{
+ GPtrArray* array;
+ int ssl_id, is_ssl;
+ if (!edt || !edt->tree)
+ return 0;
+ ssl_id = proto_get_id_by_filter_name("ssl");
+ if (ssl_id < 0)
+ return 0;
+ array = proto_find_finfo(edt->tree, ssl_id);
+ is_ssl = array->len > 0;
+ g_ptr_array_free(array, FALSE);
+ return is_ssl;
+}
+
void
set_menus_for_selected_packet(capture_file *cf)
{
- set_menu_sensitivity(main_menu_factory, "/Edit/Mark Packet",
+ int is_ssl = packet_is_ssl(cf->edt);
+ set_menu_sensitivity(main_menu_factory, "/Edit/Mark Packet (toggle)",
cf->current_frame != NULL);
- set_menu_sensitivity(packet_list_menu_factory, "/Mark Packet",
+ set_menu_sensitivity(packet_list_menu_factory, "/Mark Packet (toggle)",
cf->current_frame != NULL);
- set_menu_sensitivity(main_menu_factory, "/Edit/Time Reference",
+ set_menu_sensitivity(main_menu_factory, "/Edit/Find Next Mark",
cf->current_frame != NULL);
- set_menu_sensitivity(packet_list_menu_factory, "/Time Reference",
+ set_menu_sensitivity(main_menu_factory, "/Edit/Find Previous Mark",
cf->current_frame != NULL);
set_menu_sensitivity(main_menu_factory, "/Edit/Mark All Packets",
cf->current_frame != NULL);
set_menu_sensitivity(main_menu_factory, "/Edit/Unmark All Packets",
cf->current_frame != NULL);
+ set_menu_sensitivity(main_menu_factory, "/Edit/Set Time Reference (toggle)",
+ cf->current_frame != NULL);
+ set_menu_sensitivity(packet_list_menu_factory, "/Set Time Reference (toggle)",
+ cf->current_frame != NULL);
+ set_menu_sensitivity(main_menu_factory, "/Edit/Find Next Reference",
+ cf->current_frame != NULL);
+ set_menu_sensitivity(main_menu_factory, "/Edit/Find Previous Reference",
+ cf->current_frame != NULL);
+ set_menu_sensitivity(main_menu_factory, "/View/Resize All Columns",
+ cf->current_frame != NULL);
set_menu_sensitivity(main_menu_factory, "/View/Collapse All",
cf->current_frame != NULL);
set_menu_sensitivity(tree_view_menu_factory, "/Collapse All",
cf->current_frame != NULL);
set_menu_sensitivity(packet_list_menu_factory, "/Show Packet in New Window",
cf->current_frame != NULL);
+ set_menu_sensitivity(packet_list_menu_factory, "/SCTP",
+ cf->current_frame != NULL ? (cf->edt->pi.ipproto == IP_PROTO_SCTP) : FALSE);
+ set_menu_sensitivity(main_menu_factory, "/Analyze/Firewall ACL Rules",
+ cf->current_frame != NULL);
set_menu_sensitivity(main_menu_factory, "/Analyze/Follow TCP Stream",
cf->current_frame != NULL ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
- set_menu_sensitivity(NULL, "/Follow TCP Stream",
+ set_menu_sensitivity(packet_list_menu_factory, "/Follow TCP Stream",
+ cf->current_frame != NULL ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
+ set_menu_sensitivity(tree_view_menu_factory, "/Follow TCP Stream",
+ cf->current_frame != NULL ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
+ set_menu_sensitivity(main_menu_factory, "/Analyze/Follow SSL Stream",
+ cf->current_frame != NULL ? is_ssl : FALSE);
+ set_menu_sensitivity(packet_list_menu_factory, "/Follow SSL Stream",
+ cf->current_frame != NULL ? is_ssl : FALSE);
+ set_menu_sensitivity(tree_view_menu_factory, "/Follow SSL Stream",
+ cf->current_frame != NULL ? is_ssl : FALSE);
+ set_menu_sensitivity(packet_list_menu_factory, "/Conversation Filter/Ethernet",
+ cf->current_frame != NULL ? (cf->edt->pi.ethertype != 0) : FALSE);
+ set_menu_sensitivity(packet_list_menu_factory, "/Conversation Filter/IP",
+ cf->current_frame != NULL ? (cf->edt->pi.ethertype == 0x800) : FALSE);
+ set_menu_sensitivity(packet_list_menu_factory, "/Conversation Filter/TCP",
cf->current_frame != NULL ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
+ set_menu_sensitivity(packet_list_menu_factory, "/Conversation Filter/UDP",
+ cf->current_frame != NULL ? (cf->edt->pi.ipproto == IP_PROTO_UDP) : FALSE);
+ set_menu_sensitivity(packet_list_menu_factory, "/Conversation Filter/PN-CBA Server",
+ cf->current_frame != NULL ? (cf->edt->pi.profinet_type != 0) : FALSE);
set_menu_sensitivity(main_menu_factory, "/Analyze/Decode As...",
cf->current_frame != NULL && decode_as_ok());
- set_menu_sensitivity(NULL, "/Decode As...",
+ set_menu_sensitivity(packet_list_menu_factory, "/Decode As...",
+ cf->current_frame != NULL && decode_as_ok());
+ set_menu_sensitivity(tree_view_menu_factory, "/Decode As...",
cf->current_frame != NULL && decode_as_ok());
set_menu_sensitivity(main_menu_factory, "/View/Name Resolution/Resolve Name",
cf->current_frame != NULL && (g_resolv_flags & RESOLV_ALL_ADDRS) != RESOLV_ALL_ADDRS);
gboolean properties;
- set_menu_sensitivity(main_menu_factory, "/File/Export/Selected Packet Bytes...",
- cf->finfo_selected != NULL);
- set_menu_sensitivity(tree_view_menu_factory, "/Export Selected Packet Bytes...",
+ set_menu_sensitivity(main_menu_factory, "/File/Export/Selected Packet Bytes...",
+ cf->finfo_selected != NULL);
+ set_menu_sensitivity(hexdump_menu_factory, "/Copy",
cf->finfo_selected != NULL);
- set_menu_sensitivity(hexdump_menu_factory, "/Export Selected Packet Bytes...",
+ set_menu_sensitivity(hexdump_menu_factory, "/Export Selected Packet Bytes...",
cf->finfo_selected != NULL);
-
+
if (cf->finfo_selected != NULL) {
header_field_info *hfinfo = cf->finfo_selected->hfinfo;
if (hfinfo->parent == -1) {
proto_can_match_selected(cf->finfo_selected, cf->edt));
set_menu_sensitivity(tree_view_menu_factory, "/Protocol Preferences...",
properties);
- set_menu_sensitivity(main_menu_factory, "/View/Expand Tree", cf->finfo_selected->tree_type != -1);
- set_menu_sensitivity(tree_view_menu_factory, "/Expand Tree", cf->finfo_selected->tree_type != -1);
-/* set_menu_sensitivity(tree_view_menu_factory, "/Online Protocol Info",
- TRUE);*/
+ set_menu_sensitivity(main_menu_factory, "/View/Expand Subtrees", cf->finfo_selected->tree_type != -1);
+ set_menu_sensitivity(tree_view_menu_factory, "/Expand Subtrees", cf->finfo_selected->tree_type != -1);
+ set_menu_sensitivity(tree_view_menu_factory, "/Wiki Protocol Page",
+ TRUE);
+ set_menu_sensitivity(tree_view_menu_factory, "/Filter Field Reference",
+ TRUE);
} else {
set_menu_sensitivity(main_menu_factory,
"/Go/Go to Corresponding Packet", FALSE);
set_menu_sensitivity(tree_view_menu_factory, "/Prepare a Filter", FALSE);
set_menu_sensitivity(tree_view_menu_factory, "/Protocol Preferences...",
FALSE);
- set_menu_sensitivity(main_menu_factory, "/View/Expand Tree", FALSE);
- set_menu_sensitivity(tree_view_menu_factory, "/Expand Tree", FALSE);
-/* set_menu_sensitivity(tree_view_menu_factory, "/Online Protocol Info",
- FALSE);*/
+ set_menu_sensitivity(main_menu_factory, "/View/Expand Subtrees", FALSE);
+ set_menu_sensitivity(tree_view_menu_factory, "/Expand Subtrees", FALSE);
+ set_menu_sensitivity(tree_view_menu_factory, "/Wiki Protocol Page",
+ FALSE);
+ set_menu_sensitivity(tree_view_menu_factory, "/Filter Field Reference",
+ FALSE);
}
walk_menu_tree_for_selected_tree_row(tap_menu_tree_root, cf->finfo_selected);
set_toolbar_for_packet_history(back_history, forward_history);
}
+
+void set_menus_for_file_set(gboolean file_set, gboolean previous_file, gboolean next_file) {
+
+ set_menu_sensitivity(main_menu_factory, "/File/File Set/List Files", file_set);
+ set_menu_sensitivity(main_menu_factory, "/File/File Set/Previous File", previous_file);
+ set_menu_sensitivity(main_menu_factory, "/File/File Set/Next File", next_file);
+}