| Red Hat Documentation: man pages: man3: Linux Programmer's Manual (3) |
GETNETENTSection: Linux Programmer's Manual (3)Updated: May 15, 2025 Index NAMEgetnetent, getnetbyname, getnetbyaddr, setnetent, endnetent - get network entrySYNOPSIS#include <netdb.h> struct netent *getnetent(void); struct netent *getnetbyname(const char *name); struct netent *getnetbyaddr(long net, int type); void setnetent(int stayopen); void endnetent(void); DESCRIPTIONThe getnetent() function reads the next line from the file /etc/networks and returns a structure netent containing the broken out fields from the line. The /etc/networks file is opened if necessary.The getnetbyname() function returns a netent structure for the line from /etc/networks that matches the network name. The getnetbyaddr() function returns a netent structure for the line that matches the network number net of type type. The setnetent() function opens and rewinds the /etc/networks file. If stayopen is true (1), then the file will not be closed between calls to getnetbyname() and getnetbyaddr(). The endservent() function closes /etc/networks. The netent structure is defined in <netdb.h> as follows:
The members of the netent structure are:
RETURN VALUEThe getnetent(), getnetbyname() and getnetbyaddr() functions return the netent structure, or a NULL pointer if an error occurs or the end of the file is reached.FILES/etc/networks networks database fileCONFORMING TOBSD 4.3SEE ALSORFC 1101
IndexThis document was created by using the manual pages. Time: 11:58:05 GMT, March 24, 2025 |
|
© 2001 Red Hat, Inc. All rights reserved. About Red Hat : Legal statement : Privacy statement : Y2K statement : Contact Red Hat |