TCP/IP Programming Manual
not set, the returned address can be passed to the connect function. If
hostname is NULL, the address is set to the loopback address.
Requests the return of the canonical name for the host if the hostname
is not NULL.
AI_CANONNAME
Specifies that the hostname value is a numeric address string. If this
flag is set and hostname is not a numeric address string, the returned
AI_NUMERICHOST
value is set to EAI_NONAME. Use this flag to prevent calling a name
resolution service like DNS.
Specifies that the service value is a non NULL numeric port string. If
this flag is set and service is not a numeric port string, the returned
AI_NUMERICSERV
value is set to EAI_NONAME. Use this flag to prevent calling a name
resolution service like DNS.
Requests the return of all IPv4-mapped IPv6 addresses when the address
family is AF_INET6 and no matching IPv6 addresses exist. This flag is
ignored if the address family is AF_INET.
AI_V4MAPPED
Requests the return of all matching IPv4 and IPv6 records. This flag is
ignored unless AI_V4MAPPED is also set.
AI_ALL
Requests the return of only IPv6 records if a host has at least one IPv6
source address configured, or only IPv4 records if a host has at least
one IPv4 source address configured.
AI_ADDRCONFIG
If AI_ADDRCONFIG | AI_V4MAPPED is specified, the A records are
returned as IPv4-mapped IPv6 addresses.
AI_DEFAULT (AI_V4MAPPED |
AI_ADDRCONFIG)
If no error is returned, points to a list of addrinfo structs. For each addrinfo struct, ai_family,
ai_socktype, and ai_protocol may be used as arguments to the socket function.
ai_family
indicates a literal of the form PF_xxx, where xxx indicates the address family as a protocol
family name. This member can be used with the socket function.
ai_socktype
indicates a literal of the form SOCK_xxx, where xxx indicates the socket type.
ai_protocol
indicates either 0 (zero) or a literal of the form IPPROTO_xxx, where xxx indicates the
protocol type.
ai_addrlen
is the length of the socket address.
ai_canonname
is a pointer to the canonical name for the host.
ai_addr
is a pointer to the socket address structure that can be used with any socket function that
requires a socket address. The length of a specific ai_addr value is described by the
member named ai_addrlen.
ai_next
is a pointer to the next structure in the linked list.
arpreq
The ARP request structure is used by Address Resolution Protocol (ARP) I/O control operations.
This structure is defined in the ifarp.h header file. Use this structure in applications that assume
some of the functions of a transport protocol such as TCP or UDP, or bootp.
C Declaration
#include <ifarp.h>
struct arpreq {
Data Structures 65