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