Get a network entry, given a name
#include <netdb.h> struct netent * getnetbyname( const char * name );
- The name of the network whose entry you want to find.
Use the -l socket option to qcc to link against this library.
The getnetbyname() function gets the network entry for the given name. This function returns a pointer to a structure of type netent, which contains the broken-out fields of a line in the network database, /etc/networks.
The getnetbyaddr() and getnetbyname() functions sequentially search from the beginning of the file until a matching net name or net address and type is found, or until EOF is encountered. Network numbers are supplied in host order.
A pointer to a valid netent structure, or NULL if an error occurs.
- Network name database file.