SNMP Subagent Programmer's Guide

Compiling MIBs
3-18 119728SNMP Subagent Programmer’s Guide
Writing and Compiling MIBs
installing your MIB definition on a manager station. In the following syntax notation,
the concise MIB constructs are in a file named MYMIB.
Compiling MIBs
You use GDMOC, the MIB compiler, to compile your MIB definition into a header file
that you include in your subagent source code:
#include "GDMOC-output-file"
Invoke GDMOC like this.
MIB-definition-file
identifies the file containing your MIB definition.
include-pathname
identifies the subvolume on which include files named in your MIB definition are
located.
GDMOC-output-file
identifies the header file to hold the compiled MIB definition. The subagent source
code includes this file globally after the declarations that include Toolkit header files
and identify MIB variables.
The GDMOC output file contains the elements needed by the management and callback
functions described in Section 4, “Writing Subagent Logic”:
Include directives identifying required header files
Access methods and related structure declarations for each MIB object
#include "MYMIB"
EXTEND OBJECT-TYPE MIB-object-name
WITH extensions
IN C
RUN ZSNMPSDK.GDMOC -g MIB-definition-file
[-I include-pathname [,include-pathname...]]
-c GDMOC-output-file