123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- U32 tests whether quantities of up to 4 bytes extracted from a packet have
- specified values. The specification of what to extract is general enough to
- find data at given offsets from tcp headers or payloads.
- .TP
- [\fB!\fP] \fB\-\-u32\fP \fItests\fP
- The argument amounts to a program in a small language described below.
- .IP
- tests := location "=" value | tests "&&" location "=" value
- .IP
- value := range | value "," range
- .IP
- range := number | number ":" number
- .PP
- a single number, \fIn\fP, is interpreted the same as \fIn:n\fP. \fIn:m\fP is
- interpreted as the range of numbers \fB>=n\fP and \fB<=m\fP.
- .IP "" 4
- location := number | location operator number
- .IP "" 4
- operator := "&" | "<<" | ">>" | "@"
- .PP
- The operators \fB&\fP, \fB<<\fP, \fB>>\fP and \fB&&\fP mean the same as in C.
- The \fB=\fP is really a set membership operator and the value syntax describes
- a set. The \fB@\fP operator is what allows moving to the next header and is
- described further below.
- .PP
- There are currently some artificial implementation limits on the size of the
- tests:
- .IP " *"
- no more than 10 of "\fB=\fP" (and 9 "\fB&&\fP"s) in the u32 argument
- .IP " *"
- no more than 10 ranges (and 9 commas) per value
- .IP " *"
- no more than 10 numbers (and 9 operators) per location
- .PP
- To describe the meaning of location, imagine the following machine that
- interprets it. There are three registers:
- .IP
- A is of type \fBchar *\fP, initially the address of the IP header
- .IP
- B and C are unsigned 32 bit integers, initially zero
- .PP
- The instructions are:
- .IP
- number B = number;
- .IP
- C =
|