* time, so that we only need one Ethereal binary and one Tethereal binary
* for Windows, regardless of whether WinPcap is installed or not.
*
- * $Id: capture-wpcap.c,v 1.9 2004/03/13 22:49:29 ulfl Exp $
+ * $Id: capture-wpcap.c,v 1.10 2004/06/12 07:47:12 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
return il;
}
+/*
+ * Get an error message string for a CANT_GET_INTERFACE_LIST error from
+ * "get_interface_list()".
+ */
+gchar *
+cant_get_if_list_error_message(const char *err_str)
+{
+ /*
+ * If the error message includes "Not enough storage is available
+ * to process this command" or "The operation completed successfully",
+ * suggest that they install a WinPcap version later than 3.0.
+ */
+ if (strstr(err_str, "Not enough storage is available to process this command") != NULL ||
+ strstr(err_str, "The operation completed successfully") != NULL) {
+ return g_strdup_printf("Can't get list of interfaces: %s\n"
+"This might be a problem with WinPcap 3.0; you should try updating to\n"
+"a later version of WinPcap - see the WinPcap site at winpcap.polito.it",
+ err_str);
+ }
+ return g_strdup_printf("Can't get list of interfaces: %s", err_str);
+}
+
/*
* Append the version of WinPcap with which we were compiled to a GString.
*/
/* capture_dlg.c
* Routines for packet capture windows
*
- * $Id: capture_dlg.c,v 1.132 2004/05/26 04:21:48 guy Exp $
+ * $Id: capture_dlg.c,v 1.133 2004/06/12 07:47:14 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
int err;
int row;
char err_str[PCAP_ERRBUF_SIZE];
+ gchar *cant_get_if_list_errstr;
#ifdef _WIN32
GtkAdjustment *buffer_size_adj;
GtkWidget *buffer_size_lb, *buffer_size_sb;
if_list = get_interface_list(&err, err_str);
if (if_list == NULL && err == CANT_GET_INTERFACE_LIST) {
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Can't get list of interfaces: %s",
- err_str);
+ cant_get_if_list_errstr = cant_get_if_list_error_message(err_str);
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s",
+ cant_get_if_list_errstr);
+ g_free(cant_get_if_list_errstr);
}
cap_open_w = dlg_window_new("Ethereal: Capture Options");
/* capture_prefs.c
* Dialog box for capture preferences
*
- * $Id: capture_prefs.c,v 1.36 2004/05/31 11:22:58 ulfl Exp $
+ * $Id: capture_prefs.c,v 1.37 2004/06/12 07:47:14 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
ifopts_if_clist_add(void)
{
GList *if_list;
- int err;
+ int err;
char err_str[PCAP_ERRBUF_SIZE];
+ gchar *cant_get_if_list_errstr;
if_info_t *if_info;
guint i;
guint nitems;
if_list = get_interface_list(&err, err_str);
if (if_list == NULL && err == CANT_GET_INTERFACE_LIST) {
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
- "Can't get list of interfaces: %s", err_str);
+ cant_get_if_list_errstr =
+ cant_get_if_list_error_message(err_str);
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s",
+ cant_get_if_list_errstr);
+ g_free(cant_get_if_list_errstr);
return;
}
/* main.c
*
- * $Id: main.c,v 1.440 2004/06/01 17:33:36 ulfl Exp $
+ * $Id: main.c,v 1.441 2004/06/12 07:47:14 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
GList *lt_list, *lt_entry;
data_link_info_t *data_link_info;
gchar err_str[PCAP_ERRBUF_SIZE];
+ gchar *cant_get_if_list_errstr;
gboolean stats_known;
struct pcap_stat stats;
#else
switch (err) {
case CANT_GET_INTERFACE_LIST:
- fprintf(stderr, "ethereal: Can't get list of interfaces: %s\n",
- err_str);
+ cant_get_if_list_errstr = cant_get_if_list_error_message(err_str);
+ fprintf(stderr, "%s\n", cant_get_if_list_errstr);
+ g_free(cant_get_if_list_errstr);
break;
case NO_INTERFACES_FOUND:
/* pcap-util-unix.c
* UN*X-specific utility routines for packet capture
*
- * $Id: pcap-util-unix.c,v 1.2 2003/10/10 06:05:48 guy Exp $
+ * $Id: pcap-util-unix.c,v 1.3 2004/06/12 07:47:13 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
}
#endif /* HAVE_PCAP_FINDALLDEVS */
+/*
+ * Get an error message string for a CANT_GET_INTERFACE_LIST error from
+ * "get_interface_list()".
+ */
+gchar *
+cant_get_if_list_error_message(const char *err_str)
+{
+ return g_strdup_printf("Can't get list of interfaces: %s", err_str);
+}
+
/*
* Append the version of libpcap with which we were compiled to a GString.
*/
/* pcap-util.h
* Utility definitions for packet capture
*
- * $Id: pcap-util.h,v 1.6 2003/11/01 02:30:14 guy Exp $
+ * $Id: pcap-util.h,v 1.7 2004/06/12 07:47:13 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
void free_interface_list(GList *if_list);
+/*
+ * Get an error message string for a CANT_GET_INTERFACE_LIST error from
+ * "get_interface_list()".
+ */
+gchar *cant_get_if_list_error_message(const char *err_str);
+
/*
* The list of data link types returned by "get_pcap_linktype_list()" is
* a list of these structures.
/* tethereal.c
*
- * $Id: tethereal.c,v 1.243 2004/06/10 08:01:51 guy Exp $
+ * $Id: tethereal.c,v 1.244 2004/06/12 07:47:13 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
long adapter_index;
char *p;
gchar err_str[PCAP_ERRBUF_SIZE];
+ gchar *cant_get_if_list_errstr;
#else
gboolean capture_option_specified = FALSE;
#endif
switch (err) {
case CANT_GET_INTERFACE_LIST:
- fprintf(stderr, "tethereal: Can't get list of interfaces: %s\n",
- err_str);
+ cant_get_if_list_errstr =
+ cant_get_if_list_error_message(err_str);
+ fprintf(stderr, "tethereal: %s\n", cant_get_if_list_errstr);
+ g_free(cant_get_if_list_errstr);
break;
case NO_INTERFACES_FOUND:
switch (err) {
case CANT_GET_INTERFACE_LIST:
- fprintf(stderr, "tethereal: Can't get list of interfaces: %s\n",
- err_str);
+ cant_get_if_list_errstr =
+ cant_get_if_list_error_message(err_str);
+ fprintf(stderr, "tethereal: %s\n", cant_get_if_list_errstr);
+ g_free(cant_get_if_list_errstr);
break;
case NO_INTERFACES_FOUND:
switch (err) {
case CANT_GET_INTERFACE_LIST:
- fprintf(stderr, "tethereal: Can't get list of interfaces: %s\n",
- err_str);
+ cant_get_if_list_errstr =
+ cant_get_if_list_error_message(err_str);
+ fprintf(stderr, "tethereal: %s\n", cant_get_if_list_errstr);
+ g_free(cant_get_if_list_errstr);
break;
case NO_INTERFACES_FOUND: