我正在使用sharpsnmplib 开源库来编译MIB 文件并在我的自定义snmp 浏览器中使用它们。问题是Sharpsnmplib 无法编译RMON2-MIB 文件。使用它的后续库也无法编译。事实证明,(第一个)问题与文本(RMON2-MIB.txt)有关:
LastCreateTime ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION
"This TC describes an object that stores the last time its
entry was created.
This can be used for polling applications to determine that an
entry has been deleted and re-created between polls, causing
an otherwise undetectable discontinuity in the data."
SYNTAX TimeStamp
Sharpsnmplib 的文本约定解释器包含以下文本:
/*
* RFC2579 definition:
* Syntax ::= -- Must be one of the following:
* -- a base type (or its refinement), or
* -- a BITS pseudo-type
* type
* | "BITS" "{" NamedBits "}"
*
* From section 3.5:
* The data structure must be one of the alternatives defined
* in the ObjectSyntax CHOICE or the BITS construct. Note
* that this means that the SYNTAX clause of a Textual
* Convention can not refer to a previously defined Textual
* Convention.
…
有趣的是,TimeStamp 是 SNMPv2-TC 中定义的文本约定。RMON2-MIB 定义了自己的使用时间戳的文本约定。RMON2-MIB 中还有其他几个文本约定,它们引用了其他 MIB 文件中的文本约定。
因此,如果我做对了,RMON2-MIB 就违反了 RFC2579。但是如果 RMON2-MIB 是主动使用的 MIB 文件,这没有任何意义。
我错过了什么?应该如何正确解释 RMON2-MIB?