From aa1e053ce638e4f2c91184a43703f4c99998b5bb Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 21 May 2006 21:32:04 +0000 Subject: If we have pcap_breakloop(), at least on UN*X we can stop the capture with a pcap_breakloop() call - we don't need to call select() before calling pcap_dispatch(). Even if we do need to call select(), we don't need to supply it with a timeout - it's OK if we block indefinitely, as the signal will interrupt select(). That also means we can pass -1 as the count to pcap_dispatch(), as pcap_breakloop() will terminate the loop in pcap_dispatch(). Use sigaction() to catch SIGUSR1, so we can make sure that the signal handler doesn't get reset when the signal is delivered, and that system calls don't restart when we return from the signal handler. svn path=/trunk/; revision=18201 --- config.nmake | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'config.nmake') diff --git a/config.nmake b/config.nmake index b02347ec71..c78fd8b933 100644 --- a/config.nmake +++ b/config.nmake @@ -354,10 +354,16 @@ WINPCAP_CONFIG=^#define HAVE_LIBPCAP 1 PCAP_FINDALLDEVS_CONFIG=^#define HAVE_PCAP_FINDALLDEVS 1 PCAP_DATALINK_NAME_TO_VAL_CONFIG=^#define HAVE_PCAP_DATALINK_NAME_TO_VAL 1 PCAP_DATALINK_VAL_TO_NAME_CONFIG=^#define HAVE_PCAP_DATALINK_VAL_TO_NAME 1 +!IF "$(WINPCAP_VERSION)" == "3.1" +PCAP_BREAKLOOP_CONFIG=^#define HAVE_PCAP_BREAKLOOP 1 +!ELSE +PCAP_BREAKLOOP_CONFIG= +!ENDIF WPCAP_CONSTIFIED_CONFIG=^#define WPCAP_CONSTIFIED 1 !ELSE PCAP_FINDALLDEVS_CONFIG= PCAP_DATALINK_VAL_TO_NAME_CONFIG= +PCAP_BREAKLOOP_CONFIG= WPCAP_CONSTIFIED= !ENDIF !ELSE @@ -365,6 +371,7 @@ WINPCAP_CONFIG= PCAP_FINDALLDEVS_CONFIG= PCAP_DATALINK_NAME_TO_VAL_CONFIG= PCAP_DATALINK_VAL_TO_NAME_CONFIG= +PCAP_BREAKLOOP_CONFIG= WPCAP_CONSTIFIED= !ENDIF -- cgit v1.2.3