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