diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2001-04-03 05:26:27 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2001-04-03 05:26:27 +0000 |
commit | a817e9701520b38846b55b4c6d00981ad52f0ced (patch) | |
tree | 9f1663af21fb1628cf87f316dd3f5f91b8a7ddc1 /gtk | |
parent | e453b3e5de37e423aa9086c5a1c2014573d64d75 (diff) | |
download | wireshark-a817e9701520b38846b55b4c6d00981ad52f0ced.tar.gz wireshark-a817e9701520b38846b55b4c6d00981ad52f0ced.tar.bz2 wireshark-a817e9701520b38846b55b4c6d00981ad52f0ced.zip |
Now that WinPcap is a DLL, I can load it at run-time rather than load-time.
That means that I no longer need to distribute capture and non-capture
versions of Ethereal for Win32; one version (compiled with WinPcap headers)
can run on systems with or without WinPcap.
For systems that don't have WinPcap, instead of disabling the Capture
menu, Capture|Start brings up a dialogue informing the user that wpcap.dll
was not loadable, and gives a URL to the WinPcap home page.
svn path=/trunk/; revision=3249
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/capture_dlg.c | 18 | ||||
-rw-r--r-- | gtk/main.c | 10 |
2 files changed, 26 insertions, 2 deletions
diff --git a/gtk/capture_dlg.c b/gtk/capture_dlg.c index 1ae2796beb..7d0a7a6ccc 100644 --- a/gtk/capture_dlg.c +++ b/gtk/capture_dlg.c @@ -1,7 +1,7 @@ /* capture_dlg.c * Routines for packet capture windows * - * $Id: capture_dlg.c,v 1.37 2001/01/28 23:56:29 guy Exp $ + * $Id: capture_dlg.c,v 1.38 2001/04/03 05:26:27 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -58,6 +58,10 @@ #include "dlg_utils.h" #include "util.h" +#ifdef _WIN32 +#include "capture-wpcap.h" +#endif + /* Capture callback data keys */ #define E_CAP_IFACE_KEY "cap_iface" #define E_CAP_FILT_KEY "cap_filter_te" @@ -130,6 +134,18 @@ capture_prep_cb(GtkWidget *w, gpointer d) return; } +#ifdef _WIN32 + /* Is WPcap loaded? */ + if (!has_wpcap) { + simple_dialog(ESD_TYPE_CRIT, NULL, + "Unable to load wpcap.dll: capturing not enabled.\n" + "See http://netgroup-serv.polito.it/winpcap/ for\n" + "more details."); + return; + } +#endif + + if_list = get_interface_list(&err, err_str); if (if_list == NULL && err == CANT_GET_INTERFACE_LIST) { simple_dialog(ESD_TYPE_WARN, NULL, "Can't get list of interfaces: %s", diff --git a/gtk/main.c b/gtk/main.c index 936555dac4..fa6445fa57 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.187 2001/04/02 09:53:46 guy Exp $ + * $Id: main.c,v 1.188 2001/04/03 05:26:27 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -137,6 +137,11 @@ #include "strutil.h" #include "register.h" +#ifdef WIN32 +#include "capture-wpcap.h" +#endif + + packet_info pi; capture_file cfile; GtkWidget *top_level, *packet_list, *tree_view, *byte_nb_ptr, @@ -1113,6 +1118,9 @@ main(int argc, char *argv[]) } #ifdef WIN32 + /* Load wpcap if possible */ + load_wpcap(); + /* Start windows sockets */ WSAStartup( MAKEWORD( 1, 1 ), &wsaData ); #endif |