xref: /titanic_50/usr/src/cmd/ssh/include/fake-getaddrinfo.h (revision 45916cd2fec6e79bca5dee0421bd39e3c2910d1e)
1 /* $Id: fake-getaddrinfo.h,v 1.2 2001/02/09 01:55:36 djm Exp $ */
2 
3 #ifndef	_FAKE_GETADDRINFO_H
4 #define	_FAKE_GETADDRINFO_H
5 
6 #pragma ident	"%Z%%M%	%I%	%E% SMI"
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #include "config.h"
13 
14 #include "fake-gai-errnos.h"
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 HAVE_STRUCT_ADDRINFO
28 struct addrinfo {
29 	int	ai_flags;	/* AI_PASSIVE, AI_CANONNAME */
30 	int	ai_family;	/* PF_xxx */
31 	int	ai_socktype;	/* SOCK_xxx */
32 	int	ai_protocol;	/* 0 or IPPROTO_xxx for IPv4 and IPv6 */
33 	size_t	ai_addrlen;	/* length of ai_addr */
34 	char	*ai_canonname;	/* canonical name for hostname */
35 	struct sockaddr *ai_addr;	/* binary address */
36 	struct addrinfo *ai_next;	/* next structure in linked list */
37 };
38 #endif /* !HAVE_STRUCT_ADDRINFO */
39 
40 #ifndef HAVE_GETADDRINFO
41 int getaddrinfo(const char *hostname, const char *servname,
42                 const struct addrinfo *hints, struct addrinfo **res);
43 #endif /* !HAVE_GETADDRINFO */
44 
45 #ifndef HAVE_GAI_STRERROR
46 char *gai_strerror(int ecode);
47 #endif /* !HAVE_GAI_STRERROR */
48 
49 #ifndef HAVE_FREEADDRINFO
50 void freeaddrinfo(struct addrinfo *ai);
51 #endif /* !HAVE_FREEADDRINFO */
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 #endif /* _FAKE_GETADDRINFO_H */
58