Date: Wed, 27 Jun 2001 14:30:42 -0500 From: Alfred Perlstein <bright@sneakerz.org> To: Stuart Eichert <seichert@coopcomp.com> Cc: net@freebsd.org Subject: Re: Am I missing something? Message-ID: <20010627143042.F74703@sneakerz.org> In-Reply-To: <20010627111222.A9434@gourdy.coopcomp.com>; from seichert@coopcomp.com on Wed, Jun 27, 2001 at 11:12:22AM -0700 References: <20010627111222.A9434@gourdy.coopcomp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
* Stuart Eichert <seichert@coopcomp.com> [010627 13:12] wrote: > In the past (under FreeBSD 3.0 and 3.3) I implemented a new networking > protocol, that ran over Ethernet(and nothing else for that matter). I > put a new ETHERTYPE into ethernet.h(0x0801 for the record). In addition > I modified the switch statements in if_ethersubr.c:ether_output and > if_ethersubr.c:ether_input to recognize this type and act accordingly. > In addition I modified sys/socket.h to add an additional address family > and protocol family for my protocol. From there I implemented the protocol > in a separate directory, made some changes in the conf directory and then > I was able to compile a new kernel with support for my protocol. > > This is cool and all (and yes I have updated it to work in 4.3), but I don't > like the idea that anyone who wants to try out this protocol and any associated > programs has to recompile an entire kernel. I would much prefer to create > a kernel module that someone can load, test, and then unload. I don't think > that I can do this however, because of the ethernet routines in if_ethersubr.c. > These routines do not allow for the dynamic addition of new ETHERTYPES. > I guess one could screw around with netgraph or tap(though I really know next > to nothing about them), but that would not allow me to plug the protocol > in below the socket layer. > > Is there no way to make a kernel module that will allow for the > dynamic addition of ethernet protocols or am I just missing something? Why not provide a patch that allows one to add callbacks to the list? for ether_output under the default case you would walk the list looking for your type, since for the most part packets will be in AF_INET and when no callbacks are registered the array will be short, transmit should be cheap. For recieve if you look in the default case you can see ng_ether_input_orphan_p being used to input packets that don't match a known type. -Alfred 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?20010627143042.F74703>