Subject: Re: Changes to link layer input routines
To: Jason Thorpe <thorpej@nas.nasa.gov>
From: Christian E. Hopps <chopps@merit.edu>
List: tech-net
Date: 05/19/1999 10:51:57
Jason Thorpe <thorpej@nas.nasa.gov> writes:
> On Sat, 15 May 1999 08:26:13 -0700
> Matt Thomas <matt@3am-software.com> wrote:
>
> > Out of curiousity, what protocol?
>
> PPP Over Ethernet (RFC 2516). pppd(8) has one socket for the IPCP/LCP/etc.
> packets anbd the PPPoE Discovery packets. PPPoE Session and Discovery
> packets use different Ethertypes. pppd(8) needs to be able to choose the
> correct code path for incoming packets, etc.
>
> Basically, the application is like using Raw IP with IP_HDRINCL, except it
> happens at layer 2.
>
> The idea here is that for ETHERTYPE_PPPOE and ETHERTYPE_PPPOEDISC,
> ether_input() will NOT m_adj() past the Ethernet header.
Basically it sounds like what you need is a general purpose raw
link layer socket. I too could use this.
I haven't had time to sit down and figure out how to implement it
but here are the things I think it should have:
It should handle 802.2 encoding as well as the non llc
ethernet frames (I think I recall someone saying these
were now a part of 802.2) I believe things like fddi
always use 802.2 (?)
The user should be able to somehow bind a socket to only
a specific type. This is so e.g., all IP traffic doesn't
come down your socket. I'm not sure how to do this with
item 1 above. E.g. it sounds like your application would
need to switch on the ethertype, whereas an LLC using
application needs to switch on a different field. (I'm
not real sure of how 802.2 works, perhaps it would switch
on the ethertype field and then a sub field in the llc
header?)
I'm not sure if this is a part of the above but at least I need
it too.
The user should have some way of joining a link layer
multicast group if that interface type supports it.
The ISO code has a really nice raw-like link socket, except that
its type specific. It takes as a destination sockaddr a
sockaddr_dl. Presumably this is what a raw link layer socket
would also take (if only for the if_index to determine which
interface to go out
Chris.