new getlogin using getlogname syscall; plus cuserid library call
[unix-history] / usr / src / share / doc / smm / 18.net / 4.t
CommitLineData
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.\"
95c3c83a 5.\" @(#)4.t 6.3 (Berkeley) %G%
04d55378
KM
6.\"
7.nr H2 1
820fca5e 8.\".ds RH "Address representation
95c3c83a
MK
9.br
10.ne 2i
04d55378
KM
11.NH
12\s+2Internal address representation\s0
13.PP
14Common to all portions of the system are two data structures.
15These structures are used to represent
16addresses and various data objects.
17Addresses, internally are described by the \fIsockaddr\fP structure,
18.DS
19._f
20struct sockaddr {
21 short sa_family; /* data format identifier */
22 char sa_data[14]; /* address */
23};
24.DE
25All addresses belong to one or more \fIaddress families\fP
26which define their format and interpretation.
820fca5e
MK
27The \fIsa_family\fP field indicates the address family to which the address
28belongs, and the \fIsa_data\fP field contains the actual data value.
04d55378 29The size of the data field, 14 bytes, was selected based on a study
820fca5e
MK
30of current address formats.*
31Specific address formats use private structure definitions
32that define the format of the data field.
33The system interface supports larger address structures,
34although address-family-independent support facilities, for example routing
35and raw socket interfaces, provide only 14 bytes for address storage.
36Protocols that do not use those facilities (e.g, the current Unix domain)
37may use larger data areas.
04d55378 38.FS
820fca5e 39* Later versions of the system may support variable length addresses.
04d55378 40.FE