On 30/08/06, Jayaprakasha Guddenahalli Naganna wrote:
> Regarding v5-API's I have just only one question,
> 1. Will v5-API's forward context to var_* function?

The v5-API is based around "handlers" (see assorted examples in the
current source distributions). The parameters to this include an
(indirect) pointer to the original PDU, thus providing access to the
context for that request. This is perhaps not as obvious as it might
be, but it is available.

Current Net-SNMP distributions also support the old 'var_xxx' function
approach, for compatability with earlier code. This retains the same
interface as the v4 UCD releases, so does not expose the context of
the original request.

So the answer to your question as posed above is No - the v5-API does
not forward context to the var_* function. (Because that function is
actually the v4-API). The v5 handler-based API *does* forward the
context to the MIB-specific code (but doesn't use the same 'var_*'

> Also because of I have only one subagent which has to control multiple
> instances of mib dynamically I can't define var_* functions on the fly
> while registering mib. I am desperately wanted context to be passed to
> var_* functions. If v5-API's supports this means I will definitely go for it.

Delete "var_*" and insert "*_handler" - then yes. v5-API supports this.


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Net-snmp-coders mailing list