Q:On MibTable

Jochen Katz katz____agentpp.com
Wed May 10 14:47:21 CEST 2000


Hi,

> I want to add rows and delete rows whenever get /get next request comes
> on a
> MibTable . I tried to override the MibTable::get_request and
> MibTable::get_next_request function in the derived class . But problem
> is
> when the agent comes , initialy there is a chance that no rows may be
> present.
> So the control is not coming to any of the above functions as there are
> no rows.
> So how to add/remove  the rows using the functions add_row and
> remove_row dynamicaly ?

you will have to override some more methods of MibTable. The
following is an answer of Frank Fock to a similar problem:

| > Could you help us with this scenario. I am designing 
| > a mib table that relies on an external (non SNMP) object 
| > to hold all its data. So to avoid duplication, I would 
| > like to get away without ever "populating" the table. All 
| > gets/sets would be delegated using appropriate API to the 
| > external object. Similarly, calls to find the next index 
| > would be propagated to the external object as well. 
| 
| You can do this with by subclassing MibTable. All relevant 
| methods are virtual. You have to override a couple of 
| methods, for example
| MibTable::find_next(const Oidx&), 
| MibTable::find_succ(const Oidx&, Request*), 
| MibTable::is_empty(), as well as
| 
| MibTable::get_request 
| MibTable::prepare_set_request 
| MibTable::commit_set_request 
| MibTable::undo_set_request 
| MibTable::cleanup_set_request 

Best regards,
  Jochen



More information about the AGENTPP mailing list