TEXTUAL-CONVENTION macro
SNMP-tekstconventies worden toegewezen aan door CIM gedefinieerde typen.
Notitie
Zie De WMI SNMP-omgeving instellenvoor meer informatie over het installeren van de provider.
De volgende toewijzingsregels zijn van toepassing op tekstconventies van SNMP:
- De definitie van het benoemde type in de SYNTAX-component wijst de exacte bewoordingen toe aan de CIM-eigenschapskwalificatie object_syntax.
- Gebruik de volgende tabel om tekstconventies toe te wijzen wanneer de SYNTAX-component expliciet verwijst naar een tekstconventie van een SNMPv2C-macro TEXTUAL-CONVENTION macro of verwijst naar een impliciete tekstconventie. De standaardwaarde is altijd NULL-.
Tekstconventie | CIM-varianttype | CIM-kwalificatie |
---|---|---|
DateAndTime | VT_BSTR |
textual_convention: DateAndTime codering: OCTETSTRING object_syntax: DateAndTime cimtype: tekenreeks |
Displaystring | VT_BSTR |
textual_convention: Displaystring codering: OCTETSTRING object_syntax: Displaystring cimtype: tekenreeks |
MacAddress | VT_BSTR |
textual_convention: MacAddress codering: OCTETSTRING object_syntax: MacAddress cimtype: tekenreeks |
PhysAddress | VT_BSTR |
textual_convention: PhysAddress codering: OCTETSTRING object_syntax: PhysAddress cimtype: tekenreeks |
SnmpUDPAddress | VT_BSTR |
textual_convention: SnmpUDPAddress codering: OCTETSTRING object_syntax: SnmpUDPAddress cimtype: tekenreeks |
SnmpOSIAddress | VT_BSTR |
textual_convention: SnmpOSIAddress codering: OCTETSTRING object_syntax: SnmpOSIAddress cimtype: tekenreeks |
SnmpIPXAddress | VT_BSTR |
textual_convention: SnmpIPXAddress codering: OCTETSTRING object_syntax: SnmpIPXAddress cimtype: tekenreeks |
- Het door CIM gedefinieerde varianttype en de CIM-eigenschapskwalificaties textual_convention, codering, object_syntaxen cimtype kaart met behulp van het onderliggende primitieve type.
- De DISPLAY-HINT component van de SNMPv2C TEXTUAL-CONVENTION macro wijst exacte bewoordingen toe aan de kwalificatie van de CIM-eigenschap display_hint. Deze kwalificatie wordt niet gegenereerd als er geen TEXTUAL-CONVENTION macro is of als de macro geen DISPLAY-HINT component bevat.
Voorbeeldcode
In het volgende voorbeeld wordt een tekstconventie van SNMPv1 beschreven.
myNamedType ::= DISPLAYSTRING (SIZE (0..127))
myNamedProperty OBJECT-TYPE
SYNTAX myNamedType
ACCESS read-only
STATUS MANDATORY
DESCRIPTION ""
In dit voorbeeld worden de volgende CIM-kwalificaties gegenereerd.
object_syntax("myNamedType"),
textual_convention("DISPLAYSTRING"),
encoding("OCTETSTRING"),
variable_length("0..127")
In het volgende voorbeeld wordt een tekstconventie van SNMPv2 beschreven.
myDisplaystring ::= TEXTUAL-CONVENTION
DISPLAY-HINT "255a"
STATUS current
DESCRIPTION ""
SYNTAX OCTET STRING (SIZE (0..127))
myNamedProperty OBJECT-TYPE
SYNTAX myDisplaystring
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
In dit voorbeeld worden de volgende CIM-kwalificaties gegenereerd.
object_syntax("myDisplaystring"),
textual_convention("OCTETSTRING"),
encoding("OCTETSTRING"),
display_hint("255a"),
variable_length("0..127")