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