1 #ifndef MESHLINK_FAKE_GETADDRINFO_H
2 #define MESHLINK_FAKE_GETADDRINFO_H
4 #include "fake-gai-errnos.h"
8 # define AI_CANONNAME 2
11 #ifndef NI_NUMERICHOST
12 # define NI_NUMERICHOST 2
13 # define NI_NAMEREQD 4
14 # define NI_NUMERICSERV 8
17 #ifndef AI_NUMERICHOST
18 #define AI_NUMERICHOST 4
21 #ifndef HAVE_STRUCT_ADDRINFO
23 int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
24 int ai_family; /* PF_xxx */
25 int ai_socktype; /* SOCK_xxx */
26 int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
27 size_t ai_addrlen; /* length of ai_addr */
28 char *ai_canonname; /* canonical name for hostname */
29 struct sockaddr *ai_addr; /* binary address */
30 struct addrinfo *ai_next; /* next structure in linked list */
32 #endif /* !HAVE_STRUCT_ADDRINFO */
34 #if !HAVE_DECL_GETADDRINFO
35 int getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res) __attribute__((__warn_unused_result__));
36 #endif /* !HAVE_GETADDRINFO */
38 #if !HAVE_DECL_GAI_STRERROR
39 char *gai_strerror(int ecode) __attribute__((__warn_unused_result__));
40 #endif /* !HAVE_GAI_STRERROR */
42 #if !HAVE_DECL_FREEADDRINFO
43 void freeaddrinfo(struct addrinfo *ai);
44 #endif /* !HAVE_FREEADDRINFO */