Hi Darren,
On Fri, 2008-05-09 at 16:41 +0800, Darren Reed wrote:
> For all that these do, we don't have anything that defines a
> structure or address family for ethernet - there's no AF_ETHER
> or AF_802_3 and nor is there a "struct sockaddr_ether".
There is, from <net/if_dl.h>:
/*
* Structure of a Link-Level sockaddr:
*/
struct sockaddr_dl {
ushort_t sdl_family; /* AF_LINK */
ushort_t sdl_index; /* if != 0, system given index for interface */
uchar_t sdl_type; /* interface type */
uchar_t sdl_nlen; /* interface name length, no trailing 0 reqd. */
uchar_t sdl_alen; /* link level address length */
uchar_t sdl_slen; /* link layer selector length */
char sdl_data[244]; /* contains both if name and ll address */
};
Here sdl_type is the link type (IFT_ETHER for Ethernet, for example).
This is also in the various BSDs, so it's a portable construct.
This was designed to do what you're looking for, so I don't think
there's a need to introduce an Ethernet-specific sockaddr_ether.
-Seb
_______________________________________________
networking-discuss mailing list
[email protected]