Including The Routines And Building The Subagent - Compaq TCP/IP Services for OpenVMS Programming And Reference Manual

Tcp/ip services for openvms
Table of Contents

Advertisement

3. Initialized Subtree Structure Section
The third section of the subtree_TBL.C file is the SUBTREE structure itself. A
pointer to this structure is passed to the eSNMP library routine
to register the subtree. It is through this pointer that the library routines find
the object structures. The following is an example of the chess subtree structure:
SUBTREE chess_subtree = { "chess", "1.3.6.1.4.1.36.2.15.2.99",
The following table describes the elements of the SUBTREE structure, the
definition of each element in the header file (subtree_TBL.H)), and the element in
the chess example:
Description
The name of the subtree's base
element.
The ASCII string representation
of the subtree's OID. This is what
actually gets registered.
The OID structure for the base
node of the subtree. This points
back to the array of integers.
A pointer to the array of objects
in the object table. It is indexed
I_xxxx
by the
the subtree_TBL.H file.
The index of the last object in the
object_TBL file. This is used to
determine when the end of the
table has been reached.
4. Routines Section
The final section of the subtree_TBL.C file. contains short routines for allocating
and freeing the
not a required part of the API.

3.4 Including the Routines and Building the Subagent

The MIB compiler does not generate code for implementing the method routines
for your subagent. This includes code for processing
requests as well as for generating traps. You must write this code yourself. See
the CHESS_MIB.C module for an example.
To produce executable subagent code, follow these steps:
1. Compile the C modules generated by the MIB compiler, along with your
implementation code. Use a command in the following format (derived from
the sample provided for building the chess example in TCPIP$BUILD_
CHESS.COM):
$ CC /INCLUDE=TCPIP$SNMP /PREFIX=ALL /STANDARD=VAX CHESS_METHOD.C, -
_$ CHESS_MIB.C, CHESS_TBL.C
Creating a Subagent Using the eSNMP API
{ 11, &elems[0] }, objects, I_moveStatus};
Header File
Representation
name
dots
oid
object_oid
definitions found in
last
. These are provided as a convenience and are
mib_group_type
3.3 Creating a MIB Source File
Example
"chess"
"1.3.6.1.4.1.36.2.15.2.99"
11, &elems[0] }
objects
I_moveStatus
,
get
set
Creating a Subagent Using the eSNMP API 3–11
esnmp_register
, and other SNMP

Advertisement

Table of Contents
loading

Table of Contents