Questions for performing basic operations on a table using agent ++

Chaudhury, Neel nchaudhury____iPolicyNet.COM
Wed Apr 25 07:35:35 CEST 2001


Hi Frank and the mailing list,

I face some basic problems, when I try to use the basic operations on a
table defined in my mib.
Please take some time to look at my problem. Sorry for giving you trouble
and the length of the mail. 

Upon receiving a request on a table from the manager, my agent should reply
back to the manager reading some information from the database. For this, 
do I need to add a row first to the mib table entry? Could please check the
CODE below, if I am doing anything wrong.
and ....
1. when I do get on one of the leaf node of table entry with/out the index,
it gives the error "SNMP: Variable does not exist or Access is denied"
	Why is it so? what do I need to do for this to happen?
I have the following observation having been tried to debug the problem:
When it goes to OidxPtrEntryPtrAVLMap::seek_inexact( ) from
Mib::process_request( ) - find_managing_object( ), the root was a valid
pointer and the find_managing_object( ) returned a valid entry object. After
that when it goes to OidxPtrEntryPtrAVLMap::seek( ) from
MibTable::get_request(req, ind) - MibTable::find( ) -
OidList<MibTableRow>::find( ), the root is a NULL pointer and returns NULL
from there. The response is built with sNMP_SYNTAX_NOSUCHINSTANCE and
returned to the manager.

I don't understand, why the root is a NULL pointer in the second place?
Please let me know , if I am doing anything wrong

// CODE
        ipenforcer_smi *pMyMib = new ipenforcer_smi();	// instantiate my
mib object
        ipEnfStatCfgFwAnlysEntry *pFwEntry = new ipEnfStatCfgFwAnlysEntry();
// a table entry
        Oidx index1 = "1";
        Oidx index2 = "2";

        if( !pFwEntry->is_index_valid(index1))
            cout << "Error : Invalid Index1" << endl;
        if( !pFwEntry->is_index_valid(index2))
            cout << "Error : Invalid Index2" << endl;

        MibTableRow * row1 = pFwEntry->getInstance()->add_row(index1);
        MibTableRow * row2 = pFwEntry->getInstance()->add_row(index2);

        pFwEntry->getInstance()->set_row(row1, 1,
"row1",1,10000,"04/24/2001", 100, 100, 100,100,100, 100, 100,100,100);
        pFwEntry->getInstance()->set_row(row2, 2,
"row2",1,20000,"04/24/2001", 100, 100, 100,100,100, 100, 100,100,100);

        mib.add(pMyMib);	// registering my mib with the mib object

Any kind of help would be greatful.
Thanking you in advance,

Neel
nchaudhury at ipolicynet.com
iPolicy Networks Inc.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Neel Madhav Chaudhury (E-mail).vcf
Type: application/octet-stream
Size: 632 bytes
Desc: not available
Url : http://lists.agentpp.org/pipermail/agentpp/attachments/20010425/25336f85/attachment.dll 


More information about the AGENTPP mailing list