1 /*	$NetBSD: stub.h,v 1.4 2014/12/10 04:37:56 christos Exp $	*/
2 
3 /* Id: stub.h,v 1.1 2003/06/04 00:27:13 marka Exp  */
4 
5 #ifndef STUB_H
6 #define STUB_H
7 
8 #ifdef HAVE_GETHOSTBYNAME
9 extern struct hostent *
10 idn_stub_gethostbyname(const char *name);
11 #endif
12 
13 #ifdef GETHOST_R_GLIBC_FLAVOR
14 #ifdef HAVE_GETHOSTBYNAME_R
15 extern int
16 idn_stub_gethostbyname_r(const char *name, struct hostent *result,
17 			 char *buffer, size_t buflen,
18 			 struct hostent **rp, int *errp);
19 #endif
20 #else /* GETHOST_R_GLIBC_FLAVOR */
21 #ifdef HAVE_GETHOSTBYNAME_R
22 extern struct hostent *
23 idn_stub_gethostbyname_r(const char *name, struct hostent *result,
24 			 char *buffer, int buflen, int *errp);
25 #endif
26 #endif /* GETHOST_R_GLIBC_FLAVOR */
27 
28 #ifdef HAVE_GETHOSTBYNAME2
29 extern struct hostent *
30 idn_stub_gethostbyname2(const char *name, int af);
31 #endif
32 
33 #ifdef GETHOST_R_GLIBC_FLAVOR
34 #ifdef HAVE_GETHOSTBYNAME2_R
35 extern int
36 idn_stub_gethostbyname2_r(const char *name, int af, struct hostent *result,
37 			  char *buffer, size_t buflen,
38 			  struct hostent **rp, int *errp);
39 #endif
40 #endif /* GETHOST_R_GLIBC_FLAVOR */
41 
42 #ifdef HAVE_GETHOSTBYADDR
43 extern struct hostent *
44 idn_stub_gethostbyaddr(GHBA_ADDR_T addr, GHBA_ADDRLEN_T len, int type);
45 #endif
46 
47 #ifdef GETHOST_R_GLIBC_FLAVOR
48 #ifdef HAVE_GETHOSTBYADDR_R
49 extern int
50 idn_stub_gethostbyaddr_r(GHBA_ADDR_T addr, GHBA_ADDRLEN_T len, int type,
51 			 struct hostent *result, char *buffer,
52 			 size_t buflen, struct hostent **rp, int *errp);
53 #endif
54 #else /* GETHOST_R_GLIBC_FLAVOR */
55 #ifdef HAVE_GETHOSTBYADDR_R
56 extern struct hostent *
57 idn_stub_gethostbyaddr_r(GHBA_ADDR_T addr, GHBA_ADDRLEN_T len, int type,
58 			 struct hostent *result, char *buffer,
59 			 int buflen, int *errp);
60 #endif
61 #endif /* GETHOST_R_GLIBC_FLAVOR */
62 
63 #ifdef HAVE_GETIPNODEBYNAME
64 extern struct hostent *
65 idn_stub_getipnodebyname(const char *name, int af, int flags, int *errp);
66 #endif
67 
68 #ifdef HAVE_GETIPNODEBYADDR
69 extern struct hostent *
70 idn_stub_getipnodebyaddr(const void *src, size_t len, int af, int *errp);
71 #endif
72 
73 #ifdef HAVE_FREEHOSTENT
74 extern void
75 idn_stub_freehostent(struct hostent *hp);
76 #endif
77 
78 #ifdef HAVE_GETADDRINFO
79 extern int
80 idn_stub_getaddrinfo(const char *nodename, const char *servname,
81 		     const struct addrinfo *hints, struct addrinfo **res);
82 #endif
83 
84 #ifdef HAVE_FREEADDRINFO
85 extern void
86 idn_stub_freeaddrinfo(struct addrinfo *aip);
87 #endif
88 
89 #ifdef HAVE_GETNAMEINFO
90 extern int
91 idn_stub_getnameinfo(const struct sockaddr *sa, GNI_SALEN_T salen,
92 		     char *host, GNI_HOSTLEN_T hostlen, char *serv,
93 		     GNI_SERVLEN_T servlen, GNI_FLAGS_T flags);
94 #endif
95 
96 #endif /* STUB_H */
97