Robert Story wrote: >On Sat, 03 Jun 2006 09:18:32 +0000 Anurag wrote: >AV> In this context, I have a table with dynamic row that can potentially >AV> have CREATE-WAIT set by the manager . As per SNMP protocol, set for >AV> columns can comes in different SNMP PDU. >AV> So, ideally I would want subagent to >AV> collect all columns set for a particular row and then call my API to >AV> create a row with all columns received. > >As Wes said, this can be done. The code generated by the MFD handler can do >this. > > As can many of the other agent helpers. [Robert - have a good look at Chapter 7 sometime. That discusses how to do this for each of the helpers in turn]
>AV> 1) In latest version of net-snmp, I read that there is a something called >AV> row-context data structure. Does it handle the issue I have mentioned >AV> above ? I understand that there are two API that is generated per table. >AV> One to create a row context and other to commit it (either add/remove). I >AV> can understand that row context creation can happen when my RowStatus is >AV> set to createAndWait, but when will the commit function be called ? > Typically, the way that most MIB implementation work (regardless of the particular helper used) is to have some form of representation of the row, held internally by the agent. The MfD framework (and the iterator helper) call this the "row-context", other helpers use a slightly different terminology. But the basic idea is the same. This row structure would be created by the initial "createAndXxx" request, early on in the processing of that initial request, and populated from this and subsequent requests. Activating this row means passing this internal representation to your subsystem, and would typically be triggered by a RowStatus assignment of 'active' (or 'c&Go') So that's where you would need to put the validation to check that the row was complete. As Robert says, the MfD template includes this sort of check, but the same thing can be done with the other helpers too. There are ways of handling this with non-RowStatus-controlled tables too, with the validation checks typically being repeated in the code for each writable column. >AV> 2) Is there any concept of caching out the cached data if for some reason >AV> I did not receive set for all mandatory columns I am expecting. This >AV> might happen let say col1 and col2 is set and came in one PDU, however, >AV> for some reason col3 in second PDU did not arrive at the agent. >AV> ( say manager got disconnected), then in that case will that cached data >AV> be flushed out by the subagent. > >This could easily be done by setting a timer callback when the row is >created/modified. > A strict reading of the semantic of RowStatus implies that this is exactly what ought to happen. I don't believe that any of the agents helpers implements this by default (although I'm somewhat out of touch with recent developments). But as Robert says, it really just needs a timer to trigger a callback to remove the internal representation of the row. (And remembering to stop/remove the timer when the row is activated!) Dave _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
