From owner-freebsd-net Mon Feb 26 13:19:18 2001 Delivered-To: freebsd-net@freebsd.org Received: from samar.sasi.com (samar.sasken.com [164.164.56.2]) by hub.freebsd.org (Postfix) with ESMTP id 6D31337B503 for ; Mon, 26 Feb 2001 13:19:13 -0800 (PST) (envelope-from sseth@sasken.com) Received: from samar (samar.sasi.com [164.164.56.2]) by samar.sasi.com (8.9.3/8.9.3) with SMTP id CAA27027 for ; Tue, 27 Feb 2001 02:49:08 +0530 (IST) Received: from suns3.sasi.com ([10.0.36.3]) by samar.sasi.com; Tue, 27 Feb 2001 02:49:06 +0000 (IST) Received: from localhost (sseth@localhost) by suns3.sasi.com (8.9.3/8.9.3) with ESMTP id CAA29417 for ; Tue, 27 Feb 2001 02:49:05 +0530 (IST) Date: Tue, 27 Feb 2001 02:49:05 +0530 (IST) From: Satyajeet Seth To: Subject: Problem in configuring netgraph Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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