aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-snoop.c
diff options
context:
space:
mode:
authorguy <guy>2003-11-21 10:19:33 +0000
committerguy <guy>2003-11-21 10:19:33 +0000
commitc98ffbcabf992f4925d904e9d4e7960be069ef15 (patch)
tree6ad557801720978af1ec3a0c6cb003799fde3e51 /pcap-snoop.c
parent2c618b93a0ed7ede8a1cf90e425b343c25265dc3 (diff)
Add a "pcap_get_selectable_fd()" API to get an FD on which you can do a
"select()" or "poll()" - or -1 if that won't work.
Diffstat (limited to 'pcap-snoop.c')
-rw-r--r--pcap-snoop.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pcap-snoop.c b/pcap-snoop.c
index 0feaf7e..d216ba9 100644
--- a/pcap-snoop.c
+++ b/pcap-snoop.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-snoop.c,v 1.48 2003-11-20 02:02:40 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-snoop.c,v 1.49 2003-11-21 10:19:35 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -323,6 +323,11 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms,
goto bad;
}
+ /*
+ * "handle->fd" is a socket, so "select()" should work on it.
+ */
+ p->selectable_fd = p->fd;
+
p->read_op = pcap_read_snoop;
p->setfilter_op = install_bpf_program; /* no kernel filtering */
p->set_datalink_op = NULL; /* can't change data link type */