prefs.capture_real_time = TRUE;
prefs.capture_auto_scroll = TRUE;
prefs.capture_show_info = FALSE;
+ prefs.capture_syntax_check_filter = TRUE;
/* set the default values for the name resolution dialog box */
prefs.name_resolve = RESOLV_ALL ^ RESOLV_NETWORK;
#define PRS_CAP_REAL_TIME "capture.real_time_update"
#define PRS_CAP_AUTO_SCROLL "capture.auto_scroll"
#define PRS_CAP_SHOW_INFO "capture.show_info"
+#define PRS_CAP_SYNTAX_CHECK_FILTER "capture.syntax_check_filter"
#define RED_COMPONENT(x) (guint16) (((((x) >> 16) & 0xff) * 65535 / 255))
#define GREEN_COMPONENT(x) (guint16) (((((x) >> 8) & 0xff) * 65535 / 255))
prefs.capture_auto_scroll = ((g_ascii_strcasecmp(value, "true") == 0)?TRUE:FALSE);
} else if (strcmp(pref_name, PRS_CAP_SHOW_INFO) == 0) {
prefs.capture_show_info = ((g_ascii_strcasecmp(value, "true") == 0)?TRUE:FALSE);
+ } else if (strcmp(pref_name, PRS_CAP_SYNTAX_CHECK_FILTER) == 0) {
+ prefs.capture_syntax_check_filter = ((g_ascii_strcasecmp(value, "true") == 0)?TRUE:FALSE);
/* handle the global options */
} else if (strcmp(pref_name, PRS_NAME_RESOLVE) == 0 ||
fprintf(pf, PRS_CAP_SHOW_INFO ": %s\n",
prefs.capture_show_info == TRUE ? "TRUE" : "FALSE");
+ fprintf(pf, "\n# Syntax check capture filter?\n");
+ fprintf(pf, "# TRUE or FALSE (case-insensitive).\n");
+ fprintf(pf, PRS_CAP_SYNTAX_CHECK_FILTER ": %s\n",
+ prefs.capture_syntax_check_filter == TRUE ? "TRUE" : "FALSE");
+
fprintf (pf, "\n######## Printing ########\n");
fprintf (pf, "\n# Can be one of \"text\" or \"postscript\".\n"
dest->capture_real_time = src->capture_real_time;
dest->capture_auto_scroll = src->capture_auto_scroll;
dest->capture_show_info = src->capture_show_info;
+ dest->capture_syntax_check_filter = src->capture_syntax_check_filter;
dest->name_resolve = src->name_resolve;
dest->name_resolve_concurrency = src->name_resolve_concurrency;
dest->display_hidden_proto_items = src->display_hidden_proto_items;
gboolean capture_real_time;
gboolean capture_auto_scroll;
gboolean capture_show_info;
+ gboolean capture_syntax_check_filter;
guint rtp_player_max_visible;
guint tap_update_interval;
gboolean display_hidden_proto_items;
GtkTreeModel *model;
#endif
+ if (!prefs.capture_syntax_check_filter)
+ return;
+
filter_cm = g_object_get_data(G_OBJECT(top_level), E_CFILTER_CM_KEY);
filter_te = gtk_bin_get_child(GTK_BIN(filter_cm));
#if GTK_CHECK_VERSION(2,24,0)
#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(filter_cm,
"Enter a capture filter to reduce the amount of packets to be captured. "
- "See \"Capture Filters\" in the online help for further information how to use it."
+ "See \"Capture Filters\" in the online help for further information how to use it. "
+ "Syntax checking can be disabled in Preferences -> Capture -> Syntax check capture filter."
);
#else
gtk_tooltips_set_tip(tooltips, filter_cm,
"Enter a capture filter to reduce the amount of packets to be captured. "
"See \"Capture Filters\" in the online help for further information how to use it.",
+ "Syntax checking can be disabled in Preferences -> Capture -> Syntax check capture filter."
NULL);
#endif
gtk_box_pack_start(GTK_BOX(filter_hb), filter_cm, TRUE, TRUE, 3);
#define CAPTURE_REAL_TIME_KEY "capture_real_time"
#define AUTO_SCROLL_KEY "auto_scroll"
#define SHOW_INFO_KEY "show_info"
+#define SYNTAX_CHECK_FILTER_KEY "syntax_check_filter"
#define CAPTURE_TABLE_ROWS 6
capture_prefs_show(void)
{
GtkWidget *main_tb, *main_vb;
- GtkWidget *if_cbxe, *if_lb, *promisc_cb, *pcap_ng_cb, *sync_cb, *auto_scroll_cb, *show_info_cb;
+ GtkWidget *if_cbxe, *if_lb, *promisc_cb, *pcap_ng_cb, *sync_cb, *auto_scroll_cb, *show_info_cb, *syntax_check_filter_cb;
GtkWidget *ifopts_lb, *ifopts_bt;
GList *if_list, *combo_list;
int err;
!prefs.capture_show_info);
g_object_set_data(G_OBJECT(main_vb), SHOW_INFO_KEY, show_info_cb);
+ /* Syntax check capture filter */
+ syntax_check_filter_cb = create_preference_check_button(main_tb, row++,
+ "Syntax check capture filter:",
+ "Syntax check capture filter. Turn this off if you experience delay when writing capture filters.",
+ prefs.capture_syntax_check_filter);
+ g_object_set_data(G_OBJECT(main_vb), SYNTAX_CHECK_FILTER_KEY, syntax_check_filter_cb);
+
/* Show 'em what we got */
gtk_widget_show_all(main_vb);
void
capture_prefs_fetch(GtkWidget *w)
{
- GtkWidget *if_cbxe, *promisc_cb, *pcap_ng_cb, *sync_cb, *auto_scroll_cb, *show_info_cb;
+ GtkWidget *if_cbxe, *promisc_cb, *pcap_ng_cb, *sync_cb, *auto_scroll_cb, *show_info_cb, *syntax_check_filter_cb;
gchar *if_text;
if_cbxe = (GtkWidget *)g_object_get_data(G_OBJECT(w), DEVICE_KEY);
sync_cb = (GtkWidget *)g_object_get_data(G_OBJECT(w), CAPTURE_REAL_TIME_KEY);
auto_scroll_cb = (GtkWidget *)g_object_get_data(G_OBJECT(w), AUTO_SCROLL_KEY);
show_info_cb = (GtkWidget *)g_object_get_data(G_OBJECT(w), SHOW_INFO_KEY);
+ syntax_check_filter_cb = (GtkWidget *)g_object_get_data(G_OBJECT(w), SYNTAX_CHECK_FILTER_KEY);
if (prefs.capture_device != NULL) {
g_free(prefs.capture_device);
prefs.capture_auto_scroll = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(auto_scroll_cb));
prefs.capture_show_info = !(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(show_info_cb)));
+ prefs.capture_syntax_check_filter = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(syntax_check_filter_cb));
}
void