📄 getnetbyname.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>endnetent</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4>NAME</h4><blockquote>endnetent, getnetbyaddr, getnetbyname, getnetent, setnetent - network database functions</blockquote><h4>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="netdb.h.html">netdb.h</a>>void endnetent(void);struct netent *getnetbyaddr(in_addr_t <I>net</I>, int <I>type</I>);struct netent *getnetbyname(const char *<I>name</I>);struct netent *getnetent(void);void setnetent(int <I>stayopen</I>);</code></pre></blockquote><h4>DESCRIPTION</h4><blockquote>The<i>getnetbyaddr()</i>,<i>getnetbyname()</i>and<i>getnetent()</i>,functions each return a pointer to a <B>netent</B> structure, the members ofwhich contain the fields of an entry in the network database.<p>The<i>getnetent()</i>function reads the next entry of the database, opening a connection to thedatabase if necessary.<p>The<i>getnetbyaddr()</i>function searches the database from the beginning, and finds the first entryfor which the address family specified by <I>type</I> matches the<B>n_addrtype</B> member and the network number <I>net</I> matchesthe <B>n_net</B> member, opening a connection to the database if necessary.The <I>net</I> argument is the network number in host byte order.<p>The<i>getnetbyname()</i>function searches the database from the beginning and finds the first entryfor which the network name specified by <I>name</I> matches the <B>n_name</B>member, opening a connection to the database if necessary.<p>The<i>setnetent()</i>function opens and rewinds the database. If the <I>stayopen</I> argument isnon-zero, the connection to the net database will not be closed after eachcall to<i>getnetent()</i>(either directly, or indirectly through one of the other<i>getnet*()</i>functions).<p>The<i>endnetent()</i>function closes the database.</blockquote><h4>RETURN VALUE</h4><blockquote>On successful completion,<i>getnetbyaddr()</i>,<i>getnetbyname()</i>and<i>getnetent()</i>,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 requestedentry was not found. Otherwise, a null pointer is returned.</blockquote><h4>ERRORS</h4><blockquote>No errors are defined.</blockquote><h4>APPLICATION USAGE</h4><blockquote>The<i>getnetbyaddr()</i>,<i>getnetbyname()</i>and<i>getnetent()</i>,functions may return pointers to static data, which may be overwritten bysubsequent calls to any of these functions.<p>These functions are generally used with the Internet address family.</blockquote><h4>SEE ALSO</h4><blockquote><i><a href="netdb.h.html"><netdb.h></a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -