Commit | Line | Data |
---|---|---|
91020c73 KB |
1 | .\" Copyright (c) 1983, 1986 The Regents of the University of California. |
2 | .\" All rights reserved. | |
04d55378 | 3 | .\" |
ff262511 | 4 | .\" %sccs.include.redist.roff% |
91020c73 | 5 | .\" |
ff262511 | 6 | .\" @(#)4.t 6.5 (Berkeley) %G% |
04d55378 KM |
7 | .\" |
8 | .nr H2 1 | |
820fca5e | 9 | .\".ds RH "Address representation |
95c3c83a MK |
10 | .br |
11 | .ne 2i | |
04d55378 KM |
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. | |
820fca5e MK |
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. | |
04d55378 | 30 | The size of the data field, 14 bytes, was selected based on a study |
820fca5e MK |
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. | |
04d55378 | 39 | .FS |
820fca5e | 40 | * Later versions of the system may support variable length addresses. |
04d55378 | 41 | .FE |