1 /* $Id: fake-getaddrinfo.h,v 1.1.2.1 2002/07/12 11:45:21 guus Exp $ */
3 #ifndef _FAKE_GETADDRINFO_H
4 #define _FAKE_GETADDRINFO_H
9 #include <sys/socket.h>
12 #include "fake-gai-errnos.h"
16 # define AI_CANONNAME 2
19 #ifndef NI_NUMERICHOST
20 # define NI_NUMERICHOST 2
21 # define NI_NAMEREQD 4
22 # define NI_NUMERICSERV 8
25 #ifndef HAVE_STRUCT_ADDRINFO
27 int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
28 int ai_family; /* PF_xxx */
29 int ai_socktype; /* SOCK_xxx */
30 int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
31 size_t ai_addrlen; /* length of ai_addr */
32 char *ai_canonname; /* canonical name for hostname */
33 struct sockaddr *ai_addr; /* binary address */
34 struct addrinfo *ai_next; /* next structure in linked list */
36 #endif /* !HAVE_STRUCT_ADDRINFO */
38 #ifndef HAVE_GETADDRINFO
39 int getaddrinfo(const char *hostname, const char *servname,
40 const struct addrinfo *hints, struct addrinfo **res);
41 #endif /* !HAVE_GETADDRINFO */
43 #ifndef HAVE_GAI_STRERROR
44 char *gai_strerror(int ecode);
45 #endif /* !HAVE_GAI_STRERROR */
47 #ifndef HAVE_FREEADDRINFO
48 void freeaddrinfo(struct addrinfo *ai);
49 #endif /* !HAVE_FREEADDRINFO */
51 #endif /* _FAKE_GETADDRINFO_H */