Actions
If a structure is detected by its condition, you can specify a set of actions that are taken for that structure. If you do not specify an action, the operator specifies the submit action by default. If an action list is specified and you want to allow a tuple to be submitted for the structure, specify the submit action. Four different actions are supported:
set variable (XML element <set value="value" as="variable-name"/>)
Sets the variable to a constant value, for example:
<action>
<set value="false" as="padding"/>
</action>
store field in variable (XML element <store field="field-name" as="variable-name"/>)
Stores a field of the current structure in a variable, for example:
<action>
<store field="VERSION" as="version"/>
</action>
submit tuple (XML element <submit/>)
Submits the field values of the structure as a tuple. For more information about the mapping, see the Mapping Definition Document.
skip bytes (XML element <skip/>)
Skips any number of consecutive bytes of the given value, for example 255. This action is mostly used for padding and is the only one that can lead to a number of processed bytes, which is larger than the structure size.
For example, the padding structure is defined as a uint8 field (size 1). If the field has the value 255 and if padding is allowed (boolean variable), the condition selects this structure. The <skip><uint8="255"/></skip> action skips all consecutive bytes that have the value 255. The skip action starts skipping after the structure.
Examples
Set variables with a constant and field value:
<action>
<set value="false" as="padding"/>
<store field="VERSION" as="version"/>
</action>
Skip all consecutive bytes that have the value 255:
<action>
<skip>
<uint8 value="255"/>
</skip>
</action>
Set variable but also submit the structure as a tuple:
<action>
<set value="false" as="padding"/>
<submit/>
</action>