aboutsummaryrefslogtreecommitdiff
path: root/pcap-nit.c
diff options
context:
space:
mode:
authorguy <guy>2003-07-25 04:42:02 +0000
committerguy <guy>2003-07-25 04:42:02 +0000
commitcd2807e08d02de68b766ed88acf3bfd3b54b2a24 (patch)
tree32510d11551eab43465b88894a38d7b627eb1413 /pcap-nit.c
parent9792990eb80889004b39ee70caa98b3d91ac8012 (diff)
downloadlibpcap-cd2807e08d02de68b766ed88acf3bfd3b54b2a24.tar.gz
Add a "setfilter" function pointer to the pcap_t structure, which
handles setting a filter for a pcap_t. Have "pcap_setfilter()" call it, rather than being a per-platform function. The per-platform functions don't need to check for an offline capture any more, as they're not called for an offline capture (and the ones that just call "install_bpf_program()" don't need to exist at all).
Diffstat (limited to 'pcap-nit.c')
-rw-r--r--pcap-nit.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/pcap-nit.c b/pcap-nit.c
index 2be8e79a..883fc9f3 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.46 2003-07-25 04:04:58 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-nit.c,v 1.47 2003-07-25 04:42:03 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -260,6 +260,7 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms,
goto bad;
}
+ p->setfilter_op = install_bpf_program; /* no kernel filtering */
p->stats_op = pcap_stats_nit;
p->close_op = pcap_close_nit;
@@ -278,15 +279,6 @@ pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf)
}
int
-pcap_setfilter(pcap_t *p, struct bpf_program *fp)
-{
-
- if (install_bpf_program(p, fp) < 0)
- return (-1);
- return (0);
-}
-
-int
pcap_set_datalink_platform(pcap_t *p, int dlt)
{
return (0);