The following overview of the SOCKETS interface functions collects several functions together into task-oriented groups. The columns IPv4 and IPv6 indicate the address family (AF_INET and/or AF_INET6) in which the function involved is supported.
Function  | Description | IPv4 | IPv6 | 
|---|---|---|---|
Setting up and shutting down connections over sockets  | |||
Create socket  | x  | x  | |
Assign a name to a socket  | x  | x  | |
Initiate a connection over a socket  | x  | x  | |
Test socket for pending connections  | x  | x  | |
Accept connection over a socket  | x  | x  | |
Close socket  | x  | x  | |
Close full duplex connection  | x  | x  | |
Create a pair of connected sockets  | x  | ||
Transferring data between two sockets  | |||
Receive a message from a connected socket  | x  | x  | |
Receive a message from a connected socket  | x  | x  | |
Receive a message from a socket  | x  | x  | |
Receive a message from a socket  | x  | x  | |
Send a message from socket to socket over a connection  | x  | x  | |
Send a message from socket to socket  | x  | x  | |
Send a message from socket to socket  | x  | x  | |
Send a message from socket to socket over a connection  | x  | x  | |
Multiplex input/output  | x  | x  | |
Multiplex input/output  | x  | x  | |
Receiving information about sockets  | |||
Get socket options  | x  | x  | |
Set socket options  | x  | x  | |
Get name of communications partner  | x  | x  | |
Get name of socket  | x  | x  | |
Test configuration values  | |||
Get description of a getaddrinfo() error code  | x  | x  | |
Get information about host name, host address and services  | x  | x  | |
Get names of reachable hosts  | x  | ||
Get addresses of reachable hosts  | x  | ||
Get name of current host  | x  | x  | |
Get host name belonging to an IPv4 or IPv6 address  | x  | x  | |
Get IPv4 or IPv6 addresses belonging to a host name  | x  | x  | |
Get host and service name corresponding to IP address and port number  | x  | x  | |
Get name of a net  | x  | x  | |
Get net address  | x  | x  | |
Get number of a protocol  | x  | x  | |
Get name of a protocol  | x  | x  | |
Get port number of a service  | x  | x  | |
Get name of a service  | x  | x  | |
Open host database  | x  | x  | |
Read entry from host database  | x  | x  | |
Close host database  | x  | x  | |
Open network database  | x  | x  | |
Read entry from network database  | x  | x  | |
Close network database  | x  | x  | |
Open protocol database  | x  | x  | |
Read entry from protocol database  | x  | x  | |
Close protocol database  | x  | x  | |
Open services database  | x  | x  | |
Read entry from services database  | x  | x  | |
Close services database  | x  | x  | |
| Manipulate Internet address | |||
Convert character string from dotted notation to integer value (Internet address)  | x  | ||
Convert character string from dotted notation to integer value (subnetwork section)  | x  | ||
Create Internet address from subnetwork section and subnetwork local address section  | x  | ||
Extract local network address in byte order of host from Internet host address  | x  | ||
Extract network number in byte order of host from Internet host address  | x  | ||
Convert Internet host address into a string conforming to normal Internet dotted notation  | x  | ||
Converts an IP address in dotted or colon notation to the corresponding binary address  | x  | x  | |
Converts a binary IP address to dotted or colon notation  | x  | x  | |
| Utility functions | |||
Release memory area for an addrinfo structure  | x  | x  | |
Release memory area for a hostent structure  | x  | x  | |
Convert 32-bit fields from host to network byte order  | x  | ||
Convert 16-bit fields from host to network byte order  | x  | x  | |
Convert 32-bit fields from network to host byte order  | x  | ||
Convert 16-bit fields from network to host byte order  | x  | x  | |
| Control functions | |||
Control sockets  | x  | x  | |
Control sockets  | x  | x  | |
Test macros for AF_INET6
The following test macros for the AF_INET6 address family are defined in <netinet/in.h>.
The parameters p, p1 and p2 are in6_addr structures.
Function  | Description  | 
IN6_IS_ADDR_UNSPECIFIED (p)  | IPv6 address = unspecified (0) ?  | 
IN6_IS_ADDR_LOOPBACK (p)  | IPv6 address = loopback ?  | 
IN6_IS_ADDR_LINKLOCAL (p)  | IPv6 address = linklocal ?  | 
IN6_IS_ADDR_SITELOCAL (p)  | IPv6 address = sitelocal ?  | 
IN6_IS_ADDR_V4MAPPED (p)  | IPv6 address = IPv4-mapped ?  | 
IN6_IS_ADDR_V4COMPAT (p)  | IPv6 address = IPv4-compatible ?  | 
IN6_ARE_ADDR_EQUAL (p1, p2)  | IPv6 address1 = IPv6 address2 ?  |