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