SNMP Subagent Programmer's Guide
Writing Subagent Logic
SNMP Subagent Programmer’s Guide—119728 4-7
Management Functions
mgmt_del_instance()
The mgmt_del_instance() function de-registers MIB objects with the run-time library, 
releasing memory used for management of the objects. Use this function when you are 
finished managing any MIB object collections for which you previously used 
mgmt_new_instance(). 
rc
is an integer indicating the success of the function call. A value of 0 indicates 
success; any other value indicates that the call could not be completed.
mgmt-env
is the void pointer returned from an earlier call to mgmt_init_env().
instance-handle
is the void pointer returned from an earlier call to mgmt_new_instance() that made 
the MIB objects manageable.
Entry Condition
The MIB object collection must have already been named in a mgmt_del_instance() call. 
In addition, mgmt-env and instance-handle must not be NULL.
Exit Condition
The mgmt_del_instance() function does not change the value of instance-handle, but a 
run-time error occurs if the subagent uses this argument again without issuing a 
mgmt_new_instance() call first.
Errors
If either of the arguments is invalid, this function returns EFAULT.
Example
The following example is taken from the Hello World sample program. The program 
calls mgmt_del_instance() if it encounters an unrecoverable condition. This call 
#include "errnoh"
#include "mgmtpubh"
rc = mgmt_del_instance(mgmt-env, instance-handle);
int
mgmt_del_instance(mgmt-env, instance-handle);
 void *mgmt-env;
 void *instance-handle;










