> I am planning on using the pass directive to create a shim
> between net-snmp and our already working snmp backend.
> I have a question about the set command.
Ah!
The most important thing to realise is that the "pass" mechanism
is not reliable w.r.t. SET handling.
In particular, it doesn't allow for the graceful handling of SET
requests. If your users will be mixing SET assignments for your
backend objects, and other MIB objects within the same SET request,
then there's the potential for ending up in an inconsistent state.
> What I need to know is when the FINAL set command calls my app
> (using the pass directive).
> This is needed because the backend must know when to commit
> all the successful sets.
The pass mechanism is only called once for a SET request.
It doesn't use a multi-pass mechanism.
> -g = get
> -n = get next
> -s = set
That's the lot.
> ? = commit
Nope - the pass mechanism doesn't work that way.
The Net-SNMP agent uses a five-pass mechanism:
RESERVE ---> ACTION ----> COMMIT
| |
v v
FREE UNDO
to provide a (fairly) reliable SET processing framework.
See http://www.net-snmp.org/tutorial/agent/08-writing.html
for a fuller description. (Aimed at the UCD v4 API, but
the underlying model is much the same).
The "pass" mechanism is only invoked in the ACTION pass.
If you want to support SET requests reliably, then you'll
really need to provide your own link between a normal
variable handler routine and your existing backend.
One possibility to look at might be to put a Net-SNMP handler
into your existing backend, as a wrapper round the current
API. Then perhaps use the lightweight AgentX framework to
turn this into an AgentX subagent.
See http://www.net-snmp.org/tutorial/toolkit/demon/index.html
or http://www.net-snmp.org/tutorial-5/toolkit/demon/index.html
Dave
PS: Please - no HTML mail. Thanks
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders