ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/dlensnmp.htm

131 lines
3.7 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>DPI_PACKET_LEN()--Get Length of DPI Packet</title>
<!-- Begin Header Records ========================================== -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- Direct1 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
<!-- Edited by Kersten Feb 02 -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<h2>DPI_PACKET_LEN()--Get Length of DPI Packet</h2>
<div class="box" style="width: 80%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;qtossapi.h&gt;
int DPI_PACKET_LEN( unsigned char <em>*packet_p</em> );
</pre>
<br>
&nbsp;&nbsp;Service Program Name: QTOSSAPI<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: No<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <strong>DPI_PACKET_LEN()</strong> macro returns the length (number of
bytes) of a Distributed Protocol Interface (DPI) packet.</p>
<br>
<!-- Please NOTE: DO NOT DELETE THIS SECTION if this API has no authorities and locks. -->
<!-- Instead, use the commented out coding below to indicate NONE. -->
<h3>Authorities and Locks</h3>
<!-- Use this if there are no authorities and locks. -->
<p>None.</p>
<br>
<h3>Parameters</h3>
<dl>
<dt><strong>packet_p</strong></dt>
<dd>(Input) A pointer to a (serialized) DPI packet.</dd>
</dl>
<br>
<h3>Return Value</h3>
<table cellpadding="5">
<!-- cols="10 90" -->
<tr>
<td align="left" valign="top"><em>value</em></td>
<td align="left" valign="top">An integer value that represents the total DPI
packet length.</td>
</tr>
</table>
<p>For more information, see &quot;SNMP Subagent Problem Determination&quot; in
the <a href="../books/sc415412.pdf" target="_blank">Simple Network
Management Protocol (SNMP) Support</a> <img src="wbpdf.gif" alt="Link to PDF">
book.</p>
<br>
<h3>Usage Notes</h3>
<p>The <strong>DPI_PACKET_LEN()</strong> macro generates a C expression that
returns an integer that represents the total length of a DPI packet. It uses
the first 2 bytes (in network byte order) of the packet to calculate the
length. The length returned includes these first 2 bytes.</p>
<br>
<h3>Example</h3>
<p>See <a href="../apiref/aboutapis.htm#codedisclaimer">Code disclaimer information</a>
for information pertaining to code examples.</p>
<pre>
#include &lt;qtossapi.h&gt;
unsigned char *pack_p;
int length;
pack_p = mkDPIclose(SNMP_CLOSE_goingDown);
if (pack_p) {
length = DPI_PACKET_LEN(pack_p);
/* Send packet to agent or subagent. */
}
</pre>
<br>
<hr>
API introduced: V3R6
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> |
<a href="unix.htm">UNIX-Type APIs</a> |
<a href="aplist.htm">APIs by category</a> </td>
</tr>
</table></center>
</body>
</html>