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