Open System Services Library Calls Reference Manual (G06.27+, H06.04+)
OSS Library Calls (g - h) getnetbyname(3)
NAME
getnetbyname - Gets a network entry by name
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
H-series OSS processes: /G/system/zdllnnn/zinetdll
SYNOPSIS
#include <netdb.h>
struct netent *getnetbyname (
const char *name);
PARAMETERS
name Specifies the network name or alias.
DESCRIPTION
The getnetbyname( ) function searches the /etc/networks file sequentially until a match with the
name parameter is found.
The getnetbyname( ) function returns a pointer to a structure of type netent whose members
specify data from the /etc/networks network database file. The netdb.h header file defines the
netent structure.
NOTES
The getnetbyname( ) return value points to static data, which is overwritten by any subsequent
calls to getnetbyaddr(), getnetbyname(),orgetnetent().
RETURN VALUES
Upon successful completion, the getnetbyname( ) function returns a pointer to a netent structure
if the network name was found, and a null pointer if it was not found. If the call to getnet-
byname( ) fails, a null pointer is returned.
ERRORS
The getnetbyname( ) function does not return a value in errno.
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), getnetbyaddr(3), setnetent(3), endnetent(3).
Files: networks(4).
527187-004 Hewlett-Packard Company 3−51