blob: b131b783f73fac13da63a79f35940d5ee28295c5 [file] [log] [blame]
Matteo Scandoloa229eca2017-08-08 13:05:28 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Rich Lanec2ee4b82013-04-24 17:12:38 -070017# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
18# Copyright (c) 2011, 2012 Open Networking Foundation
19# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
Dan Talaycof6202252013-07-02 01:00:29 -070020# See the file LICENSE.pyloxi which should have been included in the source distribution
Rich Lanec2ee4b82013-04-24 17:12:38 -070021
22# Automatically generated by LOXI from template const.py
23# Do not modify
24
25OFP_VERSION = 2
26
27# Identifiers from group macro_definitions
Rich Lanec2ee4b82013-04-24 17:12:38 -070028OFP_MAX_TABLE_NAME_LEN = 32
Dan Talaycof6202252013-07-02 01:00:29 -070029OFP_MAX_PORT_NAME_LEN = 16
Rich Lane6f4978c2013-10-20 21:33:52 -070030OFP_TCP_PORT = 6653
31OFP_SSL_PORT = 6653
Dan Talaycof6202252013-07-02 01:00:29 -070032OFP_ETH_ALEN = 6
33OFP_DEFAULT_MISS_SEND_LEN = 128
34OFPFW_ICMP_TYPE = 64
35OFPFW_ICMP_CODE = 128
36OFP_DL_TYPE_ETH2_CUTOFF = 1536
37OFP_DL_TYPE_NOT_ETH_TYPE = 1535
38OFP_VLAN_NONE = 0
39OFPMT_STANDARD_LENGTH = 88
40OFP_FLOW_PERMANENT = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -070041OFP_DEFAULT_PRIORITY = 32768
Dan Talaycof6202252013-07-02 01:00:29 -070042DESC_STR_LEN = 256
43SERIAL_NUM_LEN = 32
Rich Lanec2ee4b82013-04-24 17:12:38 -070044OFPQ_ALL = 4294967295
Dan Talaycof6202252013-07-02 01:00:29 -070045OFPQ_MIN_RATE_UNCFG = 65535
Rich Lanec2ee4b82013-04-24 17:12:38 -070046
Rich Lane2e079da2014-10-29 15:30:24 -070047# Identifiers from group of_bsn_pdu_slot_num
Rich Lane6f4978c2013-10-20 21:33:52 -070048BSN_PDU_SLOT_NUM_ANY = 255
49
Rich Lane2e079da2014-10-29 15:30:24 -070050of_bsn_pdu_slot_num_map = {
Rich Lane6f4978c2013-10-20 21:33:52 -070051 255: 'BSN_PDU_SLOT_NUM_ANY',
52}
53
Rich Lanec2ee4b82013-04-24 17:12:38 -070054# Identifiers from group ofp_action_type
55OFPAT_OUTPUT = 0
56OFPAT_SET_VLAN_VID = 1
57OFPAT_SET_VLAN_PCP = 2
58OFPAT_SET_DL_SRC = 3
59OFPAT_SET_DL_DST = 4
60OFPAT_SET_NW_SRC = 5
61OFPAT_SET_NW_DST = 6
62OFPAT_SET_NW_TOS = 7
63OFPAT_SET_NW_ECN = 8
64OFPAT_SET_TP_SRC = 9
65OFPAT_SET_TP_DST = 10
66OFPAT_COPY_TTL_OUT = 11
67OFPAT_COPY_TTL_IN = 12
68OFPAT_SET_MPLS_LABEL = 13
69OFPAT_SET_MPLS_TC = 14
70OFPAT_SET_MPLS_TTL = 15
71OFPAT_DEC_MPLS_TTL = 16
72OFPAT_PUSH_VLAN = 17
73OFPAT_POP_VLAN = 18
74OFPAT_PUSH_MPLS = 19
75OFPAT_POP_MPLS = 20
76OFPAT_SET_QUEUE = 21
77OFPAT_GROUP = 22
78OFPAT_SET_NW_TTL = 23
79OFPAT_DEC_NW_TTL = 24
80OFPAT_EXPERIMENTER = 65535
81
82ofp_action_type_map = {
83 0: 'OFPAT_OUTPUT',
84 1: 'OFPAT_SET_VLAN_VID',
85 2: 'OFPAT_SET_VLAN_PCP',
86 3: 'OFPAT_SET_DL_SRC',
87 4: 'OFPAT_SET_DL_DST',
88 5: 'OFPAT_SET_NW_SRC',
89 6: 'OFPAT_SET_NW_DST',
90 7: 'OFPAT_SET_NW_TOS',
91 8: 'OFPAT_SET_NW_ECN',
92 9: 'OFPAT_SET_TP_SRC',
93 10: 'OFPAT_SET_TP_DST',
94 11: 'OFPAT_COPY_TTL_OUT',
95 12: 'OFPAT_COPY_TTL_IN',
96 13: 'OFPAT_SET_MPLS_LABEL',
97 14: 'OFPAT_SET_MPLS_TC',
98 15: 'OFPAT_SET_MPLS_TTL',
99 16: 'OFPAT_DEC_MPLS_TTL',
100 17: 'OFPAT_PUSH_VLAN',
101 18: 'OFPAT_POP_VLAN',
102 19: 'OFPAT_PUSH_MPLS',
103 20: 'OFPAT_POP_MPLS',
104 21: 'OFPAT_SET_QUEUE',
105 22: 'OFPAT_GROUP',
106 23: 'OFPAT_SET_NW_TTL',
107 24: 'OFPAT_DEC_NW_TTL',
108 65535: 'OFPAT_EXPERIMENTER',
109}
110
111# Identifiers from group ofp_bad_action_code
112OFPBAC_BAD_TYPE = 0
113OFPBAC_BAD_LEN = 1
114OFPBAC_BAD_EXPERIMENTER = 2
115OFPBAC_BAD_EXPERIMENTER_TYPE = 3
116OFPBAC_BAD_OUT_PORT = 4
117OFPBAC_BAD_ARGUMENT = 5
118OFPBAC_EPERM = 6
119OFPBAC_TOO_MANY = 7
120OFPBAC_BAD_QUEUE = 8
121OFPBAC_BAD_OUT_GROUP = 9
122OFPBAC_MATCH_INCONSISTENT = 10
123OFPBAC_UNSUPPORTED_ORDER = 11
124OFPBAC_BAD_TAG = 12
125
126ofp_bad_action_code_map = {
127 0: 'OFPBAC_BAD_TYPE',
128 1: 'OFPBAC_BAD_LEN',
129 2: 'OFPBAC_BAD_EXPERIMENTER',
130 3: 'OFPBAC_BAD_EXPERIMENTER_TYPE',
131 4: 'OFPBAC_BAD_OUT_PORT',
132 5: 'OFPBAC_BAD_ARGUMENT',
133 6: 'OFPBAC_EPERM',
134 7: 'OFPBAC_TOO_MANY',
135 8: 'OFPBAC_BAD_QUEUE',
136 9: 'OFPBAC_BAD_OUT_GROUP',
137 10: 'OFPBAC_MATCH_INCONSISTENT',
138 11: 'OFPBAC_UNSUPPORTED_ORDER',
139 12: 'OFPBAC_BAD_TAG',
140}
141
142# Identifiers from group ofp_bad_instruction_code
143OFPBIC_UNKNOWN_INST = 0
144OFPBIC_UNSUP_INST = 1
145OFPBIC_BAD_TABLE_ID = 2
146OFPBIC_UNSUP_METADATA = 3
147OFPBIC_UNSUP_METADATA_MASK = 4
148OFPBIC_UNSUP_EXP_INST = 5
149
150ofp_bad_instruction_code_map = {
151 0: 'OFPBIC_UNKNOWN_INST',
152 1: 'OFPBIC_UNSUP_INST',
153 2: 'OFPBIC_BAD_TABLE_ID',
154 3: 'OFPBIC_UNSUP_METADATA',
155 4: 'OFPBIC_UNSUP_METADATA_MASK',
156 5: 'OFPBIC_UNSUP_EXP_INST',
157}
158
159# Identifiers from group ofp_bad_match_code
160OFPBMC_BAD_TYPE = 0
161OFPBMC_BAD_LEN = 1
162OFPBMC_BAD_TAG = 2
163OFPBMC_BAD_DL_ADDR_MASK = 3
164OFPBMC_BAD_NW_ADDR_MASK = 4
165OFPBMC_BAD_WILDCARDS = 5
166OFPBMC_BAD_FIELD = 6
167OFPBMC_BAD_VALUE = 7
168
169ofp_bad_match_code_map = {
170 0: 'OFPBMC_BAD_TYPE',
171 1: 'OFPBMC_BAD_LEN',
172 2: 'OFPBMC_BAD_TAG',
173 3: 'OFPBMC_BAD_DL_ADDR_MASK',
174 4: 'OFPBMC_BAD_NW_ADDR_MASK',
175 5: 'OFPBMC_BAD_WILDCARDS',
176 6: 'OFPBMC_BAD_FIELD',
177 7: 'OFPBMC_BAD_VALUE',
178}
179
180# Identifiers from group ofp_bad_request_code
181OFPBRC_BAD_VERSION = 0
182OFPBRC_BAD_TYPE = 1
183OFPBRC_BAD_STAT = 2
184OFPBRC_BAD_EXPERIMENTER = 3
185OFPBRC_BAD_SUBTYPE = 4
186OFPBRC_EPERM = 5
187OFPBRC_BAD_LEN = 6
188OFPBRC_BUFFER_EMPTY = 7
189OFPBRC_BUFFER_UNKNOWN = 8
190OFPBRC_BAD_TABLE_ID = 9
191
192ofp_bad_request_code_map = {
193 0: 'OFPBRC_BAD_VERSION',
194 1: 'OFPBRC_BAD_TYPE',
195 2: 'OFPBRC_BAD_STAT',
196 3: 'OFPBRC_BAD_EXPERIMENTER',
197 4: 'OFPBRC_BAD_SUBTYPE',
198 5: 'OFPBRC_EPERM',
199 6: 'OFPBRC_BAD_LEN',
200 7: 'OFPBRC_BUFFER_EMPTY',
201 8: 'OFPBRC_BUFFER_UNKNOWN',
202 9: 'OFPBRC_BAD_TABLE_ID',
203}
204
Rich Lane93b33132014-04-21 12:20:58 -0700205# Identifiers from group ofp_bsn_vport_l2gre_flags
206OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID = 1
207OF_BSN_VPORT_L2GRE_DSCP_ASSIGN = 2
208OF_BSN_VPORT_L2GRE_DSCP_COPY = 4
Rich Lane5587ab12014-06-30 11:19:09 -0700209OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID = 8
Rich Lanef9530c42014-09-15 09:59:43 -0700210OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID = 16
Rich Lane93b33132014-04-21 12:20:58 -0700211
212ofp_bsn_vport_l2gre_flags_map = {
213 1: 'OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID',
214 2: 'OF_BSN_VPORT_L2GRE_DSCP_ASSIGN',
215 4: 'OF_BSN_VPORT_L2GRE_DSCP_COPY',
Rich Lane5587ab12014-06-30 11:19:09 -0700216 8: 'OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID',
Rich Lanef9530c42014-09-15 09:59:43 -0700217 16: 'OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID',
Rich Lane93b33132014-04-21 12:20:58 -0700218}
219
Dan Talaycof6202252013-07-02 01:00:29 -0700220# Identifiers from group ofp_bsn_vport_q_in_q_untagged
221OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
222
223ofp_bsn_vport_q_in_q_untagged_map = {
224 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
225}
226
Rich Laned53156a2013-08-05 17:17:33 -0700227# Identifiers from group ofp_bsn_vport_status
228OF_BSN_VPORT_STATUS_OK = 0
229OF_BSN_VPORT_STATUS_FAILED = 1
230
231ofp_bsn_vport_status_map = {
232 0: 'OF_BSN_VPORT_STATUS_OK',
233 1: 'OF_BSN_VPORT_STATUS_FAILED',
234}
235
Rich Lanec2ee4b82013-04-24 17:12:38 -0700236# Identifiers from group ofp_capabilities
237OFPC_FLOW_STATS = 1
238OFPC_TABLE_STATS = 2
239OFPC_PORT_STATS = 4
240OFPC_GROUP_STATS = 8
241OFPC_IP_REASM = 32
242OFPC_QUEUE_STATS = 64
243OFPC_ARP_MATCH_IP = 128
244
245ofp_capabilities_map = {
246 1: 'OFPC_FLOW_STATS',
247 2: 'OFPC_TABLE_STATS',
248 4: 'OFPC_PORT_STATS',
249 8: 'OFPC_GROUP_STATS',
250 32: 'OFPC_IP_REASM',
251 64: 'OFPC_QUEUE_STATS',
252 128: 'OFPC_ARP_MATCH_IP',
253}
254
255# Identifiers from group ofp_config_flags
256OFPC_FRAG_NORMAL = 0
257OFPC_FRAG_DROP = 1
258OFPC_FRAG_REASM = 2
259OFPC_FRAG_MASK = 3
260OFPC_INVALID_TTL_TO_CONTROLLER = 4
261
262ofp_config_flags_map = {
263 0: 'OFPC_FRAG_NORMAL',
264 1: 'OFPC_FRAG_DROP',
265 2: 'OFPC_FRAG_REASM',
266 3: 'OFPC_FRAG_MASK',
267 4: 'OFPC_INVALID_TTL_TO_CONTROLLER',
268}
269
270# Identifiers from group ofp_error_type
271OFPET_HELLO_FAILED = 0
272OFPET_BAD_REQUEST = 1
273OFPET_BAD_ACTION = 2
274OFPET_BAD_INSTRUCTION = 3
275OFPET_BAD_MATCH = 4
276OFPET_FLOW_MOD_FAILED = 5
277OFPET_GROUP_MOD_FAILED = 6
278OFPET_PORT_MOD_FAILED = 7
279OFPET_TABLE_MOD_FAILED = 8
280OFPET_QUEUE_OP_FAILED = 9
281OFPET_SWITCH_CONFIG_FAILED = 10
282
283ofp_error_type_map = {
284 0: 'OFPET_HELLO_FAILED',
285 1: 'OFPET_BAD_REQUEST',
286 2: 'OFPET_BAD_ACTION',
287 3: 'OFPET_BAD_INSTRUCTION',
288 4: 'OFPET_BAD_MATCH',
289 5: 'OFPET_FLOW_MOD_FAILED',
290 6: 'OFPET_GROUP_MOD_FAILED',
291 7: 'OFPET_PORT_MOD_FAILED',
292 8: 'OFPET_TABLE_MOD_FAILED',
293 9: 'OFPET_QUEUE_OP_FAILED',
294 10: 'OFPET_SWITCH_CONFIG_FAILED',
295}
296
297# Identifiers from group ofp_flow_mod_command
298OFPFC_ADD = 0
299OFPFC_MODIFY = 1
300OFPFC_MODIFY_STRICT = 2
301OFPFC_DELETE = 3
302OFPFC_DELETE_STRICT = 4
303
304ofp_flow_mod_command_map = {
305 0: 'OFPFC_ADD',
306 1: 'OFPFC_MODIFY',
307 2: 'OFPFC_MODIFY_STRICT',
308 3: 'OFPFC_DELETE',
309 4: 'OFPFC_DELETE_STRICT',
310}
311
312# Identifiers from group ofp_flow_mod_failed_code
313OFPFMFC_UNKNOWN = 0
314OFPFMFC_TABLE_FULL = 1
315OFPFMFC_BAD_TABLE_ID = 2
316OFPFMFC_OVERLAP = 3
317OFPFMFC_EPERM = 4
318OFPFMFC_BAD_TIMEOUT = 5
319OFPFMFC_BAD_COMMAND = 6
320
321ofp_flow_mod_failed_code_map = {
322 0: 'OFPFMFC_UNKNOWN',
323 1: 'OFPFMFC_TABLE_FULL',
324 2: 'OFPFMFC_BAD_TABLE_ID',
325 3: 'OFPFMFC_OVERLAP',
326 4: 'OFPFMFC_EPERM',
327 5: 'OFPFMFC_BAD_TIMEOUT',
328 6: 'OFPFMFC_BAD_COMMAND',
329}
330
331# Identifiers from group ofp_flow_mod_flags
332OFPFF_SEND_FLOW_REM = 1
333OFPFF_CHECK_OVERLAP = 2
334
335ofp_flow_mod_flags_map = {
336 1: 'OFPFF_SEND_FLOW_REM',
337 2: 'OFPFF_CHECK_OVERLAP',
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_flow_wildcards
354OFPFW_IN_PORT = 1
355OFPFW_DL_VLAN = 2
356OFPFW_DL_VLAN_PCP = 4
357OFPFW_DL_TYPE = 8
358OFPFW_NW_TOS = 16
359OFPFW_NW_PROTO = 32
360OFPFW_TP_SRC = 64
361OFPFW_TP_DST = 128
362OFPFW_MPLS_LABEL = 256
363OFPFW_MPLS_TC = 512
364OFPFW_ALL = 1023
365
366ofp_flow_wildcards_map = {
367 1: 'OFPFW_IN_PORT',
368 2: 'OFPFW_DL_VLAN',
369 4: 'OFPFW_DL_VLAN_PCP',
370 8: 'OFPFW_DL_TYPE',
371 16: 'OFPFW_NW_TOS',
372 32: 'OFPFW_NW_PROTO',
373 64: 'OFPFW_TP_SRC',
374 128: 'OFPFW_TP_DST',
375 256: 'OFPFW_MPLS_LABEL',
376 512: 'OFPFW_MPLS_TC',
377}
378
379# Identifiers from group ofp_group
380OFPG_MAX = 4294967040
381OFPG_ALL = 4294967292
382OFPG_ANY = 4294967295
383
384ofp_group_map = {
385 4294967040: 'OFPG_MAX',
386 4294967292: 'OFPG_ALL',
387 4294967295: 'OFPG_ANY',
388}
389
390# Identifiers from group ofp_group_mod_command
391OFPGC_ADD = 0
392OFPGC_MODIFY = 1
393OFPGC_DELETE = 2
394
395ofp_group_mod_command_map = {
396 0: 'OFPGC_ADD',
397 1: 'OFPGC_MODIFY',
398 2: 'OFPGC_DELETE',
399}
400
401# Identifiers from group ofp_group_mod_failed_code
402OFPGMFC_GROUP_EXISTS = 0
403OFPGMFC_INVALID_GROUP = 1
404OFPGMFC_WEIGHT_UNSUPPORTED = 2
405OFPGMFC_OUT_OF_GROUPS = 3
406OFPGMFC_OUT_OF_BUCKETS = 4
407OFPGMFC_CHAINING_UNSUPPORTED = 5
408OFPGMFC_WATCH_UNSUPPORTED = 6
409OFPGMFC_LOOP = 7
410OFPGMFC_UNKNOWN_GROUP = 8
411
412ofp_group_mod_failed_code_map = {
413 0: 'OFPGMFC_GROUP_EXISTS',
414 1: 'OFPGMFC_INVALID_GROUP',
415 2: 'OFPGMFC_WEIGHT_UNSUPPORTED',
416 3: 'OFPGMFC_OUT_OF_GROUPS',
417 4: 'OFPGMFC_OUT_OF_BUCKETS',
418 5: 'OFPGMFC_CHAINING_UNSUPPORTED',
419 6: 'OFPGMFC_WATCH_UNSUPPORTED',
420 7: 'OFPGMFC_LOOP',
421 8: 'OFPGMFC_UNKNOWN_GROUP',
422}
423
424# Identifiers from group ofp_group_type
425OFPGT_ALL = 0
426OFPGT_SELECT = 1
427OFPGT_INDIRECT = 2
428OFPGT_FF = 3
429
430ofp_group_type_map = {
431 0: 'OFPGT_ALL',
432 1: 'OFPGT_SELECT',
433 2: 'OFPGT_INDIRECT',
434 3: 'OFPGT_FF',
435}
436
437# Identifiers from group ofp_hello_failed_code
438OFPHFC_INCOMPATIBLE = 0
439OFPHFC_EPERM = 1
440
441ofp_hello_failed_code_map = {
442 0: 'OFPHFC_INCOMPATIBLE',
443 1: 'OFPHFC_EPERM',
444}
445
446# Identifiers from group ofp_instruction_type
447OFPIT_GOTO_TABLE = 1
448OFPIT_WRITE_METADATA = 2
449OFPIT_WRITE_ACTIONS = 3
450OFPIT_APPLY_ACTIONS = 4
451OFPIT_CLEAR_ACTIONS = 5
452OFPIT_EXPERIMENTER = 65535
453
454ofp_instruction_type_map = {
455 1: 'OFPIT_GOTO_TABLE',
456 2: 'OFPIT_WRITE_METADATA',
457 3: 'OFPIT_WRITE_ACTIONS',
458 4: 'OFPIT_APPLY_ACTIONS',
459 5: 'OFPIT_CLEAR_ACTIONS',
460 65535: 'OFPIT_EXPERIMENTER',
461}
462
463# Identifiers from group ofp_match_type
464OFPMT_STANDARD = 0
465
466ofp_match_type_map = {
467 0: 'OFPMT_STANDARD',
468}
469
470# Identifiers from group ofp_packet_in_reason
471OFPR_NO_MATCH = 0
472OFPR_ACTION = 1
473
474ofp_packet_in_reason_map = {
475 0: 'OFPR_NO_MATCH',
476 1: 'OFPR_ACTION',
477}
478
479# Identifiers from group ofp_port
480OFPP_MAX = 4294967040
481OFPP_IN_PORT = 4294967288
482OFPP_TABLE = 4294967289
483OFPP_NORMAL = 4294967290
484OFPP_FLOOD = 4294967291
485OFPP_ALL = 4294967292
486OFPP_CONTROLLER = 4294967293
487OFPP_LOCAL = 4294967294
Rich Laned9e3f7b2013-11-04 11:40:43 -0800488OFPP_ANY = 4294967295
Rich Lanec2ee4b82013-04-24 17:12:38 -0700489
490ofp_port_map = {
491 4294967040: 'OFPP_MAX',
492 4294967288: 'OFPP_IN_PORT',
493 4294967289: 'OFPP_TABLE',
494 4294967290: 'OFPP_NORMAL',
495 4294967291: 'OFPP_FLOOD',
496 4294967292: 'OFPP_ALL',
497 4294967293: 'OFPP_CONTROLLER',
498 4294967294: 'OFPP_LOCAL',
Rich Laned9e3f7b2013-11-04 11:40:43 -0800499 4294967295: 'OFPP_ANY',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700500}
501
502# Identifiers from group ofp_port_config
503OFPPC_PORT_DOWN = 1
504OFPPC_NO_RECV = 4
505OFPPC_NO_FWD = 32
506OFPPC_NO_PACKET_IN = 64
Rich Lane6f4978c2013-10-20 21:33:52 -0700507OFPPC_BSN_MIRROR_DEST = 2147483648
Rich Lanec2ee4b82013-04-24 17:12:38 -0700508
509ofp_port_config_map = {
510 1: 'OFPPC_PORT_DOWN',
511 4: 'OFPPC_NO_RECV',
512 32: 'OFPPC_NO_FWD',
513 64: 'OFPPC_NO_PACKET_IN',
Rich Lane6f4978c2013-10-20 21:33:52 -0700514 2147483648: 'OFPPC_BSN_MIRROR_DEST',
Rich Lanec2ee4b82013-04-24 17:12:38 -0700515}
516
517# Identifiers from group ofp_port_features
518OFPPF_10MB_HD = 1
519OFPPF_10MB_FD = 2
520OFPPF_100MB_HD = 4
521OFPPF_100MB_FD = 8
522OFPPF_1GB_HD = 16
523OFPPF_1GB_FD = 32
524OFPPF_10GB_FD = 64
525OFPPF_40GB_FD = 128
526OFPPF_100GB_FD = 256
527OFPPF_1TB_FD = 512
528OFPPF_OTHER = 1024
529OFPPF_COPPER = 2048
530OFPPF_FIBER = 4096
531OFPPF_AUTONEG = 8192
532OFPPF_PAUSE = 16384
533OFPPF_PAUSE_ASYM = 32768
534
535ofp_port_features_map = {
536 1: 'OFPPF_10MB_HD',
537 2: 'OFPPF_10MB_FD',
538 4: 'OFPPF_100MB_HD',
539 8: 'OFPPF_100MB_FD',
540 16: 'OFPPF_1GB_HD',
541 32: 'OFPPF_1GB_FD',
542 64: 'OFPPF_10GB_FD',
543 128: 'OFPPF_40GB_FD',
544 256: 'OFPPF_100GB_FD',
545 512: 'OFPPF_1TB_FD',
546 1024: 'OFPPF_OTHER',
547 2048: 'OFPPF_COPPER',
548 4096: 'OFPPF_FIBER',
549 8192: 'OFPPF_AUTONEG',
550 16384: 'OFPPF_PAUSE',
551 32768: 'OFPPF_PAUSE_ASYM',
552}
553
554# Identifiers from group ofp_port_mod_failed_code
555OFPPMFC_BAD_PORT = 0
556OFPPMFC_BAD_HW_ADDR = 1
557OFPPMFC_BAD_CONFIG = 2
558OFPPMFC_BAD_ADVERTISE = 3
559
560ofp_port_mod_failed_code_map = {
561 0: 'OFPPMFC_BAD_PORT',
562 1: 'OFPPMFC_BAD_HW_ADDR',
563 2: 'OFPPMFC_BAD_CONFIG',
564 3: 'OFPPMFC_BAD_ADVERTISE',
565}
566
Rich Lanec2ee4b82013-04-24 17:12:38 -0700567# Identifiers from group ofp_port_reason
568OFPPR_ADD = 0
569OFPPR_DELETE = 1
570OFPPR_MODIFY = 2
571
572ofp_port_reason_map = {
573 0: 'OFPPR_ADD',
574 1: 'OFPPR_DELETE',
575 2: 'OFPPR_MODIFY',
576}
577
578# Identifiers from group ofp_port_state
579OFPPS_LINK_DOWN = 1
580OFPPS_BLOCKED = 2
581OFPPS_LIVE = 4
582
583ofp_port_state_map = {
584 1: 'OFPPS_LINK_DOWN',
585 2: 'OFPPS_BLOCKED',
586 4: 'OFPPS_LIVE',
587}
588
589# Identifiers from group ofp_queue_op_failed_code
590OFPQOFC_BAD_PORT = 0
591OFPQOFC_BAD_QUEUE = 1
592OFPQOFC_EPERM = 2
593
594ofp_queue_op_failed_code_map = {
595 0: 'OFPQOFC_BAD_PORT',
596 1: 'OFPQOFC_BAD_QUEUE',
597 2: 'OFPQOFC_EPERM',
598}
599
600# Identifiers from group ofp_queue_properties
601OFPQT_NONE = 0
602OFPQT_MIN_RATE = 1
603
604ofp_queue_properties_map = {
605 0: 'OFPQT_NONE',
606 1: 'OFPQT_MIN_RATE',
607}
608
609# Identifiers from group ofp_stats_reply_flags
610OFPSF_REPLY_MORE = 1
611
612ofp_stats_reply_flags_map = {
613 1: 'OFPSF_REPLY_MORE',
614}
615
Rich Laned9e3f7b2013-11-04 11:40:43 -0800616# Identifiers from group ofp_stats_request_flags
617
618ofp_stats_request_flags_map = {
619}
620
Rich Lane6f4978c2013-10-20 21:33:52 -0700621# Identifiers from group ofp_stats_type
Rich Lanec2ee4b82013-04-24 17:12:38 -0700622OFPST_DESC = 0
623OFPST_FLOW = 1
624OFPST_AGGREGATE = 2
625OFPST_TABLE = 3
626OFPST_PORT = 4
627OFPST_QUEUE = 5
628OFPST_GROUP = 6
629OFPST_GROUP_DESC = 7
630OFPST_EXPERIMENTER = 65535
631
Rich Lane6f4978c2013-10-20 21:33:52 -0700632ofp_stats_type_map = {
Rich Lanec2ee4b82013-04-24 17:12:38 -0700633 0: 'OFPST_DESC',
634 1: 'OFPST_FLOW',
635 2: 'OFPST_AGGREGATE',
636 3: 'OFPST_TABLE',
637 4: 'OFPST_PORT',
638 5: 'OFPST_QUEUE',
639 6: 'OFPST_GROUP',
640 7: 'OFPST_GROUP_DESC',
641 65535: 'OFPST_EXPERIMENTER',
642}
643
644# Identifiers from group ofp_switch_config_failed_code
645OFPSCFC_BAD_FLAGS = 0
646OFPSCFC_BAD_LEN = 1
647
648ofp_switch_config_failed_code_map = {
649 0: 'OFPSCFC_BAD_FLAGS',
650 1: 'OFPSCFC_BAD_LEN',
651}
652
653# Identifiers from group ofp_table_config
654OFPTC_TABLE_MISS_CONTROLLER = 0
655OFPTC_TABLE_MISS_CONTINUE = 1
656OFPTC_TABLE_MISS_DROP = 2
657OFPTC_TABLE_MISS_MASK = 3
658
659ofp_table_config_map = {
660 0: 'OFPTC_TABLE_MISS_CONTROLLER',
661 1: 'OFPTC_TABLE_MISS_CONTINUE',
662 2: 'OFPTC_TABLE_MISS_DROP',
663 3: 'OFPTC_TABLE_MISS_MASK',
664}
665
666# Identifiers from group ofp_table_mod_failed_code
667OFPTMFC_BAD_TABLE = 0
668OFPTMFC_BAD_CONFIG = 1
669
670ofp_table_mod_failed_code_map = {
671 0: 'OFPTMFC_BAD_TABLE',
672 1: 'OFPTMFC_BAD_CONFIG',
673}
674
675# Identifiers from group ofp_type
676OFPT_HELLO = 0
677OFPT_ERROR = 1
678OFPT_ECHO_REQUEST = 2
679OFPT_ECHO_REPLY = 3
680OFPT_EXPERIMENTER = 4
681OFPT_FEATURES_REQUEST = 5
682OFPT_FEATURES_REPLY = 6
683OFPT_GET_CONFIG_REQUEST = 7
684OFPT_GET_CONFIG_REPLY = 8
685OFPT_SET_CONFIG = 9
686OFPT_PACKET_IN = 10
687OFPT_FLOW_REMOVED = 11
688OFPT_PORT_STATUS = 12
689OFPT_PACKET_OUT = 13
690OFPT_FLOW_MOD = 14
691OFPT_GROUP_MOD = 15
692OFPT_PORT_MOD = 16
693OFPT_TABLE_MOD = 17
694OFPT_STATS_REQUEST = 18
695OFPT_STATS_REPLY = 19
696OFPT_BARRIER_REQUEST = 20
697OFPT_BARRIER_REPLY = 21
698OFPT_QUEUE_GET_CONFIG_REQUEST = 22
699OFPT_QUEUE_GET_CONFIG_REPLY = 23
700
701ofp_type_map = {
702 0: 'OFPT_HELLO',
703 1: 'OFPT_ERROR',
704 2: 'OFPT_ECHO_REQUEST',
705 3: 'OFPT_ECHO_REPLY',
706 4: 'OFPT_EXPERIMENTER',
707 5: 'OFPT_FEATURES_REQUEST',
708 6: 'OFPT_FEATURES_REPLY',
709 7: 'OFPT_GET_CONFIG_REQUEST',
710 8: 'OFPT_GET_CONFIG_REPLY',
711 9: 'OFPT_SET_CONFIG',
712 10: 'OFPT_PACKET_IN',
713 11: 'OFPT_FLOW_REMOVED',
714 12: 'OFPT_PORT_STATUS',
715 13: 'OFPT_PACKET_OUT',
716 14: 'OFPT_FLOW_MOD',
717 15: 'OFPT_GROUP_MOD',
718 16: 'OFPT_PORT_MOD',
719 17: 'OFPT_TABLE_MOD',
720 18: 'OFPT_STATS_REQUEST',
721 19: 'OFPT_STATS_REPLY',
722 20: 'OFPT_BARRIER_REQUEST',
723 21: 'OFPT_BARRIER_REPLY',
724 22: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
725 23: 'OFPT_QUEUE_GET_CONFIG_REPLY',
726}
727
728# Identifiers from group ofp_vlan_id
729OFPVID_ANY = 65534
730OFPVID_NONE = 65535
731
732ofp_vlan_id_map = {
733 65534: 'OFPVID_ANY',
734 65535: 'OFPVID_NONE',
735}
736