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