Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (g - h) getprotobyname(3)
NAME
getprotobyname - Gets a protocol entry by name
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zinetdll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yinetdll |
SYNOPSIS
#include <netdb.h>
struct protoent *getprotobyname(
const char *name);
PARAMETERS
name Specifies the protocol name or alias.
DESCRIPTION
The getprotobyname( ) function searches the network protocols database file /etc/protocols
sequentially until a match with name is found.
The getprotobyname( ) function returns a pointer to a structure of type protoent whose members
specify data from the /etc/protocols network protocols database file. The netdb.h header file
defines the protoent structure.
When using the getprotobyname( ) function, use the endprotoent( ) function to close the proto-
cols file.
NOTES
The getprotobyname( ) return value points to static data, which is overwritten by any subsequent
calls to getprotobyname( ), getprotobynumber( ),orgetprotoent( ).
RETURN VALUES
Upon successful completion, the getprotobyname( ) function returns a pointer to a protoent
structure if the requested entry is found, and a null pointer if it is not found. If the call to getpro-
tobyname( ) fails, a null pointer is returned.
ERRORS
The getprotobyname( ) function does not set errno.
FILES
/etc/protocols The Internet network protocols database file. Each record in the file occupies a
single line and has three fields: the protocol name, the protocol number, and pro-
tocol aliases.
RELATED INFORMATION
Functions: getprotobynumber(3), getprotoent(3), setprotoent(3), endprotoent(3).
Files: protocols(4).
527187-017 Hewlett-Packard Company 3−105