On Fri, 19 Nov 2004 13:46:03 +0000 Dave wrote: DS> The first is how to delete a particular row from a table. DS> The 'delete_row' hook routine seems to be concerned with releasing DS> the per-row data structure, rather than removing it from the table DS> container. There seems to be some code within the helper handler DS> itself for deleting a row, but this seems to be linked with the DS> RowStatus checking, rather than anything more general.
The array-user helper is pretty insistent about doing the insertion (other than at startup) and deletion for you. (This is actually one of the areas where I've made a change when doing the MFD stuff.) DS> What's the approved way for removing a row using this helper? If you look at the helper code, during a commit it checks the ag->row_deleted and ag->row_created flags to make devisions about inserting and deleting rows. So setting the row_deleted flag in the action phase or earlier should get the row removed from the container. If netsnmp_table_array_check_row_status is called, it will set this flag. Looking over the set processing code in the helper, it appears that there are several bugs. Since it's been a while since I wrote the code, I might just be forgetting something, but: a) deleted rows are removed from the container, but delete_row is not called. So I think deleting rows leaks memory. I thought maybe this was intentional, to let the user keep the row for some reason, but none of the tables I wrote for net-policy use the row or delete it, so it appears to be an oversight. b) if a row creation or row deletion fails and we end up in the undo state, havoc may ensue. Looking at the code, I have to guess that at one point, row insertions/deletions were done during the action phase, since undo is trying to reverse them. But the current code doesn't do insertion/deletion until commit. I've fixed both of these in my local cvs, so the will be in 5.2.1 and 5.1.3. DS> The other area that I'm not clear about yet is how to implement a DS> table controlled via a RowStatus object. The 'create_row' hook DS> seems to activate the automatic creation of rows (i.e. simply DS> writing to a missing instance). But this isn't what's needed DS> for a pure RowStatus-controlled table. Hmm... ok, what is needed? -- Robert Story; NET-SNMP Junkie Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp> Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders> You are lost in a twisty maze of little standards, all different. ------------------------------------------------------- This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 _______________________________________________ Net-snmp-coders mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
