TEXTUAL-CONVENTION Macro
SNMP textual conventions map to CIM-defined types.
Note
For more information about installing the provider, see Setting up the WMI SNMP Environment.
The following mapping rules apply to SNMP textual conventions:
- The named type definition in the SYNTAX clause maps verbatim to the CIM property qualifier object_syntax.
- Use the following table to map textual conventions when the SYNTAX clause explicitly refers to a textual convention of a SNMPv2C TEXTUAL-CONVENTION macro, or refers to an implied textual convention. The default value is always NULL.
Textual convention | CIM variant type | CIM qualifier |
---|---|---|
DateAndTime | VT_BSTR | textual_convention: DateAndTime encoding: OCTETSTRING object_syntax: DateAndTime cimtype: string |
Displaystring | VT_BSTR | textual_convention: Displaystring encoding: OCTETSTRING object_syntax: Displaystring cimtype: string |
MacAddress | VT_BSTR | textual_convention: MacAddress encoding: OCTETSTRING object_syntax: MacAddress cimtype: string |
PhysAddress | VT_BSTR | textual_convention: PhysAddress encoding: OCTETSTRING object_syntax: PhysAddress cimtype: string |
SnmpUDPAddress | VT_BSTR | textual_convention: SnmpUDPAddress encoding: OCTETSTRING object_syntax: SnmpUDPAddress cimtype: string |
SnmpOSIAddress | VT_BSTR | textual_convention: SnmpOSIAddress encoding: OCTETSTRING object_syntax: SnmpOSIAddress cimtype: string |
SnmpIPXAddress | VT_BSTR | textual_convention: SnmpIPXAddress encoding: OCTETSTRING object_syntax: SnmpIPXAddress cimtype: string |
- The CIM-defined variant type and the CIM property qualifiers textual_convention, encoding, object_syntax, and cimtype map using the underlying primitive type.
- The DISPLAY-HINT clause of the SNMPv2C TEXTUAL-CONVENTION macro maps verbatim to the CIM property qualifier display_hint. This qualifier is not generated if there is no TEXTUAL-CONVENTION macro, or the macro does not contain a DISPLAY-HINT clause.
Example Code
The following example describes an SNMPv1 textual convention.
myNamedType ::= DISPLAYSTRING (SIZE (0..127))
myNamedProperty OBJECT-TYPE
SYNTAX myNamedType
ACCESS read-only
STATUS MANDATORY
DESCRIPTION ""
This example generates the following CIM qualifiers.
object_syntax("myNamedType"),
textual_convention("DISPLAYSTRING"),
encoding("OCTETSTRING"),
variable_length("0..127")
The following example describes an SNMPv2 textual convention.
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 ""
This example generates the following CIM qualifiers.
object_syntax("myDisplaystring"),
textual_convention("OCTETSTRING"),
encoding("OCTETSTRING"),
display_hint("255a"),
variable_length("0..127")