1 #ifndef _FAKE_GETADDRINFO_H
2 #define _FAKE_GETADDRINFO_H
7 #include "fake-gai-errnos.h"
12 # define AI_CANONNAME 2
15 #ifndef NI_NUMERICHOST
16 # define NI_NUMERICHOST 2
17 # define NI_NAMEREQD 4
18 # define NI_NUMERICSERV 8
26 #define EAI_MEMORY -10
29 #ifndef HAVE_STRUCT_ADDRINFO
31 int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
32 int ai_family; /* PF_xxx */
33 int ai_socktype; /* SOCK_xxx */
34 int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
35 size_t ai_addrlen; /* length of ai_addr */
36 char *ai_canonname; /* canonical name for hostname */
37 struct sockaddr *ai_addr; /* binary address */
38 struct addrinfo *ai_next; /* next structure in linked list */
40 #endif /* !HAVE_STRUCT_ADDRINFO */
42 #ifndef HAVE_GETADDRINFO
43 int getaddrinfo(const char *hostname, const char *servname,
44 const struct addrinfo *hints, struct addrinfo **res);
45 #endif /* !HAVE_GETADDRINFO */
47 #ifndef HAVE_GAI_STRERROR
48 char *gai_strerror(int ecode);
49 #endif /* !HAVE_GAI_STRERROR */
51 #ifndef HAVE_FREEADDRINFO
52 void freeaddrinfo(struct addrinfo *ai);
53 #endif /* !HAVE_FREEADDRINFO */
55 #endif /* _FAKE_GETADDRINFO_H */