September 2001
Intermediate to advanced
768 pages
32h 45m
English
int getprotobyname( string protocol_name) Gets the standard protocol number for a protocol name.
Returns:
Port number; -1 on error
Description:
getprotobyname() gets the protocol number for the given protocol name on the local system. If the protocol is not recognized, the function returns -1. If you’re looking for service-to-port mapping (in other words, SMTP is port 25), see getservbyname().
Information on the protocol names and corresponding numbers can be found in RFC 1340 and your system’s /etc/protocol or c:\windows\protocol file (if present).
Availability:
UNIX, Windows
Version:
4.0b4+
See also:
getprotobynumber()
Example:
$protocol = 'udp'; echo "The $protocol ... |
Read now
Unlock full access