| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
# NFT_TEST_REQUIRES(NFT_TEST_HAVE_bitshift) |
| 4 |
|
| 5 |
set -e |
| 6 |
|
| 7 |
RULESET="table ip x { |
| 8 |
chain sctm_o0_0 { |
| 9 |
} |
| 10 |
|
| 11 |
chain sctm_o0_1 { |
| 12 |
} |
| 13 |
|
| 14 |
map sctm_o0 { |
| 15 |
type mark : verdict |
| 16 |
elements = { |
| 17 |
0x0 : jump sctm_o0_0, |
| 18 |
0x1 : jump sctm_o0_1, |
| 19 |
} |
| 20 |
} |
| 21 |
|
| 22 |
counter c_o0_0 {} |
| 23 |
|
| 24 |
map sctm_o1 { |
| 25 |
type mark : counter |
| 26 |
elements = { |
| 27 |
0x0 : \"c_o0_0\", |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
chain SET_ctmark_RPLYroute { |
| 32 |
meta mark >> 8 & 0xf vmap @sctm_o0 |
| 33 |
} |
| 34 |
|
| 35 |
chain SET_ctmark_RPLYroute { |
| 36 |
counter name meta mark >> 8 & 0xf map @sctm_o1 |
| 37 |
} |
| 38 |
}" |
| 39 |
|
| 40 |
$NFT -f - <<< $RULESET |