aboutsummaryrefslogtreecommitdiff
path: root/pcap-nit.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-nit.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-nit.c')
-rw-r--r--pcap-nit.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pcap-nit.c b/pcap-nit.c
index 3f646104..6aebc90f 100644
--- a/pcap-nit.c
+++ b/pcap-nit.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-nit.c,v 1.52 2003-11-20 02:02:40 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-nit.c,v 1.53 2003-11-21 10:19:35 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -280,6 +280,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_nit;
p->setfilter_op = install_bpf_program; /* no kernel filtering */
p->set_datalink_op = NULL; /* can't change data link type */