1 #ifndef TINC_FAKE_GETADDRINFO_H
2 #define TINC_FAKE_GETADDRINFO_H
18 # define AI_CANONNAME 2
21 #ifndef NI_NUMERICHOST
22 # define NI_NUMERICHOST 2
23 # define NI_NAMEREQD 4
24 # define NI_NUMERICSERV 8
27 #ifndef AI_NUMERICHOST
28 #define AI_NUMERICHOST 4
31 #ifndef HAVE_STRUCT_ADDRINFO
33 int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
34 int ai_family; /* PF_xxx */
35 int ai_socktype; /* SOCK_xxx */
36 int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
37 size_t ai_addrlen; /* length of ai_addr */
38 char *ai_canonname; /* canonical name for hostname */
39 struct sockaddr *ai_addr; /* binary address */
40 struct addrinfo *ai_next; /* next structure in linked list */
42 #endif /* !HAVE_STRUCT_ADDRINFO */
44 #if !HAVE_DECL_GETADDRINFO
45 int getaddrinfo(const char *hostname, const char *servname,
46 const struct addrinfo *hints, struct addrinfo **res);
47 #endif /* !HAVE_GETADDRINFO */
49 #if !HAVE_DECL_GAI_STRERROR
50 char *gai_strerror(int ecode);
51 #endif /* !HAVE_GAI_STRERROR */
53 #if !HAVE_DECL_FREEADDRINFO
54 void freeaddrinfo(struct addrinfo *ai);
55 #endif /* !HAVE_FREEADDRINFO */