Matteo Scandolo | a229eca | 2017-08-08 13:05:28 -0700 | [diff] [blame] | 1 | |
| 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 Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 17 | # 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 Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 20 | # See the file LICENSE.pyloxi which should have been included in the source distribution |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 21 | |
| 22 | # Automatically generated by LOXI from template const.py |
| 23 | # Do not modify |
| 24 | |
| 25 | OFP_VERSION = 2 |
| 26 | |
| 27 | # Identifiers from group macro_definitions |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 28 | OFP_MAX_TABLE_NAME_LEN = 32 |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 29 | OFP_MAX_PORT_NAME_LEN = 16 |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 30 | OFP_TCP_PORT = 6653 |
| 31 | OFP_SSL_PORT = 6653 |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 32 | OFP_ETH_ALEN = 6 |
| 33 | OFP_DEFAULT_MISS_SEND_LEN = 128 |
| 34 | OFPFW_ICMP_TYPE = 64 |
| 35 | OFPFW_ICMP_CODE = 128 |
| 36 | OFP_DL_TYPE_ETH2_CUTOFF = 1536 |
| 37 | OFP_DL_TYPE_NOT_ETH_TYPE = 1535 |
| 38 | OFP_VLAN_NONE = 0 |
| 39 | OFPMT_STANDARD_LENGTH = 88 |
| 40 | OFP_FLOW_PERMANENT = 0 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 41 | OFP_DEFAULT_PRIORITY = 32768 |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 42 | DESC_STR_LEN = 256 |
| 43 | SERIAL_NUM_LEN = 32 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 44 | OFPQ_ALL = 4294967295 |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 45 | OFPQ_MIN_RATE_UNCFG = 65535 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 46 | |
Rich Lane | 2e079da | 2014-10-29 15:30:24 -0700 | [diff] [blame] | 47 | # Identifiers from group of_bsn_pdu_slot_num |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 48 | BSN_PDU_SLOT_NUM_ANY = 255 |
| 49 | |
Rich Lane | 2e079da | 2014-10-29 15:30:24 -0700 | [diff] [blame] | 50 | of_bsn_pdu_slot_num_map = { |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 51 | 255: 'BSN_PDU_SLOT_NUM_ANY', |
| 52 | } |
| 53 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 54 | # Identifiers from group ofp_action_type |
| 55 | OFPAT_OUTPUT = 0 |
| 56 | OFPAT_SET_VLAN_VID = 1 |
| 57 | OFPAT_SET_VLAN_PCP = 2 |
| 58 | OFPAT_SET_DL_SRC = 3 |
| 59 | OFPAT_SET_DL_DST = 4 |
| 60 | OFPAT_SET_NW_SRC = 5 |
| 61 | OFPAT_SET_NW_DST = 6 |
| 62 | OFPAT_SET_NW_TOS = 7 |
| 63 | OFPAT_SET_NW_ECN = 8 |
| 64 | OFPAT_SET_TP_SRC = 9 |
| 65 | OFPAT_SET_TP_DST = 10 |
| 66 | OFPAT_COPY_TTL_OUT = 11 |
| 67 | OFPAT_COPY_TTL_IN = 12 |
| 68 | OFPAT_SET_MPLS_LABEL = 13 |
| 69 | OFPAT_SET_MPLS_TC = 14 |
| 70 | OFPAT_SET_MPLS_TTL = 15 |
| 71 | OFPAT_DEC_MPLS_TTL = 16 |
| 72 | OFPAT_PUSH_VLAN = 17 |
| 73 | OFPAT_POP_VLAN = 18 |
| 74 | OFPAT_PUSH_MPLS = 19 |
| 75 | OFPAT_POP_MPLS = 20 |
| 76 | OFPAT_SET_QUEUE = 21 |
| 77 | OFPAT_GROUP = 22 |
| 78 | OFPAT_SET_NW_TTL = 23 |
| 79 | OFPAT_DEC_NW_TTL = 24 |
| 80 | OFPAT_EXPERIMENTER = 65535 |
| 81 | |
| 82 | ofp_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 |
| 112 | OFPBAC_BAD_TYPE = 0 |
| 113 | OFPBAC_BAD_LEN = 1 |
| 114 | OFPBAC_BAD_EXPERIMENTER = 2 |
| 115 | OFPBAC_BAD_EXPERIMENTER_TYPE = 3 |
| 116 | OFPBAC_BAD_OUT_PORT = 4 |
| 117 | OFPBAC_BAD_ARGUMENT = 5 |
| 118 | OFPBAC_EPERM = 6 |
| 119 | OFPBAC_TOO_MANY = 7 |
| 120 | OFPBAC_BAD_QUEUE = 8 |
| 121 | OFPBAC_BAD_OUT_GROUP = 9 |
| 122 | OFPBAC_MATCH_INCONSISTENT = 10 |
| 123 | OFPBAC_UNSUPPORTED_ORDER = 11 |
| 124 | OFPBAC_BAD_TAG = 12 |
| 125 | |
| 126 | ofp_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 |
| 143 | OFPBIC_UNKNOWN_INST = 0 |
| 144 | OFPBIC_UNSUP_INST = 1 |
| 145 | OFPBIC_BAD_TABLE_ID = 2 |
| 146 | OFPBIC_UNSUP_METADATA = 3 |
| 147 | OFPBIC_UNSUP_METADATA_MASK = 4 |
| 148 | OFPBIC_UNSUP_EXP_INST = 5 |
| 149 | |
| 150 | ofp_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 |
| 160 | OFPBMC_BAD_TYPE = 0 |
| 161 | OFPBMC_BAD_LEN = 1 |
| 162 | OFPBMC_BAD_TAG = 2 |
| 163 | OFPBMC_BAD_DL_ADDR_MASK = 3 |
| 164 | OFPBMC_BAD_NW_ADDR_MASK = 4 |
| 165 | OFPBMC_BAD_WILDCARDS = 5 |
| 166 | OFPBMC_BAD_FIELD = 6 |
| 167 | OFPBMC_BAD_VALUE = 7 |
| 168 | |
| 169 | ofp_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 |
| 181 | OFPBRC_BAD_VERSION = 0 |
| 182 | OFPBRC_BAD_TYPE = 1 |
| 183 | OFPBRC_BAD_STAT = 2 |
| 184 | OFPBRC_BAD_EXPERIMENTER = 3 |
| 185 | OFPBRC_BAD_SUBTYPE = 4 |
| 186 | OFPBRC_EPERM = 5 |
| 187 | OFPBRC_BAD_LEN = 6 |
| 188 | OFPBRC_BUFFER_EMPTY = 7 |
| 189 | OFPBRC_BUFFER_UNKNOWN = 8 |
| 190 | OFPBRC_BAD_TABLE_ID = 9 |
| 191 | |
| 192 | ofp_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 Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 205 | # Identifiers from group ofp_bsn_vport_l2gre_flags |
| 206 | OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID = 1 |
| 207 | OF_BSN_VPORT_L2GRE_DSCP_ASSIGN = 2 |
| 208 | OF_BSN_VPORT_L2GRE_DSCP_COPY = 4 |
Rich Lane | 5587ab1 | 2014-06-30 11:19:09 -0700 | [diff] [blame] | 209 | OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID = 8 |
Rich Lane | f9530c4 | 2014-09-15 09:59:43 -0700 | [diff] [blame] | 210 | OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID = 16 |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 211 | |
| 212 | ofp_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 Lane | 5587ab1 | 2014-06-30 11:19:09 -0700 | [diff] [blame] | 216 | 8: 'OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID', |
Rich Lane | f9530c4 | 2014-09-15 09:59:43 -0700 | [diff] [blame] | 217 | 16: 'OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID', |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 218 | } |
| 219 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 220 | # Identifiers from group ofp_bsn_vport_q_in_q_untagged |
| 221 | OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535 |
| 222 | |
| 223 | ofp_bsn_vport_q_in_q_untagged_map = { |
| 224 | 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED', |
| 225 | } |
| 226 | |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 227 | # Identifiers from group ofp_bsn_vport_status |
| 228 | OF_BSN_VPORT_STATUS_OK = 0 |
| 229 | OF_BSN_VPORT_STATUS_FAILED = 1 |
| 230 | |
| 231 | ofp_bsn_vport_status_map = { |
| 232 | 0: 'OF_BSN_VPORT_STATUS_OK', |
| 233 | 1: 'OF_BSN_VPORT_STATUS_FAILED', |
| 234 | } |
| 235 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 236 | # Identifiers from group ofp_capabilities |
| 237 | OFPC_FLOW_STATS = 1 |
| 238 | OFPC_TABLE_STATS = 2 |
| 239 | OFPC_PORT_STATS = 4 |
| 240 | OFPC_GROUP_STATS = 8 |
| 241 | OFPC_IP_REASM = 32 |
| 242 | OFPC_QUEUE_STATS = 64 |
| 243 | OFPC_ARP_MATCH_IP = 128 |
| 244 | |
| 245 | ofp_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 |
| 256 | OFPC_FRAG_NORMAL = 0 |
| 257 | OFPC_FRAG_DROP = 1 |
| 258 | OFPC_FRAG_REASM = 2 |
| 259 | OFPC_FRAG_MASK = 3 |
| 260 | OFPC_INVALID_TTL_TO_CONTROLLER = 4 |
| 261 | |
| 262 | ofp_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 |
| 271 | OFPET_HELLO_FAILED = 0 |
| 272 | OFPET_BAD_REQUEST = 1 |
| 273 | OFPET_BAD_ACTION = 2 |
| 274 | OFPET_BAD_INSTRUCTION = 3 |
| 275 | OFPET_BAD_MATCH = 4 |
| 276 | OFPET_FLOW_MOD_FAILED = 5 |
| 277 | OFPET_GROUP_MOD_FAILED = 6 |
| 278 | OFPET_PORT_MOD_FAILED = 7 |
| 279 | OFPET_TABLE_MOD_FAILED = 8 |
| 280 | OFPET_QUEUE_OP_FAILED = 9 |
| 281 | OFPET_SWITCH_CONFIG_FAILED = 10 |
| 282 | |
| 283 | ofp_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 |
| 298 | OFPFC_ADD = 0 |
| 299 | OFPFC_MODIFY = 1 |
| 300 | OFPFC_MODIFY_STRICT = 2 |
| 301 | OFPFC_DELETE = 3 |
| 302 | OFPFC_DELETE_STRICT = 4 |
| 303 | |
| 304 | ofp_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 |
| 313 | OFPFMFC_UNKNOWN = 0 |
| 314 | OFPFMFC_TABLE_FULL = 1 |
| 315 | OFPFMFC_BAD_TABLE_ID = 2 |
| 316 | OFPFMFC_OVERLAP = 3 |
| 317 | OFPFMFC_EPERM = 4 |
| 318 | OFPFMFC_BAD_TIMEOUT = 5 |
| 319 | OFPFMFC_BAD_COMMAND = 6 |
| 320 | |
| 321 | ofp_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 |
| 332 | OFPFF_SEND_FLOW_REM = 1 |
| 333 | OFPFF_CHECK_OVERLAP = 2 |
| 334 | |
| 335 | ofp_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 |
| 341 | OFPRR_IDLE_TIMEOUT = 0 |
| 342 | OFPRR_HARD_TIMEOUT = 1 |
| 343 | OFPRR_DELETE = 2 |
| 344 | OFPRR_GROUP_DELETE = 3 |
| 345 | |
| 346 | ofp_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 |
| 354 | OFPFW_IN_PORT = 1 |
| 355 | OFPFW_DL_VLAN = 2 |
| 356 | OFPFW_DL_VLAN_PCP = 4 |
| 357 | OFPFW_DL_TYPE = 8 |
| 358 | OFPFW_NW_TOS = 16 |
| 359 | OFPFW_NW_PROTO = 32 |
| 360 | OFPFW_TP_SRC = 64 |
| 361 | OFPFW_TP_DST = 128 |
| 362 | OFPFW_MPLS_LABEL = 256 |
| 363 | OFPFW_MPLS_TC = 512 |
| 364 | OFPFW_ALL = 1023 |
| 365 | |
| 366 | ofp_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 |
| 380 | OFPG_MAX = 4294967040 |
| 381 | OFPG_ALL = 4294967292 |
| 382 | OFPG_ANY = 4294967295 |
| 383 | |
| 384 | ofp_group_map = { |
| 385 | 4294967040: 'OFPG_MAX', |
| 386 | 4294967292: 'OFPG_ALL', |
| 387 | 4294967295: 'OFPG_ANY', |
| 388 | } |
| 389 | |
| 390 | # Identifiers from group ofp_group_mod_command |
| 391 | OFPGC_ADD = 0 |
| 392 | OFPGC_MODIFY = 1 |
| 393 | OFPGC_DELETE = 2 |
| 394 | |
| 395 | ofp_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 |
| 402 | OFPGMFC_GROUP_EXISTS = 0 |
| 403 | OFPGMFC_INVALID_GROUP = 1 |
| 404 | OFPGMFC_WEIGHT_UNSUPPORTED = 2 |
| 405 | OFPGMFC_OUT_OF_GROUPS = 3 |
| 406 | OFPGMFC_OUT_OF_BUCKETS = 4 |
| 407 | OFPGMFC_CHAINING_UNSUPPORTED = 5 |
| 408 | OFPGMFC_WATCH_UNSUPPORTED = 6 |
| 409 | OFPGMFC_LOOP = 7 |
| 410 | OFPGMFC_UNKNOWN_GROUP = 8 |
| 411 | |
| 412 | ofp_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 |
| 425 | OFPGT_ALL = 0 |
| 426 | OFPGT_SELECT = 1 |
| 427 | OFPGT_INDIRECT = 2 |
| 428 | OFPGT_FF = 3 |
| 429 | |
| 430 | ofp_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 |
| 438 | OFPHFC_INCOMPATIBLE = 0 |
| 439 | OFPHFC_EPERM = 1 |
| 440 | |
| 441 | ofp_hello_failed_code_map = { |
| 442 | 0: 'OFPHFC_INCOMPATIBLE', |
| 443 | 1: 'OFPHFC_EPERM', |
| 444 | } |
| 445 | |
| 446 | # Identifiers from group ofp_instruction_type |
| 447 | OFPIT_GOTO_TABLE = 1 |
| 448 | OFPIT_WRITE_METADATA = 2 |
| 449 | OFPIT_WRITE_ACTIONS = 3 |
| 450 | OFPIT_APPLY_ACTIONS = 4 |
| 451 | OFPIT_CLEAR_ACTIONS = 5 |
| 452 | OFPIT_EXPERIMENTER = 65535 |
| 453 | |
| 454 | ofp_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 |
| 464 | OFPMT_STANDARD = 0 |
| 465 | |
| 466 | ofp_match_type_map = { |
| 467 | 0: 'OFPMT_STANDARD', |
| 468 | } |
| 469 | |
| 470 | # Identifiers from group ofp_packet_in_reason |
| 471 | OFPR_NO_MATCH = 0 |
| 472 | OFPR_ACTION = 1 |
| 473 | |
| 474 | ofp_packet_in_reason_map = { |
| 475 | 0: 'OFPR_NO_MATCH', |
| 476 | 1: 'OFPR_ACTION', |
| 477 | } |
| 478 | |
| 479 | # Identifiers from group ofp_port |
| 480 | OFPP_MAX = 4294967040 |
| 481 | OFPP_IN_PORT = 4294967288 |
| 482 | OFPP_TABLE = 4294967289 |
| 483 | OFPP_NORMAL = 4294967290 |
| 484 | OFPP_FLOOD = 4294967291 |
| 485 | OFPP_ALL = 4294967292 |
| 486 | OFPP_CONTROLLER = 4294967293 |
| 487 | OFPP_LOCAL = 4294967294 |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 488 | OFPP_ANY = 4294967295 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 489 | |
| 490 | ofp_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 Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 499 | 4294967295: 'OFPP_ANY', |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 500 | } |
| 501 | |
| 502 | # Identifiers from group ofp_port_config |
| 503 | OFPPC_PORT_DOWN = 1 |
| 504 | OFPPC_NO_RECV = 4 |
| 505 | OFPPC_NO_FWD = 32 |
| 506 | OFPPC_NO_PACKET_IN = 64 |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 507 | OFPPC_BSN_MIRROR_DEST = 2147483648 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 508 | |
| 509 | ofp_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 Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 514 | 2147483648: 'OFPPC_BSN_MIRROR_DEST', |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 515 | } |
| 516 | |
| 517 | # Identifiers from group ofp_port_features |
| 518 | OFPPF_10MB_HD = 1 |
| 519 | OFPPF_10MB_FD = 2 |
| 520 | OFPPF_100MB_HD = 4 |
| 521 | OFPPF_100MB_FD = 8 |
| 522 | OFPPF_1GB_HD = 16 |
| 523 | OFPPF_1GB_FD = 32 |
| 524 | OFPPF_10GB_FD = 64 |
| 525 | OFPPF_40GB_FD = 128 |
| 526 | OFPPF_100GB_FD = 256 |
| 527 | OFPPF_1TB_FD = 512 |
| 528 | OFPPF_OTHER = 1024 |
| 529 | OFPPF_COPPER = 2048 |
| 530 | OFPPF_FIBER = 4096 |
| 531 | OFPPF_AUTONEG = 8192 |
| 532 | OFPPF_PAUSE = 16384 |
| 533 | OFPPF_PAUSE_ASYM = 32768 |
| 534 | |
| 535 | ofp_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 |
| 555 | OFPPMFC_BAD_PORT = 0 |
| 556 | OFPPMFC_BAD_HW_ADDR = 1 |
| 557 | OFPPMFC_BAD_CONFIG = 2 |
| 558 | OFPPMFC_BAD_ADVERTISE = 3 |
| 559 | |
| 560 | ofp_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 Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 567 | # Identifiers from group ofp_port_reason |
| 568 | OFPPR_ADD = 0 |
| 569 | OFPPR_DELETE = 1 |
| 570 | OFPPR_MODIFY = 2 |
| 571 | |
| 572 | ofp_port_reason_map = { |
| 573 | 0: 'OFPPR_ADD', |
| 574 | 1: 'OFPPR_DELETE', |
| 575 | 2: 'OFPPR_MODIFY', |
| 576 | } |
| 577 | |
| 578 | # Identifiers from group ofp_port_state |
| 579 | OFPPS_LINK_DOWN = 1 |
| 580 | OFPPS_BLOCKED = 2 |
| 581 | OFPPS_LIVE = 4 |
| 582 | |
| 583 | ofp_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 |
| 590 | OFPQOFC_BAD_PORT = 0 |
| 591 | OFPQOFC_BAD_QUEUE = 1 |
| 592 | OFPQOFC_EPERM = 2 |
| 593 | |
| 594 | ofp_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 |
| 601 | OFPQT_NONE = 0 |
| 602 | OFPQT_MIN_RATE = 1 |
| 603 | |
| 604 | ofp_queue_properties_map = { |
| 605 | 0: 'OFPQT_NONE', |
| 606 | 1: 'OFPQT_MIN_RATE', |
| 607 | } |
| 608 | |
| 609 | # Identifiers from group ofp_stats_reply_flags |
| 610 | OFPSF_REPLY_MORE = 1 |
| 611 | |
| 612 | ofp_stats_reply_flags_map = { |
| 613 | 1: 'OFPSF_REPLY_MORE', |
| 614 | } |
| 615 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 616 | # Identifiers from group ofp_stats_request_flags |
| 617 | |
| 618 | ofp_stats_request_flags_map = { |
| 619 | } |
| 620 | |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 621 | # Identifiers from group ofp_stats_type |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 622 | OFPST_DESC = 0 |
| 623 | OFPST_FLOW = 1 |
| 624 | OFPST_AGGREGATE = 2 |
| 625 | OFPST_TABLE = 3 |
| 626 | OFPST_PORT = 4 |
| 627 | OFPST_QUEUE = 5 |
| 628 | OFPST_GROUP = 6 |
| 629 | OFPST_GROUP_DESC = 7 |
| 630 | OFPST_EXPERIMENTER = 65535 |
| 631 | |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 632 | ofp_stats_type_map = { |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 633 | 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 |
| 645 | OFPSCFC_BAD_FLAGS = 0 |
| 646 | OFPSCFC_BAD_LEN = 1 |
| 647 | |
| 648 | ofp_switch_config_failed_code_map = { |
| 649 | 0: 'OFPSCFC_BAD_FLAGS', |
| 650 | 1: 'OFPSCFC_BAD_LEN', |
| 651 | } |
| 652 | |
| 653 | # Identifiers from group ofp_table_config |
| 654 | OFPTC_TABLE_MISS_CONTROLLER = 0 |
| 655 | OFPTC_TABLE_MISS_CONTINUE = 1 |
| 656 | OFPTC_TABLE_MISS_DROP = 2 |
| 657 | OFPTC_TABLE_MISS_MASK = 3 |
| 658 | |
| 659 | ofp_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 |
| 667 | OFPTMFC_BAD_TABLE = 0 |
| 668 | OFPTMFC_BAD_CONFIG = 1 |
| 669 | |
| 670 | ofp_table_mod_failed_code_map = { |
| 671 | 0: 'OFPTMFC_BAD_TABLE', |
| 672 | 1: 'OFPTMFC_BAD_CONFIG', |
| 673 | } |
| 674 | |
| 675 | # Identifiers from group ofp_type |
| 676 | OFPT_HELLO = 0 |
| 677 | OFPT_ERROR = 1 |
| 678 | OFPT_ECHO_REQUEST = 2 |
| 679 | OFPT_ECHO_REPLY = 3 |
| 680 | OFPT_EXPERIMENTER = 4 |
| 681 | OFPT_FEATURES_REQUEST = 5 |
| 682 | OFPT_FEATURES_REPLY = 6 |
| 683 | OFPT_GET_CONFIG_REQUEST = 7 |
| 684 | OFPT_GET_CONFIG_REPLY = 8 |
| 685 | OFPT_SET_CONFIG = 9 |
| 686 | OFPT_PACKET_IN = 10 |
| 687 | OFPT_FLOW_REMOVED = 11 |
| 688 | OFPT_PORT_STATUS = 12 |
| 689 | OFPT_PACKET_OUT = 13 |
| 690 | OFPT_FLOW_MOD = 14 |
| 691 | OFPT_GROUP_MOD = 15 |
| 692 | OFPT_PORT_MOD = 16 |
| 693 | OFPT_TABLE_MOD = 17 |
| 694 | OFPT_STATS_REQUEST = 18 |
| 695 | OFPT_STATS_REPLY = 19 |
| 696 | OFPT_BARRIER_REQUEST = 20 |
| 697 | OFPT_BARRIER_REPLY = 21 |
| 698 | OFPT_QUEUE_GET_CONFIG_REQUEST = 22 |
| 699 | OFPT_QUEUE_GET_CONFIG_REPLY = 23 |
| 700 | |
| 701 | ofp_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 |
| 729 | OFPVID_ANY = 65534 |
| 730 | OFPVID_NONE = 65535 |
| 731 | |
| 732 | ofp_vlan_id_map = { |
| 733 | 65534: 'OFPVID_ANY', |
| 734 | 65535: 'OFPVID_NONE', |
| 735 | } |
| 736 | |