2 .\" Copyright (c) 1992, X/Open Company Limited. All Rights Reserved. Portions Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4 .\" http://www.opengroup.org/bookstore/.
5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
6 .\" This notice shall appear on any product containing this material.
7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
10 .TH NETDB.H 3HEAD "Sep 10, 2004"
12 netdb.h, netdb \- definitions for network database operations
16 \fB#include <netdb.h>\fR
22 The <\fBnetdb.h\fR> header defines the type \fBin_port_t\fR and the type
23 \fBin_addr_t\fR as described in \fBin.h\fR(3HEAD).
26 The <\fBnetdb.h\fR> header defines the \fBhostent\fR structure that includes
27 the following members:
31 char *h_name /* official name of the host */
32 char **h_aliases /* pointer to an array of pointers to
33 alternative host names, terminated
35 int h_addrtype /* address type */
36 int h_length /* length, in bytes, of the address */
37 char **h_addr_list /* pointer to an array of pointers to
38 network addresses (in network byte
39 order)for the host, terminated by a
46 The <\fBnetdb.h\fR> header defines the \fBnetent\fR structure that includes the
51 char *n_name /* official, fully-qualified */
52 (including the domain) name
54 char **n_aliases /* pointer to an array of pointers to
55 alternative network names, terminated */
57 int n_addrtype /* the address type of the network */
58 in_addr_t n_net /* the network number, in host byte order */
64 The <\fBnetdb.h\fR> header defines the \fBprotoent\fR structure that includes
65 the following members:
69 char *p_name /* official name of the protocol */
70 char **p_aliases /* pointer to an array of pointers to
71 alternative protocol names, terminated
73 int p_proto /* protocol number */
79 The <\fBnetdb.h\fR> header defines the \fBservent\fR structure that includes
80 the following members:
84 char *s_name /* oficial name of the service */
85 char **s_aliases /* pointer to an array of pointers to
86 alternativeservice names, terminated by
88 int s_port /* port number at which the service
89 resides, in network byte order */
90 char *s_proto /* name of the protocol to use when
91 contacting the service */
97 The <\fBnetdb.h\fR> header defines the macro \fBIPPORT_RESERVED\fR with the
98 value of the highest reserved Internet port number.
101 The <\fBnetdb.h\fR> header provides a declaration for \fBh_errno\fR:
107 The <\fBnetdb.h\fR> header defines the following macros for use as error values
108 for \fBgethostbyaddr()\fR and \fBgethostbyname()\fR:
115 \fBHOST_NOT_FOUND\fR \fBNO_DATA\fR
116 \fBNO_RECOVERY\fR \fBTRY_AGAIN\fR
121 Inclusion of the <\fBnetdb.h\fR> header may also make visible all symbols from
126 See \fBattributes\fR(5) for descriptions of the following attributes:
134 ATTRIBUTE TYPE ATTRIBUTE VALUE
136 Interface Stability Standard
142 \fBIntro\fR(3), \fBendhostent\fR(3NSL), \fBendhostent\fR(3XNET),
143 \fBendnetent\fR(3SOCKET), \fBendnetent\fR(3XNET), \fBendprotoent\fR(3SOCKET),
144 \fBendprotoent\fR(3XNET), \fBendservent\fR(3SOCKET), \fBendservent\fR(3XNET),
145 \fBin.h\fR(3HEAD), \fBattributes\fR(5), \fBstandards\fR(5)