ng_bpf.c (68876) | ng_bpf.c (69922) |
---|---|
1 2/* 3 * ng_bpf.c 4 * 5 * Copyright (c) 1999 Whistle Communications, Inc. 6 * All rights reserved. 7 * 8 * Subject to the following obligations and disclaimer of warranty, use and --- 22 unchanged lines hidden (view full) --- 31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 35 * OF SUCH DAMAGE. 36 * 37 * Author: Archie Cobbs <archie@freebsd.org> 38 * | 1 2/* 3 * ng_bpf.c 4 * 5 * Copyright (c) 1999 Whistle Communications, Inc. 6 * All rights reserved. 7 * 8 * Subject to the following obligations and disclaimer of warranty, use and --- 22 unchanged lines hidden (view full) --- 31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 35 * OF SUCH DAMAGE. 36 * 37 * Author: Archie Cobbs <archie@freebsd.org> 38 * |
39 * $FreeBSD: head/sys/netgraph/ng_bpf.c 68876 2000-11-18 15:17:43Z dwmalone $ | 39 * $FreeBSD: head/sys/netgraph/ng_bpf.c 69922 2000-12-12 18:52:14Z julian $ |
40 * $Whistle: ng_bpf.c,v 1.3 1999/12/03 20:30:23 archie Exp $ 41 */ 42 43/* 44 * BPF NETGRAPH NODE TYPE 45 * 46 * This node type accepts any number of hook connections. With each hook 47 * is associated a bpf(4) filter program, and two hook names (each possibly --- 143 unchanged lines hidden (view full) --- 191 NULL, 192 ng_bpf_constructor, 193 ng_bpf_rcvmsg, 194 ng_bpf_rmnode, 195 ng_bpf_newhook, 196 NULL, 197 NULL, 198 ng_bpf_rcvdata, | 40 * $Whistle: ng_bpf.c,v 1.3 1999/12/03 20:30:23 archie Exp $ 41 */ 42 43/* 44 * BPF NETGRAPH NODE TYPE 45 * 46 * This node type accepts any number of hook connections. With each hook 47 * is associated a bpf(4) filter program, and two hook names (each possibly --- 143 unchanged lines hidden (view full) --- 191 NULL, 192 ng_bpf_constructor, 193 ng_bpf_rcvmsg, 194 ng_bpf_rmnode, 195 ng_bpf_newhook, 196 NULL, 197 NULL, 198 ng_bpf_rcvdata, |
199 ng_bpf_rcvdata, | |
200 ng_bpf_disconnect, 201 ng_bpf_cmdlist 202}; 203NETGRAPH_INIT(bpf, &typestruct); 204 205/* Default BPF program for a hook that matches nothing */ 206static const struct ng_bpf_hookprog ng_bpf_default_prog = { 207 { '\0' }, /* to be filled in at hook creation time */ --- 162 unchanged lines hidden (view full) --- 370 371/* 372 * Receive data on a hook 373 * 374 * Apply the filter, and then drop or forward packet as appropriate. 375 */ 376static int 377ng_bpf_rcvdata(hook_p hook, struct mbuf *m, meta_p meta, | 199 ng_bpf_disconnect, 200 ng_bpf_cmdlist 201}; 202NETGRAPH_INIT(bpf, &typestruct); 203 204/* Default BPF program for a hook that matches nothing */ 205static const struct ng_bpf_hookprog ng_bpf_default_prog = { 206 { '\0' }, /* to be filled in at hook creation time */ --- 162 unchanged lines hidden (view full) --- 369 370/* 371 * Receive data on a hook 372 * 373 * Apply the filter, and then drop or forward packet as appropriate. 374 */ 375static int 376ng_bpf_rcvdata(hook_p hook, struct mbuf *m, meta_p meta, |
378 struct mbuf **ret_m, meta_p *ret_meta) | 377 struct mbuf **ret_m, meta_p *ret_meta, struct ng_mesg **resp) |
379{ 380 const hinfo_p hip = hook->private; 381 int totlen = m->m_pkthdr.len; 382 int needfree = 0, error = 0; 383 u_char *data, buf[256]; 384 hinfo_p dhip; 385 hook_p dest; 386 u_int len; --- 116 unchanged lines hidden --- | 378{ 379 const hinfo_p hip = hook->private; 380 int totlen = m->m_pkthdr.len; 381 int needfree = 0, error = 0; 382 u_char *data, buf[256]; 383 hinfo_p dhip; 384 hook_p dest; 385 u_int len; --- 116 unchanged lines hidden --- |