From owner-freebsd-stable@FreeBSD.ORG Tue Oct 10 19:25:33 2006 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E1AFF16A40F for ; Tue, 10 Oct 2006 19:25:32 +0000 (UTC) (envelope-from dudu.meyer@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0AC6043D5D for ; Tue, 10 Oct 2006 19:25:23 +0000 (GMT) (envelope-from dudu.meyer@gmail.com) Received: by ug-out-1314.google.com with SMTP id m2so769916uge for ; Tue, 10 Oct 2006 12:25:23 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=pqy180Ncxmd3PlHOMEV/Wk1C16bs72st7M046dEn/y//UC/Fb12N8K/yFoKKihtqjK6rUBaE1FcDtZ4xXsEaGO9V7IDeuXm6S2O5rmMW4TU94CVdJkgT4pgTCHxVkfgGDF+Ti9Bw9GfFNClv7Sm82i2kaFjNxI08s6MTo2poWVY= Received: by 10.67.101.8 with SMTP id d8mr8616033ugm; Tue, 10 Oct 2006 12:25:23 -0700 (PDT) Received: by 10.66.248.4 with HTTP; Tue, 10 Oct 2006 12:25:23 -0700 (PDT) Message-ID: Date: Tue, 10 Oct 2006 16:25:23 -0300 From: "Eduardo Meyer" To: stable@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <57d710000610101008h47c96971v35b5483ca6052fad@mail.gmail.com> Cc: Subject: Re: Netgraph - ng_bpf help (first experience) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2006 19:25:33 -0000 New try, now by hand: # ngctl msg dcbpf: setprogram { thisHook="ipfw" ifMatch="matched" ifNotMatch="ipfw" bpf_prog_len=8 bpf_prog=[ { code=32 jt=0 jf=0 k=40 } { code=21 jt=0 jf=5 k=323901508 } { code=32 jt=0 jf=0 k=44 } { code=21 jt=0 jf=3 k=1869439337 } { code=32 jt=0 jf=0 k=48 } { code=21 jt=0 jf=1 k=28170 } { code=6 jt=0 jf=0 k=8192 } { code=6 jt=0 jf=0 k=0 } ] } } ngctl: send msg: No such file or directory I cant figure out which "file or directory" was not found :( Now exactly with the command originated from the man page - ng_bpf(4): ngctl msg my_node: setprogram { thisHook="hook1" ifMatch="hook2" ifNotMatch="hook3" bpf_prog_len=16 bpf_prog=[ { code=40 jt=0 jf=0 k=12 } { code=21 jt=0 jf=4 k=34525 } { code=48 jt=0 jf=0 k=20 } { code=21 jt=0 jf=11 k=6 } { code=40 jt=0 jf=0 k=56 } { code=21 jt=8 jf=9 k=80 } { code=21 jt=0 jf=8 k=2048 } { code=48 jt=0 jf=0 k=23 } { code=21 jt=0 jf=6 k=6 } { code=40 jt=0 jf=0 k=20 } { code=69 jt=4 jf=0 k=8191 } { code=177 jt=0 jf=0 k=14 } { code=72 jt=0 jf=0 k=16 } { code=21 jt=0 jf=1 k=80 } { code=6 jt=0 jf=0 k=8192 } { code=6 jt=0 jf=0 k=0 } ] } } ngctl: send msg: No such file or directory Exit 71 Same problem. With ngctl list the only node I see is: There are 1 total nodes: Name: ngctl19792 Type: socket ID: 0000003f Num hooks: 0 My kldstat: Id Refs Address Size Name 1 10 0xc0400000 40e440 kernel 2 2 0xc080f000 22ae8 sound.ko 3 1 0xc0832000 51f8 snd_t4dwave.ko 4 1 0xc0838000 59e60 acpi.ko 5 1 0xc24e6000 1a000 usb.ko 6 1 0xc3754000 4000 ng_bpf.ko 7 3 0xc3758000 a000 netgraph.ko 8 1 0xc3766000 3000 ng_tag.ko 9 1 0xc3769000 4000 ng_socket.ko What am I missing here, and why the example from the man page wont work? On 10/10/06, Eduardo Meyer wrote: > Pete, thank you for asking. > > > are you sure you are able to write to /tmp, this error looks like it > > is not able to read /tmp/bpf.awk. > > Yes, I can write. It is not the problem, since the generated code from > the awk file is OK. > > > > > > I printed the full commands that returns the error, it is: > > > > > > ngctl msg setprogram { thisHook="" ifMatch="" ifNotMatch="" > > > bpf_prog_len=8 bpf_prog=[ { code=32 jt=0 jf=0 k=40 } { code=21 jt=0 > > > jf=5 k=323901508 } { code=32 jt=0 jf=0 k=44 } { code=21 jt=0 jf=3 > > > k=1869439337 } { code=32 jt=0 jf=0 k=48 } { code=21 jt=0 jf=1 k=28170 > > > } { code=6 jt=0 jf=0 k=8192 } { code=6 jt=0 jf=0 k=0 } ] } } > > > > > > > i suspect this is what the contents of /tmp/bpf.awk are. if not maybe > > post that to the thread.... > > No, this is the out from > > echo ngctl msg ${NODEPATH} setprogram { thisHook=\"${INHOOK}\" > ifMatch=\"${MATCHHOOK}\" ifNotMatch=\"${NOTMATCHHOOK}\" ${BPFPROG} } } > > I added the echo command to see how it is getting executed. So I have > the echo and on the next line the command itself. Note that this was > just copied/pasted from the man page, with the exception of the > PATTERN. > > > -- > =========== > Eduardo Meyer > pessoal: dudu.meyer@gmail.com > profissional: ddm.farmaciap@saude.gov.br > -- =========== Eduardo Meyer pessoal: dudu.meyer@gmail.com profissional: ddm.farmaciap@saude.gov.br