blob: ecb261ee57cb61187d2dfb9e6b8380102f380b9a [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
Harshmeet Singhc51f4042014-05-21 13:32:52 -0700190# Identifiers from group ofp_bsn_tcp_flag
191OFP_BSN_TCP_FLAG_FIN = 1
192OFP_BSN_TCP_FLAG_SYN = 2
193OFP_BSN_TCP_FLAG_RST = 4
194OFP_BSN_TCP_FLAG_PSH = 8
195OFP_BSN_TCP_FLAG_ACK = 16
196OFP_BSN_TCP_FLAG_URG = 32
197OFP_BSN_TCP_FLAG_ECE = 64
198OFP_BSN_TCP_FLAG_CWR = 128
199OFP_BSN_TCP_FLAG_NS = 256
200
201ofp_bsn_tcp_flag_map = {
202 1: 'OFP_BSN_TCP_FLAG_FIN',
203 2: 'OFP_BSN_TCP_FLAG_SYN',
204 4: 'OFP_BSN_TCP_FLAG_RST',
205 8: 'OFP_BSN_TCP_FLAG_PSH',
206 16: 'OFP_BSN_TCP_FLAG_ACK',
207 32: 'OFP_BSN_TCP_FLAG_URG',
208 64: 'OFP_BSN_TCP_FLAG_ECE',
209 128: 'OFP_BSN_TCP_FLAG_CWR',
210 256: 'OFP_BSN_TCP_FLAG_NS',
211}
212
Rich Lane93b33132014-04-21 12:20:58 -0700213# Identifiers from group ofp_bsn_vport_l2gre_flags
214OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID = 1
215OF_BSN_VPORT_L2GRE_DSCP_ASSIGN = 2
216OF_BSN_VPORT_L2GRE_DSCP_COPY = 4
Rich Lane5587ab12014-06-30 11:19:09 -0700217OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID = 8
Rich Lane93b33132014-04-21 12:20:58 -0700218
219ofp_bsn_vport_l2gre_flags_map = {
220 1: 'OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID',
221 2: 'OF_BSN_VPORT_L2GRE_DSCP_ASSIGN',
222 4: 'OF_BSN_VPORT_L2GRE_DSCP_COPY',
Rich Lane5587ab12014-06-30 11:19:09 -0700223 8: 'OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID',
Rich Lane93b33132014-04-21 12:20:58 -0700224}
225
Dan Talaycof6202252013-07-02 01:00:29 -0700226# Identifiers from group ofp_bsn_vport_q_in_q_untagged
227OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
228
229ofp_bsn_vport_q_in_q_untagged_map = {
230 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
231}
232
Rich Laned53156a2013-08-05 17:17:33 -0700233# Identifiers from group ofp_bsn_vport_status
234OF_BSN_VPORT_STATUS_OK = 0
235OF_BSN_VPORT_STATUS_FAILED = 1
236
237ofp_bsn_vport_status_map = {
238 0: 'OF_BSN_VPORT_STATUS_OK',
239 1: 'OF_BSN_VPORT_STATUS_FAILED',
240}
241
Rich Lanec2ee4b82013-04-24 17:12:38 -0700242# Identifiers from group ofp_capabilities
243OFPC_FLOW_STATS = 1
244OFPC_TABLE_STATS = 2
245OFPC_PORT_STATS = 4
246OFPC_GROUP_STATS = 8
247OFPC_IP_REASM = 32
248OFPC_QUEUE_STATS = 64
249OFPC_PORT_BLOCKED = 256
250
251ofp_capabilities_map = {
252 1: 'OFPC_FLOW_STATS',
253 2: 'OFPC_TABLE_STATS',
254 4: 'OFPC_PORT_STATS',
255 8: 'OFPC_GROUP_STATS',
256 32: 'OFPC_IP_REASM',
257 64: 'OFPC_QUEUE_STATS',
258 256: 'OFPC_PORT_BLOCKED',
259}
260
261# Identifiers from group ofp_config_flags
262OFPC_FRAG_NORMAL = 0
263OFPC_FRAG_DROP = 1
264OFPC_FRAG_REASM = 2
265OFPC_FRAG_MASK = 3
266OFPC_INVALID_TTL_TO_CONTROLLER = 4
267
268ofp_config_flags_map = {
269 0: 'OFPC_FRAG_NORMAL',
270 1: 'OFPC_FRAG_DROP',
271 2: 'OFPC_FRAG_REASM',
272 3: 'OFPC_FRAG_MASK',
273 4: 'OFPC_INVALID_TTL_TO_CONTROLLER',
274}
275
276# Identifiers from group ofp_controller_max_len
277OFPCML_MAX = 65509
278OFPCML_NO_BUFFER = 65535
279
280ofp_controller_max_len_map = {
281 65509: 'OFPCML_MAX',
282 65535: 'OFPCML_NO_BUFFER',
283}
284
285# Identifiers from group ofp_controller_role
286OFPCR_ROLE_NOCHANGE = 0
287OFPCR_ROLE_EQUAL = 1
288OFPCR_ROLE_MASTER = 2
289OFPCR_ROLE_SLAVE = 3
290
291ofp_controller_role_map = {
292 0: 'OFPCR_ROLE_NOCHANGE',
293 1: 'OFPCR_ROLE_EQUAL',
294 2: 'OFPCR_ROLE_MASTER',
295 3: 'OFPCR_ROLE_SLAVE',
296}
297
298# Identifiers from group ofp_error_type
299OFPET_HELLO_FAILED = 0
300OFPET_BAD_REQUEST = 1
301OFPET_BAD_ACTION = 2
302OFPET_BAD_INSTRUCTION = 3
303OFPET_BAD_MATCH = 4
304OFPET_FLOW_MOD_FAILED = 5
305OFPET_GROUP_MOD_FAILED = 6
306OFPET_PORT_MOD_FAILED = 7
307OFPET_TABLE_MOD_FAILED = 8
308OFPET_QUEUE_OP_FAILED = 9
309OFPET_SWITCH_CONFIG_FAILED = 10
310OFPET_ROLE_REQUEST_FAILED = 11
311OFPET_EXPERIMENTER = 65535
312
313ofp_error_type_map = {
314 0: 'OFPET_HELLO_FAILED',
315 1: 'OFPET_BAD_REQUEST',
316 2: 'OFPET_BAD_ACTION',
317 3: 'OFPET_BAD_INSTRUCTION',
318 4: 'OFPET_BAD_MATCH',
319 5: 'OFPET_FLOW_MOD_FAILED',
320 6: 'OFPET_GROUP_MOD_FAILED',
321 7: 'OFPET_PORT_MOD_FAILED',
322 8: 'OFPET_TABLE_MOD_FAILED',
323 9: 'OFPET_QUEUE_OP_FAILED',
324 10: 'OFPET_SWITCH_CONFIG_FAILED',
325 11: 'OFPET_ROLE_REQUEST_FAILED',
326 65535: 'OFPET_EXPERIMENTER',
327}
328
329# Identifiers from group ofp_flow_mod_command
330OFPFC_ADD = 0
331OFPFC_MODIFY = 1
332OFPFC_MODIFY_STRICT = 2
333OFPFC_DELETE = 3
334OFPFC_DELETE_STRICT = 4
335
336ofp_flow_mod_command_map = {
337 0: 'OFPFC_ADD',
338 1: 'OFPFC_MODIFY',
339 2: 'OFPFC_MODIFY_STRICT',
340 3: 'OFPFC_DELETE',
341 4: 'OFPFC_DELETE_STRICT',
342}
343
344# Identifiers from group ofp_flow_mod_failed_code
345OFPFMFC_UNKNOWN = 0
346OFPFMFC_TABLE_FULL = 1
347OFPFMFC_BAD_TABLE_ID = 2
348OFPFMFC_OVERLAP = 3
349OFPFMFC_EPERM = 4
350OFPFMFC_BAD_TIMEOUT = 5
351OFPFMFC_BAD_COMMAND = 6
352OFPFMFC_BAD_FLAGS = 7
353
354ofp_flow_mod_failed_code_map = {
355 0: 'OFPFMFC_UNKNOWN',
356 1: 'OFPFMFC_TABLE_FULL',
357 2: 'OFPFMFC_BAD_TABLE_ID',
358 3: 'OFPFMFC_OVERLAP',
359 4: 'OFPFMFC_EPERM',
360 5: 'OFPFMFC_BAD_TIMEOUT',
361 6: 'OFPFMFC_BAD_COMMAND',
362 7: 'OFPFMFC_BAD_FLAGS',
363}
364
365# Identifiers from group ofp_flow_mod_flags
366OFPFF_SEND_FLOW_REM = 1
367OFPFF_CHECK_OVERLAP = 2
368OFPFF_RESET_COUNTS = 4
369
370ofp_flow_mod_flags_map = {
371 1: 'OFPFF_SEND_FLOW_REM',
372 2: 'OFPFF_CHECK_OVERLAP',
373 4: 'OFPFF_RESET_COUNTS',
374}
375
376# Identifiers from group ofp_flow_removed_reason
377OFPRR_IDLE_TIMEOUT = 0
378OFPRR_HARD_TIMEOUT = 1
379OFPRR_DELETE = 2
380OFPRR_GROUP_DELETE = 3
381
382ofp_flow_removed_reason_map = {
383 0: 'OFPRR_IDLE_TIMEOUT',
384 1: 'OFPRR_HARD_TIMEOUT',
385 2: 'OFPRR_DELETE',
386 3: 'OFPRR_GROUP_DELETE',
387}
388
389# Identifiers from group ofp_group
390OFPG_MAX = 4294967040
391OFPG_ALL = 4294967292
392OFPG_ANY = 4294967295
393
394ofp_group_map = {
395 4294967040: 'OFPG_MAX',
396 4294967292: 'OFPG_ALL',
397 4294967295: 'OFPG_ANY',
398}
399
400# Identifiers from group ofp_group_capabilities
401OFPGFC_SELECT_WEIGHT = 1
402OFPGFC_SELECT_LIVENESS = 2
403OFPGFC_CHAINING = 4
404OFPGFC_CHAINING_CHECKS = 8
405
406ofp_group_capabilities_map = {
407 1: 'OFPGFC_SELECT_WEIGHT',
408 2: 'OFPGFC_SELECT_LIVENESS',
409 4: 'OFPGFC_CHAINING',
410 8: 'OFPGFC_CHAINING_CHECKS',
411}
412
413# Identifiers from group ofp_group_mod_command
414OFPGC_ADD = 0
415OFPGC_MODIFY = 1
416OFPGC_DELETE = 2
417
418ofp_group_mod_command_map = {
419 0: 'OFPGC_ADD',
420 1: 'OFPGC_MODIFY',
421 2: 'OFPGC_DELETE',
422}
423
424# Identifiers from group ofp_group_mod_failed_code
425OFPGMFC_GROUP_EXISTS = 0
426OFPGMFC_INVALID_GROUP = 1
427OFPGMFC_WEIGHT_UNSUPPORTED = 2
428OFPGMFC_OUT_OF_GROUPS = 3
429OFPGMFC_OUT_OF_BUCKETS = 4
430OFPGMFC_CHAINING_UNSUPPORTED = 5
431OFPGMFC_WATCH_UNSUPPORTED = 6
432OFPGMFC_LOOP = 7
433OFPGMFC_UNKNOWN_GROUP = 8
434OFPGMFC_CHAINED_GROUP = 9
435OFPGMFC_BAD_TYPE = 10
436OFPGMFC_BAD_COMMAND = 11
437OFPGMFC_BAD_BUCKET = 12
438OFPGMFC_BAD_WATCH = 13
439OFPGMFC_EPERM = 14
440
441ofp_group_mod_failed_code_map = {
442 0: 'OFPGMFC_GROUP_EXISTS',
443 1: 'OFPGMFC_INVALID_GROUP',
444 2: 'OFPGMFC_WEIGHT_UNSUPPORTED',
445 3: 'OFPGMFC_OUT_OF_GROUPS',
446 4: 'OFPGMFC_OUT_OF_BUCKETS',
447 5: 'OFPGMFC_CHAINING_UNSUPPORTED',
448 6: 'OFPGMFC_WATCH_UNSUPPORTED',
449 7: 'OFPGMFC_LOOP',
450 8: 'OFPGMFC_UNKNOWN_GROUP',
451 9: 'OFPGMFC_CHAINED_GROUP',
452 10: 'OFPGMFC_BAD_TYPE',
453 11: 'OFPGMFC_BAD_COMMAND',
454 12: 'OFPGMFC_BAD_BUCKET',
455 13: 'OFPGMFC_BAD_WATCH',
456 14: 'OFPGMFC_EPERM',
457}
458
459# Identifiers from group ofp_group_type
460OFPGT_ALL = 0
461OFPGT_SELECT = 1
462OFPGT_INDIRECT = 2
463OFPGT_FF = 3
464
465ofp_group_type_map = {
466 0: 'OFPGT_ALL',
467 1: 'OFPGT_SELECT',
468 2: 'OFPGT_INDIRECT',
469 3: 'OFPGT_FF',
470}
471
472# Identifiers from group ofp_hello_failed_code
473OFPHFC_INCOMPATIBLE = 0
474OFPHFC_EPERM = 1
475
476ofp_hello_failed_code_map = {
477 0: 'OFPHFC_INCOMPATIBLE',
478 1: 'OFPHFC_EPERM',
479}
480
481# Identifiers from group ofp_instruction_type
482OFPIT_GOTO_TABLE = 1
483OFPIT_WRITE_METADATA = 2
484OFPIT_WRITE_ACTIONS = 3
485OFPIT_APPLY_ACTIONS = 4
486OFPIT_CLEAR_ACTIONS = 5
487OFPIT_EXPERIMENTER = 65535
488
489ofp_instruction_type_map = {
490 1: 'OFPIT_GOTO_TABLE',
491 2: 'OFPIT_WRITE_METADATA',
492 3: 'OFPIT_WRITE_ACTIONS',
493 4: 'OFPIT_APPLY_ACTIONS',
494 5: 'OFPIT_CLEAR_ACTIONS',
495 65535: 'OFPIT_EXPERIMENTER',
496}
497
498# Identifiers from group ofp_match_type
499OFPMT_STANDARD = 0
500OFPMT_OXM = 1
501
502ofp_match_type_map = {
503 0: 'OFPMT_STANDARD',
504 1: 'OFPMT_OXM',
505}
506
507# Identifiers from group ofp_oxm_class
508OFPXMC_NXM_0 = 0
509OFPXMC_NXM_1 = 1
510OFPXMC_OPENFLOW_BASIC = 32768
511OFPXMC_EXPERIMENTER = 65535
512
513ofp_oxm_class_map = {
514 0: 'OFPXMC_NXM_0',
515 1: 'OFPXMC_NXM_1',
516 32768: 'OFPXMC_OPENFLOW_BASIC',
517 65535: 'OFPXMC_EXPERIMENTER',
518}
519
520# Identifiers from group ofp_packet_in_reason
521OFPR_NO_MATCH = 0
522OFPR_ACTION = 1
523OFPR_INVALID_TTL = 2
524
525ofp_packet_in_reason_map = {
526 0: 'OFPR_NO_MATCH',
527 1: 'OFPR_ACTION',
528 2: 'OFPR_INVALID_TTL',
529}
530
531# Identifiers from group ofp_port
532OFPP_MAX = 4294967040
533OFPP_IN_PORT = 4294967288
534OFPP_TABLE = 4294967289
535OFPP_NORMAL = 4294967290
536OFPP_FLOOD = 4294967291
537OFPP_ALL = 4294967292
538OFPP_CONTROLLER = 4294967293
539OFPP_LOCAL = 4294967294
Rich Laned9e3f7b2013-11-04 11:40:43 -0800540OFPP_ANY = 4294967295
Rich Lanec2ee4b82013-04-24 17:12:38 -0700541
542ofp_port_map = {
543 4294967040: 'OFPP_MAX',
544 4294967288: 'OFPP_IN_PORT',
545 4294967289: 'OFPP_TABLE',
546 4294967290: 'OFPP_NORMAL',
547 4294967291: 'OFPP_FLOOD',
548 4294967292: 'OFPP_ALL',
549 4294967293: 'OFPP_CONTROLLER',
550 4294967294: 'OFPP_LOCAL',
Rich Laned9e3f7b2013-11-04 11:40:43 -0800551 4294967295: 'OFPP_ANY',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700552}
553
554# Identifiers from group ofp_port_config
555OFPPC_PORT_DOWN = 1
556OFPPC_NO_RECV = 4
557OFPPC_NO_FWD = 32
558OFPPC_NO_PACKET_IN = 64
Rich Lane6f4978c2013-10-20 21:33:52 -0700559OFPPC_BSN_MIRROR_DEST = 2147483648
Rich Lanec2ee4b82013-04-24 17:12:38 -0700560
561ofp_port_config_map = {
562 1: 'OFPPC_PORT_DOWN',
563 4: 'OFPPC_NO_RECV',
564 32: 'OFPPC_NO_FWD',
565 64: 'OFPPC_NO_PACKET_IN',
Rich Lane6f4978c2013-10-20 21:33:52 -0700566 2147483648: 'OFPPC_BSN_MIRROR_DEST',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700567}
568
569# Identifiers from group ofp_port_features
570OFPPF_10MB_HD = 1
571OFPPF_10MB_FD = 2
572OFPPF_100MB_HD = 4
573OFPPF_100MB_FD = 8
574OFPPF_1GB_HD = 16
575OFPPF_1GB_FD = 32
576OFPPF_10GB_FD = 64
577OFPPF_40GB_FD = 128
578OFPPF_100GB_FD = 256
579OFPPF_1TB_FD = 512
580OFPPF_OTHER = 1024
581OFPPF_COPPER = 2048
582OFPPF_FIBER = 4096
583OFPPF_AUTONEG = 8192
584OFPPF_PAUSE = 16384
585OFPPF_PAUSE_ASYM = 32768
586
587ofp_port_features_map = {
588 1: 'OFPPF_10MB_HD',
589 2: 'OFPPF_10MB_FD',
590 4: 'OFPPF_100MB_HD',
591 8: 'OFPPF_100MB_FD',
592 16: 'OFPPF_1GB_HD',
593 32: 'OFPPF_1GB_FD',
594 64: 'OFPPF_10GB_FD',
595 128: 'OFPPF_40GB_FD',
596 256: 'OFPPF_100GB_FD',
597 512: 'OFPPF_1TB_FD',
598 1024: 'OFPPF_OTHER',
599 2048: 'OFPPF_COPPER',
600 4096: 'OFPPF_FIBER',
601 8192: 'OFPPF_AUTONEG',
602 16384: 'OFPPF_PAUSE',
603 32768: 'OFPPF_PAUSE_ASYM',
604}
605
606# Identifiers from group ofp_port_mod_failed_code
607OFPPMFC_BAD_PORT = 0
608OFPPMFC_BAD_HW_ADDR = 1
609OFPPMFC_BAD_CONFIG = 2
610OFPPMFC_BAD_ADVERTISE = 3
611OFPPMFC_EPERM = 4
612
613ofp_port_mod_failed_code_map = {
614 0: 'OFPPMFC_BAD_PORT',
615 1: 'OFPPMFC_BAD_HW_ADDR',
616 2: 'OFPPMFC_BAD_CONFIG',
617 3: 'OFPPMFC_BAD_ADVERTISE',
618 4: 'OFPPMFC_EPERM',
619}
620
Rich Lanec2ee4b82013-04-24 17:12:38 -0700621# Identifiers from group ofp_port_reason
622OFPPR_ADD = 0
623OFPPR_DELETE = 1
624OFPPR_MODIFY = 2
625
626ofp_port_reason_map = {
627 0: 'OFPPR_ADD',
628 1: 'OFPPR_DELETE',
629 2: 'OFPPR_MODIFY',
630}
631
632# Identifiers from group ofp_port_state
633OFPPS_LINK_DOWN = 1
634OFPPS_BLOCKED = 2
635OFPPS_LIVE = 4
636
637ofp_port_state_map = {
638 1: 'OFPPS_LINK_DOWN',
639 2: 'OFPPS_BLOCKED',
640 4: 'OFPPS_LIVE',
641}
642
643# Identifiers from group ofp_queue_op_failed_code
644OFPQOFC_BAD_PORT = 0
645OFPQOFC_BAD_QUEUE = 1
646OFPQOFC_EPERM = 2
647
648ofp_queue_op_failed_code_map = {
649 0: 'OFPQOFC_BAD_PORT',
650 1: 'OFPQOFC_BAD_QUEUE',
651 2: 'OFPQOFC_EPERM',
652}
653
654# Identifiers from group ofp_queue_properties
655OFPQT_MIN_RATE = 1
656OFPQT_MAX_RATE = 2
657OFPQT_EXPERIMENTER = 65535
658
659ofp_queue_properties_map = {
660 1: 'OFPQT_MIN_RATE',
661 2: 'OFPQT_MAX_RATE',
662 65535: 'OFPQT_EXPERIMENTER',
663}
664
665# Identifiers from group ofp_role_request_failed_code
666OFPRRFC_STALE = 0
667OFPRRFC_UNSUP = 1
668OFPRRFC_BAD_ROLE = 2
669
670ofp_role_request_failed_code_map = {
671 0: 'OFPRRFC_STALE',
672 1: 'OFPRRFC_UNSUP',
673 2: 'OFPRRFC_BAD_ROLE',
674}
675
676# Identifiers from group ofp_stats_reply_flags
677OFPSF_REPLY_MORE = 1
678
679ofp_stats_reply_flags_map = {
680 1: 'OFPSF_REPLY_MORE',
681}
682
Rich Laned9e3f7b2013-11-04 11:40:43 -0800683# Identifiers from group ofp_stats_request_flags
684
685ofp_stats_request_flags_map = {
686}
687
Rich Lane6f4978c2013-10-20 21:33:52 -0700688# Identifiers from group ofp_stats_type
Rich Lanec2ee4b82013-04-24 17:12:38 -0700689OFPST_DESC = 0
690OFPST_FLOW = 1
691OFPST_AGGREGATE = 2
692OFPST_TABLE = 3
693OFPST_PORT = 4
694OFPST_QUEUE = 5
695OFPST_GROUP = 6
696OFPST_GROUP_DESC = 7
697OFPST_GROUP_FEATURES = 8
698OFPST_EXPERIMENTER = 65535
699
Rich Lane6f4978c2013-10-20 21:33:52 -0700700ofp_stats_type_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700701 0: 'OFPST_DESC',
702 1: 'OFPST_FLOW',
703 2: 'OFPST_AGGREGATE',
704 3: 'OFPST_TABLE',
705 4: 'OFPST_PORT',
706 5: 'OFPST_QUEUE',
707 6: 'OFPST_GROUP',
708 7: 'OFPST_GROUP_DESC',
709 8: 'OFPST_GROUP_FEATURES',
710 65535: 'OFPST_EXPERIMENTER',
711}
712
713# Identifiers from group ofp_switch_config_failed_code
714OFPSCFC_BAD_FLAGS = 0
715OFPSCFC_BAD_LEN = 1
716OFPSCFC_EPERM = 2
717
718ofp_switch_config_failed_code_map = {
719 0: 'OFPSCFC_BAD_FLAGS',
720 1: 'OFPSCFC_BAD_LEN',
721 2: 'OFPSCFC_EPERM',
722}
723
724# Identifiers from group ofp_table
725OFPTT_MAX = 254
726OFPTT_ALL = 255
727
728ofp_table_map = {
729 254: 'OFPTT_MAX',
730 255: 'OFPTT_ALL',
731}
732
733# Identifiers from group ofp_table_config
734OFPTC_TABLE_MISS_CONTROLLER = 0
735OFPTC_TABLE_MISS_CONTINUE = 1
736OFPTC_TABLE_MISS_DROP = 2
737OFPTC_TABLE_MISS_MASK = 3
738
739ofp_table_config_map = {
740 0: 'OFPTC_TABLE_MISS_CONTROLLER',
741 1: 'OFPTC_TABLE_MISS_CONTINUE',
742 2: 'OFPTC_TABLE_MISS_DROP',
743 3: 'OFPTC_TABLE_MISS_MASK',
744}
745
746# Identifiers from group ofp_table_mod_failed_code
747OFPTMFC_BAD_TABLE = 0
748OFPTMFC_BAD_CONFIG = 1
749OFPTMFC_EPERM = 2
750
751ofp_table_mod_failed_code_map = {
752 0: 'OFPTMFC_BAD_TABLE',
753 1: 'OFPTMFC_BAD_CONFIG',
754 2: 'OFPTMFC_EPERM',
755}
756
757# Identifiers from group ofp_type
758OFPT_HELLO = 0
759OFPT_ERROR = 1
760OFPT_ECHO_REQUEST = 2
761OFPT_ECHO_REPLY = 3
762OFPT_EXPERIMENTER = 4
763OFPT_FEATURES_REQUEST = 5
764OFPT_FEATURES_REPLY = 6
765OFPT_GET_CONFIG_REQUEST = 7
766OFPT_GET_CONFIG_REPLY = 8
767OFPT_SET_CONFIG = 9
768OFPT_PACKET_IN = 10
769OFPT_FLOW_REMOVED = 11
770OFPT_PORT_STATUS = 12
771OFPT_PACKET_OUT = 13
772OFPT_FLOW_MOD = 14
773OFPT_GROUP_MOD = 15
774OFPT_PORT_MOD = 16
775OFPT_TABLE_MOD = 17
776OFPT_STATS_REQUEST = 18
777OFPT_STATS_REPLY = 19
778OFPT_BARRIER_REQUEST = 20
779OFPT_BARRIER_REPLY = 21
780OFPT_QUEUE_GET_CONFIG_REQUEST = 22
781OFPT_QUEUE_GET_CONFIG_REPLY = 23
782OFPT_ROLE_REQUEST = 24
783OFPT_ROLE_REPLY = 25
784
785ofp_type_map = {
786 0: 'OFPT_HELLO',
787 1: 'OFPT_ERROR',
788 2: 'OFPT_ECHO_REQUEST',
789 3: 'OFPT_ECHO_REPLY',
790 4: 'OFPT_EXPERIMENTER',
791 5: 'OFPT_FEATURES_REQUEST',
792 6: 'OFPT_FEATURES_REPLY',
793 7: 'OFPT_GET_CONFIG_REQUEST',
794 8: 'OFPT_GET_CONFIG_REPLY',
795 9: 'OFPT_SET_CONFIG',
796 10: 'OFPT_PACKET_IN',
797 11: 'OFPT_FLOW_REMOVED',
798 12: 'OFPT_PORT_STATUS',
799 13: 'OFPT_PACKET_OUT',
800 14: 'OFPT_FLOW_MOD',
801 15: 'OFPT_GROUP_MOD',
802 16: 'OFPT_PORT_MOD',
803 17: 'OFPT_TABLE_MOD',
804 18: 'OFPT_STATS_REQUEST',
805 19: 'OFPT_STATS_REPLY',
806 20: 'OFPT_BARRIER_REQUEST',
807 21: 'OFPT_BARRIER_REPLY',
808 22: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
809 23: 'OFPT_QUEUE_GET_CONFIG_REPLY',
810 24: 'OFPT_ROLE_REQUEST',
811 25: 'OFPT_ROLE_REPLY',
812}
813
814# Identifiers from group ofp_vlan_id
815OFPVID_NONE = 0
816OFPVID_PRESENT = 4096
817
818ofp_vlan_id_map = {
819 0: 'OFPVID_NONE',
820 4096: 'OFPVID_PRESENT',
821}
822