On Thu, 2006-01-26 at 14:06 +0200, Michael G wrote:
> Suppose i have tables that are related. For instance, one table is a
> generic table of programs currently present in a video stream which
> contains some common information for each program. The other table
> contains a specific information regarding the program which structure
> depends on the type of the program.

I would approach this by storing the data as a single (shared) list
of per-row entries, containing both the common information and
extra (type-specific) fields.   Both tables would be registered
using the cache helper, and specifying the same cache_load routine
(and probably a shared 'netsnmp_cache' data structure).

The handlers for each table could then select the appropriate
fields from the (shared) per-row data structure.


That's certainly possible with the 'table_data' and 'table_tdata'
helpers.   I'm not as familiar with the MfD framework as Robert is,
so I'll leave him to advise you on how to address this requirement
using that approach.


> Can I register a handler for treating multiple tables?

Not really, no.
The handlers are best considered as being responsible for
processing a single "chunk" of the overall OID tree.
But two handlers can certainly work with a shared representation
of the underlying table(s), which would give you the linkage
you need.

> Can I register a handler for handling a range of nodes/tables,
> or a whole node tree (including the sub nodes)?

Yes.
netsnmp_register() will take responsibility for a whole subtree.
But in that case, you'd need to do much more of the work yourself.
The advantage of 'netsnmp_register_table()' (and the specialised
versions of it), is that they take care of most of the generic
processing - you can concentrate on the specifics of your table(s).

The more general your registration, the less standard processing
can be done by the Net-SNMP helpers.

Dave



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to