diff options
author | sam <sam@FreeBSD.org> | 2002-11-14 23:24:13 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2002-11-14 23:24:13 +0000 |
commit | 0d8343cbfe5785460a546de1e7776dffb5f146f4 (patch) | |
tree | 7d2fb45eb235de0f7e542dc0f28df6a6d3201f69 /sys/net/bpf.h | |
parent | 57696113da17cbfc851dc94e4456bcd4f1baedc0 (diff) | |
download | FreeBSD-src-0d8343cbfe5785460a546de1e7776dffb5f146f4.zip FreeBSD-src-0d8343cbfe5785460a546de1e7776dffb5f146f4.tar.gz |
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)
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 31d8fc2..5e931ce 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_ */ |