| 1 | .\" Copyright (c) 1983, 1986 The Regents of the University of California. |
| 2 | .\" All rights reserved. |
| 3 | .\" |
| 4 | .\" %sccs.include.redist.roff% |
| 5 | .\" |
| 6 | .\" @(#)4.t 6.5 (Berkeley) %G% |
| 7 | .\" |
| 8 | .nr H2 1 |
| 9 | .\".ds RH "Address representation |
| 10 | .br |
| 11 | .ne 2i |
| 12 | .NH |
| 13 | \s+2Internal address representation\s0 |
| 14 | .PP |
| 15 | Common to all portions of the system are two data structures. |
| 16 | These structures are used to represent |
| 17 | addresses and various data objects. |
| 18 | Addresses, internally are described by the \fIsockaddr\fP structure, |
| 19 | .DS |
| 20 | ._f |
| 21 | struct sockaddr { |
| 22 | short sa_family; /* data format identifier */ |
| 23 | char sa_data[14]; /* address */ |
| 24 | }; |
| 25 | .DE |
| 26 | All addresses belong to one or more \fIaddress families\fP |
| 27 | which define their format and interpretation. |
| 28 | The \fIsa_family\fP field indicates the address family to which the address |
| 29 | belongs, and the \fIsa_data\fP field contains the actual data value. |
| 30 | The size of the data field, 14 bytes, was selected based on a study |
| 31 | of current address formats.* |
| 32 | Specific address formats use private structure definitions |
| 33 | that define the format of the data field. |
| 34 | The system interface supports larger address structures, |
| 35 | although address-family-independent support facilities, for example routing |
| 36 | and raw socket interfaces, provide only 14 bytes for address storage. |
| 37 | Protocols that do not use those facilities (e.g, the current Unix domain) |
| 38 | may use larger data areas. |
| 39 | .FS |
| 40 | * Later versions of the system may support variable length addresses. |
| 41 | .FE |