Open System Services Library Calls Reference Manual (G06.28+, H06.05+)

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 Species the number of the network in host-byte order
type Species the Internet domain address format; the value AF_INET or
AF_INET6 must be used
DESCRIPTION
The getnetbyaddr() function searches the /etc/networks le 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 le. The netdb.h header le denes
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 le. Each record in the le occupies a single
line and has three elds: the network name, the network number, and aliases.
RELATED INFORMATION
Functions: getnetent(3), getnetbyname(3), setnetent(3), endnetent(3).
Files: networks(4).
350 Hewlett-Packard Company 527187-007