Define logger(), cleans up source code and allows us to write log entries
[tinc] / lib / fake-getaddrinfo.h
1 /* $Id: fake-getaddrinfo.h,v 1.1.2.1 2002/07/12 11:45:21 guus Exp $ */
2
3 #ifndef _FAKE_GETADDRINFO_H
4 #define _FAKE_GETADDRINFO_H
5
6 #include "config.h"
7
8 #include <sys/types.h>
9 #include <sys/socket.h>
10 #include <netdb.h>
11
12 #include "fake-gai-errnos.h"
13
14 #ifndef AI_PASSIVE
15 # define AI_PASSIVE        1
16 # define AI_CANONNAME      2
17 #endif
18
19 #ifndef NI_NUMERICHOST
20 # define NI_NUMERICHOST    2
21 # define NI_NAMEREQD       4
22 # define NI_NUMERICSERV    8
23 #endif
24
25 #ifndef HAVE_STRUCT_ADDRINFO
26 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 */
35 };
36 #endif /* !HAVE_STRUCT_ADDRINFO */
37
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 */
42
43 #ifndef HAVE_GAI_STRERROR
44 char *gai_strerror(int ecode);
45 #endif /* !HAVE_GAI_STRERROR */
46
47 #ifndef HAVE_FREEADDRINFO
48 void freeaddrinfo(struct addrinfo *ai);
49 #endif /* !HAVE_FREEADDRINFO */
50
51 #endif /* _FAKE_GETADDRINFO_H */