beautypg.com

Esnmp_unregister2 – Compaq AAR04BCTE User Manual

Page 69

background image

eSNMP API Routines

esnmp_unregister2

esnmp_unregister2

Cancels registration of a MIB subtree previously established with the master
agent. Use this routine only when the MIB subtree was registered using the

esnmp_register2

routine.

Format

int esnmp_unregister2 ( ESNMP_REG *reg ) ;

Arguments

reg

A pointer to the ESNMP_REG structure that was used when the

esnmp_register2

routine was called.

Description

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

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

esnmp_register2

routine.

Return Values

ESNMP_LIB_OK

The routine 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 ESNMP_REG esnmp_reg_for_ip2egp;

status = esnmp_unregister2( &esnmp_reg_for_ip2egp );

switch(status) {

case ESNMP_LIB_OK:
printf("The esnmp_unregister2 routine completed successfully.\n");
break;

case ESNMP_LIB_BAD_REG:
printf("The MIB subtree was not registered.\n");
break;

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;

}

eSNMP API Routines 5–11