failed to locate MIB module

Hi,
Following is the example code present in the libsmi site for dumping the
OID subtree for the OID given as argument. But I added some more lines to read a given configuration file and to print 'name' and 'description'
of SNMPv2-SMI module. The configure file (see attached below the code) 'load's 3 modules. The smiIsLoaded() calls actually says they are loaded
(return 1). But still I get the following errors:
failed to locate MIB module `SNMPv2-SMI' failed to locate MIB module `SNMPv2-TC' failed to locate MIB module `SNMPv2-CONF' LOAD STATUS: 1 1 1 failed to locate MIB module `SNMPv2-SMI' 0 [main] tell 640 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION 4774 [main] tell 640 open_stackdumpfile: Dumping stack trace to tell.exe.stackdump
Any idea what I might be doing wrong? How can I avoid these "failed to locate MIB module" errors despite giving the SMI path so explicitly? Thanks in advance for your time.
My environment is Windows NT4.0, cygwin
Rajaram S. =====================================================================================
#include <stdio.h> #include <string.h> #include <smi.h>
int main(int argc, char *argv[]) { SmiNode *smiNode; SmiModule *smiModule; int oidlen, first = 1; int err;
if (argc != 2) { fprintf(stderr, "Usage: smisubtree oid\n"); exit(1); } smiInit(NULL);
smiSetPath(".:/cygdrive/d/miblib/coslibsmi-0.2.5/mibs/ietf:/cygdrive/d/miblib/coslibsmi-0.2.5/mibs/iana:/cygdrive/d/miblib/coslibsmi-0.2.5/mibs/irtf:/cygdrive/d/miblib/coslibsmi-0.2.5/mibs/site:/cygdrive/d/miblib/coslibsmi-0.2.5/mibs/tubs");
err=smiReadConfig("./configure","smilint"); printf("LOAD STATUS: %d %d %d\n",smiIsLoaded("SNMPv2-SMI"),smiIsLoaded("SNMPv2-TC"),smiIsLoaded("SNMPv2-CONF"));
smiModule = smiGetModule("SNMPv2-SMI"); printf("Module: Name %s, description %s\n",smiModule->name, smiModule->description);
for((smiNode = smiGetNode(NULL, argv[1])) && (oidlen = smiNode->oidlen);
smiNode && (first || smiNode->oidlen > oidlen); smiNode = smiGetNextNode(smiNode, SMI_NODEKIND_ANY), first = 0) { printf ("OIDlen = %d; Desc: %s\n",oidlen,smiNode->description); printf("%*s%-32s\n", (smiNode->oidlen - oidlen + 1) * 2, " ", smiNode->name); }; exit(0); } =====================================================================================
configure file ------------- level 1
load SNMPv2-SMI load SNMPv2-TC load SNMPv2-CONF
smilint: level 1
smiint: hide namelength-32
tcpdump: load DISMAN-SCRIPT-MIB
smiquery: load IF-MIB smiquery: load DISMAN-SCRIPT-MIB =====================================================================================
participants (1)
-
Rajaram Soundararajan