Questions about mib2c.table_data.conf gen'd code

Kevin Stone <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
So I'm coding my first table implementation, using the
mib2c.table_data.conf skeleton code, and I've run into issues with the
resulting code:

I started with this:
mib2c -c mib2c.table_data.conf  -S cache=1  myTable

1) The original generated code has some bugs, that I think I've fixed,
but I'd like some confirmation that I'm not breaking something:
    a) In "initialize_table_myTable()", the call to
"netsnmp_cache_handler_GET()" not found. I changed this to
"netsnmp_cache_handler_get()" instead.
    b) In "myTable_free()", I changed (fixed) "while ((this =
netsnmp_tdata_get_first_row(table)))" to "while ((this =
netsnmp_tdata_row_first(table))) {"

    OK. No biggie, as long as I haven't broken anything with these
minor changes...

2) At the end of "initialize_table_myTable()", there is a comment line
of " /* Initialise the contents of the table here */". I'm not sure
what code is intended to follow that comment. Is that were a call to
myTable_load would go??

3) In my subagent code (where my app's main snmp loop is waiting for
something to do), immediately after the init_myScalarHandlers function
is called, I added a call to "init_myTable()", and I can watch that
code being run. The call to netsnmp_cache_create() includes a
reference to "myTable_load", but I've verified that myTable_load() is
never called. How/when does the myTable_load() get fired off? I'm
trying "snmptable -v2c -c public 127.0.0.1 myTable" from the command
line and getting back the following response (all other scalar OIDs
work fine):

                MY-MIB::myTable: No entries

This seems to confirm that my table is there, but it's empty.
Putting breakpoints in the handler shows me that I'm not even hitting
the handler code at all when I punch down the snmptable command.

4) I've read various posts here about that the cached data will be
updated when it gets "too stale", but I don't see any cache timeout
values anywhere. Where is that set?

Thanks for any clarifying comments you can spare-
Kevin

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.