Dear Wes,

Thanks again for the valuable info.

I'm afraid I will impose a bit more on this.

I looked at both of the suggestions:

1) row_merge is not for me, since I only have 1 writable column/table.

2) I also checked the iterator_helper. It has the oid code you suggested. It 
is also pretty involved and, as you mentioned, a bit heavy. By fitting its 
logic to my data, I can make it much simpler and faster. I need only 1 thing 
to do it.

I need to get the changed row index. I looked everywhere, requests, reginfo, 
reqinfo, handler. Couldn't find it. There is an index in the requests 
structure, at the right place, but it is the wrong one. I considered using 
the build_oid_noalloc to generate the index oids, but my row indeces list is 
NULL. I could of course regenerate the list by looping through the rows. I 
hope I am not asking too much.

I am using netsnmp_table_data_set from data_set.c example.

Hopefully, this is the last piece missing to complete the puzzle.

BR,
Nikos

----- Original Message ----- 
From: "Wes Hardaker" <[email protected]>
To: "Nikos Balkanas" <[email protected]>
Cc: <[email protected]>
Sent: Monday, January 05, 2009 6:14 PM
Subject: Re: Table custom handlers


>>>>>> On Sun, 4 Jan 2009 02:59:33 +0200, "Nikos Balkanas" 
>>>>>> <[email protected]> said:
>
> NB> I know how to get the values for each row/column. If I keep the old
> NB> values in an array, I could iterate through them and do it; I was
> NB> wondering if there is a better way to do it through a flag that i am
> NB> missing or something.
>
> There are multiple ways of doing it and depending on which type of
> internal data structure you have helps decide how to do it.  Generally
> speaking, you need to look at the incoming index values pulled out of
> the OIDs for the SET and use that data to look up the rows in your
> current data.  Then you go through the SET phases and replace the old
> values with the new at the appropriate point (keeping the older ones
> around till the FREE or UNDO phases).
>
> Many of the table handlers help you do this sort of thing (eg the
> iterator helper helps you walk through your data, but is inefficient).
> If you're writing your own without any of the above helpers it'll take
> more work.
>
> You might at least look at the row_merge helper, which groups all the
> incoming requests together by each row so you can safely loop through
> the request chain and know they're all affecting the same row.
> -- 
> Wes Hardaker
> Sparta, Inc. 


------------------------------------------------------------------------------
_______________________________________________
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

Reply via email to