SNMP Subagent Programmer's Guide

Writing and Compiling MIBs
SNMP Subagent Programmer’s Guide119728 3-13
Encoding MIBs
entry-name
is the logical name for the object type describing Entry-Name. Like other OBJECT-
TYPE names, the convention is to encode this name using an initial lower-case
letter:
tableEntry OBJECT-TYPE
INDEX index-list [C_NEXT_FUNC next-function-name]
defines how each entry is indexed. An index-list is one or more objects in a table
entry whose values distinguish the entry. A complete definition for each entry
object named must appear later, under scalar-object-definition.
The next-function-name in the optional C_NEXT_FUNC clause identifies a function
known as a “next function.” A next function is used in conjunction with a locator
function when your subagent does not register each table entry before the table is
accessed. Next and locator functions are encoded in your subagent and called by the
run-time library when it needs to access an entry.
When a subagent registers all the entries each time a manager accesses the table,
registration provides the run-time library all the information it needs to find entries,
so the subagent does not provide next and locator functions. However, when a
subagent manages dynamic tables and you do not want the overhead of registering
all the entries each time the table is accessed, you register the entire table and
encode a locator and a next function in your subagent. The next function returns the
index for an entry. The locator function uses the index value to find the entry.
The run-time library calls your next function and then calls your locator function
when handling GetNext requests. The run-time library calls your locator function
when handling Get and Set requests. The locator function called is the function
named in the C_LOCATOR_FUNC clause of the entry-object-definition for each
object that constitutes the index.
Refer to Section 4, “Writing Subagent Logic,” for information about how and when
to encode locator and next functions and how to use mgmt_new_instance() to
accomplish table-level or entry-level registration.
entry-object-name
identifies the subtree in which the entry resides and a number for the entry, as
defined earlier in this section for object-name, under “Object Name Definitions.
The name of the subtree in which the table resides is always a table name.
scalar-object-name
is the logical name for an object in the entry. A complete definition for the object
must appear later, under scalar-object-definition.
"{"scalar-object-name [,scalar-object-name...]"}"