On 19/09/06, Magnus Fromreide <[EMAIL PROTECTED]> wrote:
> Is find_prefix part of the public API?

Well, it's documented in 'netsnmp_library(3)"

> If that is the case then the question
> is what any external users might expect of it.

   "Given two OIDs, determine the common prefix to them both.
    Returns:
           length of largest common index of commonality. 1 = first,,,,,"


> Now that I have said the above I agree that always returning the length of the
> common prefix do sound like a more useful function.

That's what I understand the text above to mean.
But I'm not at all sure that the current code matches this description.



> Looking around in snmp_api.c it looks as if there are quite a few ways to
> compare two OID's - we have
>
> snmp_oid_ncompare
> snmp_oid_compare
> netsnmp_oid_compare_ll
> snmp_oidtree_compare
> netsnmp_oid_equals
> netsnmp_oid_is_subtree
> netsnmp_oid_find_prefix
>
> Maybe some of those could be merged?

Indeed - though we'd need to keep suitable wrapper routines for
backwards compatability.
Some of these are already implemented as such (snmp_oidtree_compare),
and others could be merged quite trivially
(snmp_oid_compare/netsnmp_oid_compare_ll)

But we've just entered the pre-release phase for 5.4, so it's probably
not the best time to embark on this just now!


> Maybe some of those could be optionally compiled as a service to our
> embedded friends?

I keep getting drawn back to my plans for a complete re-structuring of
the library code.  I made an abortive (and overly optimistic) attempt
at this several years ago, and tried to trigger some discussion
regarding a suitable framework more recently.
   Maybe once 5.4 is out of the door, I should pick this up again more
seriously.

Dave

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to