I have found the following comment in the var_example() function in
agent/mibgroup/examples/example.c
/*
* Many object will need to obtain data from the operating system in
* order to return the appropriate value. Typically, this is done
* here - immediately following the 'header' call, and before the
* switch statement. This is particularly appropriate if a single
* interface call can return data for all the objects supported.
*
* This example module does not rely on external data, so no such
* calls are needed in this case.
*/
Of course, there is no example code....
This is basically what I want to do.
I will have some sort of data structure which will map OID's to actual
message formats to send down the pipe. I will register for the OID which
prefixes a particular subgroup such as 1.3.6.1.4.1.469.1000.1.
Then when I get any requests for that sub-tree, I will process them
accordingly.
This allows me to capture an entire sub-tree in one function, which is what
I want to do, because all the "real" functionality is sitting on the other
side of the pipe.
What do I need to do to make net-snmp happy with the data that I get from
the pipe? Will I need to make dummy variables, and register those with
net-snmp? Just use the variables like in the switch statements that follow
this comment in example.c? Or quit looking at example.c all together? :)
Brian
-----Original Message-----
From: Dave Shield [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 17, 2004 3:55 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: New to list
> Right now, I have access to a pipe, that I can shoot commands down to the
> low level code. This keeps me from having to link the net-snmp stuff into
> the main application. What I would like to do is write an interface which
> uses this pipe.
What sort of traffic is passed over the pipe?
Is it used to retrieve the underlying data?
In which case Mack's approach of using "mib2c" to develop
a local MIB handler which uses this information is the most
sensible one.
Or is it used to pass the SNMP requests (in some form) down to
the lower level backend?
In which case, you're probably looking at writing a MIB handler
to translate between the Net-SNMP MIB API, and the protocol used
over this pipe.
In the latter case, you'd need to think about how this handles:
a) GET requests
b) GETNEXT requests
c) SET requests
(esp. dealing with failures)
It's a bit difficult to offer any more detailed advice, without
knowing a bit more about how things currently work.
Dave
PS: Please - no HTML mail. Thanks
-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders