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

140 lines
7.8 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>Simple Network Management Protocol (SNMP) Subagent APIs</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 ========================================== -->
<!-- NETMG2 SCRIPT A converted by B2H R4.1 (346) (CMS) by HOLTJM at -->
<!-- RCHVMW2 on 29 Jan 1999 at 10:01:37 -->
<!-- File Edited December 2001 -->
<!-- 031112 JETAYLOR replaced API and/or Exit listings with -->
<!-- pagegenerator output from javascript array -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<a name="Top_Of_Page"></a>
<!-- Java sync-link -->
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript">
</script>
<h2>Simple Network Management Protocol (SNMP) Subagent APIs</h2>
<p>The SNMP Subagent APIs are:</p>
<!-- ***** NOTE ***** Do not manually update text or links in this section. -->
<!-- Updates made in this section *will* be overlaid by automated tools -->
<!-- Notify User Technologies of needed updates to be made in XML for API finder.-->
<!--***************API BEGIN PASTE***************-->
<ul>
<li><A HREF="connsnmp.htm">connectSNMP()</A> (Establish connection with SNMP agent) establishes a logical connection between the SNMP subagent and the local (the same iSeries) SNMP agent.</li>
<li><A HREF="debgsnmp.htm">debugDPI()</A> (Set DPI packet trace) sets the level of the Distributed Protocol Interface (DPI) packet trace.</li>
<li><A HREF="discsnmp.htm">disconnectSNMP()</A> (End connection with SNMP agent) ends the logical connection between the SNMP subagent and the iSeries SNMP agent.</li>
<li><A HREF="dlensnmp.htm">DPI_PACKET_LEN()</A> (Get length of DPI packet) returns the length (number of bytes) of a Distributed Protocol Interface (DPI) packet.</li>
<li><A HREF="fparsnmp.htm">fDPIparse()</A> (Free storage from DPI packet parse) frees storage that was previously allocated by a call to pDPIpacket() to store the DPI packet.</li>
<li><A HREF="fsetsnmp.htm">fDPIset()</A> (Free storage from DPI set packet) frees storage that was previously allocated for snmp_dpi_set_packet structures.</li>
<li><A HREF="aytsnmp.htm">mkDPIAreYouThere()</A> (Make a DPI AreYouThere packet) makes a DPI AreYouThere packet and returns a pointer to the packet.</li>
<li><A HREF="clossnmp.htm">mkDPIclose()</A> (Make a DPI close packet) makes a DPI close packet and returns a pointer to the packet.</li>
<li><A HREF="opensnmp.htm">mkDPIopen()</A> (Make a DPI open packet) makes a Distributed Protocol Interface (DPI) open packet and returns a pointer to the packet.</li>
<li><A HREF="regsnmp.htm">mkDPIregister()</A> (Make a DPI register packet) makes a Distributed Protocol Interface (DPI) register packet and returns a pointer to the packet.</li>
<li><A HREF="respsnmp.htm">mkDPIresponse()</A> (Make a DPI response packet) makes a DPI response packet and returns a pointer to the packet.</li>
<li><A HREF="setsnmp.htm">mkDPIset()</A> (Make a DPI set packet) makes a DPI set structure and adds it to a chained list of set structures if previous calls have been made.</li>
<li><A HREF="trapsnmp.htm">mkDPItrap()</A> (Make a DPI trap packet) makes a DPI trap packet and returns a pointer to the packet.</li>
<li><A HREF="uregsnmp.htm">mkDPIunregister()</A> (Make a DPI unregister packet) makes a DPI unregister packet and returns a pointer to the packet.</li>
<li><A HREF="ppacsnmp.htm">pDPIpacket()</A> (Parse a DPI packet) parses a serialized Distributed Protocol Interface (DPI) packet to make it available for processing by the subagent.</li>
<li><A HREF="recvsnmp.htm">receiveDPIpacket()</A> (Receive a DPI packet from the SNMP agent) obtains a copy of a DPI packet sent by the SNMP agent to the subagent, and returns the DPI packet to the caller.</li>
<li><A HREF="sendsnmp.htm">sendDPIpacket()</A> (Send a DPI packet to the SNMP agent) sends a copy of a Distributed Protocol Interface (DPI) packet to the SNMP agent (on the same system as the subagent).</li>
<li><A HREF="waitsnmp.htm">waitDPIpacket()</A> (Wait for a DPI packet) waits for a message on the data queue with which the subagent has previously connected (see connectSNMP()--Establish Connection with SNMP Agent).</li>
</ul>
<!--***************API END PASTE***************-->
<p><strong>Note:</strong> These functions use header (include) files from the
library QSYSINC, which is optionally installable. Make sure QSYSINC is
installed on your system before using any of the functions. All of the SNMP
subagent APIs use header file <strong>qtossapi.h</strong>. You can see this
source in source file H, member name QTOSSAPI, in the QSYSINC library.</p>
<p>The Simple Network Management Protocol (SNMP) subagent APIs can be used to
dynamically extend the management information base (MIB) that the system SNMP
agent is aware of. The MIB is extended, without any change to the SNMP agent
itself, while the iSeries is running. Dynamically added MIB subtrees (as
defined and supported by a program known as a subagent) provide this
capability. You may now extend the remote and automated system management
capabilities of the iSeries within the SNMP framework. So, for example, you
could define an SNMP MIB group for your RPG and SQL application, and then use
SNMP protocol data units (PDUs), such as get and set, to determine status
information or to make changes in control variables.</p>
<p>The term <strong>Distributed Protocol Interface (DPI) packet</strong> is
used throughout this information. The DPI is an extension to SNMP agents that
permit users to dynamically add, delete, or replace management variables in the
local MIB without requiring recompilation of the SNMP agent.</p>
<p>The diagram below shows typical DPI API call sequences that are used to
accomplish the SNMP subagent functions that are listed.</p>
<table cellpadding="5">
<!-- cols="15 85" -->
<tr>
<td align="left" valign="top"><strong><em>(A)</em></strong></td>
<td align="left" valign="top">Subagent initiation</td>
</tr>
<tr>
<td align="left" valign="top"><strong><em>(B)</em></strong></td>
<td align="left" valign="top">Subagent registration (loop for multiple
subtrees)</td>
</tr>
<tr>
<td align="left" valign="top"><strong><em>(C)</em></strong></td>
<td align="left" valign="top">Normal processing loop for a subagent, starting
with a wait for a (get, getnext, set...) packet from the SNMP agent
(<samp>other</samp> may be an unregister or close packet)</td>
</tr>
<tr>
<td align="left" valign="top"><strong><em>(D)</em></strong></td>
<td align="left" valign="top">A common call sequence that might be
consolidated</td>
</tr>
<tr>
<td align="left" valign="top"><strong><em>(E)</em></strong></td>
<td align="left" valign="top">Subagent initiated trap</td>
</tr>
<tr>
<td align="left" valign="top"><strong><em>(F)</em></strong></td>
<td align="left" valign="top">Subagent termination
<p>A loop around <strong>mkDPIset()</strong> represents building a packet with
multiple varbinds.</p>
</td>
</tr>
</table>
<p><strong><a name="FIGSNMPFIG">DPI API Call
Sequences--Example</a></strong></p>
<p><img src="rv3w219.gif" alt="DPI API Call Sequences--Example"></p>
<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>