netdb.h revision 1.60.6.2 1 1.60.6.2 christos /* $NetBSD: netdb.h,v 1.60.6.2 2008/06/21 20:12:50 christos Exp $ */
2 1.60.6.2 christos
3 1.60.6.2 christos /*
4 1.60.6.2 christos * ++Copyright++ 1980, 1983, 1988, 1993
5 1.60.6.2 christos * -
6 1.60.6.2 christos * Copyright (c) 1980, 1983, 1988, 1993
7 1.60.6.2 christos * The Regents of the University of California. All rights reserved.
8 1.60.6.2 christos *
9 1.60.6.2 christos * Redistribution and use in source and binary forms, with or without
10 1.60.6.2 christos * modification, are permitted provided that the following conditions
11 1.60.6.2 christos * are met:
12 1.60.6.2 christos * 1. Redistributions of source code must retain the above copyright
13 1.60.6.2 christos * notice, this list of conditions and the following disclaimer.
14 1.60.6.2 christos * 2. Redistributions in binary form must reproduce the above copyright
15 1.60.6.2 christos * notice, this list of conditions and the following disclaimer in the
16 1.60.6.2 christos * documentation and/or other materials provided with the distribution.
17 1.60.6.2 christos * 3. Neither the name of the University nor the names of its contributors
18 1.60.6.2 christos * may be used to endorse or promote products derived from this software
19 1.60.6.2 christos * without specific prior written permission.
20 1.60.6.2 christos *
21 1.60.6.2 christos * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 1.60.6.2 christos * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 1.60.6.2 christos * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 1.60.6.2 christos * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 1.60.6.2 christos * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 1.60.6.2 christos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 1.60.6.2 christos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 1.60.6.2 christos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 1.60.6.2 christos * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 1.60.6.2 christos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 1.60.6.2 christos * SUCH DAMAGE.
32 1.60.6.2 christos * -
33 1.60.6.2 christos * Portions Copyright (c) 1993 by Digital Equipment Corporation.
34 1.60.6.2 christos *
35 1.60.6.2 christos * Permission to use, copy, modify, and distribute this software for any
36 1.60.6.2 christos * purpose with or without fee is hereby granted, provided that the above
37 1.60.6.2 christos * copyright notice and this permission notice appear in all copies, and that
38 1.60.6.2 christos * the name of Digital Equipment Corporation not be used in advertising or
39 1.60.6.2 christos * publicity pertaining to distribution of the document or software without
40 1.60.6.2 christos * specific, written prior permission.
41 1.60.6.2 christos *
42 1.60.6.2 christos * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
43 1.60.6.2 christos * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
44 1.60.6.2 christos * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
45 1.60.6.2 christos * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
46 1.60.6.2 christos * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
47 1.60.6.2 christos * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
48 1.60.6.2 christos * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
49 1.60.6.2 christos * SOFTWARE.
50 1.60.6.2 christos * -
51 1.60.6.2 christos * Portions Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
52 1.60.6.2 christos * All rights reserved.
53 1.60.6.2 christos *
54 1.60.6.2 christos * Redistribution and use in source and binary forms, with or without
55 1.60.6.2 christos * modification, are permitted provided that the following conditions
56 1.60.6.2 christos * are met:
57 1.60.6.2 christos * 1. Redistributions of source code must retain the above copyright
58 1.60.6.2 christos * notice, this list of conditions and the following disclaimer.
59 1.60.6.2 christos * 2. Redistributions in binary form must reproduce the above copyright
60 1.60.6.2 christos * notice, this list of conditions and the following disclaimer in the
61 1.60.6.2 christos * documentation and/or other materials provided with the distribution.
62 1.60.6.2 christos * 3. All advertising materials mentioning features or use of this software
63 1.60.6.2 christos * must display the following acknowledgement:
64 1.60.6.2 christos * This product includes software developed by WIDE Project and
65 1.60.6.2 christos * its contributors.
66 1.60.6.2 christos * 4. Neither the name of the project nor the names of its contributors
67 1.60.6.2 christos * may be used to endorse or promote products derived from this software
68 1.60.6.2 christos * without specific prior written permission.
69 1.60.6.2 christos *
70 1.60.6.2 christos * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
71 1.60.6.2 christos * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
72 1.60.6.2 christos * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
73 1.60.6.2 christos * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
74 1.60.6.2 christos * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
75 1.60.6.2 christos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
76 1.60.6.2 christos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
77 1.60.6.2 christos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
78 1.60.6.2 christos * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
79 1.60.6.2 christos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
80 1.60.6.2 christos * SUCH DAMAGE.
81 1.60.6.2 christos * -
82 1.60.6.2 christos * --Copyright--
83 1.60.6.2 christos */
84 1.60.6.2 christos
85 1.60.6.2 christos /*
86 1.60.6.2 christos * @(#)netdb.h 8.1 (Berkeley) 6/2/93
87 1.60.6.2 christos * Id: netdb.h,v 1.21.288.1 2008/02/28 05:46:12 marka Exp
88 1.60.6.2 christos */
89 1.60.6.2 christos
90 1.60.6.2 christos #ifndef _NETDB_H_
91 1.60.6.2 christos #define _NETDB_H_
92 1.60.6.2 christos
93 1.60.6.2 christos #include <machine/ansi.h>
94 1.60.6.2 christos #include <machine/endian_machdep.h>
95 1.60.6.2 christos #include <sys/ansi.h>
96 1.60.6.2 christos #include <sys/cdefs.h>
97 1.60.6.2 christos #include <sys/featuretest.h>
98 1.60.6.2 christos #include <inttypes.h>
99 1.60.6.2 christos /*
100 1.60.6.2 christos * Data types
101 1.60.6.2 christos */
102 1.60.6.2 christos #ifndef socklen_t
103 1.60.6.2 christos typedef __socklen_t socklen_t;
104 1.60.6.2 christos #define socklen_t __socklen_t
105 1.60.6.2 christos #endif
106 1.60.6.2 christos
107 1.60.6.2 christos #ifdef _BSD_SIZE_T_
108 1.60.6.2 christos typedef _BSD_SIZE_T_ size_t;
109 1.60.6.2 christos #undef _BSD_SIZE_T_
110 1.60.6.2 christos #endif
111 1.60.6.2 christos
112 1.60.6.2 christos #if defined(_NETBSD_SOURCE)
113 1.60.6.2 christos #ifndef _PATH_HEQUIV
114 1.60.6.2 christos #define _PATH_HEQUIV "/etc/hosts.equiv"
115 1.60.6.2 christos #endif
116 1.60.6.2 christos #ifndef _PATH_HOSTS
117 1.60.6.2 christos #define _PATH_HOSTS "/etc/hosts"
118 1.60.6.2 christos #endif
119 1.60.6.2 christos #ifndef _PATH_NETWORKS
120 1.60.6.2 christos #define _PATH_NETWORKS "/etc/networks"
121 1.60.6.2 christos #endif
122 1.60.6.2 christos #ifndef _PATH_PROTOCOLS
123 1.60.6.2 christos #define _PATH_PROTOCOLS "/etc/protocols"
124 1.60.6.2 christos #endif
125 1.60.6.2 christos #ifndef _PATH_SERVICES
126 1.60.6.2 christos #define _PATH_SERVICES "/etc/services"
127 1.60.6.2 christos #endif
128 1.60.6.2 christos #ifndef _PATH_SERVICES_DB
129 1.60.6.2 christos #define _PATH_SERVICES_DB "/var/db/services.db"
130 1.60.6.2 christos #endif
131 1.60.6.2 christos #endif
132 1.60.6.2 christos
133 1.60.6.2 christos __BEGIN_DECLS
134 1.60.6.2 christos extern int h_errno;
135 1.60.6.2 christos extern int * __h_errno __P((void));
136 1.60.6.2 christos #ifdef _REENTRANT
137 1.60.6.2 christos #define h_errno (*__h_errno())
138 1.60.6.2 christos #endif
139 1.60.6.2 christos __END_DECLS
140 1.60.6.2 christos
141 1.60.6.2 christos /*%
142 1.60.6.2 christos * Structures returned by network data base library. All addresses are
143 1.60.6.2 christos * supplied in host order, and returned in network order (suitable for
144 1.60.6.2 christos * use in system calls).
145 1.60.6.2 christos */
146 1.60.6.2 christos struct hostent {
147 1.60.6.2 christos char *h_name; /*%< official name of host */
148 1.60.6.2 christos char **h_aliases; /*%< alias list */
149 1.60.6.2 christos int h_addrtype; /*%< host address type */
150 1.60.6.2 christos int h_length; /*%< length of address */
151 1.60.6.2 christos char **h_addr_list; /*%< list of addresses from name server */
152 1.60.6.2 christos #define h_addr h_addr_list[0] /*%< address, for backward compatiblity */
153 1.60.6.2 christos };
154 1.60.6.2 christos
155 1.60.6.2 christos /*%
156 1.60.6.2 christos * Assumption here is that a network number
157 1.60.6.2 christos * fits in an unsigned long -- probably a poor one.
158 1.60.6.2 christos */
159 1.60.6.2 christos struct netent {
160 1.60.6.2 christos char *n_name; /*%< official name of net */
161 1.60.6.2 christos char **n_aliases; /*%< alias list */
162 1.60.6.2 christos int n_addrtype; /*%< net address type */
163 1.60.6.2 christos #if (defined(__sparc__) && defined(_LP64)) || \
164 1.60.6.2 christos (defined(__sh__) && defined(_LP64) && (_BYTE_ORDER == _BIG_ENDIAN))
165 1.60.6.2 christos int __n_pad0; /* ABI compatibility */
166 1.60.6.2 christos #endif
167 1.60.6.2 christos uint32_t n_net; /*%< network # */
168 1.60.6.2 christos #if defined(__alpha__) || (defined(__i386__) && defined(_LP64)) || \
169 1.60.6.2 christos (defined(__sh__) && defined(_LP64) && (_BYTE_ORDER == _LITTLE_ENDIAN))
170 1.60.6.2 christos int __n_pad0; /* ABI compatibility */
171 1.60.6.2 christos #endif
172 1.60.6.2 christos };
173 1.60.6.2 christos
174 1.60.6.2 christos struct servent {
175 1.60.6.2 christos char *s_name; /*%< official service name */
176 1.60.6.2 christos char **s_aliases; /*%< alias list */
177 1.60.6.2 christos int s_port; /*%< port # */
178 1.60.6.2 christos char *s_proto; /*%< protocol to use */
179 1.60.6.2 christos };
180 1.60.6.2 christos
181 1.60.6.2 christos struct protoent {
182 1.60.6.2 christos char *p_name; /*%< official protocol name */
183 1.60.6.2 christos char **p_aliases; /*%< alias list */
184 1.60.6.2 christos int p_proto; /*%< protocol # */
185 1.60.6.2 christos };
186 1.60.6.2 christos
187 1.60.6.2 christos /*
188 1.60.6.2 christos * Note: ai_addrlen used to be a size_t, per RFC 2553.
189 1.60.6.2 christos * In XNS5.2, and subsequently in POSIX-2001 and
190 1.60.6.2 christos * draft-ietf-ipngwg-rfc2553bis-02.txt it was changed to a socklen_t.
191 1.60.6.2 christos * To accommodate for this while preserving binary compatibility with the
192 1.60.6.2 christos * old interface, we prepend or append 32 bits of padding, depending on
193 1.60.6.2 christos * the (LP64) architecture's endianness.
194 1.60.6.2 christos *
195 1.60.6.2 christos * This should be deleted the next time the libc major number is
196 1.60.6.2 christos * incremented.
197 1.60.6.2 christos */
198 1.60.6.2 christos #if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 520 || \
199 1.60.6.2 christos defined(_NETBSD_SOURCE)
200 1.60.6.2 christos struct addrinfo {
201 1.60.6.2 christos int ai_flags; /*%< AI_PASSIVE, AI_CANONNAME */
202 1.60.6.2 christos int ai_family; /*%< PF_xxx */
203 1.60.6.2 christos int ai_socktype; /*%< SOCK_xxx */
204 1.60.6.2 christos int ai_protocol; /*%< 0 or IPPROTO_xxx for IPv4 and IPv6 */
205 1.60.6.2 christos #if defined(__sparc__) && defined(_LP64)
206 1.60.6.2 christos int __ai_pad0; /* ABI compatibility */
207 1.60.6.2 christos #endif
208 1.60.6.2 christos socklen_t ai_addrlen; /*%< length of ai_addr */
209 1.60.6.2 christos #if defined(__alpha__) || (defined(__i386__) && defined(_LP64))
210 1.60.6.2 christos int __ai_pad0; /* ABI compatibility */
211 1.60.6.2 christos #endif
212 1.60.6.2 christos char *ai_canonname; /*%< canonical name for hostname */
213 1.60.6.2 christos struct sockaddr *ai_addr; /*%< binary address */
214 1.60.6.2 christos struct addrinfo *ai_next; /*%< next structure in linked list */
215 1.60.6.2 christos };
216 1.60.6.2 christos #endif
217 1.60.6.2 christos
218 1.60.6.2 christos /*%
219 1.60.6.2 christos * Error return codes from gethostbyname() and gethostbyaddr()
220 1.60.6.2 christos * (left in extern int h_errno).
221 1.60.6.2 christos */
222 1.60.6.2 christos
223 1.60.6.2 christos #if defined(_NETBSD_SOURCE)
224 1.60.6.2 christos #define NETDB_INTERNAL -1 /*%< see errno */
225 1.60.6.2 christos #define NETDB_SUCCESS 0 /*%< no problem */
226 1.60.6.2 christos #endif
227 1.60.6.2 christos #define NO_ADDRESS NO_DATA /* no address, look for MX record */
228 1.60.6.2 christos #define HOST_NOT_FOUND 1 /*%< Authoritative Answer Host not found */
229 1.60.6.2 christos #define TRY_AGAIN 2 /*%< Non-Authoritive Host not found, or SERVERFAIL */
230 1.60.6.2 christos #define NO_RECOVERY 3 /*%< Non recoverable errors, FORMERR, REFUSED, NOTIMP */
231 1.60.6.2 christos #define NO_DATA 4 /*%< Valid name, no data record of requested type */
232 1.60.6.2 christos #if defined(_NETBSD_SOURCE)
233 1.60.6.2 christos #define NO_ADDRESS NO_DATA /*%< no address, look for MX record */
234 1.60.6.2 christos #endif
235 1.60.6.2 christos
236 1.60.6.2 christos /*
237 1.60.6.2 christos * Error return codes from getaddrinfo()
238 1.60.6.2 christos */
239 1.60.6.2 christos #if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 520 || \
240 1.60.6.2 christos defined(_NETBSD_SOURCE)
241 1.60.6.2 christos #define EAI_ADDRFAMILY 1 /*%< address family for hostname not supported */
242 1.60.6.2 christos #define EAI_AGAIN 2 /*%< temporary failure in name resolution */
243 1.60.6.2 christos #define EAI_BADFLAGS 3 /*%< invalid value for ai_flags */
244 1.60.6.2 christos #define EAI_FAIL 4 /*%< non-recoverable failure in name resolution */
245 1.60.6.2 christos #define EAI_FAMILY 5 /*%< ai_family not supported */
246 1.60.6.2 christos #define EAI_MEMORY 6 /*%< memory allocation failure */
247 1.60.6.2 christos #define EAI_NODATA 7 /*%< no address associated with hostname */
248 1.60.6.2 christos #define EAI_NONAME 8 /*%< hostname nor servname provided, or not known */
249 1.60.6.2 christos #define EAI_SERVICE 9 /*%< servname not supported for ai_socktype */
250 1.60.6.2 christos #define EAI_SOCKTYPE 10 /*%< ai_socktype not supported */
251 1.60.6.2 christos #define EAI_SYSTEM 11 /*%< system error returned in errno */
252 1.60.6.2 christos #define EAI_BADHINTS 12 /* invalid value for hints */
253 1.60.6.2 christos #define EAI_PROTOCOL 13 /* resolved protocol is unknown */
254 1.60.6.2 christos #define EAI_OVERFLOW 14 /* argument buffer overflow */
255 1.60.6.2 christos #define EAI_MAX 15
256 1.60.6.2 christos #endif /* _POSIX_C_SOURCE >= 200112 || _XOPEN_SOURCE >= 520 || _NETBSD_SOURCE */
257 1.60.6.2 christos
258 1.60.6.2 christos /*%
259 1.60.6.2 christos * Flag values for getaddrinfo()
260 1.60.6.2 christos */
261 1.60.6.2 christos #if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 520 || \
262 1.60.6.2 christos defined(_NETBSD_SOURCE)
263 1.60.6.2 christos #define AI_PASSIVE 0x00000001 /* get address to use bind() */
264 1.60.6.2 christos #define AI_CANONNAME 0x00000002 /* fill ai_canonname */
265 1.60.6.2 christos #define AI_NUMERICHOST 0x00000004 /* prevent host name resolution */
266 1.60.6.2 christos #define AI_NUMERICSERV 0x00000008 /* prevent service name resolution */
267 1.60.6.2 christos /* valid flags for addrinfo (not a standard def, apps should not use it) */
268 1.60.6.2 christos #define AI_MASK \
269 1.60.6.2 christos (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV)
270 1.60.6.2 christos #endif
271 1.60.6.2 christos
272 1.60.6.2 christos #if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 520 || \
273 1.60.6.2 christos defined(_NETBSD_SOURCE)
274 1.60.6.2 christos /*%
275 1.60.6.2 christos * Constants for getnameinfo()
276 1.60.6.2 christos */
277 1.60.6.2 christos #if defined(_NETBSD_SOURCE)
278 1.60.6.2 christos #define NI_MAXHOST 1025
279 1.60.6.2 christos #define NI_MAXSERV 32
280 1.60.6.2 christos #endif
281 1.60.6.2 christos
282 1.60.6.2 christos /*%
283 1.60.6.2 christos * Flag values for getnameinfo()
284 1.60.6.2 christos */
285 1.60.6.2 christos #define NI_NOFQDN 0x00000001
286 1.60.6.2 christos #define NI_NUMERICHOST 0x00000002
287 1.60.6.2 christos #define NI_NAMEREQD 0x00000004
288 1.60.6.2 christos #define NI_NUMERICSERV 0x00000008
289 1.60.6.2 christos #define NI_DGRAM 0x00000010
290 1.60.6.2 christos #define NI_WITHSCOPEID 0x00000020
291 1.60.6.2 christos #define NI_NUMERICSCOPE 0x00000040
292 1.60.6.2 christos
293 1.60.6.2 christos /*%
294 1.60.6.2 christos * Scope delimit character
295 1.60.6.2 christos */
296 1.60.6.2 christos #if defined(_NETBSD_SOURCE)
297 1.60.6.2 christos #define SCOPE_DELIMITER '%'
298 1.60.6.2 christos #endif
299 1.60.6.2 christos #endif /* (_POSIX_C_SOURCE - 0) >= 200112L || ... */
300 1.60.6.2 christos
301 1.60.6.2 christos __BEGIN_DECLS
302 1.60.6.2 christos void endhostent(void);
303 1.60.6.2 christos void endnetent(void);
304 1.60.6.2 christos void endprotoent(void);
305 1.60.6.2 christos void endservent(void);
306 1.60.6.2 christos #if (_XOPEN_SOURCE - 0) >= 520 && (_XOPEN_SOURCE - 0) < 600 || \
307 1.60.6.2 christos defined(_NETBSD_SOURCE)
308 1.60.6.2 christos #if 0 /* we do not ship this */
309 1.60.6.2 christos void freehostent(struct hostent *);
310 1.60.6.2 christos #endif
311 1.60.6.2 christos #endif
312 1.60.6.2 christos struct hostent *gethostbyaddr(const char *, socklen_t, int);
313 1.60.6.2 christos struct hostent *gethostbyname(const char *);
314 1.60.6.2 christos #if defined(_NETBSD_SOURCE)
315 1.60.6.2 christos struct hostent *gethostbyname2(const char *, int);
316 1.60.6.2 christos #endif
317 1.60.6.2 christos struct hostent *gethostent(void);
318 1.60.6.2 christos struct netent *getnetbyaddr(uint32_t, int);
319 1.60.6.2 christos struct netent *getnetbyname(const char *);
320 1.60.6.2 christos struct netent *getnetent(void);
321 1.60.6.2 christos struct protoent *getprotobyname(const char *);
322 1.60.6.2 christos struct protoent *getprotobynumber(int);
323 1.60.6.2 christos struct protoent *getprotoent(void);
324 1.60.6.2 christos struct servent *getservbyname(const char *, const char *);
325 1.60.6.2 christos struct servent *getservbyport(int, const char *);
326 1.60.6.2 christos struct servent *getservent(void);
327 1.60.6.2 christos #if defined(_NETBSD_SOURCE)
328 1.60.6.2 christos void herror(const char *);
329 1.60.6.2 christos const char *hstrerror(int);
330 1.60.6.2 christos #endif
331 1.60.6.2 christos void sethostent(int);
332 1.60.6.2 christos #if defined(_NETBSD_SOURCE)
333 1.60.6.2 christos /* void sethostfile(const char *); */
334 1.60.6.2 christos #endif
335 1.60.6.2 christos void setnetent(int);
336 1.60.6.2 christos void setprotoent(int);
337 1.60.6.2 christos #if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 520 || \
338 1.60.6.2 christos defined(_NETBSD_SOURCE)
339 1.60.6.2 christos void setservent(int);
340 1.60.6.2 christos int getaddrinfo(const char * __restrict, const char * __restrict,
341 1.60.6.2 christos const struct addrinfo * __restrict,
342 1.60.6.2 christos struct addrinfo ** __restrict);
343 1.60.6.2 christos int getnameinfo(const struct sockaddr * __restrict, socklen_t,
344 1.60.6.2 christos char * __restrict, socklen_t,
345 1.60.6.2 christos char * __restrict, socklen_t, int);
346 1.60.6.2 christos void freeaddrinfo(struct addrinfo *);
347 1.60.6.2 christos const char *gai_strerror(int);
348 1.60.6.2 christos #endif
349 1.60.6.2 christos void setservent(int);
350 1.60.6.2 christos __END_DECLS
351 1.60.6.2 christos
352 1.60.6.2 christos #endif /* !_NETDB_H_ */
353