blob: d1df449e06116cd947b63c52bc0bd50be092a9d1 [file] [log] [blame]
Stephane Barbarie6e1bd502018-11-05 22:44:45 -05001# Copyright 2017-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
15# Copyright (c) 2011, 2012 Open Networking Foundation
16# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
17# See the file LICENSE.pyloxi which should have been included in the source distribution
18
19# Automatically generated by LOXI from template const.py
20# Do not modify
21
22OFP_VERSION = 3
23
24# Identifiers from group macro_definitions
25OFP_MAX_TABLE_NAME_LEN = 32
26OFP_MAX_PORT_NAME_LEN = 16
27OFP_TCP_PORT = 6653
28OFP_SSL_PORT = 6653
29OFP_ETH_ALEN = 6
30OFP_DEFAULT_MISS_SEND_LEN = 128
31OFP_VLAN_NONE = 0
32OFP_FLOW_PERMANENT = 0
33OFP_DEFAULT_PRIORITY = 32768
34OFP_NO_BUFFER = 4294967295
35DESC_STR_LEN = 256
36SERIAL_NUM_LEN = 32
37OFPQ_ALL = 4294967295
38OFPQ_MIN_RATE_UNCFG = 65535
39OFPQ_MAX_RATE_UNCFG = 65535
40
41# Identifiers from group of_bsn_pdu_slot_num
42BSN_PDU_SLOT_NUM_ANY = 255
43
44of_bsn_pdu_slot_num_map = {
45 255: 'BSN_PDU_SLOT_NUM_ANY',
46}
47
48# Identifiers from group ofp_action_type
49OFPAT_OUTPUT = 0
50OFPAT_COPY_TTL_OUT = 11
51OFPAT_COPY_TTL_IN = 12
52OFPAT_SET_MPLS_TTL = 15
53OFPAT_DEC_MPLS_TTL = 16
54OFPAT_PUSH_VLAN = 17
55OFPAT_POP_VLAN = 18
56OFPAT_PUSH_MPLS = 19
57OFPAT_POP_MPLS = 20
58OFPAT_SET_QUEUE = 21
59OFPAT_GROUP = 22
60OFPAT_SET_NW_TTL = 23
61OFPAT_DEC_NW_TTL = 24
62OFPAT_SET_FIELD = 25
63OFPAT_EXPERIMENTER = 65535
64
65ofp_action_type_map = {
66 0: 'OFPAT_OUTPUT',
67 11: 'OFPAT_COPY_TTL_OUT',
68 12: 'OFPAT_COPY_TTL_IN',
69 15: 'OFPAT_SET_MPLS_TTL',
70 16: 'OFPAT_DEC_MPLS_TTL',
71 17: 'OFPAT_PUSH_VLAN',
72 18: 'OFPAT_POP_VLAN',
73 19: 'OFPAT_PUSH_MPLS',
74 20: 'OFPAT_POP_MPLS',
75 21: 'OFPAT_SET_QUEUE',
76 22: 'OFPAT_GROUP',
77 23: 'OFPAT_SET_NW_TTL',
78 24: 'OFPAT_DEC_NW_TTL',
79 25: 'OFPAT_SET_FIELD',
80 65535: 'OFPAT_EXPERIMENTER',
81}
82
83# Identifiers from group ofp_bad_action_code
84OFPBAC_BAD_TYPE = 0
85OFPBAC_BAD_LEN = 1
86OFPBAC_BAD_EXPERIMENTER = 2
87OFPBAC_BAD_EXPERIMENTER_TYPE = 3
88OFPBAC_BAD_OUT_PORT = 4
89OFPBAC_BAD_ARGUMENT = 5
90OFPBAC_EPERM = 6
91OFPBAC_TOO_MANY = 7
92OFPBAC_BAD_QUEUE = 8
93OFPBAC_BAD_OUT_GROUP = 9
94OFPBAC_MATCH_INCONSISTENT = 10
95OFPBAC_UNSUPPORTED_ORDER = 11
96OFPBAC_BAD_TAG = 12
97OFPBAC_BAD_SET_TYPE = 13
98OFPBAC_BAD_SET_LEN = 14
99OFPBAC_BAD_SET_ARGUMENT = 15
100
101ofp_bad_action_code_map = {
102 0: 'OFPBAC_BAD_TYPE',
103 1: 'OFPBAC_BAD_LEN',
104 2: 'OFPBAC_BAD_EXPERIMENTER',
105 3: 'OFPBAC_BAD_EXPERIMENTER_TYPE',
106 4: 'OFPBAC_BAD_OUT_PORT',
107 5: 'OFPBAC_BAD_ARGUMENT',
108 6: 'OFPBAC_EPERM',
109 7: 'OFPBAC_TOO_MANY',
110 8: 'OFPBAC_BAD_QUEUE',
111 9: 'OFPBAC_BAD_OUT_GROUP',
112 10: 'OFPBAC_MATCH_INCONSISTENT',
113 11: 'OFPBAC_UNSUPPORTED_ORDER',
114 12: 'OFPBAC_BAD_TAG',
115 13: 'OFPBAC_BAD_SET_TYPE',
116 14: 'OFPBAC_BAD_SET_LEN',
117 15: 'OFPBAC_BAD_SET_ARGUMENT',
118}
119
120# Identifiers from group ofp_bad_instruction_code
121OFPBIC_UNKNOWN_INST = 0
122OFPBIC_UNSUP_INST = 1
123OFPBIC_BAD_TABLE_ID = 2
124OFPBIC_UNSUP_METADATA = 3
125OFPBIC_UNSUP_METADATA_MASK = 4
126OFPBIC_BAD_EXPERIMENTER = 5
127OFPBIC_BAD_EXPERIMENTER_TYPE = 6
128OFPBIC_BAD_LEN = 7
129OFPBIC_EPERM = 8
130
131ofp_bad_instruction_code_map = {
132 0: 'OFPBIC_UNKNOWN_INST',
133 1: 'OFPBIC_UNSUP_INST',
134 2: 'OFPBIC_BAD_TABLE_ID',
135 3: 'OFPBIC_UNSUP_METADATA',
136 4: 'OFPBIC_UNSUP_METADATA_MASK',
137 5: 'OFPBIC_BAD_EXPERIMENTER',
138 6: 'OFPBIC_BAD_EXPERIMENTER_TYPE',
139 7: 'OFPBIC_BAD_LEN',
140 8: 'OFPBIC_EPERM',
141}
142
143# Identifiers from group ofp_bad_match_code
144OFPBMC_BAD_TYPE = 0
145OFPBMC_BAD_LEN = 1
146OFPBMC_BAD_TAG = 2
147OFPBMC_BAD_DL_ADDR_MASK = 3
148OFPBMC_BAD_NW_ADDR_MASK = 4
149OFPBMC_BAD_WILDCARDS = 5
150OFPBMC_BAD_FIELD = 6
151OFPBMC_BAD_VALUE = 7
152OFPBMC_BAD_MASK = 8
153OFPBMC_BAD_PREREQ = 9
154OFPBMC_DUP_FIELD = 10
155OFPBMC_EPERM = 11
156
157ofp_bad_match_code_map = {
158 0: 'OFPBMC_BAD_TYPE',
159 1: 'OFPBMC_BAD_LEN',
160 2: 'OFPBMC_BAD_TAG',
161 3: 'OFPBMC_BAD_DL_ADDR_MASK',
162 4: 'OFPBMC_BAD_NW_ADDR_MASK',
163 5: 'OFPBMC_BAD_WILDCARDS',
164 6: 'OFPBMC_BAD_FIELD',
165 7: 'OFPBMC_BAD_VALUE',
166 8: 'OFPBMC_BAD_MASK',
167 9: 'OFPBMC_BAD_PREREQ',
168 10: 'OFPBMC_DUP_FIELD',
169 11: 'OFPBMC_EPERM',
170}
171
172# Identifiers from group ofp_bad_request_code
173OFPBRC_BAD_VERSION = 0
174OFPBRC_BAD_TYPE = 1
175OFPBRC_BAD_STAT = 2
176OFPBRC_BAD_EXPERIMENTER = 3
177OFPBRC_BAD_EXPERIMENTER_TYPE = 4
178OFPBRC_EPERM = 5
179OFPBRC_BAD_LEN = 6
180OFPBRC_BUFFER_EMPTY = 7
181OFPBRC_BUFFER_UNKNOWN = 8
182OFPBRC_BAD_TABLE_ID = 9
183OFPBRC_IS_SLAVE = 10
184OFPBRC_BAD_PORT = 11
185OFPBRC_BAD_PACKET = 12
186
187ofp_bad_request_code_map = {
188 0: 'OFPBRC_BAD_VERSION',
189 1: 'OFPBRC_BAD_TYPE',
190 2: 'OFPBRC_BAD_STAT',
191 3: 'OFPBRC_BAD_EXPERIMENTER',
192 4: 'OFPBRC_BAD_EXPERIMENTER_TYPE',
193 5: 'OFPBRC_EPERM',
194 6: 'OFPBRC_BAD_LEN',
195 7: 'OFPBRC_BUFFER_EMPTY',
196 8: 'OFPBRC_BUFFER_UNKNOWN',
197 9: 'OFPBRC_BAD_TABLE_ID',
198 10: 'OFPBRC_IS_SLAVE',
199 11: 'OFPBRC_BAD_PORT',
200 12: 'OFPBRC_BAD_PACKET',
201}
202
203# Identifiers from group ofp_bsn_tcp_flag
204OFP_BSN_TCP_FLAG_FIN = 1
205OFP_BSN_TCP_FLAG_SYN = 2
206OFP_BSN_TCP_FLAG_RST = 4
207OFP_BSN_TCP_FLAG_PSH = 8
208OFP_BSN_TCP_FLAG_ACK = 16
209OFP_BSN_TCP_FLAG_URG = 32
210OFP_BSN_TCP_FLAG_ECE = 64
211OFP_BSN_TCP_FLAG_CWR = 128
212OFP_BSN_TCP_FLAG_NS = 256
213
214ofp_bsn_tcp_flag_map = {
215 1: 'OFP_BSN_TCP_FLAG_FIN',
216 2: 'OFP_BSN_TCP_FLAG_SYN',
217 4: 'OFP_BSN_TCP_FLAG_RST',
218 8: 'OFP_BSN_TCP_FLAG_PSH',
219 16: 'OFP_BSN_TCP_FLAG_ACK',
220 32: 'OFP_BSN_TCP_FLAG_URG',
221 64: 'OFP_BSN_TCP_FLAG_ECE',
222 128: 'OFP_BSN_TCP_FLAG_CWR',
223 256: 'OFP_BSN_TCP_FLAG_NS',
224}
225
226# Identifiers from group ofp_bsn_vport_l2gre_flags
227OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID = 1
228OF_BSN_VPORT_L2GRE_DSCP_ASSIGN = 2
229OF_BSN_VPORT_L2GRE_DSCP_COPY = 4
230OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID = 8
231OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID = 16
232
233ofp_bsn_vport_l2gre_flags_map = {
234 1: 'OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID',
235 2: 'OF_BSN_VPORT_L2GRE_DSCP_ASSIGN',
236 4: 'OF_BSN_VPORT_L2GRE_DSCP_COPY',
237 8: 'OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID',
238 16: 'OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID',
239}
240
241# Identifiers from group ofp_bsn_vport_q_in_q_untagged
242OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
243
244ofp_bsn_vport_q_in_q_untagged_map = {
245 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
246}
247
248# Identifiers from group ofp_bsn_vport_status
249OF_BSN_VPORT_STATUS_OK = 0
250OF_BSN_VPORT_STATUS_FAILED = 1
251
252ofp_bsn_vport_status_map = {
253 0: 'OF_BSN_VPORT_STATUS_OK',
254 1: 'OF_BSN_VPORT_STATUS_FAILED',
255}
256
257# Identifiers from group ofp_capabilities
258OFPC_FLOW_STATS = 1
259OFPC_TABLE_STATS = 2
260OFPC_PORT_STATS = 4
261OFPC_GROUP_STATS = 8
262OFPC_IP_REASM = 32
263OFPC_QUEUE_STATS = 64
264OFPC_PORT_BLOCKED = 256
265
266ofp_capabilities_map = {
267 1: 'OFPC_FLOW_STATS',
268 2: 'OFPC_TABLE_STATS',
269 4: 'OFPC_PORT_STATS',
270 8: 'OFPC_GROUP_STATS',
271 32: 'OFPC_IP_REASM',
272 64: 'OFPC_QUEUE_STATS',
273 256: 'OFPC_PORT_BLOCKED',
274}
275
276# Identifiers from group ofp_config_flags
277OFPC_FRAG_NORMAL = 0
278OFPC_FRAG_DROP = 1
279OFPC_FRAG_REASM = 2
280OFPC_FRAG_MASK = 3
281OFPC_INVALID_TTL_TO_CONTROLLER = 4
282
283ofp_config_flags_map = {
284 0: 'OFPC_FRAG_NORMAL',
285 1: 'OFPC_FRAG_DROP',
286 2: 'OFPC_FRAG_REASM',
287 3: 'OFPC_FRAG_MASK',
288 4: 'OFPC_INVALID_TTL_TO_CONTROLLER',
289}
290
291# Identifiers from group ofp_controller_max_len
292OFPCML_MAX = 65509
293OFPCML_NO_BUFFER = 65535
294
295ofp_controller_max_len_map = {
296 65509: 'OFPCML_MAX',
297 65535: 'OFPCML_NO_BUFFER',
298}
299
300# Identifiers from group ofp_controller_role
301OFPCR_ROLE_NOCHANGE = 0
302OFPCR_ROLE_EQUAL = 1
303OFPCR_ROLE_MASTER = 2
304OFPCR_ROLE_SLAVE = 3
305
306ofp_controller_role_map = {
307 0: 'OFPCR_ROLE_NOCHANGE',
308 1: 'OFPCR_ROLE_EQUAL',
309 2: 'OFPCR_ROLE_MASTER',
310 3: 'OFPCR_ROLE_SLAVE',
311}
312
313# Identifiers from group ofp_error_type
314OFPET_HELLO_FAILED = 0
315OFPET_BAD_REQUEST = 1
316OFPET_BAD_ACTION = 2
317OFPET_BAD_INSTRUCTION = 3
318OFPET_BAD_MATCH = 4
319OFPET_FLOW_MOD_FAILED = 5
320OFPET_GROUP_MOD_FAILED = 6
321OFPET_PORT_MOD_FAILED = 7
322OFPET_TABLE_MOD_FAILED = 8
323OFPET_QUEUE_OP_FAILED = 9
324OFPET_SWITCH_CONFIG_FAILED = 10
325OFPET_ROLE_REQUEST_FAILED = 11
326OFPET_EXPERIMENTER = 65535
327
328ofp_error_type_map = {
329 0: 'OFPET_HELLO_FAILED',
330 1: 'OFPET_BAD_REQUEST',
331 2: 'OFPET_BAD_ACTION',
332 3: 'OFPET_BAD_INSTRUCTION',
333 4: 'OFPET_BAD_MATCH',
334 5: 'OFPET_FLOW_MOD_FAILED',
335 6: 'OFPET_GROUP_MOD_FAILED',
336 7: 'OFPET_PORT_MOD_FAILED',
337 8: 'OFPET_TABLE_MOD_FAILED',
338 9: 'OFPET_QUEUE_OP_FAILED',
339 10: 'OFPET_SWITCH_CONFIG_FAILED',
340 11: 'OFPET_ROLE_REQUEST_FAILED',
341 65535: 'OFPET_EXPERIMENTER',
342}
343
344# Identifiers from group ofp_flow_mod_command
345OFPFC_ADD = 0
346OFPFC_MODIFY = 1
347OFPFC_MODIFY_STRICT = 2
348OFPFC_DELETE = 3
349OFPFC_DELETE_STRICT = 4
350
351ofp_flow_mod_command_map = {
352 0: 'OFPFC_ADD',
353 1: 'OFPFC_MODIFY',
354 2: 'OFPFC_MODIFY_STRICT',
355 3: 'OFPFC_DELETE',
356 4: 'OFPFC_DELETE_STRICT',
357}
358
359# Identifiers from group ofp_flow_mod_failed_code
360OFPFMFC_UNKNOWN = 0
361OFPFMFC_TABLE_FULL = 1
362OFPFMFC_BAD_TABLE_ID = 2
363OFPFMFC_OVERLAP = 3
364OFPFMFC_EPERM = 4
365OFPFMFC_BAD_TIMEOUT = 5
366OFPFMFC_BAD_COMMAND = 6
367OFPFMFC_BAD_FLAGS = 7
368
369ofp_flow_mod_failed_code_map = {
370 0: 'OFPFMFC_UNKNOWN',
371 1: 'OFPFMFC_TABLE_FULL',
372 2: 'OFPFMFC_BAD_TABLE_ID',
373 3: 'OFPFMFC_OVERLAP',
374 4: 'OFPFMFC_EPERM',
375 5: 'OFPFMFC_BAD_TIMEOUT',
376 6: 'OFPFMFC_BAD_COMMAND',
377 7: 'OFPFMFC_BAD_FLAGS',
378}
379
380# Identifiers from group ofp_flow_mod_flags
381OFPFF_SEND_FLOW_REM = 1
382OFPFF_CHECK_OVERLAP = 2
383OFPFF_RESET_COUNTS = 4
384
385ofp_flow_mod_flags_map = {
386 1: 'OFPFF_SEND_FLOW_REM',
387 2: 'OFPFF_CHECK_OVERLAP',
388 4: 'OFPFF_RESET_COUNTS',
389}
390
391# Identifiers from group ofp_flow_removed_reason
392OFPRR_IDLE_TIMEOUT = 0
393OFPRR_HARD_TIMEOUT = 1
394OFPRR_DELETE = 2
395OFPRR_GROUP_DELETE = 3
396
397ofp_flow_removed_reason_map = {
398 0: 'OFPRR_IDLE_TIMEOUT',
399 1: 'OFPRR_HARD_TIMEOUT',
400 2: 'OFPRR_DELETE',
401 3: 'OFPRR_GROUP_DELETE',
402}
403
404# Identifiers from group ofp_group
405OFPG_MAX = 4294967040
406OFPG_ALL = 4294967292
407OFPG_ANY = 4294967295
408
409ofp_group_map = {
410 4294967040: 'OFPG_MAX',
411 4294967292: 'OFPG_ALL',
412 4294967295: 'OFPG_ANY',
413}
414
415# Identifiers from group ofp_group_capabilities
416OFPGFC_SELECT_WEIGHT = 1
417OFPGFC_SELECT_LIVENESS = 2
418OFPGFC_CHAINING = 4
419OFPGFC_CHAINING_CHECKS = 8
420
421ofp_group_capabilities_map = {
422 1: 'OFPGFC_SELECT_WEIGHT',
423 2: 'OFPGFC_SELECT_LIVENESS',
424 4: 'OFPGFC_CHAINING',
425 8: 'OFPGFC_CHAINING_CHECKS',
426}
427
428# Identifiers from group ofp_group_mod_command
429OFPGC_ADD = 0
430OFPGC_MODIFY = 1
431OFPGC_DELETE = 2
432
433ofp_group_mod_command_map = {
434 0: 'OFPGC_ADD',
435 1: 'OFPGC_MODIFY',
436 2: 'OFPGC_DELETE',
437}
438
439# Identifiers from group ofp_group_mod_failed_code
440OFPGMFC_GROUP_EXISTS = 0
441OFPGMFC_INVALID_GROUP = 1
442OFPGMFC_WEIGHT_UNSUPPORTED = 2
443OFPGMFC_OUT_OF_GROUPS = 3
444OFPGMFC_OUT_OF_BUCKETS = 4
445OFPGMFC_CHAINING_UNSUPPORTED = 5
446OFPGMFC_WATCH_UNSUPPORTED = 6
447OFPGMFC_LOOP = 7
448OFPGMFC_UNKNOWN_GROUP = 8
449OFPGMFC_CHAINED_GROUP = 9
450OFPGMFC_BAD_TYPE = 10
451OFPGMFC_BAD_COMMAND = 11
452OFPGMFC_BAD_BUCKET = 12
453OFPGMFC_BAD_WATCH = 13
454OFPGMFC_EPERM = 14
455
456ofp_group_mod_failed_code_map = {
457 0: 'OFPGMFC_GROUP_EXISTS',
458 1: 'OFPGMFC_INVALID_GROUP',
459 2: 'OFPGMFC_WEIGHT_UNSUPPORTED',
460 3: 'OFPGMFC_OUT_OF_GROUPS',
461 4: 'OFPGMFC_OUT_OF_BUCKETS',
462 5: 'OFPGMFC_CHAINING_UNSUPPORTED',
463 6: 'OFPGMFC_WATCH_UNSUPPORTED',
464 7: 'OFPGMFC_LOOP',
465 8: 'OFPGMFC_UNKNOWN_GROUP',
466 9: 'OFPGMFC_CHAINED_GROUP',
467 10: 'OFPGMFC_BAD_TYPE',
468 11: 'OFPGMFC_BAD_COMMAND',
469 12: 'OFPGMFC_BAD_BUCKET',
470 13: 'OFPGMFC_BAD_WATCH',
471 14: 'OFPGMFC_EPERM',
472}
473
474# Identifiers from group ofp_group_type
475OFPGT_ALL = 0
476OFPGT_SELECT = 1
477OFPGT_INDIRECT = 2
478OFPGT_FF = 3
479
480ofp_group_type_map = {
481 0: 'OFPGT_ALL',
482 1: 'OFPGT_SELECT',
483 2: 'OFPGT_INDIRECT',
484 3: 'OFPGT_FF',
485}
486
487# Identifiers from group ofp_hello_failed_code
488OFPHFC_INCOMPATIBLE = 0
489OFPHFC_EPERM = 1
490
491ofp_hello_failed_code_map = {
492 0: 'OFPHFC_INCOMPATIBLE',
493 1: 'OFPHFC_EPERM',
494}
495
496# Identifiers from group ofp_instruction_type
497OFPIT_GOTO_TABLE = 1
498OFPIT_WRITE_METADATA = 2
499OFPIT_WRITE_ACTIONS = 3
500OFPIT_APPLY_ACTIONS = 4
501OFPIT_CLEAR_ACTIONS = 5
502OFPIT_EXPERIMENTER = 65535
503
504ofp_instruction_type_map = {
505 1: 'OFPIT_GOTO_TABLE',
506 2: 'OFPIT_WRITE_METADATA',
507 3: 'OFPIT_WRITE_ACTIONS',
508 4: 'OFPIT_APPLY_ACTIONS',
509 5: 'OFPIT_CLEAR_ACTIONS',
510 65535: 'OFPIT_EXPERIMENTER',
511}
512
513# Identifiers from group ofp_match_type
514OFPMT_STANDARD = 0
515OFPMT_OXM = 1
516
517ofp_match_type_map = {
518 0: 'OFPMT_STANDARD',
519 1: 'OFPMT_OXM',
520}
521
522# Identifiers from group ofp_oxm_class
523OFPXMC_NXM_0 = 0
524OFPXMC_NXM_1 = 1
525OFPXMC_OPENFLOW_BASIC = 32768
526OFPXMC_EXPERIMENTER = 65535
527
528ofp_oxm_class_map = {
529 0: 'OFPXMC_NXM_0',
530 1: 'OFPXMC_NXM_1',
531 32768: 'OFPXMC_OPENFLOW_BASIC',
532 65535: 'OFPXMC_EXPERIMENTER',
533}
534
535# Identifiers from group ofp_packet_in_reason
536OFPR_NO_MATCH = 0
537OFPR_ACTION = 1
538OFPR_INVALID_TTL = 2
539
540ofp_packet_in_reason_map = {
541 0: 'OFPR_NO_MATCH',
542 1: 'OFPR_ACTION',
543 2: 'OFPR_INVALID_TTL',
544}
545
546# Identifiers from group ofp_port
547OFPP_MAX = 4294967040
548OFPP_IN_PORT = 4294967288
549OFPP_TABLE = 4294967289
550OFPP_NORMAL = 4294967290
551OFPP_FLOOD = 4294967291
552OFPP_ALL = 4294967292
553OFPP_CONTROLLER = 4294967293
554OFPP_LOCAL = 4294967294
555OFPP_ANY = 4294967295
556
557ofp_port_map = {
558 4294967040: 'OFPP_MAX',
559 4294967288: 'OFPP_IN_PORT',
560 4294967289: 'OFPP_TABLE',
561 4294967290: 'OFPP_NORMAL',
562 4294967291: 'OFPP_FLOOD',
563 4294967292: 'OFPP_ALL',
564 4294967293: 'OFPP_CONTROLLER',
565 4294967294: 'OFPP_LOCAL',
566 4294967295: 'OFPP_ANY',
567}
568
569# Identifiers from group ofp_port_config
570OFPPC_PORT_DOWN = 1
571OFPPC_NO_RECV = 4
572OFPPC_NO_FWD = 32
573OFPPC_NO_PACKET_IN = 64
574OFPPC_BSN_MIRROR_DEST = 2147483648
575
576ofp_port_config_map = {
577 1: 'OFPPC_PORT_DOWN',
578 4: 'OFPPC_NO_RECV',
579 32: 'OFPPC_NO_FWD',
580 64: 'OFPPC_NO_PACKET_IN',
581 2147483648: 'OFPPC_BSN_MIRROR_DEST',
582}
583
584# Identifiers from group ofp_port_features
585OFPPF_10MB_HD = 1
586OFPPF_10MB_FD = 2
587OFPPF_100MB_HD = 4
588OFPPF_100MB_FD = 8
589OFPPF_1GB_HD = 16
590OFPPF_1GB_FD = 32
591OFPPF_10GB_FD = 64
592OFPPF_40GB_FD = 128
593OFPPF_100GB_FD = 256
594OFPPF_1TB_FD = 512
595OFPPF_OTHER = 1024
596OFPPF_COPPER = 2048
597OFPPF_FIBER = 4096
598OFPPF_AUTONEG = 8192
599OFPPF_PAUSE = 16384
600OFPPF_PAUSE_ASYM = 32768
601
602ofp_port_features_map = {
603 1: 'OFPPF_10MB_HD',
604 2: 'OFPPF_10MB_FD',
605 4: 'OFPPF_100MB_HD',
606 8: 'OFPPF_100MB_FD',
607 16: 'OFPPF_1GB_HD',
608 32: 'OFPPF_1GB_FD',
609 64: 'OFPPF_10GB_FD',
610 128: 'OFPPF_40GB_FD',
611 256: 'OFPPF_100GB_FD',
612 512: 'OFPPF_1TB_FD',
613 1024: 'OFPPF_OTHER',
614 2048: 'OFPPF_COPPER',
615 4096: 'OFPPF_FIBER',
616 8192: 'OFPPF_AUTONEG',
617 16384: 'OFPPF_PAUSE',
618 32768: 'OFPPF_PAUSE_ASYM',
619}
620
621# Identifiers from group ofp_port_mod_failed_code
622OFPPMFC_BAD_PORT = 0
623OFPPMFC_BAD_HW_ADDR = 1
624OFPPMFC_BAD_CONFIG = 2
625OFPPMFC_BAD_ADVERTISE = 3
626OFPPMFC_EPERM = 4
627
628ofp_port_mod_failed_code_map = {
629 0: 'OFPPMFC_BAD_PORT',
630 1: 'OFPPMFC_BAD_HW_ADDR',
631 2: 'OFPPMFC_BAD_CONFIG',
632 3: 'OFPPMFC_BAD_ADVERTISE',
633 4: 'OFPPMFC_EPERM',
634}
635
636# Identifiers from group ofp_port_reason
637OFPPR_ADD = 0
638OFPPR_DELETE = 1
639OFPPR_MODIFY = 2
640
641ofp_port_reason_map = {
642 0: 'OFPPR_ADD',
643 1: 'OFPPR_DELETE',
644 2: 'OFPPR_MODIFY',
645}
646
647# Identifiers from group ofp_port_state
648OFPPS_LINK_DOWN = 1
649OFPPS_BLOCKED = 2
650OFPPS_LIVE = 4
651
652ofp_port_state_map = {
653 1: 'OFPPS_LINK_DOWN',
654 2: 'OFPPS_BLOCKED',
655 4: 'OFPPS_LIVE',
656}
657
658# Identifiers from group ofp_queue_op_failed_code
659OFPQOFC_BAD_PORT = 0
660OFPQOFC_BAD_QUEUE = 1
661OFPQOFC_EPERM = 2
662
663ofp_queue_op_failed_code_map = {
664 0: 'OFPQOFC_BAD_PORT',
665 1: 'OFPQOFC_BAD_QUEUE',
666 2: 'OFPQOFC_EPERM',
667}
668
669# Identifiers from group ofp_queue_properties
670OFPQT_MIN_RATE = 1
671OFPQT_MAX_RATE = 2
672OFPQT_EXPERIMENTER = 65535
673
674ofp_queue_properties_map = {
675 1: 'OFPQT_MIN_RATE',
676 2: 'OFPQT_MAX_RATE',
677 65535: 'OFPQT_EXPERIMENTER',
678}
679
680# Identifiers from group ofp_role_request_failed_code
681OFPRRFC_STALE = 0
682OFPRRFC_UNSUP = 1
683OFPRRFC_BAD_ROLE = 2
684
685ofp_role_request_failed_code_map = {
686 0: 'OFPRRFC_STALE',
687 1: 'OFPRRFC_UNSUP',
688 2: 'OFPRRFC_BAD_ROLE',
689}
690
691# Identifiers from group ofp_stats_reply_flags
692OFPSF_REPLY_MORE = 1
693
694ofp_stats_reply_flags_map = {
695 1: 'OFPSF_REPLY_MORE',
696}
697
698# Identifiers from group ofp_stats_request_flags
699
700ofp_stats_request_flags_map = {
701}
702
703# Identifiers from group ofp_stats_type
704OFPST_DESC = 0
705OFPST_FLOW = 1
706OFPST_AGGREGATE = 2
707OFPST_TABLE = 3
708OFPST_PORT = 4
709OFPST_QUEUE = 5
710OFPST_GROUP = 6
711OFPST_GROUP_DESC = 7
712OFPST_GROUP_FEATURES = 8
713OFPST_EXPERIMENTER = 65535
714
715ofp_stats_type_map = {
716 0: 'OFPST_DESC',
717 1: 'OFPST_FLOW',
718 2: 'OFPST_AGGREGATE',
719 3: 'OFPST_TABLE',
720 4: 'OFPST_PORT',
721 5: 'OFPST_QUEUE',
722 6: 'OFPST_GROUP',
723 7: 'OFPST_GROUP_DESC',
724 8: 'OFPST_GROUP_FEATURES',
725 65535: 'OFPST_EXPERIMENTER',
726}
727
728# Identifiers from group ofp_switch_config_failed_code
729OFPSCFC_BAD_FLAGS = 0
730OFPSCFC_BAD_LEN = 1
731OFPSCFC_EPERM = 2
732
733ofp_switch_config_failed_code_map = {
734 0: 'OFPSCFC_BAD_FLAGS',
735 1: 'OFPSCFC_BAD_LEN',
736 2: 'OFPSCFC_EPERM',
737}
738
739# Identifiers from group ofp_table
740OFPTT_MAX = 254
741OFPTT_ALL = 255
742
743ofp_table_map = {
744 254: 'OFPTT_MAX',
745 255: 'OFPTT_ALL',
746}
747
748# Identifiers from group ofp_table_config
749OFPTC_TABLE_MISS_CONTROLLER = 0
750OFPTC_TABLE_MISS_CONTINUE = 1
751OFPTC_TABLE_MISS_DROP = 2
752OFPTC_TABLE_MISS_MASK = 3
753
754ofp_table_config_map = {
755 0: 'OFPTC_TABLE_MISS_CONTROLLER',
756 1: 'OFPTC_TABLE_MISS_CONTINUE',
757 2: 'OFPTC_TABLE_MISS_DROP',
758 3: 'OFPTC_TABLE_MISS_MASK',
759}
760
761# Identifiers from group ofp_table_mod_failed_code
762OFPTMFC_BAD_TABLE = 0
763OFPTMFC_BAD_CONFIG = 1
764OFPTMFC_EPERM = 2
765
766ofp_table_mod_failed_code_map = {
767 0: 'OFPTMFC_BAD_TABLE',
768 1: 'OFPTMFC_BAD_CONFIG',
769 2: 'OFPTMFC_EPERM',
770}
771
772# Identifiers from group ofp_type
773OFPT_HELLO = 0
774OFPT_ERROR = 1
775OFPT_ECHO_REQUEST = 2
776OFPT_ECHO_REPLY = 3
777OFPT_EXPERIMENTER = 4
778OFPT_FEATURES_REQUEST = 5
779OFPT_FEATURES_REPLY = 6
780OFPT_GET_CONFIG_REQUEST = 7
781OFPT_GET_CONFIG_REPLY = 8
782OFPT_SET_CONFIG = 9
783OFPT_PACKET_IN = 10
784OFPT_FLOW_REMOVED = 11
785OFPT_PORT_STATUS = 12
786OFPT_PACKET_OUT = 13
787OFPT_FLOW_MOD = 14
788OFPT_GROUP_MOD = 15
789OFPT_PORT_MOD = 16
790OFPT_TABLE_MOD = 17
791OFPT_STATS_REQUEST = 18
792OFPT_STATS_REPLY = 19
793OFPT_BARRIER_REQUEST = 20
794OFPT_BARRIER_REPLY = 21
795OFPT_QUEUE_GET_CONFIG_REQUEST = 22
796OFPT_QUEUE_GET_CONFIG_REPLY = 23
797OFPT_ROLE_REQUEST = 24
798OFPT_ROLE_REPLY = 25
799
800ofp_type_map = {
801 0: 'OFPT_HELLO',
802 1: 'OFPT_ERROR',
803 2: 'OFPT_ECHO_REQUEST',
804 3: 'OFPT_ECHO_REPLY',
805 4: 'OFPT_EXPERIMENTER',
806 5: 'OFPT_FEATURES_REQUEST',
807 6: 'OFPT_FEATURES_REPLY',
808 7: 'OFPT_GET_CONFIG_REQUEST',
809 8: 'OFPT_GET_CONFIG_REPLY',
810 9: 'OFPT_SET_CONFIG',
811 10: 'OFPT_PACKET_IN',
812 11: 'OFPT_FLOW_REMOVED',
813 12: 'OFPT_PORT_STATUS',
814 13: 'OFPT_PACKET_OUT',
815 14: 'OFPT_FLOW_MOD',
816 15: 'OFPT_GROUP_MOD',
817 16: 'OFPT_PORT_MOD',
818 17: 'OFPT_TABLE_MOD',
819 18: 'OFPT_STATS_REQUEST',
820 19: 'OFPT_STATS_REPLY',
821 20: 'OFPT_BARRIER_REQUEST',
822 21: 'OFPT_BARRIER_REPLY',
823 22: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
824 23: 'OFPT_QUEUE_GET_CONFIG_REPLY',
825 24: 'OFPT_ROLE_REQUEST',
826 25: 'OFPT_ROLE_REPLY',
827}
828
829# Identifiers from group ofp_vlan_id
830OFPVID_NONE = 0
831OFPVID_PRESENT = 4096
832
833ofp_vlan_id_map = {
834 0: 'OFPVID_NONE',
835 4096: 'OFPVID_PRESENT',
836}
837