1/* $FreeBSD: stable/11/contrib/ipfilter/bpf-ipf.h 369186 2021-01-31 04:32:46Z cy $ */ |
2 3/*- 4 * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from the Stanford/CMU enet packet filter, 8 * (net/enet.c) distributed as part of 4.3BSD, and code contributed 9 * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence --- 405 unchanged lines hidden (view full) --- 415#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k } 416#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k } 417 418#if defined(BSD) && (defined(KERNEL) || defined(_KERNEL)) 419/* 420 * Systems based on non-BSD kernels don't have ifnet's (or they don't mean 421 * anything if it is in <net/if.h>) and won't work like this. 422 */ |
423extern void bpf_tap(struct ifnet *, u_char *, u_int); 424extern void bpf_mtap(struct ifnet *, struct mbuf *); 425extern void bpfattach(struct ifnet *, u_int, u_int); 426extern void bpfilterattach(int); |
427#endif /* BSD && (_KERNEL || KERNEL) */ |
428extern int bpf_validate(struct bpf_insn *, int); 429extern u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int); |
430 431/* 432 * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). 433 */ 434#define BPF_MEMWORDS 16 435 436#ifdef __cplusplus 437} 438#endif 439 440#endif |