aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/capture_if_details_dlg_win32.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2009-06-09 20:08:47 +0000
committerGerald Combs <gerald@wireshark.org>2009-06-09 20:08:47 +0000
commitcaa884723ce3d8152959cbab782305b8c6717cc4 (patch)
treeb69ece707167d48e33bcc4ef3642622b87791397 /gtk/capture_if_details_dlg_win32.c
parent0db429e50c2239eff4ac4fc3dc2f7d620f223906 (diff)
For interfaces that don't support PacketOpenAdapter (such as TurboCap),
disable the "Details" button in the interface list. Update an error dialog to try to be more helpful. svn path=/trunk/; revision=28675
Diffstat (limited to 'gtk/capture_if_details_dlg_win32.c')
-rw-r--r--gtk/capture_if_details_dlg_win32.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/gtk/capture_if_details_dlg_win32.c b/gtk/capture_if_details_dlg_win32.c
index 48f55e039b..64f7e91a31 100644
--- a/gtk/capture_if_details_dlg_win32.c
+++ b/gtk/capture_if_details_dlg_win32.c
@@ -2330,9 +2330,15 @@ capture_if_details_open_win(char *iface)
/* open the network adapter */
adapter = wpcap_packet_open(iface);
if(adapter == NULL) {
+ /*
+ * We have an adapter that is not exposed through normal APIs (e.g. TurboCap)
+ * or an adapter that isn't plugged in.
+ *
+ * XXX - We should use the TurboCap API to get info about TurboCap adapters.
+ */
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
- "%sCould not open adapter: %s!%s"
- "\n\nThe adapter might be removed from the system in the meantime!",
+ "%sCould not open adapter %s!%s"
+ "\n\nHas it been unplugged?",
simple_dialog_primary_start(), iface, simple_dialog_primary_end());
return;
}
@@ -2496,5 +2502,21 @@ capture_if_details_open(char *iface)
}
}
+gboolean
+capture_if_has_details(char *iface) {
+ LPADAPTER adapter;
+
+ if (!iface) {
+ return FALSE;
+ }
+
+ adapter = wpcap_packet_open(iface);
+ if (adapter) {
+ wpcap_packet_close(adapter);
+ return TRUE;
+ }
+
+ return FALSE;
+}
#endif /* HAVE_LIBPCAP && _WIN32 */