Compaq TCP/IP Services for OpenVMS Programming And Reference Manual page 38

Tcp/ip services for openvms
Table of Contents

Advertisement

Creating a Subagent Using the eSNMP API
3.3 Creating a MIB Source File
1. Declaration Section
The first section of the subtree_TBL.H file is a declaration of the subtree
structure. The subtree is automatically initialized by code in the subtree_TBL.C
file. A pointer to this structure is passed to the
register a subtree with the master agent. All access to the object table for this
subtree is through this pointer. The declaration has the following form:
extern SUBTREE subtree_subtree;
2. Index Definitions Section
The second section of the subtree_TBL.H file contains index definitions for each
MIB variable in the subtree of the form:
#define I_mib-variable nnn
These values are unique for each MIB variable in a subtree and are the index into
the object table for this MIB variable. These values are also generally used to
differentiate between variables that are implemented in the same method routine
so they can be used in a switch operation.
3. Enumeration Definitions Section
The third section of the subtree_TBL.H file contains enumeration definitions for
those integer MIB variables that are defined with enumerated values, as follows:
#define D_mib-variable_enumeration-name value
These definitions are useful because they describe the value that enumerated
integer MIB variables may take on. For example:
/* enumerations for gameEntry group */
#define
#define
#define
4. MIB Group Data Structure Definitions Section
The fourth section of the subtree_TBL.H file contains data structure definitions of
the following form:
typedef structxxx {
type
.
.
.
char
.
.
.
} mib-group_type
The MIB compiler generates one of these data structures for each MIB group
in the subtree. Each structure definition contains a field representing each
MIB variable in the group. In addition to the MIB variable fields, the structure
includes a 1-byte mib-variable-mark field for each variable. You can use these for
maintaining status of a MIB variable. For example, the following is the group
structure for the chess MIB:
3–8 Creating a Subagent Using the eSNMP API
D_gameStatus_complete
D_gameStatus_underway
D_gameStatus_delete
mib-variable;
mib-variable_mark;
routine to
esnmp_register
1
2
3

Advertisement

Table of Contents
loading

Table of Contents