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