INET(7P) — Silicon Graphics
NAME
inet − Internet protocol family
SYNOPSIS
#include <sys/types.h>
#include <netinet/in.h>
DESCRIPTION
The Internet protocol family is a collection of protocols (Internet address format) layered atop the Internet Protocol (IP) transport layer. The Internet family provides protocol support for the SOCK_STREAM, SOCK_DGRAM, and SOCK_RAW socket types; the SOCK_RAW interface provides access to the IP protocol.
ADDRESSING
Internet addresses are four-byte quantities, stored in network standard format (this may vary from the user or host native data order). The include file <netinet/in.h> defines this address as a discriminated union with the following conventions:
struct in_addr *sin;
sin−>s_addr = 0;/* entire address */
sin−>s_host = 0;/* host on imp */
sin−>s_net = 0;/* network */
sin−>s_imp = 0;/* 2-byte imp */
sin−>s_impno = 0;/* imp # and ... */
sin−>s_lh = 0;/* ... logical host */
Sockets bound to the IP family use this addressing structure:
struct sockaddr_in {
short sin_family;
u_short sin_port; /* TCP and UDP use this as the socket
address on a given host */
struct in_addr sin_addr;
char sin_zero[8];
};
Sockets can be created with the address INADDR_ANY to effect “wildcard” matching on incoming messages.
PROTOCOLS
The Internet protocol family comprises the IP transport protocol, Internet Control Message Protocol (ICMP), Transmission Control Protocol (TCP), and User Datagram Protocol (UDP). TCP supports the SOCK_STREAM abstraction, while UDP supports the SOCK_DGRAM abstraction. An Internet socket of type SOCK_RAW creates a raw interface to IP. The ICMP message protocol is not directly accessible.
SEE ALSO
net(7P), tcp(7P), udp(7P), ip(7P), lo(7)
Version 2.4 — May 08, 1986