TCP/IP address information
Synopsis:
#include <netdb.h>
struct addrinfo {
    int ai_flags;
    int ai_family;
    int ai_socktype;
    int ai_protocol;
    size_t ai_addrlen;
    char * ai_canonname;
    struct sockaddr * ai_addr;
    struct addrinfo * ai_next
};
 
Description:
The addrinfo structure describes address information for use
with TCP/IP.
To get this information, call
getaddrinfo();
to free a linked list of these structures, call
freeaddrinfo().
The addrinfo structure includes these members:
- ai_flags
 
- Flags, including AI_PASSIVE, AI_CANONNAME, and AI_NUMERICHOST.
  For a complete list, see <netdb.h>.
 
- ai_family
 
- Protocol family, including PF_UNSPEC and PF_INET. 
  For a complete list, see <sys/socket.h>.
 
- ai_socktype
 
- Socket type, including SOCK_STREAM and SOCK_DGRAM. 
  For a complete list, see <sys/socket.h>.
 
- ai_protocol
 
- Protocol, including IPPROTO_TCP and IPPROTO_UDP. 
  For a complete list, see <netinet/in.h>.
 
- ai_addrlen
 
- The length of the ai_addr member.
 
- ai_canonname
 
- The canonical name for nodename.
 
- ai_addr
 
- Binary socket address.
 
- ai_next
 
- A pointer to the next addrinfo structure in the linked list.