📄 rfc1212.txt
字号:
| empty END IndexSyntax ::= CHOICE { number INTEGER (0..MAX), string OCTET STRING, object OBJECT IDENTIFIER, address NetworkAddress, ipAddress IpAddress }4.1. Mapping of the OBJECT-TYPE macro It should be noted that the expansion of the OBJECT-TYPE macro is something which conceptually happens during implementation and not during run-time.4.1.1. Mapping of the SYNTAX clause The SYNTAX clause, which must be present, defines the abstract data structure corresponding to that object type. The ASN.1 language [6] is used for this purpose. However, the SMI purposely restricts the ASN.1 constructs which may be used. These restrictions are made expressly for simplicity.SNMP Working Group [Page 7]RFC 1212 Concise MIB Definitions March 19914.1.2. Mapping of the ACCESS clause The ACCESS clause, which must be present, defines the minimum level of support required for that object type. As a local matter, implementations may support other access types (e.g., an implementation may elect to permitting writing a variable marked as read-only). Further, protocol-specific "views" (e.g., those indirectly implied by an SNMP community) may make further restrictions on access to a variable.4.1.3. Mapping of the STATUS clause The STATUS clause, which must be present, defines the implementation support required for that object type.4.1.4. Mapping of the DESCRIPTION clause The DESCRIPTION clause, which need not be present, contains a textual definition of that object type which provides all semantic definitions necessary for implementation, and should embody any information which would otherwise be communicated in any ASN.1 commentary annotations associated with the object. Note that, in order to conform to the ASN.1 syntax, the entire value of this clause must be enclosed in double quotation marks, although the value may be multi-line. Further, note that if the MIB module does not contain a textual description of the object type elsewhere then the DESCRIPTION clause must be present.4.1.5. Mapping of the REFERENCE clause The REFERENCE clause, which need not be present, contains a textual cross-reference to an object defined in some other MIB module. This is useful when de-osifying a MIB produced by some other organization.4.1.6. Mapping of the INDEX clause The INDEX clause, which may be present only if that object type corresponds to a conceptual row, defines instance identification information for that object type. (Historically, each MIB definition contained a section entitled "Identification of OBJECT instances for use with the SNMP". By using the INDEX clause, this section need no longer occur as this clause concisely captures the precise semantics needed for instance identification.) If the INDEX clause is not present, and the object type corresponds to a non-columnar object, then instances of the object are identifiedSNMP Working Group [Page 8]RFC 1212 Concise MIB Definitions March 1991 by appending a sub-identifier of zero to the name of that object. Further, note that if the MIB module does not contain a textual description of how instance identification information is derived for columnar objects, then the INDEX clause must be present. To define the instance identification information, determine which object value(s) will unambiguously distinguish a conceptual row. The syntax of those objects indicate how to form the instance-identifier: (1) integer-valued: a single sub-identifier taking the integer value (this works only for non-negative integers); (2) string-valued, fixed-length strings: `n' sub-identifiers, where `n' is the length of the string (each octet of the string is encoded in a separate sub-identifier); (3) string-valued, variable-length strings: `n+1' sub- identifiers, where `n' is the length of the string (the first sub-identifier is `n' itself, following this, each octet of the string is encoded in a separate sub- identifier); (4) object identifier-valued: `n+1' sub-identifiers, where `n' is the number of sub-identifiers in the value (the first sub-identifier is `n' itself, following this, each sub-identifier in the value is copied); (5) NetworkAddress-valued: `n+1' sub-identifiers, where `n' depends on the kind of address being encoded (the first sub-identifier indicates the kind of address, value 1 indicates an IpAddress); or, (6) IpAddress-valued: 4 sub-identifiers, in the familiar a.b.c.d notation. Note that if an "indextype" value is present (e.g., INTEGER rather than ifIndex), then a DESCRIPTION clause must be present; the text contained therein indicates the semantics of the "indextype" value.SNMP Working Group [Page 9]RFC 1212 Concise MIB Definitions March 1991 By way of example, in the context of MIB-II [7], the following INDEX clauses might be present: objects under INDEX clause ----------------- ------------ ifEntry { ifIndex } atEntry { atNetIfIndex, atNetAddress } ipAddrEntry { ipAdEntAddr } ipRouteEntry { ipRouteDest } ipNetToMediaEntry { ipNetToMediaIfIndex, ipNetToMediaNetAddress } tcpConnEntry { tcpConnLocalAddress, tcpConnLocalPort, tcpConnRemoteAddress, tcpConnRemotePort } udpEntry { udpLocalAddress, udpLocalPort } egpNeighEntry { egpNeighAddr }4.1.7. Mapping of the DEFVAL clause The DEFVAL clause, which need not be present, defines an acceptable default value which may be used when an object instance is created at the discretion of the agent acting in conformance with the third paradigm described in Section 4.2 above. During conceptual row creation, if an instance of a columnar object is not present as one of the operands in the correspondent SNMP set operation, then the value of the DEFVAL clause, if present, indicates an acceptable default value that the agent might use. The value of the DEFVAL clause must, of course, correspond to the SYNTAX clause for the object. Note that if an operand to the SNMP set operation is an instance of a read-only object, then the error noSuchName will be returned. As such, the DEFVAL clause can be used to provide an acceptable default value that the agent might use. It is possible that no acceptable default value may exist for any of the columnar objects in a conceptual row for which the creation of new object instances is allowed. In this case, the objects specified in the INDEX clause must have a corresponding ACCESS clause value of read-write.SNMP Working Group [Page 10]RFC 1212 Concise MIB Definitions March 1991 By way of example, consider the following possible DEFVAL clauses: ObjectSyntax DEFVAL clause ----------------- ------------ INTEGER 1 -- same for Counter, Gauge, TimeTicks OCTET STRING 'ffffffffffff'h DisplayString "any NVT ASCII string" OBJECT IDENTIFIER sysDescr OBJECT IDENTIFIER { system 2 } NULL NULL NetworkAddress { internet 'c0210415'h } IpAddress 'c0210415'h -- 192.33.4.214.1.8. Mapping of the OBJECT-TYPE value The value of an invocation of the OBJECT-TYPE macro is the name of the object, which is an object identifier.4.2. Usage Example Consider how the ipNetToMediaTable from MIB-II might be fully described: -- the IP Address Translation tables -- The Address Translation tables contain IpAddress to -- "physical" address equivalences. Some interfaces do not -- use translation tables for determining address equivalences -- (e.g., DDN-X.25 has an algorithmic method); if all -- interfaces are of this type, then the Address Translation -- table is empty, i.e., has zero entries. ipNetToMediaTable OBJECT-TYPE SYNTAX SEQUENCE OF IpNetToMediaEntry ACCESS not-accessible STATUS mandatory DESCRIPTION "The IP Address Translation table used for mapping from IP addresses to physical addresses." ::= { ip 22 } ipNetToMediaEntry OBJECT-TYPE SYNTAX IpNetToMediaEntry ACCESS not-accessible STATUS mandatory DESCRIPTION "Each entry contains one IpAddress to 'physical'SNMP Working Group [Page 11]RFC 1212 Concise MIB Definitions March 1991 address equivalence." INDEX { ipNetToMediaIfIndex, ipNetToMediaNetAddress } ::= { ipNetToMediaTable 1 } IpNetToMediaEntry ::= SEQUENCE { ipNetToMediaIfIndex INTEGER, ipNetToMediaPhysAddress OCTET STRING, ipNetToMediaNetAddress IpAddress, ipNetoToMediaType INTEGER } ipNetToMediaIfIndex OBJECT-TYPE SYNTAX INTEGER ACCESS read-write STATUS mandatory DESCRIPTION "The interface on which this entry's equivalence is effective. The interface identified by a particular value of this index is the same interface as identified by the same value of ifIndex." ::= { ipNetToMediaEntry 1 } ipNetToMediaPhysAddress OBJECT-TYPE SYNTAX OCTET STRING ACCESS read-write STATUS mandatory DESCRIPTION "The media-dependent 'physical' address." ::= { ipNetToMediaEntry 2 } ipNetToMediaNetAddress OBJECT-TYPE SYNTAX IpAddress ACCESS read-write STATUS mandatory DESCRIPTION "The IpAddress corresponding to the media- dependent 'physical' address." ::= { ipNetToMediaEntry 3 } ipNetToMediaType OBJECT-TYPE SYNTAX INTEGER {SNMP Working Group [Page 12]RFC 1212 Concise MIB Definitions March 1991 other(1), -- none of the following invalid(2), -- an invalidated mapping dynamic(3), static(4) } ACCESS read-write STATUS mandatory DESCRIPTION "The type of mapping. Setting this object to the value invalid(2) has the effect of invalidating the corresponding entry in the ipNetToMediaTable. That is, it effectively disassociates the interface identified with said entry from the mapping identified with said entry. It is an implementation-specific matter as to whether the agent removes an invalidated entry from the table. Accordingly, management stations must be prepared to receive tabular information from agents that corresponds to entries not currently in use. Proper interpretation of such entries requires examination of the relevant ipNetToMediaType object." ::= { ipNetToMediaEntry 4 }5. Appendix: DE-osifying MIBs There has been an increasing amount of work recently on taking MIBs defined by other organizations (e.g., the IEEE) and de-osifying them for use with the Internet-standard network management framework. The steps to achieve this are straight-forward, though tedious. Of course, it is helpful to already be experienced in writing MIB modules for use with the Internet-standard network management
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -