In this chapter we have examined the ifnet and ifaddr structures that are allocated for each network interface found at system initialization time. The ifnet structures are linked into the ifnet list. The link-level address for each interface is initialized, attached to the ifnet structure's address list, and entered into the if_addrs array.
We discussed the generic sockaddr structure and its sa_family, and sa_len members, which specify the type and length of every address. We also looked at the initialization of the sockaddr_dl structure for a link-level address.
In this chapter, we introduced the three example network interfaces that we use throughout the book.
The netstat program on many Unix systems lists network interfaces and their configuration. Try netstat -i on a system you have access to. What are the names (if_name) and maximum transmission units (if_mtu) of the network interfaces?
In if_slowtimo (Figure 3.43) the splimp and splx calls appear outside the loop. What are the advantages and disadvantages of this arrangement compared with placing the calls within the loop?
Why is SLIP's interactive queue shorter than SLIP'S standard output queue?
Why aren't if_hdrlen and if_addrlen initialized in slattach?
Draw a picture similar to Figure 3.38 for the SLIP and loopback devices.