static void
capture_prep_interface_changed_cb(GtkWidget *entry, gpointer parent_w);
-static void
+static gboolean
capture_dlg_prep(gpointer parent_w);
/*
* Try to get the list of known interfaces.
*/
+#ifdef HAVE_PCAP_REMOTE
+ if (global_capture_opts.src_type == CAPTURE_IFREMOTE)
+ if_list = get_remote_interface_list(global_capture_opts.remote_host,
+ global_capture_opts.remote_port,
+ global_capture_opts.auth_type,
+ global_capture_opts.auth_username,
+ global_capture_opts.auth_password,
+ &err, NULL);
+ else
+ if_list = capture_interface_list(&err, NULL);
+#else
if_list = capture_interface_list(&err, NULL);
+#endif
if (if_list != NULL) {
/*
* We have the list - check it.
global_capture_opts.auth_password,
&err, &err_str);
else
- if_list = get_interface_list(&err, &err_str);
+ if_list = capture_interface_list(&err, &err_str);
if (if_list == NULL && err == CANT_GET_INTERFACE_LIST) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_str);
global_capture_opts.auth_password,
&err, &err_str);
else
- if_list = get_interface_list(&err, &err_str);
+ if_list = capture_interface_list(&err, &err_str);
#else
if_list = capture_interface_list(&err, &err_str);
#endif
gtk_box_pack_start(GTK_BOX(capture_vb), if_ip_hb, FALSE, FALSE, 0);
if_ip_eb = gtk_event_box_new();
+ gtk_event_box_set_visible_window (GTK_EVENT_BOX(if_ip_eb), FALSE);
gtk_box_pack_start(GTK_BOX(if_ip_hb), if_ip_eb, TRUE, TRUE, 6);
gtk_tooltips_set_tip(tooltips, if_ip_eb, "Lists the IP address(es) "
"assigned to the selected interface. If there are "
}
#endif
- /* get the values and close the options dialog */
if(cap_open_w) {
- capture_dlg_prep(cap_open_w);
+ /*
+ * There's an options dialog; get the values from it and close it.
+ */
+ gboolean success;
+
+ success = capture_dlg_prep(cap_open_w);
window_destroy(GTK_WIDGET(cap_open_w));
+ if (!success)
+ return; /* error in options dialog */
}
if (global_capture_opts.iface == NULL) {
- gchar *if_device = g_strdup(prefs.capture_device);
- if_name = g_strdup(get_if_name(if_device));
- g_free (if_device);
+ if (prefs.capture_device == NULL) {
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
+ "You didn't specify an interface on which to capture packets.");
+ return;
+ }
+ if_name = g_strdup(get_if_name(prefs.capture_device));
} else {
if_name = g_strdup(global_capture_opts.iface);
}
/* convert dialog settings into capture_opts values */
-static void
+static gboolean
capture_dlg_prep(gpointer parent_w) {
GtkWidget *if_cb, *snap_cb, *snap_sb, *promisc_cb, *filter_te, *filter_cm,
*file_te, *multi_files_on_cb, *ringbuffer_nbf_sb, *ringbuffer_nbf_cb,
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"You didn't specify an interface on which to capture packets.");
g_free(entry_text);
- return;
+ return FALSE;
}
if (global_capture_opts.iface)
g_free(global_capture_opts.iface);
"%sMultiple files: Requested filesize too large!%s\n\n"
"The setting \"Next file every x byte(s)\" can't be greater than %u bytes (2GB).",
simple_dialog_primary_start(), simple_dialog_primary_end(), G_MAXINT);
- return;
+ return FALSE;
}
}
"%sMultiple files: No capture file name given!%s\n\n"
"You must specify a filename if you want to use multiple files.",
simple_dialog_primary_start(), simple_dialog_primary_end());
- return;
+ return FALSE;
} else if (!global_capture_opts.has_autostop_filesize && !global_capture_opts.has_file_duration) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"%sMultiple files: No file limit given!%s\n\n"
simple_dialog_primary_start(), simple_dialog_primary_end());
g_free(global_capture_opts.save_file);
global_capture_opts.save_file = NULL;
- return;
+ return FALSE;
}
} else {
global_capture_opts.has_autostop_filesize =
"%sStop Capture: Requested filesize too large!%s\n\n"
"The setting \"... after x byte(s)\" can't be greater than %u bytes (2GB).",
simple_dialog_primary_start(), simple_dialog_primary_end(), G_MAXINT);
- return;
+ return FALSE;
}
}
} /* multi_files_on */
+ return TRUE;
}
/* user requested to destroy the dialog */