bpf.h (123033) | bpf.h (123922) |
---|---|
1/* 2 * Copyright (c) 1990, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from the Stanford/CMU enet packet filter, 6 * (net/enet.c) distributed as part of 4.3BSD, and code contributed 7 * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence 8 * Berkeley Laboratory. --- 24 unchanged lines hidden (view full) --- 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)bpf.h 8.1 (Berkeley) 6/10/93 39 * @(#)bpf.h 1.34 (LBL) 6/16/96 40 * | 1/* 2 * Copyright (c) 1990, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from the Stanford/CMU enet packet filter, 6 * (net/enet.c) distributed as part of 4.3BSD, and code contributed 7 * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence 8 * Berkeley Laboratory. --- 24 unchanged lines hidden (view full) --- 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)bpf.h 8.1 (Berkeley) 6/10/93 39 * @(#)bpf.h 1.34 (LBL) 6/16/96 40 * |
41 * $FreeBSD: head/sys/net/bpf.h 123033 2003-11-28 18:48:59Z silby $ | 41 * $FreeBSD: head/sys/net/bpf.h 123922 2003-12-28 03:56:00Z sam $ |
42 */ 43 44#ifndef _NET_BPF_H_ 45#define _NET_BPF_H_ 46 47/* BSD style release date */ 48#define BPF_RELEASE 199606 49 --- 299 unchanged lines hidden (view full) --- 349 u_int *bfl_list; /* array of DLTs */ 350}; 351 352#ifdef _KERNEL 353struct bpf_if; 354int bpf_validate(const struct bpf_insn *, int); 355void bpf_tap(struct bpf_if *, u_char *, u_int); 356void bpf_mtap(struct bpf_if *, struct mbuf *); | 42 */ 43 44#ifndef _NET_BPF_H_ 45#define _NET_BPF_H_ 46 47/* BSD style release date */ 48#define BPF_RELEASE 199606 49 --- 299 unchanged lines hidden (view full) --- 349 u_int *bfl_list; /* array of DLTs */ 350}; 351 352#ifdef _KERNEL 353struct bpf_if; 354int bpf_validate(const struct bpf_insn *, int); 355void bpf_tap(struct bpf_if *, u_char *, u_int); 356void bpf_mtap(struct bpf_if *, struct mbuf *); |
357void bpf_mtap2(struct bpf_if *, void *, u_int, struct mbuf *); |
|
357void bpfattach(struct ifnet *, u_int, u_int); 358void bpfattach2(struct ifnet *, u_int, u_int, struct bpf_if **); 359void bpfdetach(struct ifnet *); 360 361void bpfilterattach(int); 362u_int bpf_filter(const struct bpf_insn *, u_char *, u_int, u_int); 363 364#define BPF_TAP(_ifp,_pkt,_pktlen) do { \ 365 if ((_ifp)->if_bpf) \ 366 bpf_tap((_ifp)->if_bpf, (_pkt), (_pktlen)); \ 367} while (0) 368#define BPF_MTAP(_ifp,_m) do { \ | 358void bpfattach(struct ifnet *, u_int, u_int); 359void bpfattach2(struct ifnet *, u_int, u_int, struct bpf_if **); 360void bpfdetach(struct ifnet *); 361 362void bpfilterattach(int); 363u_int bpf_filter(const struct bpf_insn *, u_char *, u_int, u_int); 364 365#define BPF_TAP(_ifp,_pkt,_pktlen) do { \ 366 if ((_ifp)->if_bpf) \ 367 bpf_tap((_ifp)->if_bpf, (_pkt), (_pktlen)); \ 368} while (0) 369#define BPF_MTAP(_ifp,_m) do { \ |
369 if ((_ifp)->if_bpf) \ | 370 if ((_ifp)->if_bpf) { \ 371 M_ASSERTVALID(_m); \ |
370 bpf_mtap((_ifp)->if_bpf, (_m)); \ | 372 bpf_mtap((_ifp)->if_bpf, (_m)); \ |
373 } \ |
|
371} while (0) | 374} while (0) |
375#define BPF_MTAP2(_ifp,_data,_dlen,_m) do { \ 376 if ((_ifp)->if_bpf) { \ 377 M_ASSERTVALID(_m); \ 378 bpf_mtap2((_ifp)->if_bpf,(_data),(_dlen),(_m)); \ 379 } \ 380} while (0) |
|
372#endif 373 374/* 375 * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). 376 */ 377#define BPF_MEMWORDS 16 378 379#endif /* _NET_BPF_H_ */ | 381#endif 382 383/* 384 * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). 385 */ 386#define BPF_MEMWORDS 16 387 388#endif /* _NET_BPF_H_ */ |