Open System Services Library Calls Reference Manual (G06.27+, H06.04+)
getnetbyaddr(3) OSS Library Calls Reference Manual
NAME
getnetbyaddr - Gets a network entry by address
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
H-series OSS processes: /G/system/zdllnnn/zinetdll
SYNOPSIS
#include <sys/socket.h>
#include <netdb.h>
struct netent *getnetbyaddr (
in_addr_t num,
int type);
PARAMETERS
num Specifies the number of the network in host-byte order
type Specifies the Internet domain address format; the value AF_INET or
AF_INET6 must be used
DESCRIPTION
The getnetbyaddr() function searches the /etc/networks file sequentially until a match with the
num and type parameters is found.
The getnetbyaddr() function returns a pointer to a structure of type netent whose members
specify data from the /etc/networks network name database file. The netdb.h header file defines
the netent structure.
NOTES
The getnetbyaddr() return value points to static data, which is overwritten by any subsequent
calls to getnetbyaddr(), getnetbyname(),orgetnetent().
RETURN VALUES
Upon successful completion, the getnetbyaddr() function returns a pointer to a netent structure
if the address was found, and a null pointer if the address was not found. If the call to getnet-
byaddr( ) fails, a null pointer is returned.
ERRORS
No errors are returned.
FILES
/etc/networks The Internet network name database file. Each record in the file occupies a single
line and has three fields: the network name, the network number, and aliases.
RELATED INFORMATION
Functions: getnetent(3), getnetbyname(3), setnetent(3), endnetent(3).
Files: networks(4).
3−50 Hewlett-Packard Company 527187-004