
Hi,
I'm new to libsmi and have a question that is probably easy but is baffling me.
I've written some code that deals with a single mib module ("A"). I want to traverse all the nodes in depth-first order (or "tree pre-order", as the documentation says). I use smiLoadModule(), followed by smiGetFirstNode() and smiGetNextNode() to loop through the nodes. This works as expected - I see the nodes defined in A in depth-first order.
Now I'm trying to generalize my code to load N modules at program startup. After loading all the modules, is there a way to loop through all the nodes defined in _any_ of those modules so that the nodes are returned in depth-first order? If so, how?
Any feedback would be much appreciated.
Thanks,
Garth Conrad IBM Communications Server for MVS

Hi!
Garth> [...] After loading all the modules, is there a way Garth> to loop through all the nodes defined in _any_ of those modules Garth> so that the nodes are returned in depth-first order? [...]
In this case, the easiest way is using a recursive function that runs through the child nodes of a given node (smiGet{First,Next}ChildNode()) and recursively calls itself for each of those nodes.
-frank
participants (2)
-
Frank Strauss
-
Garth R Conrad