Simple Network Management Protocol (SNMP) APIs

Before you use the SNMP APIs, you should read the Simple Network Management Protocol (SNMP) Support book Link outside Information Center. It describes how to configure AS/400 to use SNMP. It also discusses SNMP agents, subagents, managers, and management information base (MIBs). For information about using the SNMP APIs, see "Using the SNMP Subagent DPI API" in the book Simple Network Management Protocol (SNMP) Support Link outside Information Center.

You can get more information about SNMP and Distributed Protocol Interface (DPI) from Requests for Comment (RFC) on the Internet. A file called ways_to_get_rfcs has details about obtaining RFCs. To receive these details send an EMAIL message as follows:

To:  rfc-info@ISI.EDU
Subject:  gettingrfcs
help:  ways_to_get_rfcs
DPI is described in RFC 1592, "Simple Network Management Protocol Distributed Protocol Interface," Version 2.0.

The SNMP APIs include the SNMP subagent APIs and the SNMP manager APIs. This document contains information about the SNMP subagent APIs. See Simple Network Management Protocol (SNMP) Manager APIs for information about the SNMP manager APIs.

SNMP Subagent APIs

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 AS/400 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 AS/400 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.

The term Distributed Protocol Interface (DPI) packet is used throughout this chapter. 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.

SNMP Subagent APIs--Summary

The following table lists the network functions that are supported by the SNMP subagent APIs.

Figure 1-1. SNMP Subagent Functions
Operation Description
connectSNMP() Establish connection with SNMP agent
debugDPI() Set DPI packet trace
disconnectSNMP() End connection with SNMP agent
DPI_PACKET_LEN() Get length of DPI packet
fDPIparse() Free storage from DPI packet parse
fDPIset() Free storage from DPI set packet
mkDPIAreYouThere() Make a DPI AreYouThere packet
mkDPIclose() Make a DPI close packet
mkDPIopen() Make a DPI open packet
mkDPIregister() Make a DPI register packet
mkDPIresponse() Make a DPI response packet
mkDPIset() Make a DPI set packet
mkDPItrap() Make a DPI trap packet
mkDPIunregister() Make a DPI unregister packet
pDPIpacket() Parse a DPI packet
receiveDPIpacket() Receive a DPI packet from the SNMP agent
sendDPIpacket() Send a DPI packet to the SNMP agent
waitDPIpacket() Wait for a DPI packet

Note: 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 qtossapi.h. You can see this source in source file H, member name QTOSSAPI, in the QSYSINC library.

The figure below shows typical DPI API call sequences that are used to accomplish the following SNMP subagent functions:

(A)
Subagent initiation
(B)
Subagent registration (loop for multiple subtrees)
(C)
Normal processing loop for a subagent, starting with a wait for a (get, getnext, set...) packet from the SNMP agent (other may be an unregister or close packet)
(D)
A common call sequence that might be consolidated
(E)
Subagent initiated trap
(F)
Subagent termination

A loop around mkDPIset() represents building a packet with multiple varbinds.

DPI API Call Sequences--Example





Top | UNIX-Type APIs
APIs by category


[Information Center Home Page | Feedback ] [Legal | AS/400 Glossary]