Subject: Re: Changes to link layer input routines
To: Jason Thorpe <thorpej@nas.nasa.gov>
From: Ignatios Souvatzis <is@jocelyn.rhein.de>
List: tech-net
Date: 05/15/1999 13:24:20
On Fri, May 14, 1999 at 03:28:42PM -0700, Jason Thorpe wrote:
> Hi folks...
> 
> I have an application which is using a protocol family, which needs to have
> Ethernet headers intact on the packet when it is read by userspace.
> 
> Unfortunately, ether_input() and friends are structured such that they assume
> the header has been stripped of (or was never in the front of the packet to
> begin with).  Other protocol input routines do the same thing (e.g.
> token_input(), hippi_input()), while others (e.g. arc_input()) do not.

Basically, I like this, because it strips a lot of madj code snippets from
the hardware drivers. (Back then for ARCnet, I had to account for a variable
length header and didn't want to put that knowledge into the hardware driver).

> What I'd like to do is make it uniform, and place another function pointer
> in the ifnet structure (*if_input)(struct ifnet *, struct mbuf *).  This
> might have other utility, too, like allowing packet filters/compressors
> or whatever to easily insert themselves into the flow.

Uhm, only sort of. IMO, for this to be really useful, you'd need a stack, or a
linked list, of function calls.

E.g., you still want to call the original ether_new_input function after
decompressing the stream...

	-is