Sorry, I didn't specify the netsnmp version.
Due to hardware restraints, I'm using version 5.1.4.
In the net-snmp-5.1.4.tar\net-snmp-5.1.4\agent\mibgroup\mibII\setSerialNo.c
the lock mechanism is implemented in a different way :
oid my_registration_oid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 6, 1,
0 };
netsnmp_register_long_instance("snmpSetSerialNo",
my_registration_oid,
OID_LENGTH(my_registration_oid),
&setserialno,
netsnmp_setserialno_handler);
Is netsnmp_register_watched_spinlock available in 5.1.4 Version ??
If not, should i use this approach to implement the lock mechanism ?
Thanks once again.
----- Original Message -----
From: "Dave Shield" <[EMAIL PROTECTED]>
To: "vsaavedra" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Tuesday, October 23, 2007 2:45 PM
Subject: Re: Semaphore / Synchronizing write operations
> On 23/10/2007, vsaavedra <[EMAIL PROTECTED]> wrote:
> > The agent/mibgroup/mibII/setSerialNo.c dont use the
> >
> > netsnmp_register_watched_spinlock( netsnmp_handler_registration
> > *reginfo,int *spinlock) function!
>
>
> Oh yes it does!
>
> static int setserialno;
> void
> init_setSerialNo(void)
> {
> oid set_serial_oid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 6, 1 };
>
> netsnmp_register_watched_spinlock(
> netsnmp_create_handler_registration("snmpSetSerialNo", NULL,
> set_serial_oid,
> OID_LENGTH(set_serial_oid),
> HANDLER_CAN_RWRITE),
> &setserialno );
> }
>
>
>
> > For a simple scenario, whats the best aproach?
>
> See above.
>
> Dave
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.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