How to sync a MibTable with an STL::vector?

Stefan.Mueller-Wilken____resco.de Stefan.Mueller-Wilken____resco.de
Tue Apr 15 15:47:44 CEST 2003






Hi Frank,

first of all thanks for your patience. :-)

> > Okay. Got that. But there is no single hook, is there? No method that's
> > called only once before the table is walked? Sorry if I repeat myself,
but
> > MibTable::update seems to be called more than once while cycling
through
> > the table...
> >
> If you have an idea how one would detect when a
> table is walked, then such a method could be written.
> But in real life SNMP, a request can contain subrequests
> to more than one table and these tables may have different
> refresh time constrains. That's why I did not implement
> a generic solution, because although it could seem helpful
> in the first place, on the long run, it could inhibit a
> proper solution.

Seems you're right: as long as the NMS walks the table with a single
MibLeaf lookahead taken from the previous get-request, you can't tell if
the get-next is part of a complete table walk or just access to a single
MibLeaf. Loriot (the NMS I've used) obviously does not consult the MIB
first when walking the agent to optimize multiple gets to a table in one
request. That's most likely why I end up with nine get-requests and nine
updates.

My solution so far is to introduce an "invalidation flag" to my vector that
is checked from within MibTable::update. The table will only be
reconstructed if the flag has been set by a "push_back", a delete or
anything else that had changed the vector since its last reconstruction.
And this is certainly something that Agent++ as a framework can't
introduce.

> > Yeah, it sure does. Still, it would be great to have more demonstration
> > code to get an impression about how others have come to a solution.
> >
> May be someone on the list has another example.

Might be Alex or Martin who could help us here. Maybe (well, most likely,
that is ;-) ...) they have found smarter solutions than I have.

> Have you already looked at the dynamic_table example
> code?

Sure. Unfortunately dynamic_table does not back its table with an external
datastructure and thus couldn't show how to do the trick.

Cheers,
 Stefan




More information about the AGENTPP mailing list