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