2009/5/28 Vincent Bernat <[email protected]>:
> oldadmin_status  seems inaccurate  to me.  ACTION will  be  executed for
> column 5 first  then for column 6 and the  only value of oldadmin_status
> we have saved would be the second one, right?

Correct.
Remember that you are looking at the *old* implementation of the interfaces
table, which implicitly assumed that only one interface was being managed
within a single request.

The later re-implementations typically either use a per-row data structure,
with "old" and "new" fields for each writable object.  Or they use two per-row
data structures - one for the old values and one for the new.

See (e.g)  the 'if-mib' code for an example.


> Moreover,  since   ACTION  cannot  fail,  UNDO  is   not  necessary

How do you know that ACTION cannot fail?
There could easily be another varbind in the same SET request,
where the ACTION processing is more complex, and could indeed fail.
That would then trigger the UNDO pass for *all* varbinds in the request.

You cannot assume that the SET request will only contain a small
set of closely-related assigments.   That's the mistake made in the
original code design.


> Another  question:  what is  the  best  way to  pass  an  object to  the
> write_method?

The best way is to use the newer v5 "handler" approach instead.
The old-style mechanism is significantly less flexible, and is really
only retained for backwards compatibility with existing MIB modules.
It's not sensible to use this for new implementations.

>     For example,  if I need some expensive  processing to find
> an  object,  I  would  like  to  not redo  it  in  write_method.

Which is exactly why the v5 handler-style would be a better choice.



> BTW, why is there a lookup before each action?

Again - this is the old-style workflow, and has been
superceded by the v5 handlers.

I would strongly suggest that you don't waste your time on the
old UCD way of doing things.   The newer handlers are much
much more powerful.   You really want to be using those instead.

Dave

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
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

Reply via email to