getnetbyaddr()

The getnetbyaddr() call searches the local host tables for the specified network address. This call can be used only in the AF_INET domain. See z/OS Communications Server: IP Configuration Guide for information about using local host tables.

#include <manifest.h>
#include <bsdtypes.h>
#include <netdb.h>
struct netent *getnetbyaddr(unsigned long net, int type)
Parameter
Description
net
The network address
type
The address domain supported (AF_INET)
The netent structure is defined in the NETDB.H header file and contains the following elements:
Element
Description
n_name
The official name of the network.
n_aliases
An array, terminated with a NULL pointer, of alternative names for the network.
n_addrtype
The type of network address returned. The call always sets this value to AF_INET.
n_net
The network number, returned in host byte order.

Return values

The return value points to static data that is overwritten by subsequent calls. A pointer to a netent structure indicates success. A NULL pointer indicates an error or end-of-file. When a NULL pointer or 0 is returned, the value of errno is indeterminate, and therefore, the output from a tcperror() call cannot be validated.

Related calls

endnetent(), getnetbyname(), getnetent(), setnetent(), endhostent()