getprotobyname(3z)

NAME
getprotobyname, getprotobynumber - get protocol entry

SYNOPSIS
#include <net/resolv.h>

int getprotobyname(char *name);
char *getprotobynumber(int protocol, char * buf);

DESCRIPTION
The getprotobyname() function returns the standard number for the protocol with the name name. If no protocol is known then NULL is returned.

The getprotobynumber() function copies into buf (and returns buf) the protocol matching the protocol. If no protocol is known then protocol is returned in ASCII form.

RETURN VALUE
Detailed above.

NOTES
These functions use a lookup table compiled into the ZSock kernel, it is not likely that method will change in the near future.

AUTHOR
Dominic Morris <dom@jb.man.ac.uk>