Socket Address Storage
Addresses passed by an application program commonly reside in mbufs only long enough for the socket layer to pass them to the supporting protocol for transfer into a fixed-sized address structure.
This occurs, for example, when a protocol records an address in a protocol control block. The sockaddr structure is the common means by which the socket layer and network-support facilities exchange addresses. The size of the generic data array was chosen to be large enough to hold most addresses directly. Communications domains that support larger addresses may ignore the array size (see Socket Communication Domains).
- The UNIX communication domain stores file-system path names in mbufs and allows socket names as large as 108 bytes.
- The Internet communication domain uses a structure that combines an Internet address and a port number. The Internet protocols reserve space for addresses in an Internet control-block data structure and free up mbufs that contain addresses after copying their contents.