269 lines
7.5 KiB
HTML
269 lines
7.5 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>disconnectSNMP()--End Connection with SNMP Agent</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>disconnectSNMP()--End Connection with SNMP Agent</h2>
|
||
|
|
||
|
<div class="box" style="width: 70%;">
|
||
|
<br>
|
||
|
Syntax<br>
|
||
|
<pre>
|
||
|
#include <qtossapi.h>
|
||
|
|
||
|
int disconnectSNMP(
|
||
|
char <em>*queue_name</em>,
|
||
|
char <em>*lib_name</em>,
|
||
|
long int <em>timeout</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>disconnectSNMP()</strong> function ends the logical connection
|
||
|
between the SNMP subagent and the i5/OS SNMP agent.</p>
|
||
|
|
||
|
<br>
|
||
|
<h3>Authorities</h3>
|
||
|
|
||
|
<p>So that the subagent can receive messages from the SNMP agent, the following
|
||
|
conditions must be met:</p>
|
||
|
|
||
|
<ul>
|
||
|
<li>The library and data queue whose names are passed as a parameter in the
|
||
|
<strong>connectSNMP()</strong> call must exist prior to the call.<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li>The data queue and library names passed as parameters in the
|
||
|
<strong>disconnectSNMP()</strong> call must be the same as used in the
|
||
|
previous, successful <strong>connectSNMP()</strong> call.</li>
|
||
|
</ul>
|
||
|
|
||
|
<br>
|
||
|
<h3>Parameters</h3>
|
||
|
|
||
|
<dl>
|
||
|
<dt><strong>queue_name</strong></dt>
|
||
|
|
||
|
<dd>(Input) The name of the data queue (as a null-terminated string) on which
|
||
|
the subagent was receiving Distributed Protocol Interface (DPI) packets. This
|
||
|
should be the same data queue name as previously used in a call to
|
||
|
<strong>connectSNMP()</strong>.<br>
|
||
|
<br>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>lib_name</strong></dt>
|
||
|
|
||
|
<dd>(Input) The name of the i5/OS library (as a null-terminated string) to
|
||
|
which the data queue belongs. This should be the same library name as
|
||
|
previously used in a call to <strong>connectSNMP()</strong>.<br>
|
||
|
<br>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>timeout</strong></dt>
|
||
|
|
||
|
<dd>(Input) The amount of time in seconds that the subagent is willing to wait
|
||
|
for a disconnection. This field may contain any of these values:
|
||
|
|
||
|
<table cellpadding="5">
|
||
|
<!-- cols="5 95" -->
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>0</em> </td>
|
||
|
<td align="left" valign="top">Immediate disconnect, independent of whether or
|
||
|
not the SNMP agent is available or has responded</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>> 0</em> </td>
|
||
|
<td align="left" valign="top">The number of seconds to wait (maximum is
|
||
|
2 147 483 647)</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<p>Any other values result in an error return code.</p>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
<br>
|
||
|
<h3>Return Value</h3>
|
||
|
|
||
|
<p>The indicated 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 <strong>disconnectSNMP()</strong> function 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>-3</em></td>
|
||
|
<td align="left" valign="top"><em>snmpsa_RC_mismatch</em>
|
||
|
|
||
|
<p>There is a code-level mismatch between the agent and the subagent. If this
|
||
|
occurs, report the problem to the appropriate service organization.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>-4</em></td>
|
||
|
<td align="left" valign="top"><em>snmpsa_RC_timedout</em>
|
||
|
|
||
|
<p>The specified timeout value was exceeded.</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. This is more likely caused by errors in the
|
||
|
value of a parameter (for example, a value was too large or too small) or by a
|
||
|
pointer parameter that has a NULL value and should not. For char* parameters,
|
||
|
it may also be caused if the length of the string exceeds some limit.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>-8</em></td>
|
||
|
<td align="left" valign="top"><em>snmpsa_RC_lengtherr</em>
|
||
|
|
||
|
<p>During an attempt to communicate with the agent, a length exception
|
||
|
occurred. 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>An internal buffer was not obtained. 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>-14</em></td>
|
||
|
<td align="left" valign="top"><em>snmpsa_RC_sync</em>
|
||
|
|
||
|
<p>A synchronization problem occurred between the agent and subagent. If this
|
||
|
occurs, report the problem to the appropriate service organization.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<p>For more information, see "SNMP Subagent Problem Determination" in
|
||
|
the <a href="../bookssc415412.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>disconnectSNMP()</strong> function ends the logical connection
|
||
|
between the SNMP agent and a subagent. This is normally the last subagent API
|
||
|
that a subagent calls.</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>)<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li><a href="connsnmp.htm">connectSNMP()</a>--Establish Connection with SNMP
|
||
|
Agent</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>
|
||
|
int rc;
|
||
|
|
||
|
rc = disconnectSNMP( "QABCDEFG", "LIBABC", 0 );
|
||
|
if (rc) {
|
||
|
/* Handle exception. */
|
||
|
}
|
||
|
|
||
|
</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>
|
||
|
|