
Hi Juergen,
It's always easy to be critical of existing code with hindsight, and it wasn't my intention to do that. Apologies if that's what it seemed.
The one parameter to smiInit does two functions: It's a tag that controls which of the MIBS specified in the configuration file are loaded - and it also determines if the default configuration file is read or ignored. This 'overloading' of one parameter with two functions was the cause of my confusion.
I have two independent simple "patches" which might help, without modifying/extending the library interface, or breaking current code.
In smi.h, add a #define
#define SMI_LOAD_DEFAULT "__Default" // Use this with smiInit to load the default configuration file
Users can then call smiInit(SMI_LOAD_DEFAULT) rather than smiInit("foo"). More readable, and should help make the intention clear. The actual code for smiInit() remains unchanged.
My second 'patch' is to the code example on the website: http://www.ibr.cs.tu-bs.de/projects/libsmi/example.html?lang=de
As you can see, it calls smiInit(NULL), so won't load any MIBs. This example is probably why I struggled in the first place. I believe this should call
smiInit("foo"); // force loading of default config // or, if you like the previous suggestion, smiInit(SMI_LOAD_DEFAULT)
Regards, and thankyou for a great library.
Roddy Pratt Rascular Technology Ltd.