Re: MODE_SET_*

Roman Medina-Heigl Hernandez <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Dave Shield wrote:

>> Why don't we have one and
>>only MODE_SET state (like in GET or GETNEXT)?
> 
> Because changing settings is a lot more complex than
> simply reporting them.  Particularly ensuring that
> either everything gets changed, or nothing does.
> (The "as if simultaneously" behaviour).

Now I understand it. I missed the part that "a SET request can set
several variables, not only one". Then it is some kind of attempt to
reach a pseudo-atomic operation (which never gets really true since
COMMIT may unexpectedly fail).

>>Really I only need to implement a simple SET: my program should check
>>whether received OID is the right one, then store the value and exit.
> 
> But what if the agent is handling some other, more complex assignment
> as part of the same request.  Just because your particular SET handling
> is (apparently) simple, doesn't mean that the whole agent can be so
> forgiving.

I was only thinking about setting a single variable.

>>I've thought of implementing all of this in one state (for instance,
>>MODE_SET_RESERVE1), but I don't know if that's not good...
> 
> 
> Typically, you should check the requested value is OK in the RESERVE1
> pass.  If you are *certain* that the assignment can't possibly fail,
> then it's safe to do this in the COMMIT pass.  Otherwise, you should
> do it in the ACTION pass, and be ready to reverse it in the UNDO pass.

Well, actually I'm using RESERVE1 and ACTION states. But since my write
operation is not "comittable"/"undoable" perhaps I'll change ACTION by
COMMIT (it really doesn't affect my program's behaviour).

Thanks for your response. It has been very useful :)

Regards,
-Román


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.