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-getnetent.html"><LINK
28 TITLE="getrrsetbyname"
29 HREF="net-common-tcpip-manpages-getrrsetbyname.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="net-common-tcpip-manpages-getnetent.html"
65 >Chapter 38. TCP/IP Library Reference</TD
71 HREF="net-common-tcpip-manpages-getrrsetbyname.html"
85 NAME="NET-COMMON-TCPIP-MANPAGES-GETPROTOENT">getprotoent</H1
94 >GETPROTOENT(3) System Library Functions Manual GETPROTOENT(3)
97 getprotoent, getprotobynumber, getprotobyname, setprotoent, endprotoent -
101 #include <netdb.h>
107 getprotobyname(char *name);
110 getprotobynumber(int proto);
113 setprotoent(int stayopen);
119 The getprotoent(), getprotobyname(), and getprotobynumber() functions
120 each return a pointer to an object with the following structure contain-
121 ing the broken-out fields of a line in the network protocol database,
126 char *p_name; /* official name of protocol */
127 char **p_aliases; /* alias list */
128 int p_proto; /* protocol number */
131 The members of this structure are:
133 p_name The official name of the protocol.
135 p_aliases A zero-terminated list of alternate names for the protocol.
137 p_proto The protocol number.
139 The getprotoent() function reads the next line of the file, opening the
142 The setprotoent() function opens and rewinds the file. If the stayopen
143 flag is non-zero, the net database will not be closed after each call to
144 getprotobyname() or getprotobynumber().
146 The endprotoent() function closes the file.
148 The getprotobyname() and getprotobynumber() functions sequentially search
149 from the beginning of the file until a matching protocol name or protocol
150 number is found, or until EOF is encountered.
153 Null pointer (0) returned on EOF or error.
162 The getprotoent(), getprotobynumber(), getprotobyname(), setprotoent(),
163 and endprotoent() functions appeared in 4.2BSD.
166 These functions use a static data space; if the data is needed for future
167 use, it should be copied before any subsequent calls overwrite it. Only
168 the Internet protocols are currently understood.
181 SUMMARY="Footer navigation table"
192 HREF="net-common-tcpip-manpages-getnetent.html"
210 HREF="net-common-tcpip-manpages-getrrsetbyname.html"
226 HREF="tcpip-library-reference.html"