blob: e845abdad2073e128f7281762624c00a635e9bec [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 = 2
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
18OFPFW_ICMP_TYPE = 64
19OFPFW_ICMP_CODE = 128
20OFP_DL_TYPE_ETH2_CUTOFF = 1536
21OFP_DL_TYPE_NOT_ETH_TYPE = 1535
22OFP_VLAN_NONE = 0
23OFPMT_STANDARD_LENGTH = 88
24OFP_FLOW_PERMANENT = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -070025OFP_DEFAULT_PRIORITY = 32768
Dan Talaycof6202252013-07-02 01:00:29 -070026DESC_STR_LEN = 256
27SERIAL_NUM_LEN = 32
Rich Lanec2ee4b82013-04-24 17:12:38 -070028OFPQ_ALL = 4294967295
Dan Talaycof6202252013-07-02 01:00:29 -070029OFPQ_MIN_RATE_UNCFG = 65535
Rich Lanec2ee4b82013-04-24 17:12:38 -070030
Rich Lane6f4978c2013-10-20 21:33:52 -070031# Identifiers from group of_bsn_pdu_slot_num_t
32BSN_PDU_SLOT_NUM_ANY = 255
33
34of_bsn_pdu_slot_num_t_map = {
35 255: 'BSN_PDU_SLOT_NUM_ANY',
36}
37
Rich Lanec2ee4b82013-04-24 17:12:38 -070038# Identifiers from group ofp_action_type
39OFPAT_OUTPUT = 0
40OFPAT_SET_VLAN_VID = 1
41OFPAT_SET_VLAN_PCP = 2
42OFPAT_SET_DL_SRC = 3
43OFPAT_SET_DL_DST = 4
44OFPAT_SET_NW_SRC = 5
45OFPAT_SET_NW_DST = 6
46OFPAT_SET_NW_TOS = 7
47OFPAT_SET_NW_ECN = 8
48OFPAT_SET_TP_SRC = 9
49OFPAT_SET_TP_DST = 10
50OFPAT_COPY_TTL_OUT = 11
51OFPAT_COPY_TTL_IN = 12
52OFPAT_SET_MPLS_LABEL = 13
53OFPAT_SET_MPLS_TC = 14
54OFPAT_SET_MPLS_TTL = 15
55OFPAT_DEC_MPLS_TTL = 16
56OFPAT_PUSH_VLAN = 17
57OFPAT_POP_VLAN = 18
58OFPAT_PUSH_MPLS = 19
59OFPAT_POP_MPLS = 20
60OFPAT_SET_QUEUE = 21
61OFPAT_GROUP = 22
62OFPAT_SET_NW_TTL = 23
63OFPAT_DEC_NW_TTL = 24
64OFPAT_EXPERIMENTER = 65535
65
66ofp_action_type_map = {
67 0: 'OFPAT_OUTPUT',
68 1: 'OFPAT_SET_VLAN_VID',
69 2: 'OFPAT_SET_VLAN_PCP',
70 3: 'OFPAT_SET_DL_SRC',
71 4: 'OFPAT_SET_DL_DST',
72 5: 'OFPAT_SET_NW_SRC',
73 6: 'OFPAT_SET_NW_DST',
74 7: 'OFPAT_SET_NW_TOS',
75 8: 'OFPAT_SET_NW_ECN',
76 9: 'OFPAT_SET_TP_SRC',
77 10: 'OFPAT_SET_TP_DST',
78 11: 'OFPAT_COPY_TTL_OUT',
79 12: 'OFPAT_COPY_TTL_IN',
80 13: 'OFPAT_SET_MPLS_LABEL',
81 14: 'OFPAT_SET_MPLS_TC',
82 15: 'OFPAT_SET_MPLS_TTL',
83 16: 'OFPAT_DEC_MPLS_TTL',
84 17: 'OFPAT_PUSH_VLAN',
85 18: 'OFPAT_POP_VLAN',
86 19: 'OFPAT_PUSH_MPLS',
87 20: 'OFPAT_POP_MPLS',
88 21: 'OFPAT_SET_QUEUE',
89 22: 'OFPAT_GROUP',
90 23: 'OFPAT_SET_NW_TTL',
91 24: 'OFPAT_DEC_NW_TTL',
92 65535: 'OFPAT_EXPERIMENTER',
93}
94
95# Identifiers from group ofp_bad_action_code
96OFPBAC_BAD_TYPE = 0
97OFPBAC_BAD_LEN = 1
98OFPBAC_BAD_EXPERIMENTER = 2
99OFPBAC_BAD_EXPERIMENTER_TYPE = 3
100OFPBAC_BAD_OUT_PORT = 4
101OFPBAC_BAD_ARGUMENT = 5
102OFPBAC_EPERM = 6
103OFPBAC_TOO_MANY = 7
104OFPBAC_BAD_QUEUE = 8
105OFPBAC_BAD_OUT_GROUP = 9
106OFPBAC_MATCH_INCONSISTENT = 10
107OFPBAC_UNSUPPORTED_ORDER = 11
108OFPBAC_BAD_TAG = 12
109
110ofp_bad_action_code_map = {
111 0: 'OFPBAC_BAD_TYPE',
112 1: 'OFPBAC_BAD_LEN',
113 2: 'OFPBAC_BAD_EXPERIMENTER',
114 3: 'OFPBAC_BAD_EXPERIMENTER_TYPE',
115 4: 'OFPBAC_BAD_OUT_PORT',
116 5: 'OFPBAC_BAD_ARGUMENT',
117 6: 'OFPBAC_EPERM',
118 7: 'OFPBAC_TOO_MANY',
119 8: 'OFPBAC_BAD_QUEUE',
120 9: 'OFPBAC_BAD_OUT_GROUP',
121 10: 'OFPBAC_MATCH_INCONSISTENT',
122 11: 'OFPBAC_UNSUPPORTED_ORDER',
123 12: 'OFPBAC_BAD_TAG',
124}
125
126# Identifiers from group ofp_bad_instruction_code
127OFPBIC_UNKNOWN_INST = 0
128OFPBIC_UNSUP_INST = 1
129OFPBIC_BAD_TABLE_ID = 2
130OFPBIC_UNSUP_METADATA = 3
131OFPBIC_UNSUP_METADATA_MASK = 4
132OFPBIC_UNSUP_EXP_INST = 5
133
134ofp_bad_instruction_code_map = {
135 0: 'OFPBIC_UNKNOWN_INST',
136 1: 'OFPBIC_UNSUP_INST',
137 2: 'OFPBIC_BAD_TABLE_ID',
138 3: 'OFPBIC_UNSUP_METADATA',
139 4: 'OFPBIC_UNSUP_METADATA_MASK',
140 5: 'OFPBIC_UNSUP_EXP_INST',
141}
142
143# Identifiers from group ofp_bad_match_code
144OFPBMC_BAD_TYPE = 0
145OFPBMC_BAD_LEN = 1
146OFPBMC_BAD_TAG = 2
147OFPBMC_BAD_DL_ADDR_MASK = 3
148OFPBMC_BAD_NW_ADDR_MASK = 4
149OFPBMC_BAD_WILDCARDS = 5
150OFPBMC_BAD_FIELD = 6
151OFPBMC_BAD_VALUE = 7
152
153ofp_bad_match_code_map = {
154 0: 'OFPBMC_BAD_TYPE',
155 1: 'OFPBMC_BAD_LEN',
156 2: 'OFPBMC_BAD_TAG',
157 3: 'OFPBMC_BAD_DL_ADDR_MASK',
158 4: 'OFPBMC_BAD_NW_ADDR_MASK',
159 5: 'OFPBMC_BAD_WILDCARDS',
160 6: 'OFPBMC_BAD_FIELD',
161 7: 'OFPBMC_BAD_VALUE',
162}
163
164# Identifiers from group ofp_bad_request_code
165OFPBRC_BAD_VERSION = 0
166OFPBRC_BAD_TYPE = 1
167OFPBRC_BAD_STAT = 2
168OFPBRC_BAD_EXPERIMENTER = 3
169OFPBRC_BAD_SUBTYPE = 4
170OFPBRC_EPERM = 5
171OFPBRC_BAD_LEN = 6
172OFPBRC_BUFFER_EMPTY = 7
173OFPBRC_BUFFER_UNKNOWN = 8
174OFPBRC_BAD_TABLE_ID = 9
175
176ofp_bad_request_code_map = {
177 0: 'OFPBRC_BAD_VERSION',
178 1: 'OFPBRC_BAD_TYPE',
179 2: 'OFPBRC_BAD_STAT',
180 3: 'OFPBRC_BAD_EXPERIMENTER',
181 4: 'OFPBRC_BAD_SUBTYPE',
182 5: 'OFPBRC_EPERM',
183 6: 'OFPBRC_BAD_LEN',
184 7: 'OFPBRC_BUFFER_EMPTY',
185 8: 'OFPBRC_BUFFER_UNKNOWN',
186 9: 'OFPBRC_BAD_TABLE_ID',
187}
188
Dan Talaycof6202252013-07-02 01:00:29 -0700189# Identifiers from group ofp_bsn_vport_q_in_q_untagged
190OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
191
192ofp_bsn_vport_q_in_q_untagged_map = {
193 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
194}
195
Rich Laned53156a2013-08-05 17:17:33 -0700196# Identifiers from group ofp_bsn_vport_status
197OF_BSN_VPORT_STATUS_OK = 0
198OF_BSN_VPORT_STATUS_FAILED = 1
199
200ofp_bsn_vport_status_map = {
201 0: 'OF_BSN_VPORT_STATUS_OK',
202 1: 'OF_BSN_VPORT_STATUS_FAILED',
203}
204
Rich Lanec2ee4b82013-04-24 17:12:38 -0700205# Identifiers from group ofp_capabilities
206OFPC_FLOW_STATS = 1
207OFPC_TABLE_STATS = 2
208OFPC_PORT_STATS = 4
209OFPC_GROUP_STATS = 8
210OFPC_IP_REASM = 32
211OFPC_QUEUE_STATS = 64
212OFPC_ARP_MATCH_IP = 128
213
214ofp_capabilities_map = {
215 1: 'OFPC_FLOW_STATS',
216 2: 'OFPC_TABLE_STATS',
217 4: 'OFPC_PORT_STATS',
218 8: 'OFPC_GROUP_STATS',
219 32: 'OFPC_IP_REASM',
220 64: 'OFPC_QUEUE_STATS',
221 128: 'OFPC_ARP_MATCH_IP',
222}
223
224# Identifiers from group ofp_config_flags
225OFPC_FRAG_NORMAL = 0
226OFPC_FRAG_DROP = 1
227OFPC_FRAG_REASM = 2
228OFPC_FRAG_MASK = 3
229OFPC_INVALID_TTL_TO_CONTROLLER = 4
230
231ofp_config_flags_map = {
232 0: 'OFPC_FRAG_NORMAL',
233 1: 'OFPC_FRAG_DROP',
234 2: 'OFPC_FRAG_REASM',
235 3: 'OFPC_FRAG_MASK',
236 4: 'OFPC_INVALID_TTL_TO_CONTROLLER',
237}
238
239# Identifiers from group ofp_error_type
240OFPET_HELLO_FAILED = 0
241OFPET_BAD_REQUEST = 1
242OFPET_BAD_ACTION = 2
243OFPET_BAD_INSTRUCTION = 3
244OFPET_BAD_MATCH = 4
245OFPET_FLOW_MOD_FAILED = 5
246OFPET_GROUP_MOD_FAILED = 6
247OFPET_PORT_MOD_FAILED = 7
248OFPET_TABLE_MOD_FAILED = 8
249OFPET_QUEUE_OP_FAILED = 9
250OFPET_SWITCH_CONFIG_FAILED = 10
251
252ofp_error_type_map = {
253 0: 'OFPET_HELLO_FAILED',
254 1: 'OFPET_BAD_REQUEST',
255 2: 'OFPET_BAD_ACTION',
256 3: 'OFPET_BAD_INSTRUCTION',
257 4: 'OFPET_BAD_MATCH',
258 5: 'OFPET_FLOW_MOD_FAILED',
259 6: 'OFPET_GROUP_MOD_FAILED',
260 7: 'OFPET_PORT_MOD_FAILED',
261 8: 'OFPET_TABLE_MOD_FAILED',
262 9: 'OFPET_QUEUE_OP_FAILED',
263 10: 'OFPET_SWITCH_CONFIG_FAILED',
264}
265
266# Identifiers from group ofp_flow_mod_command
267OFPFC_ADD = 0
268OFPFC_MODIFY = 1
269OFPFC_MODIFY_STRICT = 2
270OFPFC_DELETE = 3
271OFPFC_DELETE_STRICT = 4
272
273ofp_flow_mod_command_map = {
274 0: 'OFPFC_ADD',
275 1: 'OFPFC_MODIFY',
276 2: 'OFPFC_MODIFY_STRICT',
277 3: 'OFPFC_DELETE',
278 4: 'OFPFC_DELETE_STRICT',
279}
280
281# Identifiers from group ofp_flow_mod_failed_code
282OFPFMFC_UNKNOWN = 0
283OFPFMFC_TABLE_FULL = 1
284OFPFMFC_BAD_TABLE_ID = 2
285OFPFMFC_OVERLAP = 3
286OFPFMFC_EPERM = 4
287OFPFMFC_BAD_TIMEOUT = 5
288OFPFMFC_BAD_COMMAND = 6
289
290ofp_flow_mod_failed_code_map = {
291 0: 'OFPFMFC_UNKNOWN',
292 1: 'OFPFMFC_TABLE_FULL',
293 2: 'OFPFMFC_BAD_TABLE_ID',
294 3: 'OFPFMFC_OVERLAP',
295 4: 'OFPFMFC_EPERM',
296 5: 'OFPFMFC_BAD_TIMEOUT',
297 6: 'OFPFMFC_BAD_COMMAND',
298}
299
300# Identifiers from group ofp_flow_mod_flags
301OFPFF_SEND_FLOW_REM = 1
302OFPFF_CHECK_OVERLAP = 2
303
304ofp_flow_mod_flags_map = {
305 1: 'OFPFF_SEND_FLOW_REM',
306 2: 'OFPFF_CHECK_OVERLAP',
307}
308
309# Identifiers from group ofp_flow_removed_reason
310OFPRR_IDLE_TIMEOUT = 0
311OFPRR_HARD_TIMEOUT = 1
312OFPRR_DELETE = 2
313OFPRR_GROUP_DELETE = 3
314
315ofp_flow_removed_reason_map = {
316 0: 'OFPRR_IDLE_TIMEOUT',
317 1: 'OFPRR_HARD_TIMEOUT',
318 2: 'OFPRR_DELETE',
319 3: 'OFPRR_GROUP_DELETE',
320}
321
322# Identifiers from group ofp_flow_wildcards
323OFPFW_IN_PORT = 1
324OFPFW_DL_VLAN = 2
325OFPFW_DL_VLAN_PCP = 4
326OFPFW_DL_TYPE = 8
327OFPFW_NW_TOS = 16
328OFPFW_NW_PROTO = 32
329OFPFW_TP_SRC = 64
330OFPFW_TP_DST = 128
331OFPFW_MPLS_LABEL = 256
332OFPFW_MPLS_TC = 512
333OFPFW_ALL = 1023
334
335ofp_flow_wildcards_map = {
336 1: 'OFPFW_IN_PORT',
337 2: 'OFPFW_DL_VLAN',
338 4: 'OFPFW_DL_VLAN_PCP',
339 8: 'OFPFW_DL_TYPE',
340 16: 'OFPFW_NW_TOS',
341 32: 'OFPFW_NW_PROTO',
342 64: 'OFPFW_TP_SRC',
343 128: 'OFPFW_TP_DST',
344 256: 'OFPFW_MPLS_LABEL',
345 512: 'OFPFW_MPLS_TC',
346}
347
348# Identifiers from group ofp_group
349OFPG_MAX = 4294967040
350OFPG_ALL = 4294967292
351OFPG_ANY = 4294967295
352
353ofp_group_map = {
354 4294967040: 'OFPG_MAX',
355 4294967292: 'OFPG_ALL',
356 4294967295: 'OFPG_ANY',
357}
358
359# Identifiers from group ofp_group_mod_command
360OFPGC_ADD = 0
361OFPGC_MODIFY = 1
362OFPGC_DELETE = 2
363
364ofp_group_mod_command_map = {
365 0: 'OFPGC_ADD',
366 1: 'OFPGC_MODIFY',
367 2: 'OFPGC_DELETE',
368}
369
370# Identifiers from group ofp_group_mod_failed_code
371OFPGMFC_GROUP_EXISTS = 0
372OFPGMFC_INVALID_GROUP = 1
373OFPGMFC_WEIGHT_UNSUPPORTED = 2
374OFPGMFC_OUT_OF_GROUPS = 3
375OFPGMFC_OUT_OF_BUCKETS = 4
376OFPGMFC_CHAINING_UNSUPPORTED = 5
377OFPGMFC_WATCH_UNSUPPORTED = 6
378OFPGMFC_LOOP = 7
379OFPGMFC_UNKNOWN_GROUP = 8
380
381ofp_group_mod_failed_code_map = {
382 0: 'OFPGMFC_GROUP_EXISTS',
383 1: 'OFPGMFC_INVALID_GROUP',
384 2: 'OFPGMFC_WEIGHT_UNSUPPORTED',
385 3: 'OFPGMFC_OUT_OF_GROUPS',
386 4: 'OFPGMFC_OUT_OF_BUCKETS',
387 5: 'OFPGMFC_CHAINING_UNSUPPORTED',
388 6: 'OFPGMFC_WATCH_UNSUPPORTED',
389 7: 'OFPGMFC_LOOP',
390 8: 'OFPGMFC_UNKNOWN_GROUP',
391}
392
393# Identifiers from group ofp_group_type
394OFPGT_ALL = 0
395OFPGT_SELECT = 1
396OFPGT_INDIRECT = 2
397OFPGT_FF = 3
398
399ofp_group_type_map = {
400 0: 'OFPGT_ALL',
401 1: 'OFPGT_SELECT',
402 2: 'OFPGT_INDIRECT',
403 3: 'OFPGT_FF',
404}
405
406# Identifiers from group ofp_hello_failed_code
407OFPHFC_INCOMPATIBLE = 0
408OFPHFC_EPERM = 1
409
410ofp_hello_failed_code_map = {
411 0: 'OFPHFC_INCOMPATIBLE',
412 1: 'OFPHFC_EPERM',
413}
414
415# Identifiers from group ofp_instruction_type
416OFPIT_GOTO_TABLE = 1
417OFPIT_WRITE_METADATA = 2
418OFPIT_WRITE_ACTIONS = 3
419OFPIT_APPLY_ACTIONS = 4
420OFPIT_CLEAR_ACTIONS = 5
421OFPIT_EXPERIMENTER = 65535
422
423ofp_instruction_type_map = {
424 1: 'OFPIT_GOTO_TABLE',
425 2: 'OFPIT_WRITE_METADATA',
426 3: 'OFPIT_WRITE_ACTIONS',
427 4: 'OFPIT_APPLY_ACTIONS',
428 5: 'OFPIT_CLEAR_ACTIONS',
429 65535: 'OFPIT_EXPERIMENTER',
430}
431
432# Identifiers from group ofp_match_type
433OFPMT_STANDARD = 0
434
435ofp_match_type_map = {
436 0: 'OFPMT_STANDARD',
437}
438
439# Identifiers from group ofp_packet_in_reason
440OFPR_NO_MATCH = 0
441OFPR_ACTION = 1
442
443ofp_packet_in_reason_map = {
444 0: 'OFPR_NO_MATCH',
445 1: 'OFPR_ACTION',
446}
447
448# Identifiers from group ofp_port
449OFPP_MAX = 4294967040
450OFPP_IN_PORT = 4294967288
451OFPP_TABLE = 4294967289
452OFPP_NORMAL = 4294967290
453OFPP_FLOOD = 4294967291
454OFPP_ALL = 4294967292
455OFPP_CONTROLLER = 4294967293
456OFPP_LOCAL = 4294967294
Rich Laned9e3f7b2013-11-04 11:40:43 -0800457OFPP_ANY = 4294967295
Rich Lanec2ee4b82013-04-24 17:12:38 -0700458
459ofp_port_map = {
460 4294967040: 'OFPP_MAX',
461 4294967288: 'OFPP_IN_PORT',
462 4294967289: 'OFPP_TABLE',
463 4294967290: 'OFPP_NORMAL',
464 4294967291: 'OFPP_FLOOD',
465 4294967292: 'OFPP_ALL',
466 4294967293: 'OFPP_CONTROLLER',
467 4294967294: 'OFPP_LOCAL',
Rich Laned9e3f7b2013-11-04 11:40:43 -0800468 4294967295: 'OFPP_ANY',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700469}
470
471# Identifiers from group ofp_port_config
472OFPPC_PORT_DOWN = 1
473OFPPC_NO_RECV = 4
474OFPPC_NO_FWD = 32
475OFPPC_NO_PACKET_IN = 64
Rich Lane6f4978c2013-10-20 21:33:52 -0700476OFPPC_BSN_MIRROR_DEST = 2147483648
Rich Lanec2ee4b82013-04-24 17:12:38 -0700477
478ofp_port_config_map = {
479 1: 'OFPPC_PORT_DOWN',
480 4: 'OFPPC_NO_RECV',
481 32: 'OFPPC_NO_FWD',
482 64: 'OFPPC_NO_PACKET_IN',
Rich Lane6f4978c2013-10-20 21:33:52 -0700483 2147483648: 'OFPPC_BSN_MIRROR_DEST',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700484}
485
486# Identifiers from group ofp_port_features
487OFPPF_10MB_HD = 1
488OFPPF_10MB_FD = 2
489OFPPF_100MB_HD = 4
490OFPPF_100MB_FD = 8
491OFPPF_1GB_HD = 16
492OFPPF_1GB_FD = 32
493OFPPF_10GB_FD = 64
494OFPPF_40GB_FD = 128
495OFPPF_100GB_FD = 256
496OFPPF_1TB_FD = 512
497OFPPF_OTHER = 1024
498OFPPF_COPPER = 2048
499OFPPF_FIBER = 4096
500OFPPF_AUTONEG = 8192
501OFPPF_PAUSE = 16384
502OFPPF_PAUSE_ASYM = 32768
503
504ofp_port_features_map = {
505 1: 'OFPPF_10MB_HD',
506 2: 'OFPPF_10MB_FD',
507 4: 'OFPPF_100MB_HD',
508 8: 'OFPPF_100MB_FD',
509 16: 'OFPPF_1GB_HD',
510 32: 'OFPPF_1GB_FD',
511 64: 'OFPPF_10GB_FD',
512 128: 'OFPPF_40GB_FD',
513 256: 'OFPPF_100GB_FD',
514 512: 'OFPPF_1TB_FD',
515 1024: 'OFPPF_OTHER',
516 2048: 'OFPPF_COPPER',
517 4096: 'OFPPF_FIBER',
518 8192: 'OFPPF_AUTONEG',
519 16384: 'OFPPF_PAUSE',
520 32768: 'OFPPF_PAUSE_ASYM',
521}
522
523# Identifiers from group ofp_port_mod_failed_code
524OFPPMFC_BAD_PORT = 0
525OFPPMFC_BAD_HW_ADDR = 1
526OFPPMFC_BAD_CONFIG = 2
527OFPPMFC_BAD_ADVERTISE = 3
528
529ofp_port_mod_failed_code_map = {
530 0: 'OFPPMFC_BAD_PORT',
531 1: 'OFPPMFC_BAD_HW_ADDR',
532 2: 'OFPPMFC_BAD_CONFIG',
533 3: 'OFPPMFC_BAD_ADVERTISE',
534}
535
Rich Lanec2ee4b82013-04-24 17:12:38 -0700536# Identifiers from group ofp_port_reason
537OFPPR_ADD = 0
538OFPPR_DELETE = 1
539OFPPR_MODIFY = 2
540
541ofp_port_reason_map = {
542 0: 'OFPPR_ADD',
543 1: 'OFPPR_DELETE',
544 2: 'OFPPR_MODIFY',
545}
546
547# Identifiers from group ofp_port_state
548OFPPS_LINK_DOWN = 1
549OFPPS_BLOCKED = 2
550OFPPS_LIVE = 4
551
552ofp_port_state_map = {
553 1: 'OFPPS_LINK_DOWN',
554 2: 'OFPPS_BLOCKED',
555 4: 'OFPPS_LIVE',
556}
557
558# Identifiers from group ofp_queue_op_failed_code
559OFPQOFC_BAD_PORT = 0
560OFPQOFC_BAD_QUEUE = 1
561OFPQOFC_EPERM = 2
562
563ofp_queue_op_failed_code_map = {
564 0: 'OFPQOFC_BAD_PORT',
565 1: 'OFPQOFC_BAD_QUEUE',
566 2: 'OFPQOFC_EPERM',
567}
568
569# Identifiers from group ofp_queue_properties
570OFPQT_NONE = 0
571OFPQT_MIN_RATE = 1
572
573ofp_queue_properties_map = {
574 0: 'OFPQT_NONE',
575 1: 'OFPQT_MIN_RATE',
576}
577
578# Identifiers from group ofp_stats_reply_flags
579OFPSF_REPLY_MORE = 1
580
581ofp_stats_reply_flags_map = {
582 1: 'OFPSF_REPLY_MORE',
583}
584
Rich Laned9e3f7b2013-11-04 11:40:43 -0800585# Identifiers from group ofp_stats_request_flags
586
587ofp_stats_request_flags_map = {
588}
589
Rich Lane6f4978c2013-10-20 21:33:52 -0700590# Identifiers from group ofp_stats_type
Rich Lanec2ee4b82013-04-24 17:12:38 -0700591OFPST_DESC = 0
592OFPST_FLOW = 1
593OFPST_AGGREGATE = 2
594OFPST_TABLE = 3
595OFPST_PORT = 4
596OFPST_QUEUE = 5
597OFPST_GROUP = 6
598OFPST_GROUP_DESC = 7
599OFPST_EXPERIMENTER = 65535
600
Rich Lane6f4978c2013-10-20 21:33:52 -0700601ofp_stats_type_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700602 0: 'OFPST_DESC',
603 1: 'OFPST_FLOW',
604 2: 'OFPST_AGGREGATE',
605 3: 'OFPST_TABLE',
606 4: 'OFPST_PORT',
607 5: 'OFPST_QUEUE',
608 6: 'OFPST_GROUP',
609 7: 'OFPST_GROUP_DESC',
610 65535: 'OFPST_EXPERIMENTER',
611}
612
613# Identifiers from group ofp_switch_config_failed_code
614OFPSCFC_BAD_FLAGS = 0
615OFPSCFC_BAD_LEN = 1
616
617ofp_switch_config_failed_code_map = {
618 0: 'OFPSCFC_BAD_FLAGS',
619 1: 'OFPSCFC_BAD_LEN',
620}
621
622# Identifiers from group ofp_table_config
623OFPTC_TABLE_MISS_CONTROLLER = 0
624OFPTC_TABLE_MISS_CONTINUE = 1
625OFPTC_TABLE_MISS_DROP = 2
626OFPTC_TABLE_MISS_MASK = 3
627
628ofp_table_config_map = {
629 0: 'OFPTC_TABLE_MISS_CONTROLLER',
630 1: 'OFPTC_TABLE_MISS_CONTINUE',
631 2: 'OFPTC_TABLE_MISS_DROP',
632 3: 'OFPTC_TABLE_MISS_MASK',
633}
634
635# Identifiers from group ofp_table_mod_failed_code
636OFPTMFC_BAD_TABLE = 0
637OFPTMFC_BAD_CONFIG = 1
638
639ofp_table_mod_failed_code_map = {
640 0: 'OFPTMFC_BAD_TABLE',
641 1: 'OFPTMFC_BAD_CONFIG',
642}
643
644# Identifiers from group ofp_type
645OFPT_HELLO = 0
646OFPT_ERROR = 1
647OFPT_ECHO_REQUEST = 2
648OFPT_ECHO_REPLY = 3
649OFPT_EXPERIMENTER = 4
650OFPT_FEATURES_REQUEST = 5
651OFPT_FEATURES_REPLY = 6
652OFPT_GET_CONFIG_REQUEST = 7
653OFPT_GET_CONFIG_REPLY = 8
654OFPT_SET_CONFIG = 9
655OFPT_PACKET_IN = 10
656OFPT_FLOW_REMOVED = 11
657OFPT_PORT_STATUS = 12
658OFPT_PACKET_OUT = 13
659OFPT_FLOW_MOD = 14
660OFPT_GROUP_MOD = 15
661OFPT_PORT_MOD = 16
662OFPT_TABLE_MOD = 17
663OFPT_STATS_REQUEST = 18
664OFPT_STATS_REPLY = 19
665OFPT_BARRIER_REQUEST = 20
666OFPT_BARRIER_REPLY = 21
667OFPT_QUEUE_GET_CONFIG_REQUEST = 22
668OFPT_QUEUE_GET_CONFIG_REPLY = 23
669
670ofp_type_map = {
671 0: 'OFPT_HELLO',
672 1: 'OFPT_ERROR',
673 2: 'OFPT_ECHO_REQUEST',
674 3: 'OFPT_ECHO_REPLY',
675 4: 'OFPT_EXPERIMENTER',
676 5: 'OFPT_FEATURES_REQUEST',
677 6: 'OFPT_FEATURES_REPLY',
678 7: 'OFPT_GET_CONFIG_REQUEST',
679 8: 'OFPT_GET_CONFIG_REPLY',
680 9: 'OFPT_SET_CONFIG',
681 10: 'OFPT_PACKET_IN',
682 11: 'OFPT_FLOW_REMOVED',
683 12: 'OFPT_PORT_STATUS',
684 13: 'OFPT_PACKET_OUT',
685 14: 'OFPT_FLOW_MOD',
686 15: 'OFPT_GROUP_MOD',
687 16: 'OFPT_PORT_MOD',
688 17: 'OFPT_TABLE_MOD',
689 18: 'OFPT_STATS_REQUEST',
690 19: 'OFPT_STATS_REPLY',
691 20: 'OFPT_BARRIER_REQUEST',
692 21: 'OFPT_BARRIER_REPLY',
693 22: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
694 23: 'OFPT_QUEUE_GET_CONFIG_REPLY',
695}
696
697# Identifiers from group ofp_vlan_id
698OFPVID_ANY = 65534
699OFPVID_NONE = 65535
700
701ofp_vlan_id_map = {
702 65534: 'OFPVID_ANY',
703 65535: 'OFPVID_NONE',
704}
705