xref: /titanic_52/usr/src/stand/lib/sa/netdb.h (revision 587644a8567e6a9533f88401daa59cbd78c4632f)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
29 
30 /*
31  * Portions of this source code were derived from Berkeley 4.3 BSD
32  * under license from the Regents of the University of California.
33  */
34 
35 #ifndef _SA_NETDB_H
36 #define	_SA_NETDB_H
37 
38 #pragma ident	"%Z%%M%	%I%	%E% SMI"
39 
40 
41 /*
42  * Exported interfaces for standalone's subset of libnsl's <netdb.h>.
43  * All standalone code *must* use this header rather than libnsl's.
44  */
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 #define	MAXHOSTNAMELEN	256
51 
52 #define	HOST_NOT_FOUND	1 /* Authoritive Answer Host not found */
53 #define	TRY_AGAIN	2 /* Non-Authoritive Host not found, or SERVERFAIL */
54 #define	NO_RECOVERY	3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
55 #define	NO_DATA		4 /* Valid name, no data record of requested type */
56 
57 struct	hostent {
58 	char	*h_name;	/* official name of host */
59 	char	**h_aliases;	/* alias list */
60 	int	h_addrtype;	/* host address type */
61 	int	h_length;	/* length of address */
62 	char	**h_addr_list;	/* list of addresses from name server */
63 #define	h_addr	h_addr_list[0]	/* address, for backward compatiblity */
64 };
65 
66 extern int h_errno;
67 
68 extern struct hostent *gethostbyname(const char *);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* _SA_NETDB_H */
75