On Mon, 2 Jul 2007 17:37:27 +0100 Graeme wrote:
GW> Ok, as per my previous email, I've been looking at a table which uses
GW> row-creation, and this is causing a couple of problems - although this
GW> could be related to my implementation because I'm a little unsure about
GW> a couple of things.  Maybe you could help clarify things please.
GW> 
GW> First some debug for you to show the error that I'm getting:
GW> internal:<table>:_mfd_<table>_irreversible:commit: called
GW> error on subcontainer remove (-1)

Yep. And so we wander further and further into uncharted territory. ;-)

GW> In the <table>iterator irreversible_commit "CONTAINER_REMOVE" call am I
GW> responsible for the container - "<table>_if_ctx.container" or is this an
GW> internal thing to Net-SNMP?

That container is the 'iterator container' that is used to iterate over your
data.

So, unless you are actually deleting a row here, it shouldn't be calling
REMOVE. It's calling REMOVE because of the flags we added in the allocate
function, so go ahead and delete that code.

Instead, make the release call in _mfd_<table>_post_request (in
<table>_interface.c) unconditional.


GW> Also, if I try to create a row which already exists (i.e. has a
GW> duplicate index) then the iterator finds that index is there already
GW> (iterates through until it comes to that index) - but then the code
GW> still seems to continue to try and add the row rather than return an
GW> error.  Do I need to implement this check somewhere - or should the
GW> net-snmp code handle this and return the error?

How are you trying to 'create a row'? Does the table have a RowStatus column?
Or do rows spring into existence any time they are accessed?



Now, since you are creating rows, I assume you'll be removing them as well.
Since you data source is external, there are 2 ways to handle that... The
simplest would be to just do what you need to do in
<table>_irreversible_commit, if it exists. If it doesn't, you'll have to set
up a remove_data callback for the iterator_container.

  void
  netsnmp_container_iterator_set_data_cb(netsnmp_container *c,
                                         Netsnmp_Iterator_Data * insert_data,
                                         Netsnmp_Iterator_Data * remove_data,
                                         Netsnmp_Iterator_Op * get_size)


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to