set mib leaf function
Noam Wolf
NoamW____flashnetworks.com
Tue Apr 17 13:14:41 CEST 2001
Hi All
I'm trying to make an API to set a Mib Leaf's value (so it could be used
from C modules also).
When I get to the function leaf->set_value(vb), I get an error of User
Breakpoint called from...
The error is actually generated when the MibLeaf is trying to execute the
function void MibLeaf::free_value()
Is my API the right way to set a MibLeaf ? (of integer type)
int fAgent_SetMibVar (int value, // IN: The
new value of the mib leaf
char* pszOid) //
IN: The oid of the variable to be set
{
//------------------[local declerations]---------------------------------
int ret = AGENT_FAIL; //int the return value of the function
Vbx vb; //the Vb that will
be set into the mib leaf
MibEntryPtr entry; //entry to the mib - pointer
to the mib leaf
MibLeaf* leaf; //a pointer to the mib leaf
to be set
//------------------[function flow]--------------------------------------
vb.set_oid(pszOid);
vb.set_value(value);
Oidx tmpoid(pszOid);
entry = mib->get(tmpoid);
leaf =((MibLeaf*)entry);
mib->lock_mib();
if(leaf->set_value(vb)==SNMP_ERROR_SUCCESS)
ret = AGENT_SUCCESS;
mib->unlock_mib();
return ret;
}
thanks,
Noam Wolf
More information about the AGENTPP
mailing list