[AGENT++] mib->find_group_of fails

Jochen Katz katz at agentpp.com
Sat Oct 8 16:42:47 CEST 2005


Hi Ajit,

> the order of operations is something like this:
> 
> Mib* mib=new Mib();
> MibGroup* g=new Group(OID);
>  g->add(new MibLeaf(SUBOID,READONLY,OctetStr("value"));
> mib->add(g);
> g=mib->find_group_of("",OID);//g==0

the following is the "right" code for your goal:

	MibContext *c = mib.get_context("");
	MibGroup* g = c->find_group(OID);

The find_group_of() method checks if the given OID exists, so
mib->find_group_of("",OID) returns 0 and
mib->find_group_of("",SUBOID) returns the valid group pointer.

Regards,
  Jochen





More information about the AGENTPP mailing list