Export (0) Print
Expand All

6 Appendix B: ABNF Encoding Definition

;
;--- Main block
;
EncodingUnit = Signature ObjectEncodingLength ObjectBlock
ObjectEncodingLength = UINT32
ObjectBlock = ObjectFlags [Decoration] Encoding
ObjectFlags = OCTET
; Bit 0 = Class, Bit 1 = Instance, 
; Bit 2 = DecorationBlock is present
Decoration = DecServerName DecNamespaceName
DecServerName = Encoded-String
DecNamespaceName = Encoded-String
Encoding = InstanceType / ClassType
;
;------ CIM class Encoding ----
;
ClassType = ParentClass CurrentClass
ParentClass = ClassAndMethodsPart
CurrentClass = ClassAndMethodsPart
ClassAndMethodsPart = ClassPart [MethodsPart]
 ; [MethodsPart] is always present if ObjectFlags indicates
 ; the CIM object is a CIM class definition, and always absent
 ; if the current CIM object is a CIM instance definition
ClassPart = ClassHeader DerivationList ClassQualifierSet 
      PropertyLookupTable [NdTable ValueTable] ClassHeap
ClassHeader = EncodingLength ReservedOctet 
      ClassNameRef NdTableValueTableLength
DerivationList = EncodingLength *ClassNameEncoding
ClassNameEncoding = Encoded-String EncodingLength
ClassNameRef = HeapStringRef
ClassQualifierSet = QualifierSet
; --------------------
PropertyLookupTable = PropertyCount *PropertyLookup
 ; PropertyLookup entries are sorted by 
 ;   CIM Property name so that binary
 ;   searches are possible.
PropertyCount = UINT32
PropertyLookup = PropertyNameRef PropertyInfoRef
PropertyNameRef = HeapStringRef
PropertyInfoRef = HeapRef
;-------------------
NdTable = *NullAndDefaultFlag
NullAndDefaultFlag = 2BIT 
  ;nullness = bit 0, inheritedDefault = bit1
NdTableValueTableLength = UINT32
ValueTable = *EncodedValue
PropertyInfo = PropertyType DeclarationOrder 
    ValueTableOffset ClassOfOrigin PropertyQualifierSet
PropertyType = CimType
DeclarationOrder = UINT16
ValueTableOffset = UINT32
ClassOfOrigin = UINT32      
; Which CIM class in the DerivationList this 
;   CIM Property comes from %x0 == the current class.
PropertyQualifierSet = QualifierSet
ClassHeap = Heap
;--- Method Encoding ---
MethodsPart = EncodingLength MethodCount 
    MethodCountPadding *MethodDescription MethodHeap
MethodCount = UINT16
MethodCountPadding = 2OCTET
MethodHeap = Heap
MethodDescription = MethodName MethodFlags MethodPadding 
    MethodOrigin MethodQualifiers InputSignature OutputSignature
MethodName = HeapStringRef
MethodFlags = OCTET
MethodPadding = 3OCTET
MethodOrigin = UINT32         ; CIM class in DerivationList
MethodQualifiers = HeapQualifierSetRef
InputSignature = MethodSignature
OutputSignature = MethodSignature
MethodSignature = HeapMethodSignatureBlockRef
; --- CIM instance encoding
InstanceType = CurrentClass EncodingLength InstanceFlags 
   InstanceClassName NdTable InstanceData InstanceQualifierSet 
   InstanceHeap
InstanceFlags = OCTET
InstanceClassName = HeapStringRef
InstanceData = ValueTable
InstanceQualifierSet = QualifierSet InstancePropQualifierSet
InstanceHeap = Heap
;--- CIM Qualifier Sets ---
QualifierSet = EncodingLength *Qualifier
Qualifier = QualifierName QualifierFlavor 
   QualifierType QualifierValue
QualifierName = HeapStringRef
QualifierFlavor = OCTET
QualifierType = CimType
QualifierValue = EncodedValue
InstancePropQualifierSet = InstPropQualSetFlag *QualifierSet
InstPropQualSetFlag = %x1 / %x2
   ; One OCTET.  If 1, there is no list of Qualifiers in
   ; InstanceQualifierSet.  If 2, there is a list of Qualifiers.
   ; The number of qualifiers is equivalent to the number of
   ; properties in the CIM class definition for the instance.
   ; The CIM Qualifier sets are in the lexical order for the
   ; properties, as in the PropertyLookupTable.
;--- Heap ---
Heap = HeapLength *HeapItem
HeapStringRef = HeapRef
HeapQualifierSetRef = HeapRef
ClassPartRef = HeapRef
HeapMethodSignatureBlockRef = HeapRef
HeapRef = UINT32 / DictionaryReference
   ; The DictionaryReference choice is taken if the
   ; reference value has the MS bit set.  Therefore
   ; only 31 bits are used for an offset into the heap
   ; when the DictionaryReference is not being used.

HeapItem = PropertyInfo / Encoded-String / Encoded-Array / 
   QualifierSet / ObjectBlock / MethodSignatureBlock
MethodSignatureBlock = EncodingLength [ObjectBlock]
EncodedValue = NumericValue / HeapRef / BOOL / NoValue
   ; Note that values are inline if they are 
   ;  NumericValue, BOOL, or NoValue
   ; If the CimType of the encoded value is CIM-TYPE-STRING
   ;  or an array of any kind,
   ; then HeapRef points to the value in the heap.
;--- Simple types ----
HeapLength = UINT32
    ;*MS bit is always set, so length is expressed in lower 31 bits
EncodingLength = UINT32
Encoded-String = Encoded-String-Flag *Character Null;
Encoded-String-Flag = OCTET
Character = AnsiCharacter / UnicodeCharacter
Null = Character
AnsiCharacter = OCTET
UnicodeCharacter = 2OCTET
Encoded-Array = ArrayCount *EncodedValue
ArrayCount = UINT32
; The DictionaryReference is used where HeapRef may appear and the 
;   EncodedValue type is Encoded-String
; These appear as 32 bit offsets into the Heap with the 
;   MS bit set to 1 and the lower
; 31 bits set to one of the integer values below
DictionaryReference = %d0 / %d1 / %d2 / %d3 / %d4 / %d5 / 
      %d6 / %d7 / %d8 / %d9 / %d10
  ; %d0   Encoded/Decoded as quote character
  ; %d1   Encoded/Decoded as "key"
  ; %d2   Encoded/Decoded as ""
  ; %d3   Encoded/Decoded as "read"
  ; %d4   Encoded/Decoded as "write"
  ; %d5   Encoded/Decoded as "volatile"
  ; %d6   Encoded/Decoded as "provider"
  ; %d7   Encoded/Decoded as "dynamic"
  ; %d8   Encoded/Decoded as "cimwin32"
  ; %d9   Encoded/Decoded as "DWORD"
  ; %d10  Encoded/Decoded as "CIMTYPE"
ReservedOctet = OCTET  ;*doc
Signature = UINT32  ;0x12345678 little-endian ;*doc
NumericValue = BYTE / SINT16 / UINT16 / SINT32 / UINT32 / 
   SINT64 / UINT64 / REAL32 / REAL64 ;*doc
BYTE = OCTET
UINT32 = 4OCTET
SINT32 = 4OCTET
UINT64 = 8OCTET
SINT64 = 8OCTET
REAL32 = 4OCTET             ; IEEE short floating-point format
REAL64 = 8OCTET             ; IEEE format
UINT16 = 2OCTET
SINT16 = 2OCTET
BOOL = 2OCTET                  ;*
OCTET = %x0-FF                  ;*
BIT = %x0 / %x1                 ;*doc
CimType = CimBaseType / CimArrayType
  ; 32 bit encoding, upper 16 bits not used.
CimArrayFlag = %x20 %x00           ; 0x2000 bit flag
CimBaseType = CIM-TYPE-SINT8 / CIM-TYPE-UINT8 /
   CIM-TYPE-SINT16 / CIM-TYPE-UINT16 / 
   CIM-TYPE-SINT32 / CIM-TYPE-UINT32 /
   CIM-TYPE-SINT64 / CIM-TYPE-UINT64 / 
   CIM-TYPE-REAL32 / CIM-TYPE-REAL64 /
   CIM-TYPE-BOOLEAN / CIM-TYPE-STRING /  
   CIM-TYPE-DATETIME / CIM-TYPE-REFERENCE /
   CIM-TYPE-CHAR16 / CIM-TYPE-OBJECT 

CimArrayType = CIM-ARRAY-SINT8 / CIM-ARRAY-UINT8 / 
   CIM-ARRAY-SINT16 / CIM-ARRAY-UINT16 /
   CIM-ARRAY-SINT32 / CIM-ARRAY-UINT32 /
   CIM-ARRAY-SINT64 / CIM-ARRAY-UINT64 /
   CIM-ARRAY-REAL32 / CIM-ARRAY-REAL64 /
   CIM-ARRAY-BOOLEAN / CIM-ARRAY-STRING /
   CIM-ARRAY-DATETIME / CIM-ARRAY-REFERENCE / 
   CIM-ARRAY-CHAR16 / CIM-ARRAY-OBJECT

CIM-TYPE-SINT8 = %d16
CIM-TYPE-UINT8 = %d17
CIM-TYPE-SINT16 =%d2
CIM-TYPE-UINT16 =%d18
CIM-TYPE-SINT32 = %d3
CIM-TYPE-UINT32 = %d19
CIM-TYPE-SINT64 = %d20
CIM-TYPE-UINT64 = %d21
CIM-TYPE-REAL32 = %d4
CIM-TYPE-REAL64 = %d5
CIM-TYPE-BOOLEAN = %d11
CIM-TYPE-STRING = %d8
CIM-TYPE-DATETIME = %d101
CIM-TYPE-REFERENCE = %d102
CIM-TYPE-CHAR16 = %d103
CIM-TYPE-OBJECT = %d13

CIM-ARRAY-SINT8 = %d8208
CIM-ARRAY-UINT8 = %d8209
CIM-ARRAY-SINT16 =%d8194
CIM-ARRAY-UINT16 =%d8210
CIM-ARRAY-SINT32 = %d8195
CIM-ARRAY-UINT32 = %d8201
CIM-ARRAY-SINT64 = %d8202
CIM-ARRAY-UINT64 = %d8203
CIM-ARRAY-REAL32 = %d8196
CIM-ARRAY-REAL64 = %d8197
CIM-ARRAY-BOOLEAN = %d8203
CIM-ARRAY-STRING = %d8200
CIM-ARRAY-DATETIME = %d8293
CIM-ARRAY-REFERENCE = %d8294
CIM-ARRAY-CHAR16 = %d8295
CIM-ARRAY-OBJECT = %d8205

 
Show:
© 2014 Microsoft