On Sat, 2005-08-06 at 18:04 +0100, saifulla Mohd Abdul wrote:
>     I have implemented my mib code using net-snmp 4.1.

Errr...
Do you mean 'ucd-snmp 4.1' or 'net-snmp 5.1' ?
There has never been a 'net-snmp 4.1' (and the UCD code
is *very* old now)


> What i need is: I want effectivly utilise that cache
> in MIB stub code. That is, for all the subsequent
> get-next requests, i should not call IPC to get the
> data.
> For that purpose, i need to know whether the request
> has come from the same session of snmpwalk/get-next.

Why does this make any difference?
Usually caching is done on the basis of how old the
information is - not who's asked for it.

For example, consider what happens if two separate
'snmpwalk' commands are running at the same time,
and requests come in alternately.
  If you cache data based on who's asking for it,
then you'll end up reloading every single entry.
If you cache data based on time, then both walks
can take advantage of the same cache.


I'd suggest you take a look at the 'cache' helper,
and use the 'load' hook routine to make a full copy
of the table (using your IPC) within the agent.
The main MIB handler can then just refer to this
internal copy, without needing to worry about IPC
at all.


Dave


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to