On Wed, 2005-04-20 at 12:16, Hongjunli wrote:
> XXXX_load(netsnmp_cache *cache, void *vmagic) can be used to
> load table data,but I don't know how to use parameters cache
> and vmagic.

'cache' is the data structure controlling the cache handling.
You probably don't want to meddle with this.

The one exception is that it includes a field 'magic'
which can be used to pass the data that's loaded between
the XXX_load routine, and wherever it's actually needed.
Use 'netsnmp_extract_cache_info' (or netsnmp_cache_reqinfo_extract)
to retrieve this cache within the handler.

Alternatively you can just use a global variable!

I can't remember what vmagic is - it's probably a read-only
version of the same hook.

>  Do these two patameters take some index parameters?
> I want to load data according to index.Can I do such? 

No - the idea of the cache helper is that it will load
*all* of the data relating to a particular table.
The table handler can then pick through it, to find the
bits that are needed for a given request.

The cache helper will hold on to that internal cache
until it's regarded as "too old" to be useful.  Then it
will release it, and the next request will trigger a
reload of a fresh copy.

Dave



-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to