diff options
Diffstat (limited to 'fake-getaddrinfo.h')
-rw-r--r-- | fake-getaddrinfo.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/fake-getaddrinfo.h b/fake-getaddrinfo.h new file mode 100644 index 000000000..de1748f6f --- /dev/null +++ b/fake-getaddrinfo.h | |||
@@ -0,0 +1,44 @@ | |||
1 | #ifndef _FAKE_GETADDRINFO_H | ||
2 | #define _FAKE_GETADDRINFO_H | ||
3 | |||
4 | #include "config.h" | ||
5 | |||
6 | #include "fake-gai-errnos.h" | ||
7 | |||
8 | #ifndef AI_PASSIVE | ||
9 | # define AI_PASSIVE 1 | ||
10 | #endif | ||
11 | |||
12 | #ifndef NI_NUMERICHOST | ||
13 | # define NI_NUMERICHOST 2 | ||
14 | # define NI_NAMEREQD 4 | ||
15 | # define NI_NUMERICSERV 8 | ||
16 | #endif | ||
17 | |||
18 | #ifndef HAVE_STRUCT_ADDRINFO | ||
19 | struct addrinfo { | ||
20 | int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ | ||
21 | int ai_family; /* PF_xxx */ | ||
22 | int ai_socktype; /* SOCK_xxx */ | ||
23 | int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ | ||
24 | size_t ai_addrlen; /* length of ai_addr */ | ||
25 | char *ai_canonname; /* canonical name for hostname */ | ||
26 | struct sockaddr *ai_addr; /* binary address */ | ||
27 | struct addrinfo *ai_next; /* next structure in linked list */ | ||
28 | } | ||
29 | #endif /* !HAVE_STRUCT_ADDRINFO */ | ||
30 | |||
31 | #ifndef HAVE_GETADDRINFO | ||
32 | int getaddrinfo(const char *hostname, const char *servname, | ||
33 | const struct addrinfo *hints, struct addrinfo **res); | ||
34 | #endif /* !HAVE_GETADDRINFO */ | ||
35 | |||
36 | #ifndef HAVE_GAI_STRERROR | ||
37 | char *gai_strerror(int ecode); | ||
38 | #endif /* !HAVE_GAI_STRERROR */ | ||
39 | |||
40 | #ifndef HAVE_FREEADDRINFO | ||
41 | void freeaddrinfo(struct addrinfo *ai); | ||
42 | #endif /* !HAVE_FREEADDRINFO */ | ||
43 | |||
44 | #endif /* _FAKE_GETADDRINFO_H */ | ||