Date: Tue, 03 Jul 2007 11:18:12 -0700 From: Julian Elischer <julian@elischer.org> To: Martha Pasikatan <magpasikat@yahoo.com> Cc: freebsd-net@freebsd.org, Alexander Motin <mav@freebsd.org> Subject: Re: Sample Netgraph code that unhooks and rehooks without losing connection Message-ID: <468A92E4.8040201@elischer.org> In-Reply-To: <862996.32073.qm@web44908.mail.sp1.yahoo.com>
index | next in thread | previous in thread | raw e-mail
your mail was ZVERY hard to read becosue you mixed you comments in with my mail without distinguishing them in any way.. I missed two of them on first reading. Martha Pasikatan wrote: > Julian Elischer <julian@elischer.org> wrote: Alexander Motin wrote: >> Martha Pasikatan wrote: >>> I would like to be able to unhook a pppoe node hooked to link0 and >>> rehook it to a tee node. Can anyone give me a sample on how to do this? >> That's impossible. As soon as pppoe node hook is disconnected all >> related info will be destroyed and session will be terminated. You >> should put there some other node like ng_tee to prevent session >> termination. >> > That means I need to create another hook through make peer, right? > Is that at the same path as link0? or inside link0? I believe he means you need to add the tee at creation time. "just in case". > Are some programs dependent on this behavior, because that might cause > side-effects on them. Is netgraph already widely-used by the way? yes. it is used by a lot of people for all kinds of strange things. > > Would connecting it to a tee node allow me to forward the packets to > another node, without disconnecting the session and at the same time, > not have the session processed anymore by the previous node? Is there already > a functionality in netgraph that does this? I might just not know about it > but it already exist. I could really use something like a divert function > not just a copy. probably another kind of node would be better for that. maybe you could use a bpf node, or possibly one of the one2many modes may be good for you. Possibly you could write a new note type. "switchpoint" which can be switched from one connection to another using a command message. New netgraph types are very easy to write. The ng_sample.c file is a good starting point. take some of the logic from tee and some of the message handling from one2many (mode setting messages) and grapfdt them together into a node that does what you want exactly. (but first look at all the nodes that already exist to see if one doesn't already do what you want).home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?468A92E4.8040201>
