Re: [tkined] PROBLEM using tnm library direct from C/C++

Juergen Schoenwaelder (schoenw@ibr.cs.tu-bs.de)
Tue, 18 May 1999 13:09:21 +0200

>>>>> gary hicking writes:

gary> I have built the tnm library directly into my C++ agent. I am
gary> using this simply for MIB knowledge (eg Name <-> OID
gary> translation).

gary> The library seems to work well. Use Tnm_MibParse() to load all
gary> the asn1 files to setup the internal tree. Then further use the
gary> various functions to get the knowledge from the
gary> mib. eg. Tnm_MibGetOid(char *name) to convert a MIB name to an
gary> OID etc etc....

gary> PROBLEM - ---------------

gary> I want to use the library to convert OID back into name (to find
gary> the names of traps received for example).

gary> I use the function Tnm_MibGetName(char *oid) for this, but it
gary> seems to return NULL every time??? Is there a bug here or am I
gary> not using this correctly.

gary> Here is an example of how I am using the functions:

gary> Tnm_MibGetOid("sysDescr.0", 0) this returns "1.3.6.1.2.1.1.1.0"
gary> Works!!!!

gary> Tnm_MibGetName("1.3.6.1.2.1.1.1.0", 0) returns NULL. Fails!!!!!

gary> Is this a known bug? If not what am I doing wrong?

These functions obviously work within scotty. I am not sure why they
do not work in your agent - perhaps and initialization problem. You
need to dive into the code to find the answer.

Anyway, we are working towards a generic C library for accessing MIB
definitions (libsmi). This library will be freely available and it
will replace the MIB parser currently used in the scotty distribution.
The flex/bison parsers have been written from scratch against the
latest SMI specifications. They have cool features that are not found
in other parsers. They are for example able to resolve IMPORTS without
any manual assistance.

Feel free to contact Frank Strauss <strauss@ibr.cs.tu-bs.de> if you
need more information about libsmi.
Juergen

-- 
Juergen Schoenwaelder  schoenw@ibr.cs.tu-bs.de http://www.cs.tu-bs.de/~schoenw
Technical University Braunschweig, Dept. Operating Systems & Computer Networks
Bueltenweg 74/75, 38106 Braunschweig, Germany.        (Tel. +49 531 / 391 3289)
--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.