1 /* $Id: fake-getaddrinfo.h,v 1.1.2.3 2003/07/17 15:06:25 guus Exp $ */
3 #ifndef _FAKE_GETADDRINFO_H
4 #define _FAKE_GETADDRINFO_H
6 #include "fake-gai-errnos.h"
10 # define AI_CANONNAME 2
13 #ifndef NI_NUMERICHOST
14 # define NI_NUMERICHOST 2
15 # define NI_NAMEREQD 4
16 # define NI_NUMERICSERV 8
19 #ifndef AI_NUMERICHOST
20 #define AI_NUMERICHOST 4
23 #ifndef HAVE_STRUCT_ADDRINFO
25 int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
26 int ai_family; /* PF_xxx */
27 int ai_socktype; /* SOCK_xxx */
28 int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
29 size_t ai_addrlen; /* length of ai_addr */
30 char *ai_canonname; /* canonical name for hostname */
31 struct sockaddr *ai_addr; /* binary address */
32 struct addrinfo *ai_next; /* next structure in linked list */
34 #endif /* !HAVE_STRUCT_ADDRINFO */
36 #ifndef HAVE_GETADDRINFO
37 int getaddrinfo(const char *hostname, const char *servname,
38 const struct addrinfo *hints, struct addrinfo **res);
39 #endif /* !HAVE_GETADDRINFO */
41 #ifndef HAVE_GAI_STRERROR
42 char *gai_strerror(int ecode);
43 #endif /* !HAVE_GAI_STRERROR */
45 #ifndef HAVE_FREEADDRINFO
46 void freeaddrinfo(struct addrinfo *ai);
47 #endif /* !HAVE_FREEADDRINFO */
49 #endif /* _FAKE_GETADDRINFO_H */