SNMP Subagent Programmer's Guide

SNMP Subagent Programmer’s Guide119728 4-1
4
Writing Subagent Logic
This section describes how to handle the following elements in your C source code:
Header files needed to use the run-time library.
MIB variable declarations that allocate storage for MIB object values.
Management functions, which your subagent calls to initiate SNMP message
handling operations.
Callback functions, which you optionally encode for the run-time library to call.
There are three kinds of callback functions: access functions, locator functions, and
next functions.
Header Files
You need to provide global include directives to identify several kinds of header files:
header files provided with the Toolkit and the GDMOC output file.
Toolkit Header Files
The Toolkit comes with a large number of header files. Because GDMOC includes
many of these files in its output and because many of the header files include other files,
you only need to be concerned with a few of them.
All subagents should include five header files globally; these header files provide
definitions specific to the Tandem implementation of the Toolkit as well as definitions
and declarations needed by all the management functions:
tdmporth
machtyph
syspubh
smitypeh
mgmtpubh
Note. Always include tdmporth first. The order of the include directives is otherwise arbitrary.