From owner-freebsd-net@FreeBSD.ORG Tue Sep 2 16:04:30 2003 Return-Path: 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 7025216A4BF for ; Tue, 2 Sep 2003 16:04:30 -0700 (PDT) Received: from hysteria.spc.org (hysteria.spc.org [195.206.69.234]) by mx1.FreeBSD.org (Postfix) with SMTP id F18AB43FF9 for ; Tue, 2 Sep 2003 16:04:27 -0700 (PDT) (envelope-from bms@hysteria.spc.org) Received: (qmail 1167 invoked by uid 5013); 2 Sep 2003 23:01:10 -0000 Date: Wed, 3 Sep 2003 00:01:10 +0100 From: Bruce M Simpson To: Jerry Toung Message-ID: <20030902230110.GE29217@spc.org> Mail-Followup-To: Bruce M Simpson , Jerry Toung , freebsd-net@freebsd.org References: <200308312303.40555.jtoung@arc.nasa.gov> <20030902191213.GC29217@spc.org> <200309021506.16581.jtoung@arc.nasa.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200309021506.16581.jtoung@arc.nasa.gov> User-Agent: Mutt/1.4.1i Organization: SPC cc: freebsd-net@freebsd.org Subject: Re: if_gre, ip_gre and the like (pseudo-interfaces) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2003 23:04:30 -0000 [Redirected to -net as more appropriate] On Tue, Sep 02, 2003 at 03:06:16PM -0700, Jerry Toung wrote: > BMS, > please be patient. I guess I am still a little bit confuse as to how a > packet goes from a real NIC (i.e xl0) to the gre pseudo-device. No problem. :-) > in if_gre.c, you define a new protocol switch in the inetdomain and > gre_input as the input processing function. > My understanding is that NIC receives a data, device driver unwraps it and > places it in &ipintrq. Then (*inetsw[ip_protox[ip->ip_p]].pr_input) in > ip_input.c points to gre_input and that's how we land in the gre module. Yes, that is broadly how it works on the inbound path. > gre_output on the other hand prepends or insert headers and make a call > to ip_output which I think will transmit the packet to the physical interface > (i.e xl0). That is also broadly how it works on the outbound path. > With all respect, I don't see any call to IF_HANDOFF in the gre code. only in > if_gif that you also wrote. I didn't write if_gif, it came from KAME. :-) Also I should add I'm looking at my own tree (which is closer to 5.1-RELEASE than -CURRENT right now), you probably want to browse source in cvsweb to get an up-to-date picture of things. BMS