Description:
MatchTableData method returns TRUE if the table data matches the parameter "Value to match". A typical use of this method is to distinguish various classes of message, for example commands, responses and data.
Parameters:
|
[Required] |
Table |
"Which table" |
|
|
[Required] |
Int64 |
"Value to match" |
|
|
[Optional] |
Str |
"Error message" |
|
Example:
Examples of its use can be seen in the HTTP and SMTP decoders. One instance from the latter decoders is:
TABLE cmd
{ 1 "Send" "Send" 1 }
{ 2 "Receive" "Receive" 1 }
{ 3 "Reserved" "Reserved" 0 }
{ 4 "Set" "Set" 1 }
{ Default "???" "???" 0 }
ENDTABLE
FIELD type (Fixed 4) (Table cmd) "Type" VERIFY (MatchTableData cmd 1 "Unsupported")
This takes the value in the filed "tpe" and looks it up in the table "cmd". Then the table data for that entry is checked against the constant given I nthe parameter "Value to match." For example, if the value of "type" were 2, the test would return true because this value matches the "Receive" entry in the table, which matches the 1 given as the parameter.