TCP/IP Programming Manual

INT(32) net_addr;
net_entry_ptr
return value; points to a structure (based on the netent structure) that contains all the required
information on the specified network. This is the return value.
If the lookup fails (for instance, if the specified network address is invalid, if no NETWORKS file
exists, if the NETWORKS file could not be opened, or if no matching network entry is found in
the NETWORKS file), NULL is returned.
net_addr
input value; the network address by which the network is to be found. Use the inet_netof
function to obtain the network portion of an Internet address.
type
input value; the type of address specified. Its value must be AF_INET or AF_INET6.
Errors
No errors are returned for this function.
Usage Guideline
This call requires the presence of a NETWORKS file providing information on the networks accessible
from this host. The format of this file is described in the TCP/IPv6 Configuration and Management
Manual.
getnetbyname
The getnetbyname function gets the network number of the network with the specified network
name.
C Synopsis
#include <socket.h>
#include <netdb.h>
net_entry_ptr = getnetbyname (net_name);
struct netent *net_entry_ptr;
char *net_name;
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
net_entry_ptr := getnetbyname (net_name);
INT(32) net_entry_ptr;
STRING .EXT net_name;
net_entry_ptr
return value; points to a structure (based on the netent structure) that contains all the required
information on the specified network. This is the return value.
If the lookup fails (for instance, if the specified name is invalid, if no NETWORKS file exists, if
the NETWORKS file could not be opened, or if no matching network entry is found in the
NETWORKS file), NULL is returned.
net_name
input value; a null-terminated character string that contains the network name.
120 Library Routines