1 /* $Id: fake-getaddrinfo.h,v 1.1.2.2 2003/07/06 23:16:27 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 AI_NUMERICHOST
26 #define AI_NUMERICHOST 4
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 */