AF_INET address family
This address family provides interprocess communication between processes that run on the same system or on different systems.
Addresses for AF_INET sockets are IP addresses and port numbers. You can specify an IP address for an AF_INET socket either as an IP address (such as 126.96.36.199) or in its 32–bit form (X'82638001').
For a socket application that uses the Internet Protocol version 4 (IPv4), the AF_INET address family uses the sockaddr_in address structure. When you use _XOPEN_SOURCE macro, the AF_INET address structure changes to be compatible with BSD 4.4/ UNIX 98 specifications. For the sockaddr_in address structure, these differences are summarized in the table:
|BSD 4.3 sockaddr_in address structure||BSD 4.4/ UNIX 98 sockaddr_in address structure|
|Address structure field||Definition|
|sin_len||This field contains the length of the address for UNIX 98
Note: The sin_len field is provided only for BSD 4.4 compatibility. It is not necessary to use this field even for BSD 4.4/ UNIX 98 compatibility. The field is ignored on input addresses.
|sin_family||This field contains the address family, which is always AF_INET when TCP or User Datagram Protocol (UDP) is used.|
|sin_port||This field contains the port number.|
|sin_addr||This field contains the IP address.|
|sin_zero||This field is reserved. Set this field to hexadecimal zeros.|