On 30/10/2007 <[EMAIL PROTECTED]> wrote:
> Is there an api (function call) in net-snmp to do that?

read_objid()

See the 'mib_api' man page.

>   If not,  is mib2c compiler source code available anywhere?

It's a perl script - so

     less `which mib2c`

              should work :-)


>  After the mib file loaded by net-snmp, I want to register individual mib 
> node and
> its corresponding handler function using its node name instead of oid

The MIB module registration calls take an OID array,
but you're perfectly at liberty to use "read_objid" to generate this OID.

The advantage of hardcoding the numeric OID into the initialisation code,
is that the agent is then not dependent on the MIB files being available
(as well as being slightly more efficient).   A small increase in work for the
coder makes a noticeable difference to the reliability of the agent.

But if you prefer to explicitly convert names into OIDs, then feel free.


>   Again, all of this is for the purpose of avoiding using mib2c.

Remember that mib2c is simply a tool to help generate code.
If you're happy writing equivalent code by hand, then there's
nothing to stop you doing so.
   (That's actually how I tend to work, most of the time).
You can still use numeric OIDs in your registration code, even
if you haven't used mib2c to generate the code.

Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to