137 lines
5.3 KiB
HTML
137 lines
5.3 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
|
|
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
|
|
<title>endnetent</title>
|
|
</head>
|
|
<body bgcolor="white">
|
|
|
|
<basefont size="3"> <a name="endnetent"></a> <a name="tag_03_119"></a><!-- endnetent -->
|
|
<!--header start-->
|
|
<center><font size="2">The Open Group Base Specifications Issue 6<br>
|
|
IEEE Std 1003.1-2001<br>
|
|
Copyright © 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
|
|
|
|
<!--header end-->
|
|
<hr size="2" noshade>
|
|
<h4><a name="tag_03_119_01"></a>NAME</h4>
|
|
|
|
<blockquote>endnetent, getnetbyaddr, getnetbyname, getnetent, setnetent - network database functions</blockquote>
|
|
|
|
<h4><a name="tag_03_119_02"></a>SYNOPSIS</h4>
|
|
|
|
<blockquote class="synopsis">
|
|
<p><code><tt>#include <<a href="../basedefs/netdb.h.html">netdb.h</a>><br>
|
|
<br>
|
|
void endnetent(void);<br>
|
|
struct netent *getnetbyaddr(uint32_t</tt> <i>net</i><tt>, int</tt> <i>type</i><tt>);<br>
|
|
struct netent *getnetbyname(const char *</tt><i>name</i><tt>);<br>
|
|
struct netent *getnetent(void);<br>
|
|
void setnetent(int</tt> <i>stayopen</i><tt>);<br>
|
|
</tt></code></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_119_03"></a>DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>These functions shall retrieve information about networks. This information is considered to be stored in a database that can be
|
|
accessed sequentially or randomly. The implementation of this database is unspecified.</p>
|
|
|
|
<p>The <i>setnetent</i>() function shall open and rewind the database. If the <i>stayopen</i> argument is non-zero, the connection
|
|
to the <i>net</i> database shall not be closed after each call to <i>getnetent</i>() (either directly, or indirectly through one of
|
|
the other <a href="../functions/endnetent.html"><i>getnet*</i>()</a> functions), and the implementation may maintain an open file
|
|
descriptor to the database.</p>
|
|
|
|
<p>The <i>getnetent</i>() function shall read the next entry of the database, opening and closing a connection to the database as
|
|
necessary.</p>
|
|
|
|
<p>The <i>getnetbyaddr</i>() function shall search the database from the beginning, and find the first entry for which the address
|
|
family specified by <i>type</i> matches the <i>n_addrtype</i> member and the network number <i>net</i> matches the <i>n_net</i>
|
|
member, opening and closing a connection to the database as necessary. The <i>net</i> argument shall be the network number in host
|
|
byte order.</p>
|
|
|
|
<p>The <i>getnetbyname</i>() function shall search the database from the beginning and find the first entry for which the network
|
|
name specified by <i>name</i> matches the <i>n_name</i> member, opening and closing a connection to the database as necessary.</p>
|
|
|
|
<p>The <i>getnetbyaddr</i>(), <i>getnetbyname</i>(), and <i>getnetent</i>() functions shall each return a pointer to a
|
|
<b>netent</b> structure, the members of which shall contain the fields of an entry in the network database.</p>
|
|
|
|
<p>The <i>endnetent</i>() function shall close the database, releasing any open file descriptor.</p>
|
|
|
|
<p>These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_119_04"></a>RETURN VALUE</h4>
|
|
|
|
<blockquote>
|
|
<p>Upon successful completion, <i>getnetbyaddr</i>(), <i>getnetbyname</i>(), and <i>getnetent</i>() shall return a pointer to a
|
|
<b>netent</b> structure if the requested entry was found, and a null pointer if the end of the database was reached or the
|
|
requested entry was not found. Otherwise, a null pointer shall be returned.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_119_05"></a>ERRORS</h4>
|
|
|
|
<blockquote>
|
|
<p>No errors are defined.</p>
|
|
</blockquote>
|
|
|
|
<hr>
|
|
<div class="box"><em>The following sections are informative.</em></div>
|
|
|
|
<h4><a name="tag_03_119_06"></a>EXAMPLES</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_119_07"></a>APPLICATION USAGE</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>getnetbyaddr</i>(), <i>getnetbyname</i>(), and <i>getnetent</i>() functions may return pointers to static data, which may
|
|
be overwritten by subsequent calls to any of these functions.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_119_08"></a>RATIONALE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_119_09"></a>FUTURE DIRECTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_119_10"></a>SEE ALSO</h4>
|
|
|
|
<blockquote>
|
|
<p>The Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/netdb.h.html"><i><netdb.h></i></a></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_119_11"></a>CHANGE HISTORY</h4>
|
|
|
|
<blockquote>
|
|
<p>First released in Issue 6. Derived from the XNS, Issue 5.2 specification.</p>
|
|
</blockquote>
|
|
|
|
<div class="box"><em>End of informative text.</em></div>
|
|
|
|
<hr>
|
|
<hr size="2" noshade>
|
|
<center><font size="2"><!--footer start-->
|
|
UNIX ® is a registered Trademark of The Open Group.<br>
|
|
POSIX ® is a registered Trademark of The IEEE.<br>
|
|
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
|
|
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
|
|
]</font></center>
|
|
|
|
<!--footer end-->
|
|
<hr size="2" noshade>
|
|
</body>
|
|
</html>
|
|
|