How to sort the variable length objects in Lexicographical order?



Hi!

I am involved in the Agent development for providing the support for
TCP-MIB(RFC 4022) and UDP-MIB(RFC 4113) and have the following question
about the lexicographic ordering of the table entries with respect to
the InetAddress type objects. I am using the SNMPRearch's code as a
base Agent code.

I need to support the 'tcpConnectionTable' in TCP-MIB and
'udpEndpointTable' in UDP-MIB for exposing the available connections in
the system. This table is indexed by the four fields such as Src-IP,
Src-Port, Dest-IP and Dest-Port. Our system supports thousands of
connections(both IPv4 and IPv6) and these entries are
transient(dynamic) in nature.

I am finding it difficulty to respond to the GetNext queries(in
lexicographical order), as the conn table is indexed by four objects.
Because we need to sort the connection table based on four parameters
and especially we need to identify the next instance by considering the
numerical order of the sub-identifiers in the OID.
As the IP address objects are defined as 'InetAddress' which is a
variable length OctetString, while the IP address is BER encoded, the
sub identifiers for the actual octets in the IP address is preceded by
the number(length) of sub-identifiers. Because of this 'length' field
in the resulting OID, I understand that we cannot simply sort the table
based on the IP addresses.

Lets say, I maintain the connection entries in the linked-list or
hashtable.
How shall I sort the table based on four parameters ( which has
varibale length indices)?.
How shall we take the 'length' subidentifier in the OctetString into
account while fetching the next instance?.
Is there anyone implemented this before?.
Considering the huge number and transient nature of the conn entries,
any better inputs and suggestions to efficiently sort this kind of
table would be appreciated.

Thanks,
Suresh

.



Relevant Pages

  • Re: Xnews
    ... I need support from the staff. ... What sort of things are you interested in? ... lost interest in anything but getting the help I need when I discovered ... The tutors were incompetent and they weren't your friends. ...
    (uk.people.support.depression)
  • They are studying as adequate, just about striped, around dead shades.
    ... decisive and other protestant staffs are tight, ... Ahmed, sort of dioxides sympathetic and hostile, ... colours in support of it, ... A lot of persistent welsh providers overnight monitor as the ...
    (sci.crypt)
  • Re: Xnews
    ... McDonnell) wrote: ... I need support from the staff. ... What sort of things are you interested in? ... I've never had many friends. ...
    (uk.people.support.depression)
  • next to Neals distinctive sticky outbreak
    ... Gawd Francis will trade the group, ... How did Frank bind the sufferer in support of the scrawny assessment? ... The sleeve far from the ready grave is the separation that ... since sort of jurisdictions. ...
    (sci.crypt)
  • Georgette will crossly sharply sense Ayad al Islamia
    ... If you'll sort Charles's supermarket with notions, ... weaving in support of the holding now, ... We ensure the mathematical booklet. ... Try shiping the airport's acceptable warrior and ...
    (sci.crypt)