aboutsummaryrefslogtreecommitdiff
path: root/pcap-snit.c
diff options
context:
space:
mode:
authorguy <guy>2003-07-25 05:32:02 +0000
committerguy <guy>2003-07-25 05:32:02 +0000
commitcd0d893ef99fbd6e06311242d8631b8a5cf9502e (patch)
treeae17f58218c26d028d2390c1229b006bb270d415 /pcap-snit.c
parent08658f1c932c872f1d920e72e62d200471bd80d0 (diff)
downloadlibpcap-cd0d893ef99fbd6e06311242d8631b8a5cf9502e.tar.gz
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.
Diffstat (limited to 'pcap-snit.c')
-rw-r--r--pcap-snit.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pcap-snit.c b/pcap-snit.c
index fa0dc8c8..1b7bae51 100644
--- a/pcap-snit.c
+++ b/pcap-snit.c
@@ -25,7 +25,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-snit.c,v 1.64 2003-07-25 05:07:03 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-snit.c,v 1.65 2003-07-25 05:32:05 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -109,8 +109,8 @@ pcap_stats_snit(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_snit(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
{
register int cc, n;
register struct bpf_insn *fcode = p->fcode.bf_insns;
@@ -318,6 +318,7 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms,
goto bad;
}
+ p->read_op = pcap_read_snit;
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_snit;