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