⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getnetbyname.html

📁 posix标准英文,html格式
💻 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-2004 IEEE and 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, 2004 Edition<br>Copyright &copy; 2001-2004 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 &lt;<a href="../basedefs/netdb.h.html">netdb.h</a>&gt;<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 beaccessed 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 connectionto the <i>net</i> database shall not be closed after each call to <i>getnetent</i>() (either directly, or indirectly through one ofthe other <a href="../functions/endnetent.html"><i>getnet*</i>()</a> functions), and the implementation may maintain an open filedescriptor 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 asnecessary.</p><p>The <i>getnetbyaddr</i>() function shall search the database from the beginning, and find the first entry for which the addressfamily 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 hostbyte order.</p><p>The <i>getnetbyname</i>() function shall search the database from the beginning and find the first entry for which the networkname 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 therequested 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 maybe 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&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/netdb.h.html"><i>&lt;netdb.h&gt;</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 size="2" noshade><center><font size="2"><!--footer start-->UNIX &reg; is a registered Trademark of The Open Group.<br>POSIX &reg; 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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -