Apology If I resending it again.

Thanks. But what about get_first_data_point() and get_next_data_point() ?
They also need to access the tcp_head right ? vamgic is not a an argument for 
these functions.

I
 have one more doubt. Let's say there is two table tcpTable and 
udpTable. And both has been loaded by same _load() function and _free 
function.

    netsnmp_inject_handler( reginfo,
            netsnmp_get_cache_handler(TCP_STATS_CACHE_TIMEOUT,
                    tcpTable_load, tcpTable_free,
                    tcpTable_oid, OID_LENGTH(tcpTable_oid)));


So I do not want to create seperate cache for udp
 table. Like to keep the same cache for both the table oids.
is it possible to do so ? How can I do so ?

Thanks

--- On Tue, 8/23/11, Dave Shield <[email protected]> wrote:

From: Dave Shield <[email protected]>
Subject: Re: is there any way I can avoid global variable?
To: "sujata patra" <[email protected]>
Cc: "net-snmp-coders" <[email protected]>
Date: Tuesday, August 23, 2011, 12:17 AM

On 22 August 2011 17:36, sujata patra <[email protected]> wrote:
> Let 's take tcpTable.c ... I do not like the global variable.
> Instead is there way way to pass this as argument across functions .
> can this two netsnmp_cache *cache, void *vmagic be useful?

You shouldn't touch the 'cache' parameter - this is used by the cache helper
to decide whether/when to invoke the load/free functions.
But you could certainly use the 'vmagic' parameter to avoid the
use of a global variable.   That's exactly why this parameter is there.

Dave
------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to