blob: a951bcf2aea4a44443c0921fdbe3b30b09707c8d [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
Rich Lane93b33132014-04-21 12:20:58 -0700189# Identifiers from group ofp_bsn_vport_l2gre_flags
190OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID = 1
191OF_BSN_VPORT_L2GRE_DSCP_ASSIGN = 2
192OF_BSN_VPORT_L2GRE_DSCP_COPY = 4
Rich Lane5587ab12014-06-30 11:19:09 -0700193OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID = 8
Rich Lane93b33132014-04-21 12:20:58 -0700194
195ofp_bsn_vport_l2gre_flags_map = {
196 1: 'OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID',
197 2: 'OF_BSN_VPORT_L2GRE_DSCP_ASSIGN',
198 4: 'OF_BSN_VPORT_L2GRE_DSCP_COPY',
Rich Lane5587ab12014-06-30 11:19:09 -0700199 8: 'OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID',
Rich Lane93b33132014-04-21 12:20:58 -0700200}
201
Dan Talaycof6202252013-07-02 01:00:29 -0700202# Identifiers from group ofp_bsn_vport_q_in_q_untagged
203OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
204
205ofp_bsn_vport_q_in_q_untagged_map = {
206 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
207}
208
Rich Laned53156a2013-08-05 17:17:33 -0700209# Identifiers from group ofp_bsn_vport_status
210OF_BSN_VPORT_STATUS_OK = 0
211OF_BSN_VPORT_STATUS_FAILED = 1
212
213ofp_bsn_vport_status_map = {
214 0: 'OF_BSN_VPORT_STATUS_OK',
215 1: 'OF_BSN_VPORT_STATUS_FAILED',
216}
217
Rich Lanec2ee4b82013-04-24 17:12:38 -0700218# Identifiers from group ofp_capabilities
219OFPC_FLOW_STATS = 1
220OFPC_TABLE_STATS = 2
221OFPC_PORT_STATS = 4
222OFPC_GROUP_STATS = 8
223OFPC_IP_REASM = 32
224OFPC_QUEUE_STATS = 64
225OFPC_ARP_MATCH_IP = 128
226
227ofp_capabilities_map = {
228 1: 'OFPC_FLOW_STATS',
229 2: 'OFPC_TABLE_STATS',
230 4: 'OFPC_PORT_STATS',
231 8: 'OFPC_GROUP_STATS',
232 32: 'OFPC_IP_REASM',
233 64: 'OFPC_QUEUE_STATS',
234 128: 'OFPC_ARP_MATCH_IP',
235}
236
237# Identifiers from group ofp_config_flags
238OFPC_FRAG_NORMAL = 0
239OFPC_FRAG_DROP = 1
240OFPC_FRAG_REASM = 2
241OFPC_FRAG_MASK = 3
242OFPC_INVALID_TTL_TO_CONTROLLER = 4
243
244ofp_config_flags_map = {
245 0: 'OFPC_FRAG_NORMAL',
246 1: 'OFPC_FRAG_DROP',
247 2: 'OFPC_FRAG_REASM',
248 3: 'OFPC_FRAG_MASK',
249 4: 'OFPC_INVALID_TTL_TO_CONTROLLER',
250}
251
252# Identifiers from group ofp_error_type
253OFPET_HELLO_FAILED = 0
254OFPET_BAD_REQUEST = 1
255OFPET_BAD_ACTION = 2
256OFPET_BAD_INSTRUCTION = 3
257OFPET_BAD_MATCH = 4
258OFPET_FLOW_MOD_FAILED = 5
259OFPET_GROUP_MOD_FAILED = 6
260OFPET_PORT_MOD_FAILED = 7
261OFPET_TABLE_MOD_FAILED = 8
262OFPET_QUEUE_OP_FAILED = 9
263OFPET_SWITCH_CONFIG_FAILED = 10
264
265ofp_error_type_map = {
266 0: 'OFPET_HELLO_FAILED',
267 1: 'OFPET_BAD_REQUEST',
268 2: 'OFPET_BAD_ACTION',
269 3: 'OFPET_BAD_INSTRUCTION',
270 4: 'OFPET_BAD_MATCH',
271 5: 'OFPET_FLOW_MOD_FAILED',
272 6: 'OFPET_GROUP_MOD_FAILED',
273 7: 'OFPET_PORT_MOD_FAILED',
274 8: 'OFPET_TABLE_MOD_FAILED',
275 9: 'OFPET_QUEUE_OP_FAILED',
276 10: 'OFPET_SWITCH_CONFIG_FAILED',
277}
278
279# Identifiers from group ofp_flow_mod_command
280OFPFC_ADD = 0
281OFPFC_MODIFY = 1
282OFPFC_MODIFY_STRICT = 2
283OFPFC_DELETE = 3
284OFPFC_DELETE_STRICT = 4
285
286ofp_flow_mod_command_map = {
287 0: 'OFPFC_ADD',
288 1: 'OFPFC_MODIFY',
289 2: 'OFPFC_MODIFY_STRICT',
290 3: 'OFPFC_DELETE',
291 4: 'OFPFC_DELETE_STRICT',
292}
293
294# Identifiers from group ofp_flow_mod_failed_code
295OFPFMFC_UNKNOWN = 0
296OFPFMFC_TABLE_FULL = 1
297OFPFMFC_BAD_TABLE_ID = 2
298OFPFMFC_OVERLAP = 3
299OFPFMFC_EPERM = 4
300OFPFMFC_BAD_TIMEOUT = 5
301OFPFMFC_BAD_COMMAND = 6
302
303ofp_flow_mod_failed_code_map = {
304 0: 'OFPFMFC_UNKNOWN',
305 1: 'OFPFMFC_TABLE_FULL',
306 2: 'OFPFMFC_BAD_TABLE_ID',
307 3: 'OFPFMFC_OVERLAP',
308 4: 'OFPFMFC_EPERM',
309 5: 'OFPFMFC_BAD_TIMEOUT',
310 6: 'OFPFMFC_BAD_COMMAND',
311}
312
313# Identifiers from group ofp_flow_mod_flags
314OFPFF_SEND_FLOW_REM = 1
315OFPFF_CHECK_OVERLAP = 2
316
317ofp_flow_mod_flags_map = {
318 1: 'OFPFF_SEND_FLOW_REM',
319 2: 'OFPFF_CHECK_OVERLAP',
320}
321
322# Identifiers from group ofp_flow_removed_reason
323OFPRR_IDLE_TIMEOUT = 0
324OFPRR_HARD_TIMEOUT = 1
325OFPRR_DELETE = 2
326OFPRR_GROUP_DELETE = 3
327
328ofp_flow_removed_reason_map = {
329 0: 'OFPRR_IDLE_TIMEOUT',
330 1: 'OFPRR_HARD_TIMEOUT',
331 2: 'OFPRR_DELETE',
332 3: 'OFPRR_GROUP_DELETE',
333}
334
335# Identifiers from group ofp_flow_wildcards
336OFPFW_IN_PORT = 1
337OFPFW_DL_VLAN = 2
338OFPFW_DL_VLAN_PCP = 4
339OFPFW_DL_TYPE = 8
340OFPFW_NW_TOS = 16
341OFPFW_NW_PROTO = 32
342OFPFW_TP_SRC = 64
343OFPFW_TP_DST = 128
344OFPFW_MPLS_LABEL = 256
345OFPFW_MPLS_TC = 512
346OFPFW_ALL = 1023
347
348ofp_flow_wildcards_map = {
349 1: 'OFPFW_IN_PORT',
350 2: 'OFPFW_DL_VLAN',
351 4: 'OFPFW_DL_VLAN_PCP',
352 8: 'OFPFW_DL_TYPE',
353 16: 'OFPFW_NW_TOS',
354 32: 'OFPFW_NW_PROTO',
355 64: 'OFPFW_TP_SRC',
356 128: 'OFPFW_TP_DST',
357 256: 'OFPFW_MPLS_LABEL',
358 512: 'OFPFW_MPLS_TC',
359}
360
361# Identifiers from group ofp_group
362OFPG_MAX = 4294967040
363OFPG_ALL = 4294967292
364OFPG_ANY = 4294967295
365
366ofp_group_map = {
367 4294967040: 'OFPG_MAX',
368 4294967292: 'OFPG_ALL',
369 4294967295: 'OFPG_ANY',
370}
371
372# Identifiers from group ofp_group_mod_command
373OFPGC_ADD = 0
374OFPGC_MODIFY = 1
375OFPGC_DELETE = 2
376
377ofp_group_mod_command_map = {
378 0: 'OFPGC_ADD',
379 1: 'OFPGC_MODIFY',
380 2: 'OFPGC_DELETE',
381}
382
383# Identifiers from group ofp_group_mod_failed_code
384OFPGMFC_GROUP_EXISTS = 0
385OFPGMFC_INVALID_GROUP = 1
386OFPGMFC_WEIGHT_UNSUPPORTED = 2
387OFPGMFC_OUT_OF_GROUPS = 3
388OFPGMFC_OUT_OF_BUCKETS = 4
389OFPGMFC_CHAINING_UNSUPPORTED = 5
390OFPGMFC_WATCH_UNSUPPORTED = 6
391OFPGMFC_LOOP = 7
392OFPGMFC_UNKNOWN_GROUP = 8
393
394ofp_group_mod_failed_code_map = {
395 0: 'OFPGMFC_GROUP_EXISTS',
396 1: 'OFPGMFC_INVALID_GROUP',
397 2: 'OFPGMFC_WEIGHT_UNSUPPORTED',
398 3: 'OFPGMFC_OUT_OF_GROUPS',
399 4: 'OFPGMFC_OUT_OF_BUCKETS',
400 5: 'OFPGMFC_CHAINING_UNSUPPORTED',
401 6: 'OFPGMFC_WATCH_UNSUPPORTED',
402 7: 'OFPGMFC_LOOP',
403 8: 'OFPGMFC_UNKNOWN_GROUP',
404}
405
406# Identifiers from group ofp_group_type
407OFPGT_ALL = 0
408OFPGT_SELECT = 1
409OFPGT_INDIRECT = 2
410OFPGT_FF = 3
411
412ofp_group_type_map = {
413 0: 'OFPGT_ALL',
414 1: 'OFPGT_SELECT',
415 2: 'OFPGT_INDIRECT',
416 3: 'OFPGT_FF',
417}
418
419# Identifiers from group ofp_hello_failed_code
420OFPHFC_INCOMPATIBLE = 0
421OFPHFC_EPERM = 1
422
423ofp_hello_failed_code_map = {
424 0: 'OFPHFC_INCOMPATIBLE',
425 1: 'OFPHFC_EPERM',
426}
427
428# Identifiers from group ofp_instruction_type
429OFPIT_GOTO_TABLE = 1
430OFPIT_WRITE_METADATA = 2
431OFPIT_WRITE_ACTIONS = 3
432OFPIT_APPLY_ACTIONS = 4
433OFPIT_CLEAR_ACTIONS = 5
434OFPIT_EXPERIMENTER = 65535
435
436ofp_instruction_type_map = {
437 1: 'OFPIT_GOTO_TABLE',
438 2: 'OFPIT_WRITE_METADATA',
439 3: 'OFPIT_WRITE_ACTIONS',
440 4: 'OFPIT_APPLY_ACTIONS',
441 5: 'OFPIT_CLEAR_ACTIONS',
442 65535: 'OFPIT_EXPERIMENTER',
443}
444
445# Identifiers from group ofp_match_type
446OFPMT_STANDARD = 0
447
448ofp_match_type_map = {
449 0: 'OFPMT_STANDARD',
450}
451
452# Identifiers from group ofp_packet_in_reason
453OFPR_NO_MATCH = 0
454OFPR_ACTION = 1
455
456ofp_packet_in_reason_map = {
457 0: 'OFPR_NO_MATCH',
458 1: 'OFPR_ACTION',
459}
460
461# Identifiers from group ofp_port
462OFPP_MAX = 4294967040
463OFPP_IN_PORT = 4294967288
464OFPP_TABLE = 4294967289
465OFPP_NORMAL = 4294967290
466OFPP_FLOOD = 4294967291
467OFPP_ALL = 4294967292
468OFPP_CONTROLLER = 4294967293
469OFPP_LOCAL = 4294967294
Rich Laned9e3f7b2013-11-04 11:40:43 -0800470OFPP_ANY = 4294967295
Rich Lanec2ee4b82013-04-24 17:12:38 -0700471
472ofp_port_map = {
473 4294967040: 'OFPP_MAX',
474 4294967288: 'OFPP_IN_PORT',
475 4294967289: 'OFPP_TABLE',
476 4294967290: 'OFPP_NORMAL',
477 4294967291: 'OFPP_FLOOD',
478 4294967292: 'OFPP_ALL',
479 4294967293: 'OFPP_CONTROLLER',
480 4294967294: 'OFPP_LOCAL',
Rich Laned9e3f7b2013-11-04 11:40:43 -0800481 4294967295: 'OFPP_ANY',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700482}
483
484# Identifiers from group ofp_port_config
485OFPPC_PORT_DOWN = 1
486OFPPC_NO_RECV = 4
487OFPPC_NO_FWD = 32
488OFPPC_NO_PACKET_IN = 64
Rich Lane6f4978c2013-10-20 21:33:52 -0700489OFPPC_BSN_MIRROR_DEST = 2147483648
Rich Lanec2ee4b82013-04-24 17:12:38 -0700490
491ofp_port_config_map = {
492 1: 'OFPPC_PORT_DOWN',
493 4: 'OFPPC_NO_RECV',
494 32: 'OFPPC_NO_FWD',
495 64: 'OFPPC_NO_PACKET_IN',
Rich Lane6f4978c2013-10-20 21:33:52 -0700496 2147483648: 'OFPPC_BSN_MIRROR_DEST',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700497}
498
499# Identifiers from group ofp_port_features
500OFPPF_10MB_HD = 1
501OFPPF_10MB_FD = 2
502OFPPF_100MB_HD = 4
503OFPPF_100MB_FD = 8
504OFPPF_1GB_HD = 16
505OFPPF_1GB_FD = 32
506OFPPF_10GB_FD = 64
507OFPPF_40GB_FD = 128
508OFPPF_100GB_FD = 256
509OFPPF_1TB_FD = 512
510OFPPF_OTHER = 1024
511OFPPF_COPPER = 2048
512OFPPF_FIBER = 4096
513OFPPF_AUTONEG = 8192
514OFPPF_PAUSE = 16384
515OFPPF_PAUSE_ASYM = 32768
516
517ofp_port_features_map = {
518 1: 'OFPPF_10MB_HD',
519 2: 'OFPPF_10MB_FD',
520 4: 'OFPPF_100MB_HD',
521 8: 'OFPPF_100MB_FD',
522 16: 'OFPPF_1GB_HD',
523 32: 'OFPPF_1GB_FD',
524 64: 'OFPPF_10GB_FD',
525 128: 'OFPPF_40GB_FD',
526 256: 'OFPPF_100GB_FD',
527 512: 'OFPPF_1TB_FD',
528 1024: 'OFPPF_OTHER',
529 2048: 'OFPPF_COPPER',
530 4096: 'OFPPF_FIBER',
531 8192: 'OFPPF_AUTONEG',
532 16384: 'OFPPF_PAUSE',
533 32768: 'OFPPF_PAUSE_ASYM',
534}
535
536# Identifiers from group ofp_port_mod_failed_code
537OFPPMFC_BAD_PORT = 0
538OFPPMFC_BAD_HW_ADDR = 1
539OFPPMFC_BAD_CONFIG = 2
540OFPPMFC_BAD_ADVERTISE = 3
541
542ofp_port_mod_failed_code_map = {
543 0: 'OFPPMFC_BAD_PORT',
544 1: 'OFPPMFC_BAD_HW_ADDR',
545 2: 'OFPPMFC_BAD_CONFIG',
546 3: 'OFPPMFC_BAD_ADVERTISE',
547}
548
Rich Lanec2ee4b82013-04-24 17:12:38 -0700549# Identifiers from group ofp_port_reason
550OFPPR_ADD = 0
551OFPPR_DELETE = 1
552OFPPR_MODIFY = 2
553
554ofp_port_reason_map = {
555 0: 'OFPPR_ADD',
556 1: 'OFPPR_DELETE',
557 2: 'OFPPR_MODIFY',
558}
559
560# Identifiers from group ofp_port_state
561OFPPS_LINK_DOWN = 1
562OFPPS_BLOCKED = 2
563OFPPS_LIVE = 4
564
565ofp_port_state_map = {
566 1: 'OFPPS_LINK_DOWN',
567 2: 'OFPPS_BLOCKED',
568 4: 'OFPPS_LIVE',
569}
570
571# Identifiers from group ofp_queue_op_failed_code
572OFPQOFC_BAD_PORT = 0
573OFPQOFC_BAD_QUEUE = 1
574OFPQOFC_EPERM = 2
575
576ofp_queue_op_failed_code_map = {
577 0: 'OFPQOFC_BAD_PORT',
578 1: 'OFPQOFC_BAD_QUEUE',
579 2: 'OFPQOFC_EPERM',
580}
581
582# Identifiers from group ofp_queue_properties
583OFPQT_NONE = 0
584OFPQT_MIN_RATE = 1
585
586ofp_queue_properties_map = {
587 0: 'OFPQT_NONE',
588 1: 'OFPQT_MIN_RATE',
589}
590
591# Identifiers from group ofp_stats_reply_flags
592OFPSF_REPLY_MORE = 1
593
594ofp_stats_reply_flags_map = {
595 1: 'OFPSF_REPLY_MORE',
596}
597
Rich Laned9e3f7b2013-11-04 11:40:43 -0800598# Identifiers from group ofp_stats_request_flags
599
600ofp_stats_request_flags_map = {
601}
602
Rich Lane6f4978c2013-10-20 21:33:52 -0700603# Identifiers from group ofp_stats_type
Rich Lanec2ee4b82013-04-24 17:12:38 -0700604OFPST_DESC = 0
605OFPST_FLOW = 1
606OFPST_AGGREGATE = 2
607OFPST_TABLE = 3
608OFPST_PORT = 4
609OFPST_QUEUE = 5
610OFPST_GROUP = 6
611OFPST_GROUP_DESC = 7
612OFPST_EXPERIMENTER = 65535
613
Rich Lane6f4978c2013-10-20 21:33:52 -0700614ofp_stats_type_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700615 0: 'OFPST_DESC',
616 1: 'OFPST_FLOW',
617 2: 'OFPST_AGGREGATE',
618 3: 'OFPST_TABLE',
619 4: 'OFPST_PORT',
620 5: 'OFPST_QUEUE',
621 6: 'OFPST_GROUP',
622 7: 'OFPST_GROUP_DESC',
623 65535: 'OFPST_EXPERIMENTER',
624}
625
626# Identifiers from group ofp_switch_config_failed_code
627OFPSCFC_BAD_FLAGS = 0
628OFPSCFC_BAD_LEN = 1
629
630ofp_switch_config_failed_code_map = {
631 0: 'OFPSCFC_BAD_FLAGS',
632 1: 'OFPSCFC_BAD_LEN',
633}
634
635# Identifiers from group ofp_table_config
636OFPTC_TABLE_MISS_CONTROLLER = 0
637OFPTC_TABLE_MISS_CONTINUE = 1
638OFPTC_TABLE_MISS_DROP = 2
639OFPTC_TABLE_MISS_MASK = 3
640
641ofp_table_config_map = {
642 0: 'OFPTC_TABLE_MISS_CONTROLLER',
643 1: 'OFPTC_TABLE_MISS_CONTINUE',
644 2: 'OFPTC_TABLE_MISS_DROP',
645 3: 'OFPTC_TABLE_MISS_MASK',
646}
647
648# Identifiers from group ofp_table_mod_failed_code
649OFPTMFC_BAD_TABLE = 0
650OFPTMFC_BAD_CONFIG = 1
651
652ofp_table_mod_failed_code_map = {
653 0: 'OFPTMFC_BAD_TABLE',
654 1: 'OFPTMFC_BAD_CONFIG',
655}
656
657# Identifiers from group ofp_type
658OFPT_HELLO = 0
659OFPT_ERROR = 1
660OFPT_ECHO_REQUEST = 2
661OFPT_ECHO_REPLY = 3
662OFPT_EXPERIMENTER = 4
663OFPT_FEATURES_REQUEST = 5
664OFPT_FEATURES_REPLY = 6
665OFPT_GET_CONFIG_REQUEST = 7
666OFPT_GET_CONFIG_REPLY = 8
667OFPT_SET_CONFIG = 9
668OFPT_PACKET_IN = 10
669OFPT_FLOW_REMOVED = 11
670OFPT_PORT_STATUS = 12
671OFPT_PACKET_OUT = 13
672OFPT_FLOW_MOD = 14
673OFPT_GROUP_MOD = 15
674OFPT_PORT_MOD = 16
675OFPT_TABLE_MOD = 17
676OFPT_STATS_REQUEST = 18
677OFPT_STATS_REPLY = 19
678OFPT_BARRIER_REQUEST = 20
679OFPT_BARRIER_REPLY = 21
680OFPT_QUEUE_GET_CONFIG_REQUEST = 22
681OFPT_QUEUE_GET_CONFIG_REPLY = 23
682
683ofp_type_map = {
684 0: 'OFPT_HELLO',
685 1: 'OFPT_ERROR',
686 2: 'OFPT_ECHO_REQUEST',
687 3: 'OFPT_ECHO_REPLY',
688 4: 'OFPT_EXPERIMENTER',
689 5: 'OFPT_FEATURES_REQUEST',
690 6: 'OFPT_FEATURES_REPLY',
691 7: 'OFPT_GET_CONFIG_REQUEST',
692 8: 'OFPT_GET_CONFIG_REPLY',
693 9: 'OFPT_SET_CONFIG',
694 10: 'OFPT_PACKET_IN',
695 11: 'OFPT_FLOW_REMOVED',
696 12: 'OFPT_PORT_STATUS',
697 13: 'OFPT_PACKET_OUT',
698 14: 'OFPT_FLOW_MOD',
699 15: 'OFPT_GROUP_MOD',
700 16: 'OFPT_PORT_MOD',
701 17: 'OFPT_TABLE_MOD',
702 18: 'OFPT_STATS_REQUEST',
703 19: 'OFPT_STATS_REPLY',
704 20: 'OFPT_BARRIER_REQUEST',
705 21: 'OFPT_BARRIER_REPLY',
706 22: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
707 23: 'OFPT_QUEUE_GET_CONFIG_REPLY',
708}
709
710# Identifiers from group ofp_vlan_id
711OFPVID_ANY = 65534
712OFPVID_NONE = 65535
713
714ofp_vlan_id_map = {
715 65534: 'OFPVID_ANY',
716 65535: 'OFPVID_NONE',
717}
718