Mon 13 Oct 2003 01:56:09 AM UTC, original submission:
Sequence elements with a defined type but no defined
left-hand symbol should be assigned a default symbol name based on the enclosing Sequence's OID.
Example:
--Defined symbols:
--
-- nncAlmDateAndTime
-- nncAlmPriority
-- nncAlmText
--Undefined Symbols:
--
-- nncAlmSubcode
-- nncAlmParms
.
.
.
nncAlmInfo OBJECT-TYPE
SYNTAX SEQUENCE OF NncAlmInfo
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"Alarm information shared by all alarm trap types."
::= { nncExtNotifObjects 2 }
NncAlmInfo ::= SEQUENCE {
nncAlmDateAndTime TimeTicks,
nncAlmPriority AlmPriorityType,
nncAlmText StringType,
nncAlmSubcode StringType,
nncAlmParms ParameterStringType
}
-- Discussion
The undefined symbols (nncAlmSubcode and nncAlmParms) in the sequence are shown in Java via:
mibvalsym.getValue().toString()
where mibvalsym is the nncAlmInfo ObjectIdentifierValue. The toString() resolves to:
OBJECT-TYPE (
Syntax: SEQUENCE OF SEQUENCE [nncAlmDateAndTime INTEGER (0..4294967295), nncAl
mPriority TEXTUAL-CONVENTION (
Status: current
Description: Different alarm priorities.
Syntax: INTEGER (1 | 2 | 3 | 4)
), nncAlmText TEXTUAL-CONVENTION (
Status: current
Description: Types used to forward various text fields.
Syntax: OCTET STRING (SIZE (0..30))
), nncAlmSubcode TEXTUAL-CONVENTION (
Status: current
Description: Types used to forward various text fields.
Syntax: OCTET STRING (SIZE (0..30))
), nncAlmParms TEXTUAL-CONVENTION (
Status: current
Description: Types used to forward various text fields.
Syntax: OCTET STRING (SIZE (0..40))
)[
Access: not-accessible
Status: current
Description: Alaram information shared by all alarm trap types.
The child count in the sequence's ObjectIdentifierValue is three instead of five, which means that the unknown input element's objects where not created.
In contrast, using snmptrap daemon (from NET-SNMP, formerly UCD-SNMP) under Linux, the trapdaemon's ASN.1 analyser fills in missing nams with the parent sequence's OID plus the missing symbol's position:
.
.
.1.3.6.1.4.1.123.3.44.1.2.1 --> nncAlmDateAndTime == 122:21:52:09.33
.1.3.6.1.4.1.123.3.44.1.2.2 --> nncAlmPriority == 3
.1.3.6.1.4.1.123.3.44.1.2.3 --> nncAlmText == "PVC Active S1"
.1.3.6.1.4.1.123.3.44.1.2.4 --> nncAlmInfo.4 == "S1 1,39 "
.1.3.6.1.4.1.123.3.44.1.2.5 --> nncAlmInfo.5 == "1,39 "
-----------
Reason for bringing this up: external customers can load arbitrary MIBs and the java code is expected to see and manipulate the "missing" entries.
|