backing up
[vsorcdistro/.git] / ryu / build / lib.linux-armv7l-2.7 / ryu / tests / switch / of13 / action / 25_SET_FIELD / 14_TCP_DST_IPv4.json
1 [
2     "action: set_field: 14_TCP_DST (IPv4)",
3     {
4         "description": "ethernet/ipv4/tcp(dst_port=2222)-->'tcp_dst=2222,actions=set_field:6789->tcp_dst,output:2'",
5         "prerequisite":[
6             {
7                 "OFPFlowMod":{
8                     "table_id":0,
9                     "match":{
10                         "OFPMatch":{
11                             "oxm_fields":[
12                                 {
13                                     "OXMTlv":{
14                                         "field":"eth_type",
15                                         "value":2048
16                                     }
17                                 },
18                                 {
19                                     "OXMTlv":{
20                                         "field":"ip_proto",
21                                         "value":6
22                                     }
23                                 },
24                                 {
25                                     "OXMTlv":{
26                                         "field":"tcp_dst",
27                                         "value":2222
28                                     }
29                                 }
30                             ]
31                         }
32                     },
33                     "instructions":[
34                         {
35                             "OFPInstructionActions":{
36                                 "actions":[
37                                     {
38                                         "OFPActionSetField":{
39                                             "field":{
40                                                 "OXMTlv":{
41                                                     "field":"tcp_dst",
42                                                     "value":6789
43                                                 }
44                                             }
45                                         }
46                                     },
47                                     {
48                                         "OFPActionOutput":{
49                                             "port":2
50                                         }
51                                     }
52                                 ],
53                                 "type":4
54                             }
55                         }
56                     ]
57                 }
58             }
59         ],
60         "tests":[
61             {
62                 "ingress":[
63                     "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)",
64                     "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)",
65                     "tcp(dst_port=2222, option=bytes(b'\\x00' * 4), src_port=11111)",
66                     "b'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'"
67                 ],
68                 "egress":[
69                     "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)",
70                     "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)",
71                     "tcp(dst_port=6789, option=bytes(b'\\x00' * 4), src_port=11111)",
72                     "b'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'"
73                 ]
74             }
75         ]
76     },
77     {
78         "description": "ethernet/vlan/ipv4/tcp(dst_port=2222)-->'tcp_dst=2222,actions=set_field:6789->tcp_dst,output:2'",
79         "prerequisite":[
80             {
81                 "OFPFlowMod":{
82                     "table_id":0,
83                     "match":{
84                         "OFPMatch":{
85                             "oxm_fields":[
86                                 {
87                                     "OXMTlv":{
88                                         "field":"eth_type",
89                                         "value":2048
90                                     }
91                                 },
92                                 {
93                                     "OXMTlv":{
94                                         "field":"ip_proto",
95                                         "value":6
96                                     }
97                                 },
98                                 {
99                                     "OXMTlv":{
100                                         "field":"tcp_dst",
101                                         "value":2222
102                                     }
103                                 }
104                             ]
105                         }
106                     },
107                     "instructions":[
108                         {
109                             "OFPInstructionActions":{
110                                 "actions":[
111                                     {
112                                         "OFPActionSetField":{
113                                             "field":{
114                                                 "OXMTlv":{
115                                                     "field":"tcp_dst",
116                                                     "value":6789
117                                                 }
118                                             }
119                                         }
120                                     },
121                                     {
122                                         "OFPActionOutput":{
123                                             "port":2
124                                         }
125                                     }
126                                 ],
127                                 "type":4
128                             }
129                         }
130                     ]
131                 }
132             }
133         ],
134         "tests":[
135             {
136                 "ingress":[
137                     "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)",
138                     "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)",
139                     "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)",
140                     "tcp(dst_port=2222, option=bytes(b'\\x00' * 4), src_port=11111)",
141                     "b'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'"
142                 ],
143                 "egress":[
144                     "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)",
145                     "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)",
146                     "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)",
147                     "tcp(dst_port=6789, option=bytes(b'\\x00' * 4), src_port=11111)",
148                     "b'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'"
149                 ]
150             }
151         ]
152     },
153     {
154         "description": "ethernet/mpls/ipv4/tcp(dst_port=2222)-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,tcp_dst=2222,actions=set_field:6789->tcp_dst,output:2'",
155         "prerequisite":[
156             {
157                 "OFPFlowMod":{
158                     "table_id":0,
159                     "match":{
160                         "OFPMatch":{
161                             "oxm_fields":[
162                                 {
163                                     "OXMTlv":{
164                                         "field":"eth_type",
165                                         "value":34887
166                                     }
167                                 }
168                             ]
169                         }
170                     },
171                     "instructions":[
172                         {
173                             "OFPInstructionActions":{
174                                 "actions":[
175                                     {
176                                         "OFPActionPopMpls":{
177                                             "ethertype":2048
178                                         }
179                                     }
180                                 ],
181                                 "type":4
182                             }
183                         },
184                         {
185                             "OFPInstructionGotoTable":{
186                                 "table_id":1
187                             }
188                         }
189                     ]
190                 }
191             },
192             {
193                 "OFPFlowMod":{
194                     "table_id":1,
195                     "match":{
196                         "OFPMatch":{
197                             "oxm_fields":[
198                                 {
199                                     "OXMTlv":{
200                                         "field":"eth_type",
201                                         "value":2048
202                                     }
203                                 },
204                                 {
205                                     "OXMTlv":{
206                                         "field":"ip_proto",
207                                         "value":6
208                                     }
209                                 },
210                                 {
211                                     "OXMTlv":{
212                                         "field":"tcp_dst",
213                                         "value":2222
214                                     }
215                                 }
216                             ]
217                         }
218                     },
219                     "instructions":[
220                         {
221                             "OFPInstructionActions":{
222                                 "actions":[
223                                     {
224                                         "OFPActionSetField":{
225                                             "field":{
226                                                 "OXMTlv":{
227                                                     "field":"tcp_dst",
228                                                     "value":6789
229                                                 }
230                                             }
231                                         }
232                                     },
233                                     {
234                                         "OFPActionOutput":{
235                                             "port":2
236                                         }
237                                     }
238                                 ],
239                                 "type":4
240                             }
241                         }
242                     ]
243                 }
244             }
245         ],
246         "tests":[
247             {
248                 "ingress":[
249                     "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)",
250                     "mpls(bsb=1, label=100, exp=3, ttl=64)",
251                     "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)",
252                     "tcp(dst_port=2222, option=bytes(b'\\x00' * 4), src_port=11111)",
253                     "b'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'"
254                 ],
255                 "egress":[
256                     "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)",
257                     "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)",
258                     "tcp(dst_port=6789, option=bytes(b'\\x00' * 4), src_port=11111)",
259                     "b'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'"
260                 ]
261             }
262         ]
263     },
264     {
265         "description": "ethernet/itag/ethernet/ipv4/tcp(dst_port=2222)-->'actions=pop_pbb,goto_table:1','table_id:1,tcp_dst=2222,actions=set_field:6789->tcp_dst,output:2'",
266         "prerequisite":[
267             {
268                 "OFPFlowMod":{
269                     "table_id":0,
270                     "match":{
271                         "OFPMatch":{
272                             "oxm_fields":[
273                                 {
274                                     "OXMTlv":{
275                                         "field":"eth_type",
276                                         "value":35047
277                                     }
278                                 }
279                             ]
280                         }
281                     },
282                     "instructions":[
283                         {
284                             "OFPInstructionActions":{
285                                 "actions":[
286                                     {
287                                         "OFPActionPopPbb":{}
288                                     }
289                                 ],
290                                 "type":4
291                             }
292                         },
293                         {
294                             "OFPInstructionGotoTable":{
295                                 "table_id":1
296                             }
297                         }
298                     ]
299                 }
300             },
301             {
302                 "OFPFlowMod":{
303                     "table_id":1,
304                     "match":{
305                         "OFPMatch":{
306                             "oxm_fields":[
307                                 {
308                                     "OXMTlv":{
309                                         "field":"eth_type",
310                                         "value":2048
311                                     }
312                                 },
313                                 {
314                                     "OXMTlv":{
315                                         "field":"ip_proto",
316                                         "value":6
317                                     }
318                                 },
319                                 {
320                                     "OXMTlv":{
321                                         "field":"tcp_dst",
322                                         "value":2222
323                                     }
324                                 }
325                             ]
326                         }
327                     },
328                     "instructions":[
329                         {
330                             "OFPInstructionActions":{
331                                 "actions":[
332                                     {
333                                         "OFPActionSetField":{
334                                             "field":{
335                                                 "OXMTlv":{
336                                                     "field":"tcp_dst",
337                                                     "value":6789
338                                                 }
339                                             }
340                                         }
341                                     },
342                                     {
343                                         "OFPActionOutput":{
344                                             "port":2
345                                         }
346                                     }
347                                 ],
348                                 "type":4
349                             }
350                         }
351                     ]
352                 }
353             }
354         ],
355         "tests":[
356             {
357                 "ingress":[
358                     "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)",
359                     "itag(sid=100)",
360                     "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)",
361                     "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)",
362                     "tcp(dst_port=2222, option=bytes(b'\\x00' * 4), src_port=11111)",
363                     "b'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'"
364                 ],
365                 "egress":[
366                     "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)",
367                     "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)",
368                     "tcp(dst_port=6789, option=bytes(b'\\x00' * 4), src_port=11111)",
369                     "b'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'"
370                 ]
371             }
372         ]
373     }
374 ]