How to sort the variable length objects in Lexicographical order?
- From: suresh.kumar.j@xxxxxxxxx
- Date: 3 Jun 2006 06:38:16 -0700
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
.
- Follow-Ups:
- Re: How to sort the variable length objects in Lexicographical order?
- From: Juergen Schoenwaelder
- Re: How to sort the variable length objects in Lexicographical order?
- Prev by Date: Tables with just the Index objects?.
- Next by Date: Re: Tables with just the Index objects?.
- Previous by thread: Tables with just the Index objects?.
- Next by thread: Re: How to sort the variable length objects in Lexicographical order?
- Index(es):
Relevant Pages
|