summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2014-07-09 11:03:05 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2014-07-09 11:03:05 +0000
commit0983a6f99c7a5491ed754153a0af32ad11100b68 (patch)
tree06f2bacd833b22e084513b15db79649b915b96e1 /sys/net
parent42c4f45bad9861fff06c921b7e9f014874c6ea92 (diff)
tedu bpf_mtap_pflog().
now that it is a trivial wrapper around the extended bpf_mtap_hdr, we can use bpf_mtap_hdr directly. added benefit: pflog_bpfcopy doesn't need to be exported any more and can stay private to if_pflog.c ok benno bluhm reyk
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/bpf.c15
-rw-r--r--sys/net/bpf.h3
-rw-r--r--sys/net/if_pflog.c6
-rw-r--r--sys/net/if_pflog.h4
4 files changed, 7 insertions, 21 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 4db2310febb..7bec98f182c 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.94 2014/07/09 09:30:49 henning Exp $ */
+/* $OpenBSD: bpf.c,v 1.95 2014/07/09 11:03:04 henning Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/*
@@ -1297,19 +1297,6 @@ bpf_mtap_ether(caddr_t arg, struct mbuf *m, u_int direction)
#endif
}
-void
-bpf_mtap_pflog(caddr_t arg, caddr_t data, struct mbuf *m)
-{
-#if NPFLOG > 0
- if (m == NULL)
- return;
-
- bpf_mtap_hdr(arg, data, PFLOG_HDRLEN, m, BPF_DIRECTION_OUT,
- pflog_bpfcopy);
-#endif
-}
-
-
/*
* Move the packet data from interface memory (pkt) into the
* store buffer. Return 1 if it's time to wakeup a listener (buffer full),
diff --git a/sys/net/bpf.h b/sys/net/bpf.h
index 7b061ec10b6..f318ba4339b 100644
--- a/sys/net/bpf.h
+++ b/sys/net/bpf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.h,v 1.44 2014/07/09 09:30:49 henning Exp $ */
+/* $OpenBSD: bpf.h,v 1.45 2014/07/09 11:03:04 henning Exp $ */
/* $NetBSD: bpf.h,v 1.15 1996/12/13 07:57:33 mikel Exp $ */
/*
@@ -276,7 +276,6 @@ void bpf_mtap_hdr(caddr_t, caddr_t, u_int, struct mbuf *, u_int,
void (*)(const void *, void *, size_t));
void bpf_mtap_af(caddr_t, u_int32_t, struct mbuf *, u_int);
void bpf_mtap_ether(caddr_t, struct mbuf *, u_int);
-void bpf_mtap_pflog(caddr_t, caddr_t, struct mbuf *);
void bpfattach(caddr_t *, struct ifnet *, u_int, u_int);
void bpfdetach(struct ifnet *);
void bpfilterattach(int);
diff --git a/sys/net/if_pflog.c b/sys/net/if_pflog.c
index f0d18ef9ff7..104f27ebfa7 100644
--- a/sys/net/if_pflog.c
+++ b/sys/net/if_pflog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pflog.c,v 1.59 2014/06/25 16:21:20 mikeb Exp $ */
+/* $OpenBSD: if_pflog.c,v 1.60 2014/07/09 11:03:04 henning Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -85,6 +85,7 @@ int pflogioctl(struct ifnet *, u_long, caddr_t);
void pflogstart(struct ifnet *);
int pflog_clone_create(struct if_clone *, int);
int pflog_clone_destroy(struct ifnet *);
+void pflog_bpfcopy(const void *, void *, size_t);
LIST_HEAD(, pflog_softc) pflogif_list;
struct if_clone pflog_cloner =
@@ -298,7 +299,8 @@ pflog_packet(struct pf_pdesc *pd, u_int8_t reason, struct pf_rule *rm,
ifn->if_opackets++;
ifn->if_obytes += pd->m->m_pkthdr.len;
- bpf_mtap_pflog(ifn->if_bpf, (caddr_t)&hdr, pd->m);
+ bpf_mtap_hdr(ifn->if_bpf, (caddr_t)&hdr, PFLOG_HDRLEN, pd->m,
+ BPF_DIRECTION_OUT, pflog_bpfcopy);
#endif
return (0);
diff --git a/sys/net/if_pflog.h b/sys/net/if_pflog.h
index ffd3f58bcfd..0a1bd38b534 100644
--- a/sys/net/if_pflog.h
+++ b/sys/net/if_pflog.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pflog.h,v 1.24 2013/06/25 09:16:34 mpi Exp $ */
+/* $OpenBSD: if_pflog.h,v 1.25 2014/07/09 11:03:04 henning Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -67,8 +67,6 @@ struct pflog_softc {
LIST_ENTRY(pflog_softc) sc_list;
};
-void pflog_bpfcopy(const void *, void *, size_t);
-
#if NPFLOG > 0
#define PFLOG_PACKET(a,b,c,d,e) pflog_packet(a,b,c,d,e)
#else