SNMP Subagent Programmer's Guide
Writing Subagent Logic
SNMP Subagent Programmer’s Guide—119728 4-35
Callback Functions
Next Functions
Next functions are used to return the lexically next set of indexes for an entry in a
dynamic table. When the run-time library calls this function, it supplies index values.
The function overwrites the current index pointers with pointers to the values of the
indexes of the next table entry. Always provide a locator function and a next function
when you do not register each entry in tables you make available for manager access.
int
is 0 if the function succeeds or 2 (ENOENT) if it fails. The failure literal is defined
in the header file named errnoh.
next-function-name
is the name that appears in the MIB definition in the INDEX clause for the table
entry:
MIB-object-name OBJECT-TYPE
...
INDEX index-list [C_NEXT_FUNC next-function-name]
...
parent-context
is an input pointer to the context of the parent of the table. The value of parent-
context is the same as that passed to mgmt_new_instance in the context argument for
the parent of the table.
index-list
is an input/output pointer to an ordered array of pointers. Each pointer in the array
points to an index value. If the run-time library calls this function with NULL as the
first element of this array, the array should be filled in with pointers to the index
values of the first table entry. The function must lexically compare index values to
determine the next entry of the table.
#include "stdtypeh"
#include "errnoh"
int
next-function-name (parent-context, index-list);
void *parent-context;
void **index-list;