1 /* -*- c-basic-offset: 8; -*- */
6 * Everything here really belongs in <netdb.h>.
7 * These defines are separate for now, to avoid having to modify the
12 int ai_flags
; /* AI_PASSIVE, AI_CANONNAME */
13 int ai_family
; /* PF_xxx */
14 int ai_socktype
; /* SOCK_xxx */
15 int ai_protocol
; /* IPPROTO_xxx for IPv4 and IPv6 */
16 size_t ai_addrlen
; /* length of ai_addr */
17 char *ai_canonname
; /* canonical name for host */
18 struct sockaddr
*ai_addr
; /* binary address */
19 struct addrinfo
*ai_next
; /* next structure in linked list */
22 /* following for getaddrinfo() */
23 #define AI_PASSIVE 1 /* socket is intended for bind() + listen() */
24 #define AI_CANONNAME 2 /* return canonical name */
26 /* following for getnameinfo() */
27 #define NI_MAXHOST 1025 /* max hostname returned */
28 #define NI_MAXSERV 32 /* max service name returned */
30 #define NI_NOFQDN 1 /* do not return FQDN */
31 #define NI_NUMERICHOST 2 /* return numeric form of hostname */
32 #define NI_NAMEREQD 4 /* return error if hostname not found */
33 #define NI_NUMERICSERV 8 /* return numeric form of service name */
34 #define NI_DGRAM 16 /* datagram service for getservbyname() */
37 #define EAI_ADDRFAMILY 1 /* address family for host not supported */
38 #define EAI_AGAIN 2 /* temporary failure in name resolution */
39 #define EAI_BADFLAGS 3 /* invalid value for ai_flags */
40 #define EAI_FAIL 4 /* non-recoverable fail in name resolution */
41 #define EAI_FAMILY 5 /* ai_family not supported */
42 #define EAI_MEMORY 6 /* memory allocation failure */
43 #define EAI_NODATA 7 /* no address associated with host */
44 #define EAI_NONAME 8 /* host nor service provided, or not known */
45 #define EAI_SERVICE 9 /* service not supported for ai_socktype */
46 #define EAI_SOCKTYPE 10 /* ai_socktype not supported */
47 #define EAI_SYSTEM 11 /* system error returned in errno */