NAME

zkGetprotobyname, zkGetprotobynumber - network protocol database functions

SYNOPSIS

#include "zkNetdb.h"

struct protoent* zkGetprotobyname(const char* name);

struct protoent* zkGetprotobynumber(int proto);

DESCRIPTION

The zkGetprotobyname() and zkGetprotobynumber() functions each return a pointer to a protoent structure, the members of which contain the fields of an entry in the network protocol database.

The zkGetprotobyname() function searches the database from the beginning and finds the first entry for which the protocol name specified by name matches the p_name member, opening a connection to the database if necessary.

The zkGetprotobynumber() function searches the database from the beginning and finds the first entry for which the protocol number specified by number matches the p_proto member, opening a connection to the database if necessary.

RETURN VALUES

On successful completion, zkGetprotobyname() and zkGetprotobynumber() functions return a pointer to a protoent structure if the requested entry was found, and NULL if the end of the database was reached or the requested entry was not found.

ERRORS

No errors are defined.

APPLICATION USAGE

The zkGetprotobyname() and zkGetprotobynumber() functions may return pointers to static data, which may be overwritten by subsequent calls to any of these functions.

These functions are generally used with the Internet address family.