Describes a socket address.
A structure at least as large as any other sockaddr_*
address structures. It's aligned so that a pointer to it
can be cast as a pointer to other sockaddr_* structures
and used to access its fields.
Describes the length of a socket address. This is an
integer type of at least 32 bits.
Describes a socket's protocol family. This is an unsigned
Internet domain socketssockaddr_in
Describes an IPv4 Internet domain socket address. The
sin_port and sin_addr members are stored in network byte
Describes an IPv6 Internet domain socket address. The
sin6_addr.s6_addr array is used to contain a 128-bit IPv6
address, stored in network byte order.
UNIX domain socketssockaddr_un
Describes a UNIX domain socket address.
socklen_t was invented by POSIX. See also accept(2).
These structures were invented before modern ISO C strict-
aliasing rules. If aliasing rules are applied strictly, these
structures would be extremely difficult to use without invoking
Undefined Behavior. POSIX Issue 8 will fix this by requiring
that implementations make sure that these structures can be
safely used as they were designed.