beautypg.com

Esnmp_unregister – Compaq AAR04BCTE User Manual

Page 64

background image

eSNMP API Routines
esnmp_unregister

esnmp_unregister

Cancels registration of a MIB subtree previously registered with the master
agent.

Format

int esnmp_unregister ( SUBTREE *subtree ) ;

Arguments

subtree

A pointer to a subtree structure corresponding to the subtree to be handled.
The code emitted by the MIB compiler files (subtree_TBL.C and subtree_TBL.H)
externally declare and initialize the subtree structures. Refer to Chapter 3 for
more information about these files.

Description

This routine can be called by the application code to tell the eSNMP subagent

not to process requests for variables in this MIB subtree anymore. You can later
reregister a MIB subtree, if needed, by calling the

esnmp_register

routine.

Return Values

SNMP_LIB_OK

The

esnmp_unregister

routine has completed

successfully.

ESNMP_LIB_BAD_REG

The MIB subtree was not registered.

ESNMP_LIB_LOST_
CONNECTION

The request to unregister the MIB subtree could
not be sent. You should restart the protocol.

Example

#include
int status

extern SUBTREE ipRouteEntry_subtree;

status = esnmp_unregister (&ipRouteEntry_subtree);

switch (status) {
case ESNMP_LIB_OK:

printf ("The esnmp_unregister routine completed successfully.\n");
break;

case ESNMP_LIB_BAD_REG:

printf ("The MIB subtree was not registered.\n");

case ESNMP_LIB_LOST_CONNECTION:

printf ("%s%s%s\n", "The request to unregister the ",

"MIB subtree could not be sent. ",
"You should restart the protocol.\n");

break;
}

5–6 eSNMP API Routines