Adding TableRows w/ multiple indexes

Adelberg, Robert (RADELBER) RADELBER____arinc.com
Wed Oct 11 22:30:25 CEST 2000


At initialization, I need to populate a mib table from a configuration file.
I have a doubly indexed table defined as:

linkEntry       OBJECT-TYPE
    SYNTAX      LinkEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
            "Information about a particular SSP.
            Each entry provides the Name and Location of the SSP."
    INDEX   { nodeIP, linkIndex }
    ::= { linkTable 1 }

The MibTable::add_row() only takes one index, how do I add a row with two
indexes?
I tried it like this: where I want a row of (NodeA,Link123) and a row of
(NodeA,Link321).
 
	Oidx nodeindex = "10.0.0.207";
	Oidx linkindex = "7";
	
	MibTableRow* r = nodeEntry::instance->add_row(nodeindex);
	nodeEntry::instance->set_row(r, "Node A",1,"Phoenix");

	r = linkEntry::instance->add_row(nodeindex);
	linkEntry::instance->set_row(r,1,"Link123",1,1);

->	r = linkEntry::instance->add_row(nodeindex);
	linkEntry::instance->set_row(r,2,"Link321",1,2);

but the second link add_row() overwrites the first. And only "Link321" is in
the table.
If the MibTable class has to be subclassed, is there an example of this?

The AgentGenerator generated code like this:
void linkEntry::set_row(MibTableRow* r, long p0, char* p1, long p2, long p3)
{
	r->get_nth(0)->replace_value(new SnmpInt32(p0));
	r->get_nth(1)->replace_value(new OctetStr(p1));
	r->get_nth(2)->replace_value(new SnmpInt32(p2));
	r->get_nth(3)->replace_value(new SnmpInt32(p3));
}
where, the first column ( nth(0) ) is the linkindex. Does this need to be
modified?
The atm_mib example has multiple indexed tables but does not use add_row().


Thanks in advance,

Rob


Rob Adelberg
Arinc, Inc.
(480) 755-3094




More information about the AGENTPP mailing list