diff options
author | Sam Leffler <sam@FreeBSD.org> | 2002-11-14 23:24:13 +0000 |
---|---|---|
committer | Sam Leffler <sam@FreeBSD.org> | 2002-11-14 23:24:13 +0000 |
commit | 24a229f4668ed54c5a84b136cddfcf08e5fef9fe (patch) | |
tree | 7d2fb45eb235de0f7e542dc0f28df6a6d3201f69 /sys/net/bpf.h | |
parent | e1796d40b90dc50b8eaf1b8aedd8a66844ee1f89 (diff) | |
download | src-24a229f4668ed54c5a84b136cddfcf08e5fef9fe.tar.gz src-24a229f4668ed54c5a84b136cddfcf08e5fef9fe.zip |
o add support for multiple link types per interface (e.g. 802.11 and Ethernet)
o introduce BPF_TAP and BPF_MTAP macros to hide implementation details and
ease code portability
o use m_getcl where appropriate
Reviewed by: many
Approved by: re
Obtained from: NetBSD (multiple link type support)
Notes
Notes:
svn path=/head/; revision=106927
Diffstat (limited to 'sys/net/bpf.h')
-rw-r--r-- | sys/net/bpf.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/net/bpf.h b/sys/net/bpf.h index 31d8fc27bccb..5e931ce6a25c 100644 --- a/sys/net/bpf.h +++ b/sys/net/bpf.h @@ -340,14 +340,25 @@ struct bpf_insn { #define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k } #ifdef _KERNEL +struct bpf_if; int bpf_validate(const struct bpf_insn *, int); -void bpf_tap(struct ifnet *, u_char *, u_int); -void bpf_mtap(struct ifnet *, struct mbuf *); +void bpf_tap(struct bpf_if *, u_char *, u_int); +void bpf_mtap(struct bpf_if *, struct mbuf *); void bpfattach(struct ifnet *, u_int, u_int); +void bpfattach2(struct ifnet *, u_int, u_int, struct bpf_if **); void bpfdetach(struct ifnet *); void bpfilterattach(int); u_int bpf_filter(const struct bpf_insn *, u_char *, u_int, u_int); + +#define BPF_TAP(_ifp,_pkt,_pktlen) do { \ + if ((_ifp)->if_bpf) \ + bpf_tap((_ifp)->if_bpf, (_pkt), (_pktlen)); \ +} while (0) +#define BPF_MTAP(_ifp,_m) do { \ + if ((_ifp)->if_bpf) \ + bpf_mtap((_ifp)->if_bpf, (_m)); \ +} while (0) #endif /* @@ -355,4 +366,4 @@ u_int bpf_filter(const struct bpf_insn *, u_char *, u_int, u_int); */ #define BPF_MEMWORDS 16 -#endif +#endif /* _NET_BPF_H_ */ |