Removal of bpf_tap().

This commit is contained in:
msaitoh 2018-06-25 03:22:14 +00:00
parent bc382992a0
commit c6a4b11da8
4 changed files with 7 additions and 31 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: bpf.9,v 1.3 2010/12/02 12:54:13 wiz Exp $
.\" $NetBSD: bpf.9,v 1.4 2018/06/25 03:22:14 msaitoh Exp $
.\"
.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -24,7 +24,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd June 8, 2010
.Dd June 25, 2018
.Dt BPF 9
.Os
.Sh NAME
@ -43,7 +43,6 @@ struct bpf_ops {
void (*bpf_detach)(struct ifnet *);
void (*bpf_change_type)(struct ifnet *, u_int, u_int);
void (*bpf_tap)(struct bpf_if *, u_char *, u_int);
void (*bpf_mtap)(struct bpf_if *, struct mbuf *);
void (*bpf_mtap2)(struct bpf_if *, void *, u_int, struct mbuf *);
void (*bpf_mtap_af)(struct bpf_if *, uint32_t, struct mbuf *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: bpf.c,v 1.224 2018/05/14 02:55:03 ozaki-r Exp $ */
/* $NetBSD: bpf.c,v 1.225 2018/06/25 03:22:14 msaitoh Exp $ */
/*
* Copyright (c) 1990, 1991, 1993
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.224 2018/05/14 02:55:03 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.225 2018/06/25 03:22:14 msaitoh Exp $");
#if defined(_KERNEL_OPT)
#include "opt_bpf.h"
@ -1607,19 +1607,6 @@ bpf_deliver(struct bpf_if *bp, void *(*cpfn)(void *, const void *, size_t),
pserialize_read_exit(s);
}
/*
* Incoming linkage from device drivers. Process the packet pkt, of length
* pktlen, which is stored in a contiguous buffer. The packet is parsed
* by each process' filter, and if accepted, stashed into the corresponding
* buffer.
*/
static void
_bpf_tap(struct bpf_if *bp, u_char *pkt, u_int pktlen)
{
bpf_deliver(bp, memcpy, pkt, pktlen, pktlen, true);
}
/*
* Incoming linkage from device drivers, when the head of the packet is in
* a buffer, and the tail is in an mbuf chain.
@ -2453,7 +2440,6 @@ struct bpf_ops bpf_ops_kernel = {
.bpf_detach = _bpfdetach,
.bpf_change_type = _bpf_change_type,
.bpf_tap = _bpf_tap,
.bpf_mtap = _bpf_mtap,
.bpf_mtap2 = _bpf_mtap2,
.bpf_mtap_af = _bpf_mtap_af,

View File

@ -1,4 +1,4 @@
/* $NetBSD: bpf.h,v 1.70 2018/04/19 21:20:43 christos Exp $ */
/* $NetBSD: bpf.h,v 1.71 2018/06/25 03:22:14 msaitoh Exp $ */
/*
* Copyright (c) 1990, 1991, 1993
@ -417,7 +417,6 @@ struct bpf_ops {
void (*bpf_detach)(struct ifnet *);
void (*bpf_change_type)(struct ifnet *, u_int, u_int);
void (*bpf_tap)(struct bpf_if *, u_char *, u_int);
void (*bpf_mtap)(struct bpf_if *, struct mbuf *);
void (*bpf_mtap2)(struct bpf_if *, void *, u_int, struct mbuf *);
void (*bpf_mtap_af)(struct bpf_if *, uint32_t, struct mbuf *);
@ -442,13 +441,6 @@ bpf_attach2(struct ifnet *_ifp, u_int _dlt, u_int _hdrlen, struct bpf_if **_dp)
bpf_ops->bpf_attach(_ifp, _dlt, _hdrlen, _dp);
}
static __inline void
bpf_tap(struct ifnet *_ifp, u_char *_pkt, u_int _len)
{
if (_ifp->if_bpf)
bpf_ops->bpf_tap(_ifp->if_bpf, _pkt, _len);
}
static __inline void
bpf_mtap(struct ifnet *_ifp, struct mbuf *_m)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: bpf_stub.c,v 1.7 2017/01/25 01:04:23 ozaki-r Exp $ */
/* $NetBSD: bpf_stub.c,v 1.8 2018/06/25 03:22:14 msaitoh Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bpf_stub.c,v 1.7 2017/01/25 01:04:23 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: bpf_stub.c,v 1.8 2018/06/25 03:22:14 msaitoh Exp $");
#include <sys/param.h>
#include <sys/kmem.h>
@ -61,7 +61,6 @@ struct bpf_ops bpf_ops_stub = {
.bpf_detach = bpf_stub_detach,
.bpf_change_type = (void *)bpf_stub_null,
.bpf_tap = (void *)bpf_stub_warn,
.bpf_mtap = (void *)bpf_stub_warn,
.bpf_mtap2 = (void *)bpf_stub_warn,
.bpf_mtap_af = (void *)bpf_stub_warn,