Previous section.

Technical Standard: Networking Services (XNS), Issue 5.2 Draft 2.0
Copyright © 1999 The Open Group

Use of Sockets over Internet Protocols based on IPv4

Support for sockets over Internet Protocols based on IPv4 is mandatory.

This Chapter gives the protocol-specific information that is relevant to the use of sockets in connection with TCP, UDP and ICMP over Version 4 of the Internet Protocol - IPv4.

Headers
Symbolic constant AF_INET is defined in <sys/socket.h> (see <sys/socket.h>) to identify the IPv4 Internet address family. Header <netinet/in.h> (see <netinet/in.h>) contains other definitions used in connection with IPv4 Internet sockets.

The sockaddr_storage structure defined in <sys/socket.h> is large enough to accommodate a sockaddr_in structure (see <netinet/in.h>) and is aligned at an appropriate boundary so that pointers to it can be cast as pointers to sockaddr_in structures and used to access the fields of those structures without alignment problems. When a sockaddr_storage structure is cast as a sockaddr_in structure, the ss_family field maps onto the sin_family field.

Contents Next section Index