From owner-freebsd-net@FreeBSD.ORG Wed Aug 10 16:34:23 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D55FC16A41F for ; Wed, 10 Aug 2005 16:34:23 +0000 (GMT) (envelope-from vanvorst@ieee.org) Received: from mail.stupendousness.org (67-41-211-151.brbn.qwest.net [67.41.211.151]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E9FC43D48 for ; Wed, 10 Aug 2005 16:34:22 +0000 (GMT) (envelope-from vanvorst@ieee.org) Received: from brussels.luv.shack (localhost.localdomain [127.0.0.1]) by mail.stupendousness.org (8.13.1/8.13.1) with ESMTP id j7AGYMxv024332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 10 Aug 2005 10:34:22 -0600 Received: (from apache@localhost) by brussels.luv.shack (8.13.1/8.13.1/Submit) id j7AGYL6l024331; Wed, 10 Aug 2005 10:34:21 -0600 X-Authentication-Warning: brussels.luv.shack: apache set sender to vanvorst@ieee.org using -f Received: from 157.127.124.134 (proxying for unknown) (SquirrelMail authenticated user vanvorst) by www.stupendousness.org with HTTP; Wed, 10 Aug 2005 10:34:21 -0600 (MDT) Message-ID: <59841.157.127.124.134.1123691661.squirrel@www.stupendousness.org> Date: Wed, 10 Aug 2005 10:34:21 -0600 (MDT) From: "Nathanael M Van Vorst" To: freebsd-net@freebsd.org User-Agent: SquirrelMail/1.4.4-1.FC3 MIME-Version: 1.0 Content-Type: multipart/mixed;boundary="----=_20050810103421_56376" X-Priority: 3 (Normal) Importance: Normal X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Netgraph question X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vanvorst@ieee.org List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2005 16:34:24 -0000 ------=_20050810103421_56376 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit I sent this is Julian a bit ago. I guess he has been too busy to look into it, so I hope someone else in the community can help! Somehow I lost the screen shot I refer to in the message below (but its trival to reproduce). In brief, the code below is supposed to create a KLD/psuedo-device that I can pass netgraph items to, then later on have a netgraph node get them back. Thanks! --Nate ---------------------------- Original Message ---------------------------- Subject: Re: netgraph question From: "Nathanael M Van Vorst" Date: Wed, July 27, 2005 11:55 am To: "Julian Elischer" -------------------------------------------------------------------------- Sorry my reply has taken so long. I just got back from vacation. Thank you for taking the time to help! I am attaching a bit of code I put together. Its attached as a tar (test.tar). Please note, this is just a hack I have put together to see if I can get this concept working before I integrate this into my larger, rather complicated, project. The tar should extract into a directory named "test". "test" will have the folling structure: test |-echodev.c |-Makefile |-wireMe |-nateNode |-nate.h |-nate.c |-Makefile |-registerNode |-reg.c |-reg.h |-Makfile The tar consits of three things: 1) a node to receive packets, print a message to the long then drop the message, 2) a node that calls system module functions and passes all its items to the system module, 3) a system module or more acturatly a psuedo-device that takes items from a node and puts them on a queue. "wireMe" just loads the correctly KLDs for me and wires up a very simple netgraph graph (which follows). is my ethernet device, is a registerNode and is a nateNode. --> --> When receives the first message, it calls "setMyHook" with the destination hook to . "setMyHook" is in the echoDev and simple stores the pointer if its current pointer is NULL. After calls "setMyHook" is calls "addItem". "addItem" is also in echoDev and simply places the item at the end of the queue. Also in I have tried alot of stuff trying to see what is wrong. All the other crap is just that, crap. First, I cat echo dev. Them I cause packets to be sent to and in turn handed over to the echoDev. After I see echoDev print the syslog that it has 5 or more items, I "cat /dev/echo". cat'ing /dev/echo should case echoDev to call NG_FWD with hook that was passed in and first item that was passed in. This is where it dies. Below are the set of commands I type in the 'test' as root cd test make clean make cd nateNode make clean make cd ../registerNode make clean make cd .. ./wireme cat /dev/echo cat /dev/echo --then the kernel panics. The kernel core is trash so it doesn’t help. I am attaching a screen shot of the panic. Thank you for all your efforts (and for netgraph)! --Nate --------------------------------------- Nathanael Van Vorst Home: vanvorst@ieee.org 303-274-6396 “It is intuitively obvious to even the most casual of observers!” ------=_20050810103421_56376--