diff --git a/capture/capture-pcap-util.c b/capture/capture-pcap-util.c index d756a09a83..19bb805153 100644 --- a/capture/capture-pcap-util.c +++ b/capture/capture-pcap-util.c @@ -68,6 +68,9 @@ #include "capture/capture_ifinfo.h" #include "capture/capture-pcap-util.h" #include "capture/capture-pcap-util-int.h" +#ifdef _WIN32 +#include "capture/capture-wpcap.h" +#endif #include #include @@ -623,7 +626,7 @@ get_interface_list_findalldevs_ex(const char *hostname, const char *port, auth.username = g_strdup(username); auth.password = g_strdup(passwd); - if (pcap_findalldevs_ex(source, &auth, &alldevs, errbuf) == -1) { + if (ws_pcap_findalldevs_ex(source, &auth, &alldevs, errbuf) == -1) { *err = CANT_GET_INTERFACE_LIST; if (err_str != NULL) *err_str = cant_get_if_list_error_message(errbuf); diff --git a/capture/capture-wpcap.c b/capture/capture-wpcap.c index 058dccba10..18312e417b 100644 --- a/capture/capture-wpcap.c +++ b/capture/capture-wpcap.c @@ -420,7 +420,7 @@ pcap_open(const char *a, int b, int c, int d, struct pcap_rmtauth *e, char *errb } int -pcap_findalldevs_ex(const char *a, struct pcap_rmtauth *b, pcap_if_t **c, char *errbuf) +ws_pcap_findalldevs_ex(const char *a, struct pcap_rmtauth *b, pcap_if_t **c, char *errbuf) { int ret; ws_assert(has_wpcap); diff --git a/capture/capture-wpcap.h b/capture/capture-wpcap.h index a6affdab25..99095c120b 100644 --- a/capture/capture-wpcap.h +++ b/capture/capture-wpcap.h @@ -14,6 +14,13 @@ extern "C" { #endif /* __cplusplus */ +#ifdef HAVE_LIBPCAP +#ifdef __MINGW32__ +#include <_bsd_types.h> +#endif +#include +#endif + extern gboolean has_wpcap; extern void load_wpcap(void); @@ -25,6 +32,9 @@ extern void load_wpcap(void); */ gboolean npf_sys_is_running(void); +int +ws_pcap_findalldevs_ex(const char *a, struct pcap_rmtauth *b, pcap_if_t **c, char *errbuf); + #ifdef __cplusplus } #endif /* __cplusplus */