Using the protocolentry class


Introduction

The protocolentry class provides methods for retrieving network protocol definitions. These are usually defined in a file like /etc/protocols on unix-like systems or C:\Windows\System32\drivers\etc\protocol on Windows, or are served from another source via the name-service switch.

Protocols can be looked up by name or number.


Lookup By Name

This example retrieves network protocol information for the "tcp" protocol.

@protocolentry-name.cpp.html@

Lookup By Number

This example retrieves network protocol information for "protocol number 6".

@protocolentry-number.cpp.html@