header length is the size of the
ether_header
data structure plus 8
(the size of the maximum LLC header).
The media headers are represented by the following data structures:
ether_header
The media header structure for Ethernet-related
media. The
if_ether.h
file defines the
ether_header
structure.
fddi_header
The media header structure for FDDI-related
media. The
if_fddi.h
file defines the
fddi_header
structure.
trn_header
The media header structure for Token Ring-related
media. The
if_trn.h
file defines the
trn_header
structure.
6.3 Setting Up the Media
The following code shows how the
el_attach( )
routine sets up
media-related information:
sc->is_ac.ac_bcastaddr = (u_char *)etherbroadcastaddr;
1
sc->is_ac.ac_arphrd = ARPHRD_ETHER;
2
ifp->if_mtu = ETHERMTU;
3
ifp->if_mediamtu = ETHERMTU;
4
ifp->if_type = IFT_ETHER;
5
((struct arpcom *)ifp)->ac_flag = 0;
6
sin = (struct sockaddr_in *)&ifp->if_addr;
7
sin->sin_family = AF_INET;
8
1
Sets the
ac_bcastaddr
member of the
softc
data structure for this
device to the Ethernet broadcast address. The system stores the
Ethernet broadcast address in the
etherbroadcastaddr
character
array. Tru64 UNIX defines the
etherbroadcastaddr
character array
in the
if_ether.h
file.
The name
is_ac
is an alternate name for the
ess_ac
member of the
ether_driver
data structure. The
ess_ac
member is referred to as
the Ethernet common part and is actually an instance of the
arpcom
data structure.
2
Sets the
ac_arphrd
member of the
softc
data structure for this
device to the constant
ARPHRD_ETHER
, which represents the Ethernet
hardware address. The
if_arp.h
file defines this constant.
For the Token Ring interface, set the
ac_arphrd
member to the
constant
ARPHRD_802
. The
if_arp.h
file also defines this constant.
For the FDDI interface, set the
ac_arphrd
member to the constant
ARPHRD_ETHER
, which represents the Ethernet hardware address. See
RFC 826 for more details.
Implementing the Autoconfiguration Support Section (attach) 6–3