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