TCP/IP Programming Manual
The data structures used by the support routines are built from the following data files:
• $SYSTEM.ZTCPIP.HOSTS
• $SYSTEM.ZTCPIP.IPNODES (NonStop TCP/IPv6 only)
• $SYSTEM.ZTCPIP.SERVICES
• $SYSTEM.ZTCPIP.NETWORKS
• $SYSTEM.ZTCPIP.PROTOCOL
The formats of these four data files are given in the TCP/IPv6 Configuration and Management
Manual.
In this section, the description of each structure includes the following information:
• Purpose of the structure
• Structure declaration (enclosed in a box), for both C and TAL
• Description of each field in the structure declaration
• Type of routine that uses the structure
The structure descriptions are arranged alphabetically.
addrinfo
The address info structure is used by the network database library. This structure is defined in the
netdb.h header file. Use this structure in applications that assume some of the functions of a
transport protocol such as TCP or UDP.
C Declaration
#include <netdb.h>
struct addrinfo {
int ai_flags; /*input flags */
int ai_family; /*protofamily for socket */
int ai_socktype; /* socket type */
int ai_protocol; /* protocol for socket */
size_t ai_addrlen; /* length of socket address /*
char *ai_canonname; /* ptr to canonical name for host*/
struct sockaddr *ai_addr; /* ptr to socket address structure */
struct addrinfo *ai_next; /* pointer to next in list */
};
TAL Declaration
?NOLIST, SOURCE SOCKDEFT
STRUCT addrinfo (*);
INT(32) ai_flags;
INT(32) ai_family;
INT(32) ai_socktype;
INT(32) ai_protocol;
INT(32) ai_addrlen;
STRING .EXT ai_canonname;
INT(32).EXT ai_addr (sockaddr);
INT(32).EXT ai_next(addrinfo);
ai_flags
contains a combination of one or more of the following flags:
Returns an address that can be passed to the bind function. If
hostname is NULL, the address is set to INADDR_ANY or
AI_PASSIVE
in6addr_any, as appropriate for the address family. If this flag is
64 Data Structures