Subject: | $SNMP::MIB{...}->{children} is not guaranteed to be in subID order |
Noticed a issue with how SNMP::MIB is adding in the children for certain
OIDs. In certain cases, the indexes are NOT at the top set of children,
despite having top subIDs. Here's an example:
$ pl-snmpmib docsQosPktClassEntry
%DOCS-QOS-MIB::docsQosPktClassEntry = (
access => 'NoAccess',
augments => undef,
children => [
\%DOCS-QOS-MIB::docsQosPktClassBitMap,
\%DOCS-QOS-MIB::docsQosPktClassPkts,
\%DOCS-QOS-MIB::docsQosPktClassState,
\%DOCS-QOS-MIB::docsQosPktClassVlanId,
\%DOCS-QOS-MIB::docsQosPktClassUserPriHigh,
\%DOCS-QOS-MIB::docsQosPktClassUserPriLow,
\%DOCS-QOS-MIB::docsQosPktClassEnetProtocol,
\%DOCS-QOS-MIB::docsQosPktClassEnetProtocolType,
\%DOCS-QOS-MIB::docsQosPktClassSourceMacAddr,
\%DOCS-QOS-MIB::docsQosPktClassDestMacMask,
\%DOCS-QOS-MIB::docsQosPktClassDestMacAddr,
\%DOCS-QOS-MIB::docsQosPktClassDestPortEnd,
\%DOCS-QOS-MIB::docsQosPktClassDestPortStart,
\%DOCS-QOS-MIB::docsQosPktClassSourcePortEnd,
\%DOCS-QOS-MIB::docsQosPktClassSourcePortStart,
\%DOCS-QOS-MIB::docsQosPktClassIpDestMask,
\%DOCS-QOS-MIB::docsQosPktClassIpDestAddr,
\%DOCS-QOS-MIB::docsQosPktClassIpSourceMask,
\%DOCS-QOS-MIB::docsQosPktClassIpSourceAddr,
\%DOCS-QOS-MIB::docsQosPktClassIpProtocol,
\%DOCS-QOS-MIB::docsQosPktClassIpTosMask,
\%DOCS-QOS-MIB::docsQosPktClassIpTosHigh,
\%DOCS-QOS-MIB::docsQosPktClassIpTosLow,
\%DOCS-QOS-MIB::docsQosPktClassPriority,
\%DOCS-QOS-MIB::docsQosPktClassDirection,
\%DOCS-QOS-MIB::docsQosPktClassId
],
defaultValue => undef,
description => 'An entry in this table provides a single packet
classifier rule. The index ifIndex is an ifType
of docsCableMaclayer(127).',
enums => {},
hint => undef,
indexes => [
'ifIndex',
'docsQosServiceFlowId',
'docsQosPktClassId'
],
label => 'docsQosPktClassEntry',
moduleID => 'DOCS-QOS-MIB',
nextNode => \%DOCS-QOS-MIB::docsQosPktClassBitMap,
objectID => '.1.3.6.1.2.1.10.127.7.1.1.1',
parent => \%DOCS-QOS-MIB::docsQosPktClassTable,
ranges => [],
status => 'Current',
subID => 1,
syntax => '',
textualConvention => undef,
type => '',
units => undef,
varbinds => []
);
$ pl-snmpmib docsQosPktClassId
%DOCS-QOS-MIB::docsQosPktClassId = (
access => 'NoAccess',
augments => undef,
children => [],
defaultValue => undef,
description => 'Index assigned to packet classifier entry by
the CMTS which is unique per service flow.',
enums => {},
hint => undef,
indexes => [],
label => 'docsQosPktClassId',
moduleID => 'DOCS-QOS-MIB',
nextNode => \%DOCS-QOS-MIB::docsQosServiceFlowTable,
objectID => '.1.3.6.1.2.1.10.127.7.1.1.1.1',
parent => \%DOCS-QOS-MIB::docsQosPktClassEntry,
ranges => [
{
high => 65535,
low => 1
}
],
status => 'Current',
subID => 1,
syntax => 'INTEGER32',
textualConvention => undef,
type => 'INTEGER32',
units => undef,
varbinds => []
);
Notice how docsQosPktClassId has a OID of .1.3.6.1.2.1.10.127.7.1.1.1.1,
but it is actually last in the children list? Other tables I've found
which break the order are:
DOCS-IF-MIB::docsIfCmtsMacToCmTable
DOCS-QOS3-MIB::docsQosParamSetTable
DOCS-QOS3-MIB::docsQosServiceFlowLogTable
DOCS-QOS-MIB::docsQosCmtsMacToSrvFlowTable
DOCS-QOS-MIB::docsQosDynamicServiceStatsTable
DOCS-QOS-MIB::docsQosPktClassTable
DOCS-QOS-MIB::docsQosServiceClassTable
DOCS-QOS-MIB::docsQosServiceFlowTable
DOCS-QOS-MIB::docsQosUpstreamStatsTable