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

222 lines
7.0 KiB
HTML

<!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>debugDPI()--Set DPI Packet Trace</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>debugDPI()--Set DPI Packet Trace</h2>
<div class="box" style="width: 70%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;qtossapi.h&gt;
void debugDPI( int <em>level</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>debugDPI()</strong> function sets the level of the Distributed
Protocol Interface (DPI<SUP>(R)</SUP>) packet trace. The trace consists of a representation
(printed to STDERR) of DPI packets as they are parsed (by the <strong>
pDPIpacket()</strong> function) or made (by one of the mkDPI<em>xxx</em>()
APIs). The trace is written to ILE C standard error output.</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>level</strong></dt>
<dd>(Input) The level of tracing to perform. If this value is zero, tracing is
turned off. If it has any other value, tracing is turned on at the specified
level. The higher the value, the more detail. A higher level includes all lower
levels of tracing. Possible values follow:
<table cellpadding="5">
<!-- cols="5 95" -->
<tr>
<td align="left" valign="top"><em>0</em></td>
<td align="left" valign="top">Turn off packet tracing</td>
</tr>
<tr>
<td align="left" valign="top"><em>1</em></td>
<td align="left" valign="top">Display packet creation and parsing</td>
</tr>
<tr>
<td align="left" valign="top"><em>2</em></td>
<td align="left" valign="top">Level 1, plus display the hexadecimal dump of
incoming and outgoing DPI packets.</td>
</tr>
</table>
</dd>
</dl>
<br>
<h3>Usage Notes</h3>
<p>The <strong>debugDPI()</strong> function is used to turn the DPI packet
trace on or off.</p>
<br>
<h3>Related Information</h3>
<ul>
<li>The &lt;<strong>qtossapi.h</strong>&gt; file (see <a href="unix13.htm">
Header Files for UNIX-Type Functions</a>)<br>
<br>
</li>
<li><a href="regsnmp.htm">mkDPIregister()</a>--Make a DPI Register Packet<br>
<br>
</li>
<li><a href="respsnmp.htm">mkDPIresponse()</a>--Make a DPI Response Packet<br>
<br>
</li>
<li><a href="ppacsnmp.htm">pDPIpacket()</a>--Parse a DPI Packet</li>
</ul>
<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;
debugDPI(2);
</pre>
<p>Following are some examples of the DPI packet trace. A simple way to view
STDERR is to run your program in batch in a submitted job.</p>
<p>The following is an example of a trace, with the <em>level</em> parameter
set to 1, of a register packet made by the subagent's call to <strong>
mkDPIregister()</strong>. This is indicated in the trace by the letter <samp>
c</samp> (for create) at the beginning of a trace line. Immediately following
that is the parse of the response packet that the subagent got back from the
SNMP agent. This is indicated in the trace by the letter <samp>p</samp> (for
parse) at the beginning of a trace line.</p>
<pre>
cDPIpacket: Major=2, Version=2, Release=0, Id=1, Type=SNMP_DPI_REGISTER
cDPIreg: subtree=1.3.6.1.2.3.4.5.6., priority=0, timeout=4
view_selection=No
bulk_selection=No
pDPIpacket: Major=2, Version=2, Release=0, Id=1, Type=SNMP_DPI_RESPONSE
pDPIresp: ret_code=0 [0x0] (noError), ret_index=255
pDPIset: subtree=1.3.6.1.2.3.4.5.6, instance=** NONE **
object=1.3.6.1.2.3.4.5.6
value_type=NULL ['04'H], value_len=0
value=** NULL **
</pre>
<p>Next is an example of a "get" packet that is received by a subagent.
Immediately following that is the response packet that the subagent built
(indicated by the letter <samp>c</samp>) by calling <strong>
mkDPIresponse()</strong>.</p>
<pre>
pDPIpacket: Major=2, Version=2, Release=0, Id=2, Type=SNMP_DPI_GET
Community=** NONE **
pDPIget: subtree=1.3.6.1.2.3.4.5.6., instance=1.0
object=1.3.6.1.2.3.4.5.6.1.0
cDPIpacket: Major=2, Version=2, Release=0, Id=2, Type=SNMP_DPI_RESPONSE
cDPIresp: ret_code=0 [0x0] (noError), ret_index=0
cDPIset: subtree=1.3.6.1.2.3.4.5.6., instance=1.0
object=1.3.6.1.2.3.4.5.6.1.0
value_type=Integer32 ['81'H], value_len=4
value=1 [0x00000001]
</pre>
<p>Next is an example of the trace with the <em>level</em> parameter set to 2.
This causes a hexadecimal dump of the DPI packet to be generated when <strong>
pDPIpacket()</strong> is called, in addition to the trace level of 1. Next is
the same packet as parsed by <strong>pDPIpacket()</strong>, and immediately
following that is the response packet that the subagent built by calling
<strong>mkDPIresponse()</strong>.</p>
<pre>
Dump of 33 byte incoming DPI packet:
00 1f 02 02 00 00 03 02 00 00 f1 4b f3 4b f6 4b
f1 4b f2 4b f3 4b f4 4b f5 4b f6 4b 00 f5 4b f0
00
pDPIpacket: Major=2, Version=2, Release=0, Id=3, Type=SNMP_DPI_GETNEXT
Community=** NONE **
pDPInext: subtree=1.3.6.1.2.3.4.5.6., instance=5.0
object=1.3.6.1.2.3.4.5.6.5.0
cDPIpacket: Major=2, Version=2, Release=0, Id=3, Type=SNMP_DPI_RESPONSE
cDPIresp: ret_code=0 [0x0] (noError), ret_index=0
cDPIset: subtree=1.3.6.1.2.3.4.5.6., instance=6.0
object=1.3.6.1.2.3.4.5.6.6.0
value_type=Counter32 ['86'H], value_len=4
value=6 [0x00000006]
</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>