Content-type: text/html
Classify ESP packets. ESPClassifier can have an arbitrary number of patterns. Each pattern is a logical espression. ESPClassifier based on the content of the ESP packet.
The following is the ESP packet format
0 8 16 24 32
----------------------------------------------------------------------
| Version | | opcode | len |
----------------------------------------------------------------------
| CID | Operands |
---------------------------------------------------------------------
| Operands .... |
---------------------------------------------------------------------
| Operands | Checksum |
---------------------------------------------------------------------
| Checksum |
----------------------------------
The second Byte has the following format.
0 1 2 3 4 5 6 7 8
---------------------------------
| | | | | | | | |
---------------------------------
| | | | | | | |------ Reserved
| | | | | | |----- EXEC_RECV bit
| | | | | |------ EXEC_SEND bit
| | | | |----- RB bit (reflect packet)
| | | |----- ERR bit
| | |----- LOC_OUTPUT bit
| |----- LOC_CENTER bit
|----- LOC_INPUT bit
You can use '&&', '||', '!', 'and', 'or', 'not' to link the following basic terms:
execsend: true if EXEC_SEND bit was set; otherwise false.
execrecv: true if EXEC_RECV bit was set; otherwise false.
reflect: true if RB bit was set; otherwise false.
noreflect: it is the same as "not reflect" or " ! reflect".
error: true if ERR bit was set; otherwise false.
noerror: it is the same as "not error" or "! error".
input: true if LOC_INPUT bit was set; otherwise false.
output: true if LOC_OUTPUT bit was set; otherwise flase.
center: true if LOC_CENTER bit was set; otherwise false.
opcode [OP] NUMBER: Check the opcode field.
the OP can be "=", "==", "!=", "<=", ">=", ">" or "<". If OP
is not presented, "=" will be the default OP. "=" and "==" is
the same thing.
NUMBER should be a integer value, you can also use some
predefined value, such as "op_count","op_compare"....
version [OP] NUMBER: Check the Version field.
len [OP] NUMBER: Check the Len field.
The ESPClassifier has N outputs, each associated with the corresponding pattern from the configuration string.
As a special case, a pattern consisting of "-", "any" or "all" matches every packet.
As the Classifier(n) element, the patterns are scanned by order, and the packet is sent to the output port corresponding to the first matching pattern.
ESPClassifier( noreflect,
execrecv && input,
-);
This statement will create an element with three outputs to processing ESP Packets. The ESP packets without RB bit set will be sent to output 0; ESP packets with RB, EXEC_RECV, LOC_INPUT bit set will be sent to output 1; And all other packets will be sent to output 2.
ESPClassifier only handle ESP packets.All the packets pass through this element must be ESP packet with ESP annotation set. That is to say, the packet must came from the output 1 or output 2 of IPESPSwitch(n)