Hello,

I use the table_data helper with cache (snmp 5.4.1):
mib2c -c mib2c.table_data.conf -S cache=1 mydataTable

All works fine and the cache load function is called correctly. I can
make snmpgettable and my table is updated.

The problem is when the table is empty, the cache_load _function is
never called, so the table still always empty !

My init function :
------------
initialize_table_mydataTable(void) {
....
cache = netsnmp_cache_create(-1, mydataTable_load, ....);
cache->magic = (void *) table_data;
cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET |
NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD | NETSNMP_CACHE_DONT_FREE_EXPIRED |
NETSNMP_CACHE_DONT_AUTO_RELEASE;
netsnmp_inject_handler_before(reg, netsnmp_cache_handler_get(cache),
"mydataTable");
// Init table
mydataTable_load(cache, table_data);
}
------------

Ouput from snmpd -f -L -Dmydata -Dhandler
When it's work fine :
------------
handler:calling: main handler bulk_to_next
handler:calling: calling handler bulk_to_next for mode GETNEXT
handler:returned: handler bulk_to_next returned 0
handler:calling: calling handler table for mode GETNEXT
handler:calling: calling handler table_container for mode GETNEXT
handler:calling: calling handler table_tdata for mode GET
handler:returned: handler table_tdata returned 0
handler:calling: calling handler cache_handler for mode GET
mydata: Update Handler ...MAJ
handler:returned: handler cache_handler returned 0
handler:calling: calling handler mydataTable for mode GET
------------

When the table is empty the function "Update Handler" is never call
------------
handler:calling: main handler bulk_to_next
handler:calling: calling handler bulk_to_next for mode GETNEXT
handler:returned: handler bulk_to_next returned 0
handler:calling: calling handler table for mode GETNEXT
handler:calling: calling handler table_container for mode GETNEXT
handler:returned: handler table_container returned 0
handler:returned: handler table returned 0
handler:calling: main handler bulk_to_next
handler:calling: calling handler bulk_to_next for mode GETNEXT
handler:returned: handler bulk_to_next returned 0
handler:calling: calling handler table for mode GETNEXT
handler:calling: calling handler table_container for mode GETNEXT
handler:returned: handler table_container returned 0
----

Thanks for your help.
Stephane







-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders