summaryrefslogtreecommitdiffstats
path: root/tests/py/inet/comp.t.payload.netdev
blob: cdeba2bd29502f7e4f7a836df97caa4fb556ae73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# comp nexthdr != esp
inet test-inet input
  [ meta load l4proto => reg 1 ]
  [ cmp eq reg 1 0x0000006c ]
  [ payload load 1b @ transport header + 0 => reg 1 ]
  [ cmp neq reg 1 0x00000032 ]

# comp flags 0x0
inet test-inet input
  [ meta load l4proto => reg 1 ]
  [ cmp eq reg 1 0x0000006c ]
  [ payload load 1b @ transport header + 1 => reg 1 ]
  [ cmp eq reg 1 0x00000000 ]

# comp flags != 0x23
inet test-inet input
  [ meta load l4proto => reg 1 ]
  [ cmp eq reg 1 0x0000006c ]
  [ payload load 1b @ transport header + 1 => reg 1 ]
  [ cmp neq reg 1 0x00000023 ]

# comp flags 0x33-0x45
inet test-inet input
  [ meta load l4proto => reg 1 ]
  [ cmp eq reg 1 0x0000006c ]
  [ payload load 1b @ transport header + 1 => reg 1 ]
  [ cmp gte reg 1 0x00000033 ]
  [ cmp lte reg 1 0x00000045 ]

# comp flags != 0x33-0x45
inet test-inet input
  [ meta load l4proto => reg 1 ]
  [ cmp eq reg 1 0x0000006c ]
  [ payload load 1b @ transport header + 1 => reg 1 ]
  [ range neq reg 1 0x00000033 0x00000045 ]

# comp flags {0x33, 0x55, 0x67, 0x88}
__set%d test-inet 3
__set%d test-inet 0
	element 00000033  : 0 [end]	element 00000055  : 0 [end]	element 00000067  : 0 [end]	element 00000088  : 0 [end]
inet test-inet input
  [ meta load l4proto => reg 1 ]
  [ cmp eq reg 1 0x0000006c ]
  [ payload load 1b @ transport header + 1 => reg 1 ]
  [ lookup reg 1 set __set%d ]

# comp flags { 0x33-0x55}
__set%d test-inet 7
__set%d test-inet 0
	element 00000000  : 1 [end]	element 00000033  : 0 [end]	element 00000056  : 1 [end]
inet test-inet input
  [ meta load l4proto => reg 1 ]
  [ cmp eq reg 1 0x0000006c ]
  [ payload load 1b @ transport header + 1 => reg 1 ]
  [ lookup reg 1 set __set%d ]

# comp cpi 22
inet test-inet input
  [ meta load l4proto => reg 1 ]
  [ cmp eq reg 1 0x0000006c ]
  [ payload load 2b @ transport header + 2 => reg 1 ]
  [ cmp eq reg 1 0x00001600 ]

# comp cpi != 233
inet test-inet input
  [ meta load l4proto => reg 1 ]
  [ cmp eq reg 1 0x0000006c ]
  [ payload load 2b @ transport header + 2 => reg 1 ]
  [ cmp neq reg 1 0x0000e900 ]

# comp cpi 33-45
inet test-inet input
  [ meta load l4proto => reg 1 ]
  [ cmp eq reg 1 0x0000006c ]
  [ payload load 2b @ transport header + 2 => reg 1 ]
  [ cmp gte reg 1 0x00002100 ]
  [ cmp lte reg 1 0x00002d00 ]

# comp cpi != 33-45
inet test-inet input
  [ meta load l4proto => reg 1 ]
  [ cmp eq reg 1 0x0000006c ]
  [ payload load 2b @ transport header + 2 => reg 1 ]
  [ range neq reg 1 0x00002100 0x00002d00 ]

# comp cpi {33, 55, 67, 88}
__set%d test-inet 3
__set%d test-inet 0
	element 00002100  : 0 [end]	element 00003700  : 0 [end]	element 00004300  : 0 [end]	element 00005800  : 0 [end]
inet test-inet input
  [ meta load l4proto => reg 1 ]
  [ cmp eq reg 1 0x0000006c ]
  [ payload load 2b @ transport header + 2 => reg 1 ]
  [ lookup reg 1 set __set%d ]

# comp cpi { 33-55}
__set%d test-inet 7
__set%d test-inet 0
	element 00000000  : 1 [end]	element 00002100  : 0 [end]	element 00003800  : 1 [end]
inet test-inet input
  [ meta load l4proto => reg 1 ]
  [ cmp eq reg 1 0x0000006c ]
  [ payload load 2b @ transport header + 2 => reg 1 ]
  [ lookup reg 1 set __set%d ]