OPS := [ OPS ] OP
OPTIONS := [
divisor
NUM ] [
baseclass
ID ] [
match
EMATCH_TREE ] [
action
ACTION_SPEC ]
KEY_LIST := [ KEY_LIST ] KEY
OP := {
or | and | xor | rshift | addend }
NUM
ID := X:Y
KEY := {
src | dst | proto | proto-src | proto-dst | iif |
priority | mark | nfct | nfct-src | nfct-dst |
nfct-proto-src | nfct-proto-dst | rt-classid | sk-uid |
sk-gid | vlan-tag | rxhash }
The range of class IDs can be limited by the divisor option, which is used for a modulus.
tc filter add ... flow hash \
keys src,dst,proto,proto-src,proto-dst divisor 1024
tc filter add ... flow hash \
keys nfct-src,nfct-dst,proto,nfct-proto-src,nfct-proto-dst \
divisor 1024
tc filter add ... flow map \
key dst addend -192.168.0.0 divisor 256
tc filter add ... flow map \
key dst and 0xff
tc filter add ... flow map \
key dst and 0xff xor 0xff