|
|
This section describes address structures and library routines used to call them.
The two most common addressing schemes are AF_UNIX and
AF_INET, (the AF stands for address family).
AF_UNIX addressing uses UNIX System
pathnames to identify sockets. These sockets are very useful
for interprocess communication (IPC) between
processes on the same machine.
For the UNIX address family, the sockaddr_un structure
members specify the protocol family of the address, and the pathname.
struct sockaddr_un { short sun_family; /*address family--AF_UNIX*/ char sun_path[108]; /*pathname*/ };The underlying generic structure of sockaddr is:
struct sockaddr { short sa_family; /*address family*/ char sa_data[14]; /*up to 14 bytes of address*/ };