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