inet(6F) TCP/IP R4.11 inet(6F)
NAME
inet - Communications Protocol Internet protocol family
SYNOPSIS
#include <netinet/in.h>
DESCRIPTION
The Internet protocol family is a collection of protocols based on
and including the Internet Protocol (IP), the Transmission Control
Protocol (TCP), and the User Datagram Protocol (UDP). Each of these
protocols uses the Internet address format.
Addressing
Internet addresses are four-byte quantities, stored in network
standard format. The include file netinet/in.h defines this address
as a discriminated union wrapped in a struct inaddr.
Sockets bound to the Internet protocol family utilize the following
addressing structure:
struct sockaddrin {
short sinfamily;
ushort sinport;
struct inaddr sinaddr;
char sinzero[8];
};
The sinfamily field is stored in host byte order and should be set
to AF_INET.
The sinport and sinaddr fields should be stored in network byte
order.
Sockets may be created with the address INADDR_ANY to affect
"wildcard" matching on incoming messages.
Protocols
The Internet protocol family consists of the Internet Protocol (IP),
Internet Control Message Protocol (ICMP), Transmission Control
Protocol (TCP), and User Datagram Protocol (UDP). TCP is used to
support the SOCK_STREAM socket type, while UDP is used to support the
SOCK_DGRAM socket type. A raw interface to IP is available by
creating an Internet socket of type SOCK_RAW. The ICMP is not
directly accessible.
SEE ALSO
byteorder(3N), ip(6P), tcp(6P), udp(6P).
Licensed material--property of copyright holder(s)