Re: Locked access to variables in sub-agent

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 31/10/06, Thomas Nemeth <[email protected]> wrote:
>                                                     The previous
>     developper have used the netsnmp_register_int_instance() function to
>     register integer variables.
>     As access are locked, I would like to add a lock/unlock function around
>     the GET or SET action

That's relatively difficult when using the "netsnmp_register_int_instance()"
API.  The whole point of this approach is that the MIB object is handled
by Net-SNMP-supplied code.   Having registered the OID, it never needs
to go anywhere near your code again.

I suspect you'd be best off looking at re-implementing these MIB objects
using the "scalar" helper.  This would register a handler routine, which
would be called whenever a (valid) request for the object was received.
   That would allow you to perform the necessary locking/unlocking
around GET or SET requests.

(It would also have the added advantage of handling erquests for non-valid
instances correctly).

Have a look at "mibgroup/agent/nsDebug.c" for an example of this helper.

Dave

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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.