MinFieldOrEndOfLayer

Description:

This method derives a size from the value in a field that has already been processed. Three parameters are used, the first two being required. The first parameter is the unit, that is one of the terms listed for the Fixed method ("Bits", "Bytes", etc.). The second is the name of the field that contains the size. The optional third parameter is an adjustment, a (possibly negative) integer that is subtracted from the field value.

Suppose the field "data_count" contains the value 6. (FromField Words data_count 1) would extract the value 6, subtract 1, multiply by 16 (remember all Size methods return the length in bits), and return the result 80.

This will not exceed the end of the layer.

Parameters:

[Required]

List

"Units"


List values:

Bit

Bits

Times

Nibble

Nibbles

Byte

Bytes

Octet

Octets

Word

Words

Dword

Dwords

Qword

Qwords

[Required]

Field

"Which field"


[Optional]

Int

"Offset (in units)"

(Default value: 0)

Example:

FIELD type_value (MinFieldOrEndOfLayer Bytes two_byte_length 3) (StringOfASCII 30) "Type"