Date: Wed, 3 Sep 2003 00:01:10 +0100 From: Bruce M Simpson <bms@spc.org> To: Jerry Toung <jtoung@arc.nasa.gov> Cc: freebsd-net@freebsd.org Subject: Re: if_gre, ip_gre and the like (pseudo-interfaces) Message-ID: <20030902230110.GE29217@spc.org> In-Reply-To: <200309021506.16581.jtoung@arc.nasa.gov> References: <200308312303.40555.jtoung@arc.nasa.gov> <20030902191213.GC29217@spc.org> <200309021506.16581.jtoung@arc.nasa.gov>
next in thread | previous in thread | raw e-mail | index | archive | help
[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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030902230110.GE29217>