Antwort: Re: [libsmi] smiGetNode and instance identifiers

Hi Dave,
From my experience one would not only need to split an arbitrary OID
into class (object) ID and instance ID. Rather it would be nice to split an OID into class ID and a sequence of index sub-identifiers accompanied with corresponding index relevant object type information.
In the second step it would be nice to get returned the values of the index objects as well, since it might be redundant work for each API user to convert a string sub-index OID into its string value. Especially, when the user does not know whether the string is of variable length or fixed (implied) length.
Regards, Frank (the other one ;-)
-- !! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to libsmi-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.

Frank Fock writes:
Frank> From my experience one would not only need to split an Frank> arbitrary OID into class (object) ID and instance ID. Rather it Frank> would be nice to split an OID into class ID and a sequence of Frank> index sub-identifiers accompanied with corresponding index Frank> relevant object type information.
Frank> In the second step it would be nice to get returned the values Frank> of the index objects as well, since it might be redundant work Frank> for each API user to convert a string sub-index OID into its Frank> string value. Especially, when the user does not know whether Frank> the string is of variable length or fixed (implied) length.
I agree. The Tnm Tcl extension has commands to "pack/unpack" values into instance identifier and I once rewrote them to use libsmi (before my laptop got stolen). So yes, this can be done with a reasonable amount of work on top of libsmi and it would certainly make applications smaller if they can reuse utility functions like this.
The question remains whether the libsmi library, whose main purpose is to give you access to parsed MIB definitions, should be extended to provide such services or not. For me, services like this are conceptually on layer above what libsmi originally tried to achieve and the question is whether we want to go there. It probably makes sense since it reduces the total similar but slightly different code in various SNMP packages.
I think the hard work is to figure out an API conceptually above the libsmi API which is flexible in signalling errors back to applications and has uses a memory allocation scheme which fits nicely into the applications memory management philosophy.
Lets try to compile a list of functions that would be useful:
(1) Functions that take OID strings in various format and return useful information back.
(2) Functions that can validate instance identifier and pack/unpack instance identifier from/into a vector of values.
(3) Functions that can apply format hints in both directions (as far as that is possible).
(4) Functions that can validate values (type, size, range).
Something else?
/js
participants (2)
-
Frank Fock
-
Juergen Schoenwaelder