blob: e2545f1f2cc6579d83871e4633d2290e32a72b65 [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 = 4
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
Rich Lanec2ee4b82013-04-24 17:12:38 -070021OFP_NO_BUFFER = 4294967295
Dan Talaycof6202252013-07-02 01:00:29 -070022DESC_STR_LEN = 256
23SERIAL_NUM_LEN = 32
24OFPQ_ALL = 4294967295
25OFPQ_MAX_RATE_UNCFG = 65535
26OFPQ_MIN_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_PUSH_PBB = 26
44OFPAT_POP_PBB = 27
45OFPAT_EXPERIMENTER = 65535
46
47ofp_action_type_map = {
48 0: 'OFPAT_OUTPUT',
49 11: 'OFPAT_COPY_TTL_OUT',
50 12: 'OFPAT_COPY_TTL_IN',
51 15: 'OFPAT_SET_MPLS_TTL',
52 16: 'OFPAT_DEC_MPLS_TTL',
53 17: 'OFPAT_PUSH_VLAN',
54 18: 'OFPAT_POP_VLAN',
55 19: 'OFPAT_PUSH_MPLS',
56 20: 'OFPAT_POP_MPLS',
57 21: 'OFPAT_SET_QUEUE',
58 22: 'OFPAT_GROUP',
59 23: 'OFPAT_SET_NW_TTL',
60 24: 'OFPAT_DEC_NW_TTL',
61 25: 'OFPAT_SET_FIELD',
62 26: 'OFPAT_PUSH_PBB',
63 27: 'OFPAT_POP_PBB',
64 65535: 'OFPAT_EXPERIMENTER',
65}
66
67# Identifiers from group ofp_bad_action_code
68OFPBAC_BAD_TYPE = 0
69OFPBAC_BAD_LEN = 1
70OFPBAC_BAD_EXPERIMENTER = 2
71OFPBAC_BAD_EXP_TYPE = 3
72OFPBAC_BAD_OUT_PORT = 4
73OFPBAC_BAD_ARGUMENT = 5
74OFPBAC_EPERM = 6
75OFPBAC_TOO_MANY = 7
76OFPBAC_BAD_QUEUE = 8
77OFPBAC_BAD_OUT_GROUP = 9
78OFPBAC_MATCH_INCONSISTENT = 10
79OFPBAC_UNSUPPORTED_ORDER = 11
80OFPBAC_BAD_TAG = 12
81OFPBAC_BAD_SET_TYPE = 13
82OFPBAC_BAD_SET_LEN = 14
83OFPBAC_BAD_SET_ARGUMENT = 15
84
85ofp_bad_action_code_map = {
86 0: 'OFPBAC_BAD_TYPE',
87 1: 'OFPBAC_BAD_LEN',
88 2: 'OFPBAC_BAD_EXPERIMENTER',
89 3: 'OFPBAC_BAD_EXP_TYPE',
90 4: 'OFPBAC_BAD_OUT_PORT',
91 5: 'OFPBAC_BAD_ARGUMENT',
92 6: 'OFPBAC_EPERM',
93 7: 'OFPBAC_TOO_MANY',
94 8: 'OFPBAC_BAD_QUEUE',
95 9: 'OFPBAC_BAD_OUT_GROUP',
96 10: 'OFPBAC_MATCH_INCONSISTENT',
97 11: 'OFPBAC_UNSUPPORTED_ORDER',
98 12: 'OFPBAC_BAD_TAG',
99 13: 'OFPBAC_BAD_SET_TYPE',
100 14: 'OFPBAC_BAD_SET_LEN',
101 15: 'OFPBAC_BAD_SET_ARGUMENT',
102}
103
104# Identifiers from group ofp_bad_instruction_code
105OFPBIC_UNKNOWN_INST = 0
106OFPBIC_UNSUP_INST = 1
107OFPBIC_BAD_TABLE_ID = 2
108OFPBIC_UNSUP_METADATA = 3
109OFPBIC_UNSUP_METADATA_MASK = 4
110OFPBIC_BAD_EXPERIMENTER = 5
111OFPBIC_BAD_EXP_TYPE = 6
112OFPBIC_BAD_LEN = 7
113OFPBIC_EPERM = 8
114
115ofp_bad_instruction_code_map = {
116 0: 'OFPBIC_UNKNOWN_INST',
117 1: 'OFPBIC_UNSUP_INST',
118 2: 'OFPBIC_BAD_TABLE_ID',
119 3: 'OFPBIC_UNSUP_METADATA',
120 4: 'OFPBIC_UNSUP_METADATA_MASK',
121 5: 'OFPBIC_BAD_EXPERIMENTER',
122 6: 'OFPBIC_BAD_EXP_TYPE',
123 7: 'OFPBIC_BAD_LEN',
124 8: 'OFPBIC_EPERM',
125}
126
127# Identifiers from group ofp_bad_match_code
128OFPBMC_BAD_TYPE = 0
129OFPBMC_BAD_LEN = 1
130OFPBMC_BAD_TAG = 2
131OFPBMC_BAD_DL_ADDR_MASK = 3
132OFPBMC_BAD_NW_ADDR_MASK = 4
133OFPBMC_BAD_WILDCARDS = 5
134OFPBMC_BAD_FIELD = 6
135OFPBMC_BAD_VALUE = 7
136OFPBMC_BAD_MASK = 8
137OFPBMC_BAD_PREREQ = 9
138OFPBMC_DUP_FIELD = 10
139OFPBMC_EPERM = 11
140
141ofp_bad_match_code_map = {
142 0: 'OFPBMC_BAD_TYPE',
143 1: 'OFPBMC_BAD_LEN',
144 2: 'OFPBMC_BAD_TAG',
145 3: 'OFPBMC_BAD_DL_ADDR_MASK',
146 4: 'OFPBMC_BAD_NW_ADDR_MASK',
147 5: 'OFPBMC_BAD_WILDCARDS',
148 6: 'OFPBMC_BAD_FIELD',
149 7: 'OFPBMC_BAD_VALUE',
150 8: 'OFPBMC_BAD_MASK',
151 9: 'OFPBMC_BAD_PREREQ',
152 10: 'OFPBMC_DUP_FIELD',
153 11: 'OFPBMC_EPERM',
154}
155
156# Identifiers from group ofp_bad_request_code
157OFPBRC_BAD_VERSION = 0
158OFPBRC_BAD_TYPE = 1
159OFPBRC_BAD_MULTIPART = 2
160OFPBRC_BAD_EXPERIMENTER = 3
161OFPBRC_BAD_EXP_TYPE = 4
162OFPBRC_EPERM = 5
163OFPBRC_BAD_LEN = 6
164OFPBRC_BUFFER_EMPTY = 7
165OFPBRC_BUFFER_UNKNOWN = 8
166OFPBRC_BAD_TABLE_ID = 9
167OFPBRC_IS_SLAVE = 10
168OFPBRC_BAD_PORT = 11
169OFPBRC_BAD_PACKET = 12
170OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13
171
172ofp_bad_request_code_map = {
173 0: 'OFPBRC_BAD_VERSION',
174 1: 'OFPBRC_BAD_TYPE',
175 2: 'OFPBRC_BAD_MULTIPART',
176 3: 'OFPBRC_BAD_EXPERIMENTER',
177 4: 'OFPBRC_BAD_EXP_TYPE',
178 5: 'OFPBRC_EPERM',
179 6: 'OFPBRC_BAD_LEN',
180 7: 'OFPBRC_BUFFER_EMPTY',
181 8: 'OFPBRC_BUFFER_UNKNOWN',
182 9: 'OFPBRC_BAD_TABLE_ID',
183 10: 'OFPBRC_IS_SLAVE',
184 11: 'OFPBRC_BAD_PORT',
185 12: 'OFPBRC_BAD_PACKET',
186 13: 'OFPBRC_MULTIPART_BUFFER_OVERFLOW',
187}
188
Dan Talaycof6202252013-07-02 01:00:29 -0700189# Identifiers from group ofp_bsn_vport_q_in_q_untagged
190OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
191
192ofp_bsn_vport_q_in_q_untagged_map = {
193 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
194}
195
Rich Lanec2ee4b82013-04-24 17:12:38 -0700196# Identifiers from group ofp_capabilities
197OFPC_FLOW_STATS = 1
198OFPC_TABLE_STATS = 2
199OFPC_PORT_STATS = 4
200OFPC_GROUP_STATS = 8
201OFPC_IP_REASM = 32
202OFPC_QUEUE_STATS = 64
203OFPC_PORT_BLOCKED = 256
204
205ofp_capabilities_map = {
206 1: 'OFPC_FLOW_STATS',
207 2: 'OFPC_TABLE_STATS',
208 4: 'OFPC_PORT_STATS',
209 8: 'OFPC_GROUP_STATS',
210 32: 'OFPC_IP_REASM',
211 64: 'OFPC_QUEUE_STATS',
212 256: 'OFPC_PORT_BLOCKED',
213}
214
215# Identifiers from group ofp_config_flags
216OFPC_FRAG_NORMAL = 0
217OFPC_FRAG_DROP = 1
218OFPC_FRAG_REASM = 2
219OFPC_FRAG_MASK = 3
220
221ofp_config_flags_map = {
222 0: 'OFPC_FRAG_NORMAL',
223 1: 'OFPC_FRAG_DROP',
224 2: 'OFPC_FRAG_REASM',
225 3: 'OFPC_FRAG_MASK',
226}
227
228# Identifiers from group ofp_controller_max_len
229OFPCML_MAX = 65509
230OFPCML_NO_BUFFER = 65535
231
232ofp_controller_max_len_map = {
233 65509: 'OFPCML_MAX',
234 65535: 'OFPCML_NO_BUFFER',
235}
236
237# Identifiers from group ofp_controller_role
238OFPCR_ROLE_NOCHANGE = 0
239OFPCR_ROLE_EQUAL = 1
240OFPCR_ROLE_MASTER = 2
241OFPCR_ROLE_SLAVE = 3
242
243ofp_controller_role_map = {
244 0: 'OFPCR_ROLE_NOCHANGE',
245 1: 'OFPCR_ROLE_EQUAL',
246 2: 'OFPCR_ROLE_MASTER',
247 3: 'OFPCR_ROLE_SLAVE',
248}
249
250# Identifiers from group ofp_error_type
251OFPET_HELLO_FAILED = 0
252OFPET_BAD_REQUEST = 1
253OFPET_BAD_ACTION = 2
254OFPET_BAD_INSTRUCTION = 3
255OFPET_BAD_MATCH = 4
256OFPET_FLOW_MOD_FAILED = 5
257OFPET_GROUP_MOD_FAILED = 6
258OFPET_PORT_MOD_FAILED = 7
259OFPET_TABLE_MOD_FAILED = 8
260OFPET_QUEUE_OP_FAILED = 9
261OFPET_SWITCH_CONFIG_FAILED = 10
262OFPET_ROLE_REQUEST_FAILED = 11
263OFPET_METER_MOD_FAILED = 12
264OFPET_TABLE_FEATURES_FAILED = 13
265OFPET_EXPERIMENTER = 65535
266
267ofp_error_type_map = {
268 0: 'OFPET_HELLO_FAILED',
269 1: 'OFPET_BAD_REQUEST',
270 2: 'OFPET_BAD_ACTION',
271 3: 'OFPET_BAD_INSTRUCTION',
272 4: 'OFPET_BAD_MATCH',
273 5: 'OFPET_FLOW_MOD_FAILED',
274 6: 'OFPET_GROUP_MOD_FAILED',
275 7: 'OFPET_PORT_MOD_FAILED',
276 8: 'OFPET_TABLE_MOD_FAILED',
277 9: 'OFPET_QUEUE_OP_FAILED',
278 10: 'OFPET_SWITCH_CONFIG_FAILED',
279 11: 'OFPET_ROLE_REQUEST_FAILED',
280 12: 'OFPET_METER_MOD_FAILED',
281 13: 'OFPET_TABLE_FEATURES_FAILED',
282 65535: 'OFPET_EXPERIMENTER',
283}
284
285# Identifiers from group ofp_flow_mod_command
286OFPFC_ADD = 0
287OFPFC_MODIFY = 1
288OFPFC_MODIFY_STRICT = 2
289OFPFC_DELETE = 3
290OFPFC_DELETE_STRICT = 4
291
292ofp_flow_mod_command_map = {
293 0: 'OFPFC_ADD',
294 1: 'OFPFC_MODIFY',
295 2: 'OFPFC_MODIFY_STRICT',
296 3: 'OFPFC_DELETE',
297 4: 'OFPFC_DELETE_STRICT',
298}
299
300# Identifiers from group ofp_flow_mod_failed_code
301OFPFMFC_UNKNOWN = 0
302OFPFMFC_TABLE_FULL = 1
303OFPFMFC_BAD_TABLE_ID = 2
304OFPFMFC_OVERLAP = 3
305OFPFMFC_EPERM = 4
306OFPFMFC_BAD_TIMEOUT = 5
307OFPFMFC_BAD_COMMAND = 6
308OFPFMFC_BAD_FLAGS = 7
309
310ofp_flow_mod_failed_code_map = {
311 0: 'OFPFMFC_UNKNOWN',
312 1: 'OFPFMFC_TABLE_FULL',
313 2: 'OFPFMFC_BAD_TABLE_ID',
314 3: 'OFPFMFC_OVERLAP',
315 4: 'OFPFMFC_EPERM',
316 5: 'OFPFMFC_BAD_TIMEOUT',
317 6: 'OFPFMFC_BAD_COMMAND',
318 7: 'OFPFMFC_BAD_FLAGS',
319}
320
321# Identifiers from group ofp_flow_mod_flags
322OFPFF_SEND_FLOW_REM = 1
323OFPFF_CHECK_OVERLAP = 2
324OFPFF_RESET_COUNTS = 4
325OFPFF_NO_PKT_COUNTS = 8
326OFPFF_NO_BYT_COUNTS = 16
327
328ofp_flow_mod_flags_map = {
329 1: 'OFPFF_SEND_FLOW_REM',
330 2: 'OFPFF_CHECK_OVERLAP',
331 4: 'OFPFF_RESET_COUNTS',
332 8: 'OFPFF_NO_PKT_COUNTS',
333 16: 'OFPFF_NO_BYT_COUNTS',
334}
335
336# Identifiers from group ofp_flow_removed_reason
337OFPRR_IDLE_TIMEOUT = 0
338OFPRR_HARD_TIMEOUT = 1
339OFPRR_DELETE = 2
340OFPRR_GROUP_DELETE = 3
341
342ofp_flow_removed_reason_map = {
343 0: 'OFPRR_IDLE_TIMEOUT',
344 1: 'OFPRR_HARD_TIMEOUT',
345 2: 'OFPRR_DELETE',
346 3: 'OFPRR_GROUP_DELETE',
347}
348
349# Identifiers from group ofp_group
350OFPG_MAX = 4294967040
351OFPG_ALL = 4294967292
352OFPG_ANY = 4294967295
353
354ofp_group_map = {
355 4294967040: 'OFPG_MAX',
356 4294967292: 'OFPG_ALL',
357 4294967295: 'OFPG_ANY',
358}
359
360# Identifiers from group ofp_group_capabilities
361OFPGFC_SELECT_WEIGHT = 1
362OFPGFC_SELECT_LIVENESS = 2
363OFPGFC_CHAINING = 4
364OFPGFC_CHAINING_CHECKS = 8
365
366ofp_group_capabilities_map = {
367 1: 'OFPGFC_SELECT_WEIGHT',
368 2: 'OFPGFC_SELECT_LIVENESS',
369 4: 'OFPGFC_CHAINING',
370 8: 'OFPGFC_CHAINING_CHECKS',
371}
372
373# Identifiers from group ofp_group_mod_command
374OFPGC_ADD = 0
375OFPGC_MODIFY = 1
376OFPGC_DELETE = 2
377
378ofp_group_mod_command_map = {
379 0: 'OFPGC_ADD',
380 1: 'OFPGC_MODIFY',
381 2: 'OFPGC_DELETE',
382}
383
384# Identifiers from group ofp_group_mod_failed_code
385OFPGMFC_GROUP_EXISTS = 0
386OFPGMFC_INVALID_GROUP = 1
387OFPGMFC_WEIGHT_UNSUPPORTED = 2
388OFPGMFC_OUT_OF_GROUPS = 3
389OFPGMFC_OUT_OF_BUCKETS = 4
390OFPGMFC_CHAINING_UNSUPPORTED = 5
391OFPGMFC_WATCH_UNSUPPORTED = 6
392OFPGMFC_LOOP = 7
393OFPGMFC_UNKNOWN_GROUP = 8
394OFPGMFC_CHAINED_GROUP = 9
395OFPGMFC_BAD_TYPE = 10
396OFPGMFC_BAD_COMMAND = 11
397OFPGMFC_BAD_BUCKET = 12
398OFPGMFC_BAD_WATCH = 13
399OFPGMFC_EPERM = 14
400
401ofp_group_mod_failed_code_map = {
402 0: 'OFPGMFC_GROUP_EXISTS',
403 1: 'OFPGMFC_INVALID_GROUP',
404 2: 'OFPGMFC_WEIGHT_UNSUPPORTED',
405 3: 'OFPGMFC_OUT_OF_GROUPS',
406 4: 'OFPGMFC_OUT_OF_BUCKETS',
407 5: 'OFPGMFC_CHAINING_UNSUPPORTED',
408 6: 'OFPGMFC_WATCH_UNSUPPORTED',
409 7: 'OFPGMFC_LOOP',
410 8: 'OFPGMFC_UNKNOWN_GROUP',
411 9: 'OFPGMFC_CHAINED_GROUP',
412 10: 'OFPGMFC_BAD_TYPE',
413 11: 'OFPGMFC_BAD_COMMAND',
414 12: 'OFPGMFC_BAD_BUCKET',
415 13: 'OFPGMFC_BAD_WATCH',
416 14: 'OFPGMFC_EPERM',
417}
418
419# Identifiers from group ofp_group_type
420OFPGT_ALL = 0
421OFPGT_SELECT = 1
422OFPGT_INDIRECT = 2
423OFPGT_FF = 3
424
425ofp_group_type_map = {
426 0: 'OFPGT_ALL',
427 1: 'OFPGT_SELECT',
428 2: 'OFPGT_INDIRECT',
429 3: 'OFPGT_FF',
430}
431
432# Identifiers from group ofp_hello_elem_type
433OFPHET_VERSIONBITMAP = 1
434
435ofp_hello_elem_type_map = {
436 1: 'OFPHET_VERSIONBITMAP',
437}
438
439# Identifiers from group ofp_hello_failed_code
440OFPHFC_INCOMPATIBLE = 0
441OFPHFC_EPERM = 1
442
443ofp_hello_failed_code_map = {
444 0: 'OFPHFC_INCOMPATIBLE',
445 1: 'OFPHFC_EPERM',
446}
447
448# Identifiers from group ofp_instruction_type
449OFPIT_GOTO_TABLE = 1
450OFPIT_WRITE_METADATA = 2
451OFPIT_WRITE_ACTIONS = 3
452OFPIT_APPLY_ACTIONS = 4
453OFPIT_CLEAR_ACTIONS = 5
454OFPIT_METER = 6
455OFPIT_EXPERIMENTER = 65535
456
457ofp_instruction_type_map = {
458 1: 'OFPIT_GOTO_TABLE',
459 2: 'OFPIT_WRITE_METADATA',
460 3: 'OFPIT_WRITE_ACTIONS',
461 4: 'OFPIT_APPLY_ACTIONS',
462 5: 'OFPIT_CLEAR_ACTIONS',
463 6: 'OFPIT_METER',
464 65535: 'OFPIT_EXPERIMENTER',
465}
466
467# Identifiers from group ofp_ipv6exthdr_flags
468OFPIEH_NONEXT = 1
469OFPIEH_ESP = 2
470OFPIEH_AUTH = 4
471OFPIEH_DEST = 8
472OFPIEH_FRAG = 16
473OFPIEH_ROUTER = 32
474OFPIEH_HOP = 64
475OFPIEH_UNREP = 128
476OFPIEH_UNSEQ = 256
477
478ofp_ipv6exthdr_flags_map = {
479 1: 'OFPIEH_NONEXT',
480 2: 'OFPIEH_ESP',
481 4: 'OFPIEH_AUTH',
482 8: 'OFPIEH_DEST',
483 16: 'OFPIEH_FRAG',
484 32: 'OFPIEH_ROUTER',
485 64: 'OFPIEH_HOP',
486 128: 'OFPIEH_UNREP',
487 256: 'OFPIEH_UNSEQ',
488}
489
490# Identifiers from group ofp_match_type
491OFPMT_STANDARD = 0
492OFPMT_OXM = 1
493
494ofp_match_type_map = {
495 0: 'OFPMT_STANDARD',
496 1: 'OFPMT_OXM',
497}
498
499# Identifiers from group ofp_meter
500OFPM_MAX = 4294901760
501OFPM_SLOWPATH = 4294967293
502OFPM_CONTROLLER = 4294967294
503OFPM_ALL = 4294967295
504
505ofp_meter_map = {
506 4294901760: 'OFPM_MAX',
507 4294967293: 'OFPM_SLOWPATH',
508 4294967294: 'OFPM_CONTROLLER',
509 4294967295: 'OFPM_ALL',
510}
511
512# Identifiers from group ofp_meter_band_type
513OFPMBT_DROP = 1
514OFPMBT_DSCP_REMARK = 2
515OFPMBT_EXPERIMENTER = 65535
516
517ofp_meter_band_type_map = {
518 1: 'OFPMBT_DROP',
519 2: 'OFPMBT_DSCP_REMARK',
520 65535: 'OFPMBT_EXPERIMENTER',
521}
522
523# Identifiers from group ofp_meter_flags
524OFPMF_KBPS = 1
525OFPMF_PKTPS = 2
526OFPMF_BURST = 4
527OFPMF_STATS = 8
528
529ofp_meter_flags_map = {
530 1: 'OFPMF_KBPS',
531 2: 'OFPMF_PKTPS',
532 4: 'OFPMF_BURST',
533 8: 'OFPMF_STATS',
534}
535
536# Identifiers from group ofp_meter_mod_command
537OFPMC_ADD = 0
538OFPMC_MODIFY = 1
539OFPMC_DELETE = 2
540
541ofp_meter_mod_command_map = {
542 0: 'OFPMC_ADD',
543 1: 'OFPMC_MODIFY',
544 2: 'OFPMC_DELETE',
545}
546
547# Identifiers from group ofp_meter_mod_failed_code
548OFPMMFC_UNKNOWN = 0
549OFPMMFC_METER_EXISTS = 1
550OFPMMFC_INVALID_METER = 2
551OFPMMFC_UNKNOWN_METER = 3
552OFPMMFC_BAD_COMMAND = 4
553OFPMMFC_BAD_FLAGS = 5
554OFPMMFC_BAD_RATE = 6
555OFPMMFC_BAD_BURST = 7
556OFPMMFC_BAD_BAND = 8
557OFPMMFC_BAD_BAND_VALUE = 9
558OFPMMFC_OUT_OF_METERS = 10
559OFPMMFC_OUT_OF_BANDS = 11
560
561ofp_meter_mod_failed_code_map = {
562 0: 'OFPMMFC_UNKNOWN',
563 1: 'OFPMMFC_METER_EXISTS',
564 2: 'OFPMMFC_INVALID_METER',
565 3: 'OFPMMFC_UNKNOWN_METER',
566 4: 'OFPMMFC_BAD_COMMAND',
567 5: 'OFPMMFC_BAD_FLAGS',
568 6: 'OFPMMFC_BAD_RATE',
569 7: 'OFPMMFC_BAD_BURST',
570 8: 'OFPMMFC_BAD_BAND',
571 9: 'OFPMMFC_BAD_BAND_VALUE',
572 10: 'OFPMMFC_OUT_OF_METERS',
573 11: 'OFPMMFC_OUT_OF_BANDS',
574}
575
576# Identifiers from group ofp_multipart_reply_flags
577OFPMPF_REPLY_MORE = 1
578
579ofp_multipart_reply_flags_map = {
580 1: 'OFPMPF_REPLY_MORE',
581}
582
583# Identifiers from group ofp_multipart_request_flags
584OFPMPF_REQ_MORE = 1
585
586ofp_multipart_request_flags_map = {
587 1: 'OFPMPF_REQ_MORE',
588}
589
590# Identifiers from group ofp_multipart_types
591OFPMP_DESC = 0
592OFPMP_FLOW = 1
593OFPMP_AGGREGATE = 2
594OFPMP_TABLE = 3
595OFPMP_PORT_STATS = 4
596OFPMP_QUEUE = 5
597OFPMP_GROUP = 6
598OFPMP_GROUP_DESC = 7
599OFPMP_GROUP_FEATURES = 8
600OFPMP_METER = 9
601OFPMP_METER_CONFIG = 10
602OFPMP_METER_FEATURES = 11
603OFPMP_TABLE_FEATURES = 12
604OFPMP_PORT_DESC = 13
605OFPMP_EXPERIMENTER = 65535
606
607ofp_multipart_types_map = {
608 0: 'OFPMP_DESC',
609 1: 'OFPMP_FLOW',
610 2: 'OFPMP_AGGREGATE',
611 3: 'OFPMP_TABLE',
612 4: 'OFPMP_PORT_STATS',
613 5: 'OFPMP_QUEUE',
614 6: 'OFPMP_GROUP',
615 7: 'OFPMP_GROUP_DESC',
616 8: 'OFPMP_GROUP_FEATURES',
617 9: 'OFPMP_METER',
618 10: 'OFPMP_METER_CONFIG',
619 11: 'OFPMP_METER_FEATURES',
620 12: 'OFPMP_TABLE_FEATURES',
621 13: 'OFPMP_PORT_DESC',
622 65535: 'OFPMP_EXPERIMENTER',
623}
624
625# Identifiers from group ofp_oxm_class
626OFPXMC_NXM_0 = 0
627OFPXMC_NXM_1 = 1
628OFPXMC_OPENFLOW_BASIC = 32768
629OFPXMC_EXPERIMENTER = 65535
630
631ofp_oxm_class_map = {
632 0: 'OFPXMC_NXM_0',
633 1: 'OFPXMC_NXM_1',
634 32768: 'OFPXMC_OPENFLOW_BASIC',
635 65535: 'OFPXMC_EXPERIMENTER',
636}
637
638# Identifiers from group ofp_packet_in_reason
639OFPR_NO_MATCH = 0
640OFPR_ACTION = 1
641OFPR_INVALID_TTL = 2
642
643ofp_packet_in_reason_map = {
644 0: 'OFPR_NO_MATCH',
645 1: 'OFPR_ACTION',
646 2: 'OFPR_INVALID_TTL',
647}
648
649# Identifiers from group ofp_port
650OFPP_MAX = 4294967040
651OFPP_IN_PORT = 4294967288
652OFPP_TABLE = 4294967289
653OFPP_NORMAL = 4294967290
654OFPP_FLOOD = 4294967291
655OFPP_ALL = 4294967292
656OFPP_CONTROLLER = 4294967293
657OFPP_LOCAL = 4294967294
658
659ofp_port_map = {
660 4294967040: 'OFPP_MAX',
661 4294967288: 'OFPP_IN_PORT',
662 4294967289: 'OFPP_TABLE',
663 4294967290: 'OFPP_NORMAL',
664 4294967291: 'OFPP_FLOOD',
665 4294967292: 'OFPP_ALL',
666 4294967293: 'OFPP_CONTROLLER',
667 4294967294: 'OFPP_LOCAL',
668}
669
670# Identifiers from group ofp_port_config
671OFPPC_PORT_DOWN = 1
672OFPPC_NO_RECV = 4
673OFPPC_NO_FWD = 32
674OFPPC_NO_PACKET_IN = 64
675
676ofp_port_config_map = {
677 1: 'OFPPC_PORT_DOWN',
678 4: 'OFPPC_NO_RECV',
679 32: 'OFPPC_NO_FWD',
680 64: 'OFPPC_NO_PACKET_IN',
681}
682
683# Identifiers from group ofp_port_features
684OFPPF_10MB_HD = 1
685OFPPF_10MB_FD = 2
686OFPPF_100MB_HD = 4
687OFPPF_100MB_FD = 8
688OFPPF_1GB_HD = 16
689OFPPF_1GB_FD = 32
690OFPPF_10GB_FD = 64
691OFPPF_40GB_FD = 128
692OFPPF_100GB_FD = 256
693OFPPF_1TB_FD = 512
694OFPPF_OTHER = 1024
695OFPPF_COPPER = 2048
696OFPPF_FIBER = 4096
697OFPPF_AUTONEG = 8192
698OFPPF_PAUSE = 16384
699OFPPF_PAUSE_ASYM = 32768
700
701ofp_port_features_map = {
702 1: 'OFPPF_10MB_HD',
703 2: 'OFPPF_10MB_FD',
704 4: 'OFPPF_100MB_HD',
705 8: 'OFPPF_100MB_FD',
706 16: 'OFPPF_1GB_HD',
707 32: 'OFPPF_1GB_FD',
708 64: 'OFPPF_10GB_FD',
709 128: 'OFPPF_40GB_FD',
710 256: 'OFPPF_100GB_FD',
711 512: 'OFPPF_1TB_FD',
712 1024: 'OFPPF_OTHER',
713 2048: 'OFPPF_COPPER',
714 4096: 'OFPPF_FIBER',
715 8192: 'OFPPF_AUTONEG',
716 16384: 'OFPPF_PAUSE',
717 32768: 'OFPPF_PAUSE_ASYM',
718}
719
720# Identifiers from group ofp_port_mod_failed_code
721OFPPMFC_BAD_PORT = 0
722OFPPMFC_BAD_HW_ADDR = 1
723OFPPMFC_BAD_CONFIG = 2
724OFPPMFC_BAD_ADVERTISE = 3
725OFPPMFC_EPERM = 4
726
727ofp_port_mod_failed_code_map = {
728 0: 'OFPPMFC_BAD_PORT',
729 1: 'OFPPMFC_BAD_HW_ADDR',
730 2: 'OFPPMFC_BAD_CONFIG',
731 3: 'OFPPMFC_BAD_ADVERTISE',
732 4: 'OFPPMFC_EPERM',
733}
734
735# Identifiers from group ofp_port_no
736OFPP_ANY = 4294967295
737
738ofp_port_no_map = {
739 4294967295: 'OFPP_ANY',
740}
741
742# Identifiers from group ofp_port_reason
743OFPPR_ADD = 0
744OFPPR_DELETE = 1
745OFPPR_MODIFY = 2
746
747ofp_port_reason_map = {
748 0: 'OFPPR_ADD',
749 1: 'OFPPR_DELETE',
750 2: 'OFPPR_MODIFY',
751}
752
753# Identifiers from group ofp_port_state
754OFPPS_LINK_DOWN = 1
755OFPPS_BLOCKED = 2
756OFPPS_LIVE = 4
757
758ofp_port_state_map = {
759 1: 'OFPPS_LINK_DOWN',
760 2: 'OFPPS_BLOCKED',
761 4: 'OFPPS_LIVE',
762}
763
764# Identifiers from group ofp_queue_op_failed_code
765OFPQOFC_BAD_PORT = 0
766OFPQOFC_BAD_QUEUE = 1
767OFPQOFC_EPERM = 2
768
769ofp_queue_op_failed_code_map = {
770 0: 'OFPQOFC_BAD_PORT',
771 1: 'OFPQOFC_BAD_QUEUE',
772 2: 'OFPQOFC_EPERM',
773}
774
775# Identifiers from group ofp_queue_properties
776OFPQT_MIN_RATE = 1
777OFPQT_MAX_RATE = 2
778OFPQT_EXPERIMENTER = 65535
779
780ofp_queue_properties_map = {
781 1: 'OFPQT_MIN_RATE',
782 2: 'OFPQT_MAX_RATE',
783 65535: 'OFPQT_EXPERIMENTER',
784}
785
786# Identifiers from group ofp_role_request_failed_code
787OFPRRFC_STALE = 0
788OFPRRFC_UNSUP = 1
789OFPRRFC_BAD_ROLE = 2
790
791ofp_role_request_failed_code_map = {
792 0: 'OFPRRFC_STALE',
793 1: 'OFPRRFC_UNSUP',
794 2: 'OFPRRFC_BAD_ROLE',
795}
796
797# Identifiers from group ofp_switch_config_failed_code
798OFPSCFC_BAD_FLAGS = 0
799OFPSCFC_BAD_LEN = 1
800OFPSCFC_EPERM = 2
801
802ofp_switch_config_failed_code_map = {
803 0: 'OFPSCFC_BAD_FLAGS',
804 1: 'OFPSCFC_BAD_LEN',
805 2: 'OFPSCFC_EPERM',
806}
807
808# Identifiers from group ofp_table
809OFPTT_MAX = 254
810OFPTT_ALL = 255
811
812ofp_table_map = {
813 254: 'OFPTT_MAX',
814 255: 'OFPTT_ALL',
815}
816
817# Identifiers from group ofp_table_config
818OFPTC_DEPRECATED_MASK = 3
819
820ofp_table_config_map = {
821 3: 'OFPTC_DEPRECATED_MASK',
822}
823
824# Identifiers from group ofp_table_feature_prop_type
825OFPTFPT_INSTRUCTIONS = 0
826OFPTFPT_INSTRUCTIONS_MISS = 1
827OFPTFPT_NEXT_TABLES = 2
828OFPTFPT_NEXT_TABLES_MISS = 3
829OFPTFPT_WRITE_ACTIONS = 4
830OFPTFPT_WRITE_ACTIONS_MISS = 5
831OFPTFPT_APPLY_ACTIONS = 6
832OFPTFPT_APPLY_ACTIONS_MISS = 7
833OFPTFPT_MATCH = 8
834OFPTFPT_WILDCARDS = 10
835OFPTFPT_WRITE_SETFIELD = 12
836OFPTFPT_WRITE_SETFIELD_MISS = 13
837OFPTFPT_APPLY_SETFIELD = 14
838OFPTFPT_APPLY_SETFIELD_MISS = 15
839OFPTFPT_EXPERIMENTER = 65534
840OFPTFPT_EXPERIMENTER_MISS = 65535
841
842ofp_table_feature_prop_type_map = {
843 0: 'OFPTFPT_INSTRUCTIONS',
844 1: 'OFPTFPT_INSTRUCTIONS_MISS',
845 2: 'OFPTFPT_NEXT_TABLES',
846 3: 'OFPTFPT_NEXT_TABLES_MISS',
847 4: 'OFPTFPT_WRITE_ACTIONS',
848 5: 'OFPTFPT_WRITE_ACTIONS_MISS',
849 6: 'OFPTFPT_APPLY_ACTIONS',
850 7: 'OFPTFPT_APPLY_ACTIONS_MISS',
851 8: 'OFPTFPT_MATCH',
852 10: 'OFPTFPT_WILDCARDS',
853 12: 'OFPTFPT_WRITE_SETFIELD',
854 13: 'OFPTFPT_WRITE_SETFIELD_MISS',
855 14: 'OFPTFPT_APPLY_SETFIELD',
856 15: 'OFPTFPT_APPLY_SETFIELD_MISS',
857 65534: 'OFPTFPT_EXPERIMENTER',
858 65535: 'OFPTFPT_EXPERIMENTER_MISS',
859}
860
861# Identifiers from group ofp_table_features_failed_code
862OFPTFFC_BAD_TABLE = 0
863OFPTFFC_BAD_METADATA = 1
864OFPTFFC_BAD_TYPE = 2
865OFPTFFC_BAD_LEN = 3
866OFPTFFC_BAD_ARGUMENT = 4
867OFPTFFC_EPERM = 5
868
869ofp_table_features_failed_code_map = {
870 0: 'OFPTFFC_BAD_TABLE',
871 1: 'OFPTFFC_BAD_METADATA',
872 2: 'OFPTFFC_BAD_TYPE',
873 3: 'OFPTFFC_BAD_LEN',
874 4: 'OFPTFFC_BAD_ARGUMENT',
875 5: 'OFPTFFC_EPERM',
876}
877
878# Identifiers from group ofp_table_mod_failed_code
879OFPTMFC_BAD_TABLE = 0
880OFPTMFC_BAD_CONFIG = 1
881OFPTMFC_EPERM = 2
882
883ofp_table_mod_failed_code_map = {
884 0: 'OFPTMFC_BAD_TABLE',
885 1: 'OFPTMFC_BAD_CONFIG',
886 2: 'OFPTMFC_EPERM',
887}
888
889# Identifiers from group ofp_type
890OFPT_HELLO = 0
891OFPT_ERROR = 1
892OFPT_ECHO_REQUEST = 2
893OFPT_ECHO_REPLY = 3
894OFPT_EXPERIMENTER = 4
895OFPT_FEATURES_REQUEST = 5
896OFPT_FEATURES_REPLY = 6
897OFPT_GET_CONFIG_REQUEST = 7
898OFPT_GET_CONFIG_REPLY = 8
899OFPT_SET_CONFIG = 9
900OFPT_PACKET_IN = 10
901OFPT_FLOW_REMOVED = 11
902OFPT_PORT_STATUS = 12
903OFPT_PACKET_OUT = 13
904OFPT_FLOW_MOD = 14
905OFPT_GROUP_MOD = 15
906OFPT_PORT_MOD = 16
907OFPT_TABLE_MOD = 17
908OFPT_MULTIPART_REQUEST = 18
909OFPT_MULTIPART_REPLY = 19
910OFPT_BARRIER_REQUEST = 20
911OFPT_BARRIER_REPLY = 21
912OFPT_QUEUE_GET_CONFIG_REQUEST = 22
913OFPT_QUEUE_GET_CONFIG_REPLY = 23
914OFPT_ROLE_REQUEST = 24
915OFPT_ROLE_REPLY = 25
916OFPT_GET_ASYNC_REQUEST = 26
917OFPT_GET_ASYNC_REPLY = 27
918OFPT_SET_ASYNC = 28
919OFPT_METER_MOD = 29
920
921ofp_type_map = {
922 0: 'OFPT_HELLO',
923 1: 'OFPT_ERROR',
924 2: 'OFPT_ECHO_REQUEST',
925 3: 'OFPT_ECHO_REPLY',
926 4: 'OFPT_EXPERIMENTER',
927 5: 'OFPT_FEATURES_REQUEST',
928 6: 'OFPT_FEATURES_REPLY',
929 7: 'OFPT_GET_CONFIG_REQUEST',
930 8: 'OFPT_GET_CONFIG_REPLY',
931 9: 'OFPT_SET_CONFIG',
932 10: 'OFPT_PACKET_IN',
933 11: 'OFPT_FLOW_REMOVED',
934 12: 'OFPT_PORT_STATUS',
935 13: 'OFPT_PACKET_OUT',
936 14: 'OFPT_FLOW_MOD',
937 15: 'OFPT_GROUP_MOD',
938 16: 'OFPT_PORT_MOD',
939 17: 'OFPT_TABLE_MOD',
940 18: 'OFPT_MULTIPART_REQUEST',
941 19: 'OFPT_MULTIPART_REPLY',
942 20: 'OFPT_BARRIER_REQUEST',
943 21: 'OFPT_BARRIER_REPLY',
944 22: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
945 23: 'OFPT_QUEUE_GET_CONFIG_REPLY',
946 24: 'OFPT_ROLE_REQUEST',
947 25: 'OFPT_ROLE_REPLY',
948 26: 'OFPT_GET_ASYNC_REQUEST',
949 27: 'OFPT_GET_ASYNC_REPLY',
950 28: 'OFPT_SET_ASYNC',
951 29: 'OFPT_METER_MOD',
952}
953
954# Identifiers from group ofp_vlan_id
955OFPVID_NONE = 0
956OFPVID_PRESENT = 4096
957
958ofp_vlan_id_map = {
959 0: 'OFPVID_NONE',
960 4096: 'OFPVID_PRESENT',
961}
962