From owner-freebsd-hackers Mon Jun 17 20:34:21 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from jester.ti.com (jester.ti.com [192.94.94.1]) by hub.freebsd.org (Postfix) with ESMTP id 228CE37B41F; Mon, 17 Jun 2002 20:34:13 -0700 (PDT) Received: from dlep8.itg.ti.com ([157.170.134.88]) by jester.ti.com (8.11.6/8.11.6) with ESMTP id g5I3YBK12187; Mon, 17 Jun 2002 22:34:12 -0500 (CDT) Received: from dlep8.itg.ti.com (localhost [127.0.0.1]) by dlep8.itg.ti.com (8.9.3/8.9.3) with ESMTP id WAA23975; Mon, 17 Jun 2002 22:34:11 -0500 (CDT) Received: from popsvr.india.ti.com (popsvr.india.ti.com [157.87.95.215]) by dlep8.itg.ti.com (8.9.3/8.9.3) with ESMTP id WAA23949; Mon, 17 Jun 2002 22:34:08 -0500 (CDT) Received: from gautham ([192.168.185.126]) by popsvr.india.ti.com (8.8.8/8.8.8) with SMTP id JAA01395; Tue, 18 Jun 2002 09:03:58 +0530 (IST) Reply-To: From: "Gautham Ganapathy" To: "Terry Lambert" Cc: "FreeBSD.org - Hackers" , "FreeBSD. org - Net" Subject: RE: Inserting a kernel module b/w IP and ethernet (Moving to net-) Date: Tue, 18 Jun 2002 09:05:10 +0530 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <3D0DF45F.C616C7CA@mindspring.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Monday, June 17, 2002 8:08 PM, Terry Lambert wrote: > > Gautham Ganapathy wrote: > > How can I add an extra layer of processing b/w the IP and > ethernet layers > > using a kernel module ? If I load a module, I should be able to > access the > > functions exported by IP and ethernet. Also, I think the > ethernet layer can > > be configured to use my module as the protocol by patching > ifconfig. Am I > > right so far ? So, how do I get IP to use my module as it's > link layer ? If > > I am wrong, what's the proper way ? Or is there any other > simpler way ? My > > requirement is to add a compression layer (RFC 2507) > > Questions like this should probably be sent to -net, rather than > -hackers. You will probably find a better answer than mine, just > by searching the -net list archives at www.freebsd.org. > ok. will do > The RFC specifically references a NetBSD implementation for PPP; is > this for PPP? If it's for PPP, then mpd may have already implemented > what you need as a netgraph node. One thing you aren't going to be > able to do is BPF on input after netgraph catches the data. > it is not for ppp. this will currently be used on a LAN. it is used for reducing header bandwidth on wireless transmission systems. the ip packets generated after compression are not compatible with standard ipv4 packets and probably cannot be used on the same network. as in tcp/ip, there is no dependency on an underlying protocol. i'll check if the netbsd ppp will be of use. > Don't bother with a protocol family, unless you want to have to > implement everything; TCP in tcp_output() calls ip_output() > directly, so you will not be able to wedge it in there (TCP and IP > are not implemented as stackable protocol layers seperate and > distinct from each other). I can point you at code that does > this, but it requires changing your application in order to > make it open sockets with the new family instead of AF_INET; if > you ar adamant, the code is at Rice University, as part of the > Scala Server Project. i won't need to embed it between tcp and ip. it would have to be between ip and ethernet. > My particular choice for an example would be /sys/netgraph/ng_pppoe.c > but others might point you to something else. Julian or Archie are > always the best people to ask (obviously). > > You could also create an interface (see /sys/netgraph/ng_iface.c) > that pretended to be a plain old interface, and did the > encapsulation/deincapsulation, and sent to the regular interface. > this sounds good, but i think i have a lot of code to go through since i have just started studying the kernel. > The basics are going to be that you replace the mbuf with your > modified mbuf, rather than eating it outright, if you want the > input/output processing to proceed normally on the (de)compressed > packet. > > I don't know if there is a ng_null that anyone has written; it > would *really* be the best starting point. > thanx a lot To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message