
On Sat, Dec 11, 2010 at 09:24:18AM -0600, Mark Martin wrote:
I have used libsmi for a couple of projects, having said that, the one thing I have discovered in regards to smiInit (this is proven with the sample progam, smiInit takes an argument, or NULL, using NULL, it will not dump the OID tree, except for the first node, then nothing else follows... except the remaining numbers. However, if you put something (doesn't matter what) as a char * argument, the tree parse works. I have looked at the manual page many times, and even looked at the 'C' code for smiInit, and I am not sure of the full functionality of the argument, other than it adds a 'handle' in the init function, all the the man page says is 'tag:dataset' I am not sure what this means in the context it is implemented.
Can someone provide more insight, as to how and why someone would used this, by a more practical explanation?
I can pass "x", and the parse works, no "x:yyy", so I am not sure what this parameter would be used for other than it actually parsing the mib tree.
Here is the man page text:
The smiInit() function should be the first SMI function called in an application. It initializes its internal structures. If tag is not NULL, the global configuration file and (on UNIX systems) a user con‐ figuration file are read implicitly, if existent. All global statements and those statements with a tag (a ‘‘tag: ’’ prefix) that matches the tag argument are executed. (see also CONFIGURATION FILES below). smi‐ Init() returns zero on success, or otherwise a negative value.
The smiInit() function can also be used to support multiple sets of MIB data. In this case, the tag argument may be prepended by a colon and a name to differentiate the data sets. Any library function call subse‐ quent to an smiInit("tag:dataset") call is using the specified data set.
Perhaps it is not the best text. But then, from your description, it is also difficult to infer what your specific problem is. In most circumstances, you simply use smiInit(NULL) or smiInit("myfancyapp"). The "tag:dataset" notation is only relevant if your program needs to maintain multiple independent parse trees, like for example smidiff.
/js