<html>
<head>
<title>firstworks   Programming with Rudiments using the protocolentry class</title>
<link href="../css/styles.css" rel="stylesheet">
</head>
<body>

<a name="protocolentry"></a>
<span class="heading">Using the protocolentry class</span><br><br>

<ul>
<li><a href="#intro">Introduction</a></li>
<li><a href="#name">Lookup By Name</a></li>
<li><a href="#number">Lookup By Number</a></li>
</ul>

<br>
<a name="intro"></a>
<h3>Introduction</h3>

<p>The <a href="../classes/html/classprotocolentry.html">protocolentry class</a> 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.</p>

<p>Protocols can be looked up by name or number.</p>

<br>
<a name="name"></a>
<h3>Lookup By Name</h3>

<p>This example retrieves network protocol information for the "tcp" protocol.</p>

<blockquote class="code">
@protocolentry-name.cpp.html@
</blockquote>

<br>
<a name="number"></a>
<h3>Lookup By Number</h3>

<p>This example retrieves network protocol information for "protocol number 6".</p>

<blockquote class="code">
@protocolentry-number.cpp.html@
</blockquote>

</body>
</html>
