Require OpenSSL 1.1.0 or later.
[tinc] / src / fake-getaddrinfo.h
1 #ifndef TINC_FAKE_GETADDRINFO_H
2 #define TINC_FAKE_GETADDRINFO_H
3
4 #ifndef EAI_NODATA
5 #define EAI_NODATA      1
6 #endif
7
8 #ifndef EAI_MEMORY
9 #define EAI_MEMORY      2
10 #endif
11
12 #ifndef EAI_FAMILY
13 #define EAI_FAMILY      3
14 #endif
15
16 #ifndef AI_PASSIVE
17 # define AI_PASSIVE        1
18 # define AI_CANONNAME      2
19 #endif
20
21 #ifndef NI_NUMERICHOST
22 # define NI_NUMERICHOST    2
23 # define NI_NAMEREQD       4
24 # define NI_NUMERICSERV    8
25 #endif
26
27 #ifndef AI_NUMERICHOST
28 #define AI_NUMERICHOST 4
29 #endif
30
31 #ifndef HAVE_STRUCT_ADDRINFO
32 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 */
41 };
42 #endif /* !HAVE_STRUCT_ADDRINFO */
43
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 */
48
49 #if !HAVE_DECL_GAI_STRERROR
50 char *gai_strerror(int ecode);
51 #endif /* !HAVE_GAI_STRERROR */
52
53 #if !HAVE_DECL_FREEADDRINFO
54 void freeaddrinfo(struct addrinfo *ai);
55 #endif /* !HAVE_FREEADDRINFO */
56
57 #endif