rfc1442.txt
来自「RFC 的详细文档!」· 文本 代码 · 共 2,194 行 · 第 1/5 页
TXT
2,194 行
Case, McCloghrie, Rose & Waldbusser [Page 21]
RFC 1442 SMI for SNMPv2 April 1993
7. Mapping of the OBJECT-TYPE macro
The OBJECT-TYPE macro is used to define a managed object. It
should be noted that the expansion of the OBJECT-TYPE macro is
something which conceptually happens during implementation and
not during run-time.
7.1. Mapping of the SYNTAX clause
The SYNTAX clause, which must be present, defines the abstract
data structure corresponding to that object. The data
structure must be one of the alternatives defined in the
ObjectSyntax CHOICE.
Full ASN.1 sub-typing is allowed, as appropriate to the
underingly ASN.1 type, primarily as an aid to implementors in
understanding the meaning of the object. Any such restriction
on size, range, enumerations or repertoire specified in this
clause represents the maximal level of support which makes
"protocol sense". Of course, sub-typing is not allowed for
the Counter32 or Counter64 types, but is allowed for the
Gauge32 type.
The semantics of ObjectSyntax are now described.
7.1.1. Integer32 and INTEGER
The Integer32 type represents integer-valued information
between -2^31 and 2^31-1 inclusive (-2147483648 to 2147483647
decimal). This type is indistinguishable from the INTEGER
type.
The INTEGER type may also be used to represent integer-valued
information, if it contains named-number enumerations, or if
it is sub-typed to be more constrained than the Integer32
type. In the former case, only those named-numbers so
enumerated may be present as a value. Note that although it
is recommended that enumerated values start at 1 and be
numbered contiguously, any valid value for Integer32 is
allowed for an enumerated value and, further, enumerated
values needn't be contiguously assigned.
Case, McCloghrie, Rose & Waldbusser [Page 22]
RFC 1442 SMI for SNMPv2 April 1993
Finally, the hyphen character is not allowed as a part of the
label name for any named-number enumeration.
7.1.2. OCTET STRING
The OCTET STRING type represents arbitrary binary or textual
data. Although there is no SMI-specified size limitation for
this type, MIB designers should realize that there may be
implementation and interoperability limitations for sizes in
excess of 255 octets.
7.1.3. OBJECT IDENTIFIER
The OBJECT IDENTIFIER type represents administratively
assigned names. Any instance of this type may have at most
128 sub-identifiers. Further, each sub-identifier must not
exceed the value 2^32-1 (4294967295 decimal).
7.1.4. BIT STRING
The BIT STRING type represents an enumeration of named bits.
This collection is assigned non-negative, contiguous values,
starting at zero. Only those named-bits so enumerated may be
present in a value.
A requirement on "standard" MIB modules is that the hyphen
character is not allowed as a part of the label name for any
named-bit enumeration.
7.1.5. IpAddress
The IpAddress type represents a 32-bit internet address. It
is represented as an OCTET STRING of length 4, in network
byte-order.
Note that the IpAddress type is a tagged type for historical
reasons. Network addresses should be represented using an
invocation of the TEXTUAL-CONVENTION macro [3].
Case, McCloghrie, Rose & Waldbusser [Page 23]
RFC 1442 SMI for SNMPv2 April 1993
7.1.6. Counter32
The Counter32 type represents a non-negative integer which
monotonically increases until it reaches a maximum value of
2^32-1 (4294967295 decimal), when it wraps around and starts
increasing again from zero.
Counters have no defined "initial" value, and thus, a single
value of a Counter has (in general) no information content.
Discontinuities in the monotonically increasing value normally
occur at re-initialization of the management system, and at
other times as specified in the description of an object-type
using this ASN.1 type. If such other times can occur, for
example, the creation of an object instance at times other
than re-initialization, then a corresponding object should be
defined with a SYNTAX clause value of TimeStamp (a textual
convention defined in [3]) indicating the time of the last
discontinuity.
The value of the MAX-ACCESS clause for objects with a SYNTAX
clause value of Counter32 is always "read-only".
A DEFVAL clause is not allowed for objects with a SYNTAX
clause value of Counter32.
7.1.7. Gauge32
The Gauge32 type represents a non-negative integer, which may
increase or decrease, but shall never exceed a maximum value.
The maximum value can not be greater than 2^32-1 (4294967295
decimal). The value of a Gauge has its maximum value whenever
the information being modeled is greater or equal to that
maximum value; if the information being modeled subsequently
decreases below the maximum value, the Gauge also decreases.
7.1.8. TimeTicks
The TimeTicks type represents a non-negative integer which
represents the time, modulo 2^32 (4294967296 decimal), in
hundredths of a second between two epochs. When objects are
defined which use this ASN.1 type, the description of the
object identifies both of the reference epochs.
Case, McCloghrie, Rose & Waldbusser [Page 24]
RFC 1442 SMI for SNMPv2 April 1993
For example, [3] defines the TimeStamp textual convention
which is based on the TimeTicks type. With a TimeStamp, the
first reference epoch is defined as when MIB-II's sysUpTime
[7] was zero, and the second reference epoch is defined as the
current value of sysUpTime.
7.1.9. Opaque
The Opaque type is provided solely for backward-compatibility,
and shall not be used for newly-defined object types.
The Opaque type supports the capability to pass arbitrary
ASN.1 syntax. A value is encoded using the ASN.1 Basic
Encoding Rules [4] into a string of octets. This, in turn, is
encoded as an OCTET STRING, in effect "double-wrapping" the
original ASN.1 value.
Note that a conforming implementation need only be able to
accept and recognize opaquely-encoded data. It need not be
able to unwrap the data and then interpret its contents.
A requirement on "standard" MIB modules is that no object may
have a SYNTAX clause value of Opaque.
7.1.10. NsapAddress
The NsapAddress type represents an OSI address as a variable-
length OCTET STRING. The first octet of the string contains a
binary value in the range of 0..20, and indicates the length
in octets of the NSAP. Following the first octet, is the
NSAP, expressed in concrete binary notation, starting with the
most significant octet. A zero-length NSAP is used as a
"special" address meaning "the default NSAP" (analogous to the
IP address of 0.0.0.0). Such an NSAP is encoded as a single
octet, containing the value 0. All other NSAPs are encoded in
at least 4 octets.
Note that the NsapAddress type is a tagged type for historical
reasons. Network addresses should be represented using an
invocation of the TEXTUAL-CONVENTION macro [3].
Case, McCloghrie, Rose & Waldbusser [Page 25]
RFC 1442 SMI for SNMPv2 April 1993
7.1.11. Counter64
The Counter64 type represents a non-negative integer which
monotonically increases until it reaches a maximum value of
2^64-1 (18446744073709551615 decimal), when it wraps around
and starts increasing again from zero.
Counters have no defined "initial" value, and thus, a single
value of a Counter has (in general) no information content.
Discontinuities in the monotonically increasing value normally
occur at re-initialization of the management system, and at
other times as specified in the description of an object-type
using this ASN.1 type. If such other times can occur, for
example, the creation of an object instance at times other
than re-initialization, then a corresponding object should be
defined with a SYNTAX clause value of TimeStamp (a textual
convention defined in [3]) indicating the time of the last
discontinuity.
The value of the MAX-ACCESS clause for objects with a SYNTAX
clause value of Counter64 is always "read-only".
A requirement on "standard" MIB modules is that the Counter64
type may be used only if the information being modeled would
wrap in less than one hour if the Counter32 type was used
instead.
A DEFVAL clause is not allowed for objects with a SYNTAX
clause value of Counter64.
7.1.12. UInteger32
The UInteger32 type represents integer-valued information
between 0 and 2^32-1 inclusive (0 to 4294967295 decimal).
7.2. Mapping of the UNITS clause
This UNITS clause, which need not be present, contains a
textual definition of the units associated with that object.
Case, McCloghrie, Rose & Waldbusser [Page 26]
RFC 1442 SMI for SNMPv2 April 1993
7.3. Mapping of the MAX-ACCESS clause
The MAX-ACCESS clause, which must be present, defines whether
it makes "protocol sense" to read, write and/or create an
instance of the object. This is the maximal level of access
for the object. (This maximal level of access is independent
of any administrative authorization policy.)
The value "read-write" indicates that read and write access
make "protocol sense", but create does not. The value "read-
create" indicates that read, write and create access make
"protocol sense". The value "not-accessible" indicates either
an auxiliary object (see Section 7.7) or an object which is
accessible only via a notificationn (e.g., snmpTrapOID [5]).
These values are ordered, from least to greatest: "not-
accessible", "read-only", "read-write", "read-create".
If any columnar object in a conceptual row has "read-create"
as its maximal level of access, then no other columnar object
of the same conceptual row may have a maximal access of
"read-write". (Note that "read-create" is a superset of
"read-write".)
7.4. Mapping of the STATUS clause
The STATUS clause, which must be present, indicates whether
this definition is current or historic.
The values "current", and "obsolete" are self-explanatory.
The "deprecated" value indicates that the object is obsolete,
but that an implementor may wish to support that object to
foster interoperability with older implementations.
7.5. Mapping of the DESCRIPTION clause
The DESCRIPTION clause, which must be present, contains a
textual definition of that object 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.
Case, McCloghrie, Rose & Waldbusser [Page 27]
RFC 1442 SMI for SNMPv2 April 1993
7.6. 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
information module. This is useful when de-osifying a MIB
module produced by some other organization.
7.7. Mapping of the INDEX clause
The INDEX clause, which must be present if that object
corresponds to a conceptual row (unless an AUGMENTS clause is
present instead), and must be absent otherwise, defines
instance identification information for the columnar objects
subordinate to that object.
Management operations apply exclusively to scalar objects.
However, it is convenient for developers of management
applications to impose imaginary, tabular structures on the
ordered collection of objects that constitute the MIB. Each
such conceptual table contains zero or more rows, and each row
may contain one or more scalar objects, termed columnar
objects. This conceptualization is formalized by using the
OBJECT-TYPE macro to define both an object which corresponds
to a table and an object which corresponds to a row in that
table. A conceptual table has SYNTAX of the form:
SEQUENCE OF <EntryType>
where <EntryType> refers to the SEQUENCE type of its
subordinate conceptual row. A conceptual row has SYNTAX of
the form:
<EntryType>
where <EntryType> is a SEQUENCE type defined as follows:
<EntryType> ::= SEQUENCE { <type1>, ... , <typeN> }
where there is one <type> for each subordinate object, and
each <type> is of the form:
<descriptor> <syntax>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?