On 23/02/2008, Devvrat Tripathi <[EMAIL PROTECTED]> wrote:
> if i just change the variable in case the mode is SET_ACTION and do
> not do anything in other SET modes will it work.
It will work for successful SET requests.
The problems will arise when the (overall) SET request fails.
Handling this reliably is non-trivial.
> How exactly do i go about doing it properly.
The minimal approach would be something like:
* In the first RESERVE1 pass, check that the new value is valid
(correct type, and a plausible value).
* In the ACTION pass, apply this new value.
* In the UNDO pass, revert back to the old value.
It may be that in order to undo the assignment (or even to
apply it in the first place), you may have to allocate memory
or something similar. This would typically be done in the
RESERVE2 pass, and released in the FREE, UNDO, and
COMMIT passes.
If it's not possible to revert to the previous value, then you
should apply the new value in the COMMIT pass (and
make damn sure that your checking is solid, so you
can be confident that applying this new value will work!)
There are other ways of handling SET requests (particularly
when it comes to creating new rows in a table), but that's
a fairly typical and straightforward division of labour.
Dave
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users