From cd0d893ef99fbd6e06311242d8631b8a5cf9502e Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 25 Jul 2003 05:32:02 +0000 Subject: Add a "read" function pointer to the pcap_t structure, which handles reading packets from a pcap_t, and make "pcap_read()" call it. That removes the last place where we have to check for a pcap_t that refers to a DAG card rather than a live capture, so get rid of the "is_dag" flag. --- pcap-nit.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pcap-nit.c') diff --git a/pcap-nit.c b/pcap-nit.c index c0cd9ee..44db9af 100644 --- a/pcap-nit.c +++ b/pcap-nit.c @@ -20,7 +20,7 @@ */ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/libpcap/pcap-nit.c,v 1.48 2003-07-25 05:07:02 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/pcap-nit.c,v 1.49 2003-07-25 05:32:04 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -95,8 +95,8 @@ pcap_stats_nit(pcap_t *p, struct pcap_stat *ps) return (0); } -int -pcap_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user) +static int +pcap_read_nit(pcap_t *p, int cnt, pcap_handler callback, u_char *user) { register int cc, n; register struct bpf_insn *fcode = p->fcode.bf_insns; @@ -260,6 +260,7 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms, goto bad; } + 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 */ p->stats_op = pcap_stats_nit; -- cgit v1.2.3