]> git.ipfire.org Git - thirdparty/glibc.git/blame - include/netdb.h
First steps to get conformtest fully working
[thirdparty/glibc.git] / include / netdb.h
CommitLineData
5c2a0669 1#ifndef _NETDB_H
3cf595e5 2#include <resolv/netdb.h>
5c2a0669 3
31341567 4#ifndef _ISOMAC
c2afe833 5/* Macros for accessing h_errno from inside libc. */
d063d164 6# undef h_errno
c2afe833
RM
7# ifdef _LIBC_REENTRANT
8# include <tls.h>
d063d164
UD
9# ifndef NOT_IN_libc
10# define h_errno __libc_h_errno
c2afe833 11# else
d063d164 12# define h_errno h_errno /* For #ifndef h_errno tests. */
c2afe833 13# endif
d063d164 14extern __thread int h_errno attribute_tls_model_ie;
c2afe833 15# else
ffa8d2a0 16extern int h_errno;
c2afe833 17# endif /* _LIBC_REENTRANT */
d063d164 18# define __set_h_errno(x) (h_errno = (x))
c2afe833 19
e2ec9b4d 20libc_hidden_proto (hstrerror)
a585ba22
RM
21libc_hidden_proto (innetgr)
22libc_hidden_proto (rcmd_af)
23libc_hidden_proto (rexec_af)
24libc_hidden_proto (rresvport_af)
25libc_hidden_proto (ruserok_af)
26
9b0b40d3
RM
27libc_hidden_proto (getaddrinfo)
28libc_hidden_proto (getnameinfo)
29libc_hidden_proto (freeaddrinfo)
7a8bdff0 30libc_hidden_proto (gai_strerror)
a4baf360 31libc_hidden_proto (__h_errno_location)
9b0b40d3 32
5c2a0669 33/* Document internal interfaces. */
fe559c5e
UD
34extern int __gethostent_r (struct hostent *__restrict __result_buf,
35 char *__restrict __buf, size_t __buflen,
36 struct hostent **__restrict __result,
dff07c4b 37 int *__restrict __h_errnop) attribute_hidden;
c3301189
UD
38extern int __old_gethostent_r (struct hostent *__restrict __result_buf,
39 char *__restrict __buf, size_t __buflen,
40 struct hostent **__restrict __result,
41 int *__restrict __h_errnop);
5c2a0669 42
a784e502 43extern int __gethostbyaddr_r (const void *__restrict __addr,
9d4d69b8 44 socklen_t __len, int __type,
fe559c5e
UD
45 struct hostent *__restrict __result_buf,
46 char *__restrict __buf, size_t __buflen,
47 struct hostent **__restrict __result,
c19559b0 48 int *__restrict __h_errnop);
a784e502 49extern int __old_gethostbyaddr_r (const void *__restrict __addr,
c3301189
UD
50 socklen_t __len, int __type,
51 struct hostent *__restrict __result_buf,
52 char *__restrict __buf, size_t __buflen,
53 struct hostent **__restrict __result,
54 int *__restrict __h_errnop);
5c2a0669 55
a784e502 56extern int __gethostbyaddr2_r (const void *__restrict __addr,
53bab260
UD
57 socklen_t __len, int __type,
58 struct hostent *__restrict __result_buf,
59 char *__restrict __buf, size_t __buflen,
60 struct hostent **__restrict __result,
61 int *__restrict __h_errnop,
62 int32_t *ttlp);
63
a784e502 64extern int __gethostbyname_r (const char *__restrict __name,
fe559c5e
UD
65 struct hostent *__restrict __result_buf,
66 char *__restrict __buf, size_t __buflen,
67 struct hostent **__restrict __result,
c19559b0 68 int *__restrict __h_errnop);
a784e502 69extern int __old_gethostbyname_r (const char *__restrict __name,
c3301189
UD
70 struct hostent *__restrict __result_buf,
71 char *__restrict __buf, size_t __buflen,
72 struct hostent **__restrict __result,
73 int *__restrict __h_errnop);
5c2a0669 74
a784e502 75extern int __gethostbyname2_r (const char *__restrict __name, int __af,
fe559c5e 76 struct hostent *__restrict __result_buf,
5c2a0669 77 char *__restrict __buf, size_t __buflen,
fe559c5e 78 struct hostent **__restrict __result,
c19559b0 79 int *__restrict __h_errnop);
a784e502 80extern int __old_gethostbyname2_r (const char *__restrict __name, int __af,
c3301189
UD
81 struct hostent *__restrict __result_buf,
82 char *__restrict __buf, size_t __buflen,
83 struct hostent **__restrict __result,
84 int *__restrict __h_errnop);
5c2a0669 85
a784e502 86extern int __gethostbyname3_r (const char *__restrict __name, int __af,
53bab260
UD
87 struct hostent *__restrict __result_buf,
88 char *__restrict __buf, size_t __buflen,
89 struct hostent **__restrict __result,
90 int *__restrict __h_errnop,
91 int32_t *ttlp, char **canonp);
92
fe559c5e
UD
93extern int __getnetent_r (struct netent *__restrict __result_buf,
94 char *__restrict __buf, size_t __buflen,
95 struct netent **__restrict __result,
dff07c4b 96 int *__restrict __h_errnop) attribute_hidden;
c3301189
UD
97extern int __old_getnetent_r (struct netent *__restrict __result_buf,
98 char *__restrict __buf, size_t __buflen,
99 struct netent **__restrict __result,
100 int *__restrict __h_errnop);
5c2a0669 101
9b48fa9b 102extern int __getnetbyaddr_r (uint32_t __net, int __type,
fe559c5e
UD
103 struct netent *__restrict __result_buf,
104 char *__restrict __buf, size_t __buflen,
105 struct netent **__restrict __result,
c19559b0 106 int *__restrict __h_errnop);
c3301189
UD
107extern int __old_getnetbyaddr_r (uint32_t __net, int __type,
108 struct netent *__restrict __result_buf,
109 char *__restrict __buf, size_t __buflen,
110 struct netent **__restrict __result,
111 int *__restrict __h_errnop);
5c2a0669 112
a784e502 113extern int __getnetbyname_r (const char *__restrict __name,
fe559c5e
UD
114 struct netent *__restrict __result_buf,
115 char *__restrict __buf, size_t __buflen,
116 struct netent **__restrict __result,
c19559b0 117 int *__restrict __h_errnop);
a784e502 118extern int __old_getnetbyname_r (const char *__restrict __name,
c3301189
UD
119 struct netent *__restrict __result_buf,
120 char *__restrict __buf, size_t __buflen,
121 struct netent **__restrict __result,
122 int *__restrict __h_errnop);
5c2a0669 123
fe559c5e
UD
124extern int __getservent_r (struct servent *__restrict __result_buf,
125 char *__restrict __buf, size_t __buflen,
dff07c4b
UD
126 struct servent **__restrict __result)
127 attribute_hidden;
c3301189
UD
128extern int __old_getservent_r (struct servent *__restrict __result_buf,
129 char *__restrict __buf, size_t __buflen,
130 struct servent **__restrict __result);
5c2a0669 131
a784e502
UD
132extern int __getservbyname_r (const char *__restrict __name,
133 const char *__restrict __proto,
fe559c5e
UD
134 struct servent *__restrict __result_buf,
135 char *__restrict __buf, size_t __buflen,
c19559b0 136 struct servent **__restrict __result);
a784e502
UD
137extern int __old_getservbyname_r (const char *__restrict __name,
138 const char *__restrict __proto,
c3301189
UD
139 struct servent *__restrict __result_buf,
140 char *__restrict __buf, size_t __buflen,
141 struct servent **__restrict __result);
5c2a0669 142
fe559c5e 143extern int __getservbyport_r (int __port,
a784e502 144 const char *__restrict __proto,
fe559c5e
UD
145 struct servent *__restrict __result_buf,
146 char *__restrict __buf, size_t __buflen,
c19559b0 147 struct servent **__restrict __result);
c3301189 148extern int __old_getservbyport_r (int __port,
a784e502 149 const char *__restrict __proto,
c3301189
UD
150 struct servent *__restrict __result_buf,
151 char *__restrict __buf, size_t __buflen,
152 struct servent **__restrict __result);
5c2a0669 153
fe559c5e
UD
154extern int __getprotoent_r (struct protoent *__restrict __result_buf,
155 char *__restrict __buf, size_t __buflen,
dff07c4b
UD
156 struct protoent **__restrict __result)
157 attribute_hidden;
c3301189
UD
158extern int __old_getprotoent_r (struct protoent *__restrict __result_buf,
159 char *__restrict __buf, size_t __buflen,
160 struct protoent **__restrict __result);
5c2a0669 161
a784e502 162extern int __getprotobyname_r (const char *__restrict __name,
fe559c5e
UD
163 struct protoent *__restrict __result_buf,
164 char *__restrict __buf, size_t __buflen,
c19559b0 165 struct protoent **__restrict __result);
a784e502 166extern int __old_getprotobyname_r (const char *__restrict __name,
c3301189
UD
167 struct protoent *__restrict __result_buf,
168 char *__restrict __buf, size_t __buflen,
169 struct protoent **__restrict __result);
fe559c5e
UD
170
171extern int __getprotobynumber_r (int __proto,
172 struct protoent *__restrict __res_buf,
173 char *__restrict __buf, size_t __buflen,
c19559b0 174 struct protoent **__restrict __result);
c3301189
UD
175extern int __old_getprotobynumber_r (int __proto,
176 struct protoent *__restrict __res_buf,
177 char *__restrict __buf, size_t __buflen,
178 struct protoent **__restrict __result);
5c2a0669 179
fe559c5e
UD
180extern int __getnetgrent_r (char **__restrict __hostp,
181 char **__restrict __userp,
182 char **__restrict __domainp,
c19559b0 183 char *__restrict __buffer, size_t __buflen);
3846463e
UD
184
185extern int ruserpass (const char *host, const char **aname,
186 const char **apass);
e2ec9b4d 187libc_hidden_proto (ruserpass)
6eace24c
UD
188
189
925c3c5c
UD
190/* The following definition has been removed from the public header
191 since we don't want people to use them. */
6eace24c 192
6eace24c
UD
193#define AI_DEFAULT (AI_V4MAPPED | AI_ADDRCONFIG)
194
51eecc4a
AJ
195#include <inet/netgroup.h>
196
784d802e
AJ
197struct parser_data;
198extern int _nss_files_parse_protoent (char *line, struct protoent *result,
199 struct parser_data *data,
200 size_t datalen, int *errnop);
201extern int _nss_files_parse_servent (char *line, struct servent *result,
202 struct parser_data *data,
203 size_t datalen, int *errnop);
204extern int _nss_files_parse_netent (char *line, struct netent *result,
205 struct parser_data *data,
206 size_t datalen, int *errnop);
207extern enum nss_status _nss_netgroup_parseline (char **cursor,
208 struct __netgrent *result,
209 char *buffer, size_t buflen,
210 int *errnop);
8cf26632
UD
211libnss_files_hidden_proto (_nss_files_parse_protoent)
212libnss_files_hidden_proto (_nss_files_parse_servent)
213libnss_files_hidden_proto (_nss_files_parse_netent)
214libnss_files_hidden_proto (_nss_netgroup_parseline)
784d802e 215
23bab906
AJ
216#define DECLARE_NSS_PROTOTYPES(service) \
217extern enum nss_status _nss_ ## service ## _setprotoent (int); \
218extern enum nss_status _nss_ ## service ## _endprotoent (void); \
219extern enum nss_status _nss_ ## service ## _getprotoent_r \
220 (struct protoent *proto, char *buffer, size_t buflen, \
221 int *errnop); \
222extern enum nss_status _nss_ ## service ## _getprotobyname_r \
223 (const char *name, struct protoent *proto, \
224 char *buffer, size_t buflen, int *errnop); \
225extern enum nss_status _nss_ ## service ## _getprotobynumber_r \
226 (int number, struct protoent *proto, \
227 char *buffer, size_t buflen, int *errnop); \
228extern enum nss_status _nss_ ## service ## _sethostent (int); \
229extern enum nss_status _nss_ ## service ## _endhostent (void); \
230extern enum nss_status _nss_ ## service ## _gethostent_r \
231 (struct hostent *host, char *buffer, size_t buflen, \
232 int *errnop, int *h_errnop); \
233extern enum nss_status _nss_ ## service ## _gethostbyname2_r \
234 (const char *name, int af, struct hostent *host, \
235 char *buffer, size_t buflen, int *errnop, \
236 int *h_errnop); \
237extern enum nss_status _nss_ ## service ## _gethostbyname_r \
238 (const char *name, struct hostent *host, char *buffer, \
239 size_t buflen, int *errnop, int *h_errnop); \
240extern enum nss_status _nss_ ## service ## _gethostbyaddr_r \
241 (const void *addr, socklen_t addrlen, int af, \
242 struct hostent *host, char *buffer, size_t buflen, \
243 int *errnop, int *h_errnop); \
244extern enum nss_status _nss_ ## service ## _setservent (int); \
245extern enum nss_status _nss_ ## service ## _endservent (void); \
246extern enum nss_status _nss_ ## service ## _getservent_r \
247 (struct servent *serv, char *buffer, size_t buflen, \
248 int *errnop); \
249extern enum nss_status _nss_ ## service ## _getservbyname_r \
250 (const char *name, const char *protocol, \
251 struct servent *serv, char *buffer, size_t buflen, \
252 int *errnop); \
253extern enum nss_status _nss_ ## service ## _getservbyport_r \
254 (int port, const char *protocol, struct servent *serv, \
255 char *buffer, size_t buflen, int *errnop); \
256extern enum nss_status _nss_ ## service ## _setnetgrent \
257 (const char *group, struct __netgrent *result); \
258extern enum nss_status _nss_ ## service ## _endnetgrent \
259 (struct __netgrent *result); \
260extern enum nss_status _nss_ ## service ## _getnetgrent_r \
261 (struct __netgrent *result, char *buffer, \
262 size_t buflen, int *errnop); \
263extern enum nss_status _nss_ ## service ## _setnetent (int stayopen); \
264extern enum nss_status _nss_ ## service ## _endnetent (void); \
265extern enum nss_status _nss_ ## service ## _getnetent_r \
266 (struct netent *net, char *buffer, size_t buflen, \
267 int *errnop, int *herrnop); \
268extern enum nss_status _nss_ ## service ## _getnetbyname_r \
269 (const char *name, struct netent *net, char *buffer, \
270 size_t buflen, int *errnop, int *herrnop); \
271extern enum nss_status _nss_ ## service ## _getnetbyaddr_r \
272 (uint32_t addr, int type, struct netent *net, \
273 char *buffer, size_t buflen, int *errnop, \
51eecc4a
AJ
274 int *herrnop);
275
276DECLARE_NSS_PROTOTYPES (compat)
277DECLARE_NSS_PROTOTYPES (dns)
278DECLARE_NSS_PROTOTYPES (files)
279DECLARE_NSS_PROTOTYPES (hesiod)
280DECLARE_NSS_PROTOTYPES (nis)
281DECLARE_NSS_PROTOTYPES (nisplus)
282
283#undef DECLARE_NSS_PROTOTYPES
31341567 284#endif
51eecc4a 285
5c2a0669 286#endif /* !_NETDB_H */