One way to implement this is to have a structure that has backup values stored, such that you have the object you want to read and write, OID, and an placeholder old_OID.

You can then iterate over the request varbinds, storing any old values until such time as you commit them, or undo the set.
-------- Original Message --------
Subject: State Information in smnpset: where to keep it?
From: Kent Borg <kent.b...@csr.com>
Date: Tue, January 08, 2013 9:07 am
To: "net-snmp-users@lists.sourceforge.net"
<net-snmp-users@lists.sourceforge.net>

Hello,

I am working on an AgentX agent to run in an embedded beast, and I seem to have things working.

But I am worried about the state machine used in setting a variable. How do I save state information between MODE_SET_RESERVE1 and MODE_SET_RESERVE2, MODE_SET_COMMIT?

 - reginfo->my_reg_void seems to be per-registration not per-request. 
 - my_void is mentioned in old mailing list traffic but doesn't seem to exist anymore
 - storing in static variables in my handler functions seems to work, but is it safe?

Thanks,

-kb

--
Kent Borg
Software Engineer
CSR Technology, Inc.
A member of the CSR Group of Companies
+1-781-791-6282
kent.b...@csr.com



Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog

------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to