Unleashed v1.4
[unleashed.git] / share / man / man3xnet / endnetent.3xnet
blob96af9bbb0ad77650fd5b10dffec920e08891c4f8
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
44 .\" Portions Copyright (c) 1998, Sun Microsystems, Inc.  All Rights Reserved.
45 .\"
46 .TH ENDNETENT 3XNET "Jun 10, 2002"
47 .SH NAME
48 endnetent, getnetbyaddr, getnetbyname, getnetent, setnetent \- network database
49 functions
50 .SH SYNOPSIS
51 .LP
52 .nf
53 \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... [ \fIlibrary\fR ... ]
54 #include <netdb.h>
56 \fBvoid\fR \fBendnetent\fR(\fBvoid);struct netent *getnetbyaddr(in_addr_t\fR \fInet\fR, \fBint\fR \fItype\fR);
57 .fi
59 .LP
60 .nf
61 \fBstruct netent *\fR\fBgetnetbyname\fR(\fBconst char *\fR\fIname\fR);
62 .fi
64 .LP
65 .nf
66 \fBstruct netent *\fR\fBgetnetent\fR(void)
67 .fi
69 .LP
70 .nf
71 \fBvoid\fR \fBsetnetent\fR(\fBint\fR \fIstayopen\fR);
72 .fi
74 .SH DESCRIPTION
75 .sp
76 .LP
77 The \fBgetnetbyaddr()\fR, \fBgetnetbyname()\fR and \fBgetnetent()\fR, functions
78 each return a pointer to a \fBnetent\fR structure, the members of which contain
79 the fields of an entry in the network database.
80 .sp
81 .LP
82 The \fBgetnetent()\fR function reads the next entry of the database, opening a
83 connection to the database if necessary.
84 .sp
85 .LP
86 The \fBgetnetbyaddr()\fR function searches the database from the beginning, and
87 finds the first entry for which the address family specified by \fBtype\fR
88 matches the \fBn_addrtype\fR member and the network number \fInet\fR matches
89 the \fBn_net\fR member, opening a connection to the database if necessary. The
90 \fInet\fR argument is the network number in host byte order.
91 .sp
92 .LP
93 The \fBgetnetbyname()\fR function searches the database from the beginning and
94 finds the first entry for which the network name specified by \fIname\fR
95 matches the \fBn_name\fR member, opening a connection to the database if
96 necessary.
97 .sp
98 .LP
99 The \fBsetnetent()\fR function opens and rewinds the database.  If the
100 \fIstayopen\fR argument is non-zero, the connection to the net database will
101 not be closed after each call to \fBgetnetent()\fR (either directly, or
102 indirectly through one of the other \fBgetnet*(\|)\fR functions).
105 The \fBendnetent()\fR function closes the database.
106 .SH USAGE
109 The \fBgetnetbyaddr()\fR, \fBgetnetbyname()\fR and \fBgetnetent()\fR, functions
110 may return pointers to static data, which may be overwritten by subsequent
111 calls to any of these functions.
114 These functions are generally used with the Internet address family.
115 .SH RETURN VALUES
118 On successful completion, \fBgetnetbyaddr()\fR, \fBgetnetbyname()\fR and
119 \fBgetnetent()\fR, return a pointer to a \fBnetent\fR structure if the
120 requested entry was found, and a null pointer if the end of the database was
121 reached or the requested entry was not found.  Otherwise, a null pointer is
122 returned.
123 .SH ERRORS
126 No errors are defined.
127 .SH ATTRIBUTES
130 See \fBattributes\fR(5) for descriptions of the following attributes:
135 box;
136 c | c
137 l | l .
138 ATTRIBUTE TYPE  ATTRIBUTE VALUE
140 Interface Stability     Standard
142 MT-Level        MT-Safe
145 .SH SEE ALSO
148 \fBattributes\fR(5), \fBstandards\fR(5)