getprotobyname

Returns information about a protocol, given its name.

Library:LibC
Standard:BSD
Service:Networking

Syntax

  #include <netdb.h> 
   
  struct protoent *getprotobyname (
     const char   *name);
  

Parameters

name

(IN) Points to the name of the protocol (such as "TCP" or "tcp", the matching is case insensitive).

Return Values

If successful, returns a pointer to a structure of type protoent Otherwise, returns NULL.

Remarks

The getprotobyname function accepts a pointer to a character string representing a protocol name. The function begins searching for the character string from the beginning of the sys:\etc\protocol file and continues until it finds a matching entry or reaches end-of-file.

NOTE:Calling any database routine overwrites the results of the last call to this function.

See Also

getprotobynumber