From owner-freebsd-hackers Sun Feb 15 20:12:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA19950 for freebsd-hackers-outgoing; Sun, 15 Feb 1998 20:12:05 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from sasami.jurai.net (winter@sasami.jurai.net [207.31.78.80]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA19898 for ; Sun, 15 Feb 1998 20:11:55 -0800 (PST) (envelope-from winter@jurai.net) Received: from localhost (winter@localhost) by sasami.jurai.net (8.8.8/8.8.7) with SMTP id XAA29417; Sun, 15 Feb 1998 23:11:10 -0500 (EST) Date: Sun, 15 Feb 1998 23:11:10 -0500 (EST) From: "Matthew N. Dodd" To: Archie Cobbs cc: Philippe Regnauld , sthaug@nethelp.no, hackers@FreeBSD.ORG Subject: Re: IP tunnels In-Reply-To: <199802152040.MAA25372@bubba.whistle.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I'm playing around with code to implement IP-ENCAP(4), IPIP(94), and ENCAP(98) in the kernel. Would it not be useful to define a driver framework that would allow easy extension to add GRE support and PPTP? I've been tossing a few ideas around but have not come up with something concrete. Doing this in userland with the tun device is fairly easy but a kernel level driver would be really slick. On Sun, 15 Feb 1998, Archie Cobbs wrote: > What a coincidence. I'm starting to play with GRE a little bit. I > was simply going to open a raw IP socket with IPPROTO_GRE (47) and > filter out sub-protocols that I don't want (by examining the GRE > protocol field): > > s = socket(AF_INET, IPPROTO_RAW, 0); > read(s, (char *) &packet, sizeof(packet)); > if (packet.proto != 0x809b) > break; > /* process packet */ > > However, it might be useful to make GRE a supported kernel protocol. > There would not be much code involved, but it would be kindof handy. > So if you were tunneling AppleTalk, for example, you could say this: > > proto = 0x809b; /* Ethertype for AppleTalk */ > s = socket(AF_INET, IPPROTO_GRE, proto); > /* process packet */ > > You would still read and write complete GRE packets; the kernel would > simply be mulitplexing incoming packets to sockets based on the GRE > protocol number (in the above example, 0x0800). So different processes > that were tunnelling different things could operate independently. > > Optionally, the kernel could provide slightly more service, like > automatically filling in the checksum if the checksum bit is set, > verifying incoming packets' checksums, etc. > > The question is.. is this something worth doing? If so, I'll can try > to hack something up. > > -Archie > > References: RFC 1701, RFC 1702 /* Matthew N. Dodd | A memory retaining a love you had for life winter@jurai.net | As cruel as it seems nothing ever seems to http://www.jurai.net/~winter | go right - FLA M 3.1:53 */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message