225 lines
6.1 KiB
HTML
225 lines
6.1 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>sendDPIpacket()--Send a DPI Packet to the SNMP Agent</title>
|
||
|
<!-- 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. -->
|
||
|
<!-- Begin Header Records ========================================== -->
|
||
|
<!-- Direct1 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
|
||
|
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
|
||
|
<!--End Header Records -->
|
||
|
<!-- Edited by Kersten Feb 02 -->
|
||
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
||
|
</head>
|
||
|
<body>
|
||
|
<a name="Top_Of_Page"></a>
|
||
|
<!-- Java sync-link -->
|
||
|
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
|
||
|
</script>
|
||
|
|
||
|
<h2>sendDPIpacket()--Send a DPI Packet to the SNMP Agent</h2>
|
||
|
|
||
|
<div class="box" style="width: 60%;">
|
||
|
<br>
|
||
|
Syntax<br>
|
||
|
<pre>
|
||
|
#include <qtossapi.h>
|
||
|
|
||
|
int sendDPIpacket( void <em>*dpimsg_p</em>, int <em>length</em> );
|
||
|
|
||
|
</pre>
|
||
|
|
||
|
<br>
|
||
|
Service Program Name: QTOSSAPI<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
Default Public Authority: *USE<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
Threadsafe: No<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
</div>
|
||
|
|
||
|
<p>The <strong>sendDPIpacket()</strong> function sends a copy of a Distributed
|
||
|
Protocol Interface (DPI) packet to the SNMP agent (on the same iSeries server
|
||
|
as the subagent).</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>dpimsg_p</strong></dt>
|
||
|
|
||
|
<dd>(Input) A pointer to the serialized DPI packet.<br>
|
||
|
<br>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>length</strong></dt>
|
||
|
|
||
|
<dd>(Input) The length in bytes of the DPI packet to be sent.</dd>
|
||
|
</dl>
|
||
|
|
||
|
<br>
|
||
|
<h3>Return Value</h3>
|
||
|
|
||
|
<p>The return values are defined in the <strong><qtossapi.h></strong>
|
||
|
file.</p>
|
||
|
|
||
|
<table cellpadding="5">
|
||
|
<!-- cols="5 95" -->
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>0</em></td>
|
||
|
<td align="left" valign="top"><em>snmpsa_RC_ok</em>
|
||
|
|
||
|
<p>The routine was successful.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>-1</em></td>
|
||
|
<td align="left" valign="top"><em>snmpsa_RC_err</em>
|
||
|
|
||
|
<p>An exception occurred. Check the subagent job log for the exception
|
||
|
information, correct the condition, and resubmit the subagent job. (This return
|
||
|
code is only used when a more specific return code is not available.)</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>-2</em></td>
|
||
|
<td align="left" valign="top"><em>snmpsa_RC_noagent</em>
|
||
|
|
||
|
<p>The SNMP agent is not available.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>-4</em></td>
|
||
|
<td align="left" valign="top"><em>snmpsa_RC_timedout</em>
|
||
|
|
||
|
<p>An internal time-out occurred. See the job log for further information about
|
||
|
the exception.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>-7</em></td>
|
||
|
<td align="left" valign="top"><em>snmpsa_RC_parmerr</em>
|
||
|
|
||
|
<p>A parameter error occurred, probably a null pointer.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>-8</em></td>
|
||
|
<td align="left" valign="top"><em>snmpsa_RC_lengtherr</em>
|
||
|
|
||
|
<p>The length parameter may be incorrect, or the DPI packet to be sent is
|
||
|
longer than the maximum length supported, or the length specified is not a
|
||
|
positive number. See any messages in the job log and correct any errors that
|
||
|
are indicated, then retry the operation.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>-9</em></td>
|
||
|
<td align="left" valign="top"><em>snmpsa_RC_buffer</em>
|
||
|
|
||
|
<p>If the subagent was trying to send a response to an SNMP agent request (for
|
||
|
example, using get packets), it cannot be sent. The subagent may continue. (The
|
||
|
SNMP manager may retry the original request.) If the subagent was trying to
|
||
|
send a subagent-initiated packet (for example, using open or register packets),
|
||
|
then a dynamic buffer was unavailable, probably due to agent workload. The
|
||
|
subagent may try to send the packet again.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>-11</em></td>
|
||
|
<td align="left" valign="top"><em>snmpsa_RC_canttrap</em>
|
||
|
|
||
|
<p>A trap cannot be sent to the SNMP agent at this time, probably due to
|
||
|
pending agent workload. The subagent may retry.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>-12</em></td>
|
||
|
<td align="left" valign="top"><em>snmpsa_RC_connectfirst</em>
|
||
|
|
||
|
<p>The subagent must connect to the SNMP agent before making this call.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<p>For more information, see "SNMP Subagent Problem Determination" in the <a
|
||
|
href="../books/sc415412.pdf" target="_blank">>Simple Network Management
|
||
|
Protocol</a> <img src="wbpdf.gif" alt="Link to PDF">.</p>
|
||
|
|
||
|
<br>
|
||
|
<h3>Usage Notes</h3>
|
||
|
|
||
|
<p>The <strong>sendDPIpacket()</strong> function sends a copy of a DPI packet
|
||
|
that was sent to the SNMP agent.</p>
|
||
|
|
||
|
<br>
|
||
|
<h3>Related Information</h3>
|
||
|
|
||
|
<ul>
|
||
|
<li>The <<strong>qtossapi.h</strong>> file (see <a href="unix13.htm">Header
|
||
|
Files for UNIX-Type Functions</a>)</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 <qtossapi.h>
|
||
|
unsigned char *pack_p;
|
||
|
int rc;
|
||
|
|
||
|
pack_p = mkDPIopen("1.3.6.1.2.3.4.5",
|
||
|
"Sample DPI sub-agent"
|
||
|
0L,2L, DPI_NATIVE_CSET,
|
||
|
0,(char *)0);
|
||
|
if (pack_p) {
|
||
|
|
||
|
/* Send packet to the agent. */
|
||
|
rc = sendDPIpacket( pack_p, DPI_PACKET_LEN(pack_p) );
|
||
|
|
||
|
}
|
||
|
</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>
|
||
|
|