getnetent()

The getnetent() call returns a pointer to the next entry in the ETC\NETWORKS file.

Syntax

#include <netdb.h>
struct netent *getnetent()

Description

This call, by opening and sequentially reading the ETC\NETWORKS file, returns a pointer to the next entry in the file.

The getnetent() call returns a pointer to a netent structure, which contains the equivalent fields for a network description line in the ETC\NETWORKS file. The netent structure is defined in the <NETDB.H> file.

Use the endnetent() call to close the ETC\NETWORKS file.

Return Values

The getnetent() call returns a pointer to the next entry in the ETC\NETWORKS file. The return value points to static data that subsequent API calls can modify. A pointer to a netent structure indicates success. A NULL pointer indicates an error or EOF.

The netent structure is defined in the <NETDB.H> header file and contains the following elements:

Element

n _ name n _ aliases n _ addrtype n _ net

Related Calls


[Back: getnetbyname()]
[Next: getprotobyname()]