Copyright (C) 2000-2012 |
Manpages GETNETENTSection: Linux Programmer's Manual (3 )Updated: 1993-05-15 Index Return to Main Contents 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 ALSOgetprotoent(3), getservent(3), networks(5)RFC 1101
IndexThis document was created by man2html, using the manual pages. Time: 14:27:55 GMT, July 27, 2024 |