--===============0372225126==
Content-Type: multipart/alternative;
boundary="----=_Part_4458_32980872.1193842092059"

------=_Part_4458_32980872.1193842092059
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Well, after some hours trying to make this work ( I'm a java programmer, my
C skills are pretty basic :-D), i finally manage to make this work.

I replace

netsnmp_set_row_column(rowData, COLUMN_SPINLOCK,
ASN_INTEGER,&setspinLock, sizeof(setspinLock));


with:

*((int*)(data->data.voidp)) = setspinLock;

Now it works! Thanks!

PS: By the way, I can't understand why using netsnmp_set_row_column didn't
work, maybe because netsnmp_set_row_column only works to set empty columns
and dont work to update column values ???




On 10/30/07, andre robalo wrote:
>
> I'm sorry! I didn't want to sound lazy, but sometimes we ask questions
> when we should stop and think a little.
>
> The answer was simple after all.
>
> In the first time I do :
>
> setspinLock = 1;
> netsnmp_set_row_column(rowData, COLUMN_SPINLOCK,
> ASN_INTEGER,&setspinLock , sizeof(setspinLock));
>
> When I want to increment the spinlock value, I do:
>
> setspinLock = *((int *) data-> data.voidp);
> setspinLock ++;
> netsnmp_set_row_column(rowData, COLUMN_SPINLOCK,
> ASN_INTEGER,&setspinLock, sizeof(setspinLock));
>
>
> I think this code is OK, but there is one problem: The spinlock column
> isn't increased!
> Should I use other function to update the column value ?
> I looked in this page: http://net-snmp.sourceforge.net/dev/...__dataset.html
> , but I cant find any function to update column values, so i suppose i
> have to use netsnmp_set_row_column. But i cant figure what i'm missing here.
>
>
>
>
>
>
>
>
>
>
>
>
>
> On 10/30/07, Dave Shield wrote:
> >
> > On 30/10/2007, andre robalo wrote:
> > > Last question: when adding a new row , the spinlock column will be

> > null! How
> > > can I initialize the spinlock column when a row is created ?

> >
> > Have a look at the code that actually creates the row,
> > or defines the structure of the default row.
> >
> > I'm afraid that I don't have time to look through the code for you.
> > I should really concentrate on what I'm being paid to do :-<
> >
> > Dave
> >

>
>


------=_Part_4458_32980872.1193842092059
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Well, after some hours trying to make this work ( I'm a java programmer, my C skills are pretty basic :-D), i finally manage to make this work.

I replace

                  netsnmp_set_row_column(rowData, COLUMN_SPINLOCK, ASN_INTEGER,&setspinLock, sizeof(setspinLock));



with:

                  *((int*)(data->data.voidp)) =  setspinLock;

Now it works! Thanks!

PS: By the way, I can't understand why using netsnmp_set_row_column didn't work, maybe because netsnmp_set_row_column only works to set empty columns and dont work to update column values ???





On 10/30/07, andre robalo <andre.robalo41@gmail.com> wrote:

I'm sorry! I didn't want to sound lazy, but sometimes we ask questions when we should stop and think a little.

The answer was simple after all.

In the first time I do :

               setspinLock = 1;

               netsnmp_set_row_column(rowData, COLUMN_SPINLOCK, ASN_INTEGER,&setspinLock , sizeof(setspinLock));

When I want to increment the spinlock value, I do:

                setspinLock = *((int *) data->
data.voidp);
                setspinLock ++;
                netsnmp_set_row_column(rowData, COLUMN_SPINLOCK, ASN_INTEGER,&setspinLock, sizeof(setspinLock));


I think this code is OK, but there is one problem: The spinlock column isn't increased!

Should I use other function to update the column value ?
I looked in this page:
http://net-snmp.sourceforge.net/dev/...__dataset.html
, but I cant find any function to update column values, so i suppose  i have to use netsnmp_set_row_column. But i cant figure what i'm missing here.















On 10/30/07, Dave Shield <.T.Shield@liverpool.ac.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">D.T.Shield@liverpool.ac.uk> wrote:


On 30/10/2007, andre robalo <andre.robalo41@gmail.com> wrote:
> Last question: when adding a new row , the spinlock column will be null! How

> can I initialize the spinlock column when a row is created ?


Have a look at the code that actually creates the row,
or defines the structure of the default row.

I'm afraid that I don't have time to look through the code for you.
I should really concentrate on what I'm being paid to do :-<


Dave





------=_Part_4458_32980872.1193842092059--


--===============0372225126==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
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/
--===============0372225126==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
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/...net-snmp-users

--===============0372225126==--