diff options
author | Guy Harris <guy@alum.mit.edu> | 2006-05-20 22:01:08 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2006-05-20 22:01:08 +0000 |
commit | 37a570600e7188e9a0d3ef5bbdf66dec431689be (patch) | |
tree | 130195e06483cf3d322eda717d9b4536fd451e2a /capture_loop.h | |
parent | 629f0ecbe58ca0c083717496e679ba84fa7d6442 (diff) |
Dumpcap doesn't need to ensure that it doesn't block indefinitely, as it
has no UI, nor does it need to ensure it processes only one packet at a
time; get rid of the select stuff, and pass a count of -1 to
pcap_dispatch() so it processes a single bufferfull of packets rather
than just one packet at a time.
svn path=/trunk/; revision=18194
Diffstat (limited to 'capture_loop.h')
-rw-r--r-- | capture_loop.h | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/capture_loop.h b/capture_loop.h index c0a91e2e24..4d2778793b 100644 --- a/capture_loop.h +++ b/capture_loop.h @@ -51,29 +51,6 @@ extern void capture_loop_stop(void); /*** the following is internal only (should be moved to capture_loop_int.h) ***/ -/* - * We don't want to do a "select()" on the pcap_t's file descriptor on - * BSD (because "select()" doesn't work correctly on BPF devices on at - * least some releases of some flavors of BSD), and we don't want to do - * it on Windows (because "select()" is something for sockets, not for - * arbitrary handles). (Note that "Windows" here includes Cygwin; - * even in its pretend-it's-UNIX environment, we're using WinPcap, not - * a UNIX libpcap.) - * - * We *do* want to do it on other platforms, as, on other platforms (with - * the possible exception of Ultrix and Digital UNIX), the read timeout - * doesn't expire if no packets have arrived, so a "pcap_dispatch()" call - * will block until packets arrive, causing the UI to hang. - * - * XXX - the various BSDs appear to define BSD in <sys/param.h>; we don't - * want to include it if it's not present on this platform, however. - */ -#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && \ - !defined(__bsdi__) && !defined(__APPLE__) && !defined(_WIN32) && \ - !defined(__CYGWIN__) -# define MUST_DO_SELECT -#endif - typedef void (*capture_packet_cb_fct)(u_char *, const struct pcap_pkthdr *, const u_char *); @@ -95,9 +72,6 @@ typedef struct _loop_data { /* pcap "input file" */ pcap_t *pcap_h; /* pcap handle */ gboolean pcap_err; /* E: TRUE if error from pcap */ -#ifdef MUST_DO_SELECT - int pcap_fd; /* pcap file descriptor */ -#endif /* capture pipe (unix only "input file") */ gboolean from_cap_pipe; /* TRUE if we are capturing data from a capture pipe */ |