Date: Tue, 27 Feb 2001 02:49:05 +0530 (IST) From: Satyajeet Seth <sseth@sasken.com> To: <net@freebsd.org> Subject: Problem in configuring netgraph Message-ID: <Pine.GSO.4.30.0102270141460.28244-100000@suns3.sasi.com>
next in thread | raw e-mail | index | archive | help
Hi I tried to use ng_ether and ng_bpf as follows: fxp0(lower) --- (bhook)[bpf](nomatch)(hook1)----(upper)fxp0 [ ]( match )(hook2)----not connected $ ngctl mkpeer fxp0: bpf divert bhook $ ngctl name fxp0:divert bpf0 $ ngctl + msg bpf0: setprogram { thisHook="bhook" ifMatch="hook2" ifNotMatch="hook1" bpf_prog_len=1 bpf_prog=[ { code=6 } ] } Now 'nghook -a bpf0: hook1' shows output while 'nghook -a bpf0: hook2' doesn't. $ ngctl connect fxp0: bpf0: upper hook1 1. After this I am unable to ping any of the lan machines. Could you suggest what I could be doing wrong? 2. I am writing a BPF program(for filtering packets destined to particular MAC addresses) by converting instructions like: BPF_STMT(BPF_LD+BPF_H+BPF_ABS,12), BPF_STMT(BPF_RET+BPF_K,0) into: [ {code=28 jt=0 jf=0 k=0x0c} {code=6 jt=0 jf=0 k=0}] After seeing the definitions of BPF_STMT,BPF_LD etc. in /sys/net/bpf.h. Is this the correct way? 3. I noticed a problem that the filter could not be set as : ngctl msg bpf0: setprogram {...} It gave the message: ngctl: send msg: Invalid argument I am using FreeBSD 4.1. Thanks Satya To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.30.0102270141460.28244-100000>