return;
}
+ /* pcap_compile_nopcap will not alter the filter string, so the (char *) cast is "safe" */
if (pcap_compile_nopcap(DUMMY_SNAPLENGTH /* use a dummy snaplength for syntax-checking */,
- global_capture_opts.linktype, &fcode, filter_text, 1 /* Do optimize */,
+ global_capture_opts.linktype, &fcode, (char *)filter_text, 1 /* Do optimize */,
DUMMY_NETMASK /* use a dummy netmask for syntax-checking */) < 0) {
colorize_filter_te_as_invalid(filter_te);
} else {
#endif
+#if defined(HAVE_PCAP_OPEN_DEAD) && defined(HAVE_BPF_IMAGE)
static void
capture_filter_compile_cb(GtkWidget *w _U_, gpointer user_data _U_)
{
filter_te = GTK_COMBO(filter_cm)->entry;
filter_text = gtk_entry_get_text(GTK_ENTRY(filter_te));
+ /* pcap_compile will not alter the filter string, so the (char *) cast is "safe" */
#ifdef PCAP_NETMASK_UNKNOWN
- if (pcap_compile(pd, &fcode, filter_text, 1 /* Do optimize */, PCAP_NETMASK_UNKNOWN) < 0) {
+ if (pcap_compile(pd, &fcode, (char *)filter_text, 1 /* Do optimize */, PCAP_NETMASK_UNKNOWN) < 0) {
#else
- if (pcap_compile(pd, &fcode, filter_text, 1 /* Do optimize */, 0) < 0) {
+ if (pcap_compile(pd, &fcode, (char *)filter_text, 1 /* Do optimize */, 0) < 0) {
#endif
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", pcap_geterr(pd));
} else {
pcap_close(pd);
}
+#endif
/* show capture prepare (options) dialog */
void
#endif
*pcap_ng_cb,
*filter_hb, *filter_bt, *filter_te, *filter_cm,
+#if defined(HAVE_PCAP_OPEN_DEAD) && defined(HAVE_BPF_IMAGE)
*compile_bt,
+#endif
*file_fr, *file_vb,
*file_hb, *file_bt, *file_lb, *file_te,
*multi_tb, *multi_files_on_cb,
/* let an eventually capture filters dialog know the text entry to fill in */
g_object_set_data(G_OBJECT(filter_bt), E_FILT_TE_PTR_KEY, filter_te);
+#if defined(HAVE_PCAP_OPEN_DEAD) && defined(HAVE_BPF_IMAGE)
compile_bt = gtk_button_new_with_label("Compile BPF");
g_signal_connect(compile_bt, "clicked", G_CALLBACK(capture_filter_compile_cb), NULL);
gtk_tooltips_set_tip(tooltips, compile_bt,
- "Compile the capture filter expression and show the BPF code.",
+ "Compile the capture filter expression and show the BPF (Berkeley Packet Filter) code.",
NULL);
gtk_box_pack_start(GTK_BOX(filter_hb), compile_bt, FALSE, FALSE, 3);
+#endif
/* advanced row */
#ifdef HAVE_AIRPCAP
m_resolv_cb = gtk_check_button_new_with_mnemonic(
"Enable _MAC name resolution");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_resolv_cb),
- g_resolv_flags & RESOLV_MAC);
+ gbl_resolv_flags & RESOLV_MAC);
gtk_tooltips_set_tip(tooltips, m_resolv_cb,
"Perform MAC layer name resolution while capturing.", NULL);
gtk_container_add(GTK_CONTAINER(resolv_vb), m_resolv_cb);
n_resolv_cb = gtk_check_button_new_with_mnemonic(
"Enable _network name resolution");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(n_resolv_cb),
- g_resolv_flags & RESOLV_NETWORK);
+ gbl_resolv_flags & RESOLV_NETWORK);
gtk_tooltips_set_tip(tooltips, n_resolv_cb,
"Perform network layer name resolution while capturing.", NULL);
gtk_container_add(GTK_CONTAINER(resolv_vb), n_resolv_cb);
t_resolv_cb = gtk_check_button_new_with_mnemonic(
"Enable _transport name resolution");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_resolv_cb),
- g_resolv_flags & RESOLV_TRANSPORT);
+ gbl_resolv_flags & RESOLV_TRANSPORT);
gtk_tooltips_set_tip(tooltips, t_resolv_cb,
"Perform transport layer name resolution while capturing.", NULL);
gtk_container_add(GTK_CONTAINER(resolv_vb), t_resolv_cb);
!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hide_info_cb));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_resolv_cb)))
- g_resolv_flags |= RESOLV_MAC;
+ gbl_resolv_flags |= RESOLV_MAC;
else
- g_resolv_flags &= ~RESOLV_MAC;
+ gbl_resolv_flags &= ~RESOLV_MAC;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(n_resolv_cb)))
- g_resolv_flags |= RESOLV_NETWORK;
+ gbl_resolv_flags |= RESOLV_NETWORK;
else
- g_resolv_flags &= ~RESOLV_NETWORK;
+ gbl_resolv_flags &= ~RESOLV_NETWORK;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(t_resolv_cb)))
- g_resolv_flags |= RESOLV_TRANSPORT;
+ gbl_resolv_flags |= RESOLV_TRANSPORT;
else
- g_resolv_flags &= ~RESOLV_TRANSPORT;
+ gbl_resolv_flags &= ~RESOLV_TRANSPORT;
global_capture_opts.has_ring_num_files =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ringbuffer_nbf_cb));