1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="TCP/IP Library Reference"
23 HREF="tcpip-library-reference.html"><LINK
26 HREF="net-common-tcpip-manpages-getnameinfo.html"><LINK
29 HREF="net-common-tcpip-manpages-getprotoent.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="net-common-tcpip-manpages-getnameinfo.html"
65 >Chapter 38. TCP/IP Library Reference</TD
71 HREF="net-common-tcpip-manpages-getprotoent.html"
85 NAME="NET-COMMON-TCPIP-MANPAGES-GETNETENT">getnetent</H1
94 >GETNETENT(3) System Library Functions Manual GETNETENT(3)
97 getnetent, getnetbyaddr, getnetbyname, setnetent, endnetent - get network
101 #include <netdb.h>
107 getnetbyname(char *name);
110 getnetbyaddr(in_addr_t net, int type);
113 setnetent(int stayopen);
119 The getnetent(), getnetbyname(), and getnetbyaddr() functions each return
120 a pointer to an object with the following structure containing the bro-
121 ken-out fields of a line in the network database, /etc/networks.
124 char *n_name; /* official name of net */
125 char **n_aliases; /* alias list */
126 int n_addrtype; /* net number type */
127 in_addr_t n_net; /* net number */
130 The members of this structure are:
132 n_name The official name of the network.
134 n_aliases A zero-terminated list of alternate names for the network.
136 n_addrtype The type of the network number returned; currently only
139 n_net The network number. Network numbers are returned in machine
142 The getnetent() function reads the next line of the file, opening the
145 The setnetent() function opens and rewinds the file. If the stayopen
146 flag is non-zero, the net database will not be closed after each call to
147 getnetbyname() or getnetbyaddr().
149 The endnetent() function closes the file.
151 The getnetbyname() and getnetbyaddr() functions search the domain name
152 server if the system is configured to use one. If the search fails, or
153 no name server is configured, they sequentially search from the beginning
154 of the file until a matching net name or net address and type is found,
155 or until EOF is encountered. Network numbers are supplied in host order.
161 Null pointer (0) returned on EOF or error.
164 resolver(3), networks(5)
167 The getnetent(), getnetbyaddr(), getnetbyname(), setnetent(), and
168 endnetent() functions appeared in 4.2BSD.
171 The data space used by these functions is static; if future use requires
172 the data, it should be copied before any subsequent calls to these func-
173 tions overwrite it. Only Internet network numbers are currently under-
174 stood. Expecting network numbers to fit in no more than 32 bits is
177 BSD March 13, 1997 BSD
188 SUMMARY="Footer navigation table"
199 HREF="net-common-tcpip-manpages-getnameinfo.html"
217 HREF="net-common-tcpip-manpages-getprotoent.html"
233 HREF="tcpip-library-reference.html"