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 | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 21 | |
| 22 | # Automatically generated by LOXI from template const.py |
| 23 | # Do not modify |
| 24 | |
| 25 | OFP_VERSION = 1 |
| 26 | |
| 27 | # Identifiers from group macro_definitions |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -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 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 34 | OFP_VLAN_NONE = 65535 |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 35 | OFPFW_ICMP_TYPE = 64 |
| 36 | OFPFW_ICMP_CODE = 128 |
| 37 | OFP_DL_TYPE_ETH2_CUTOFF = 1536 |
| 38 | OFP_DL_TYPE_NOT_ETH_TYPE = 1535 |
| 39 | OFP_FLOW_PERMANENT = 0 |
| 40 | OFP_DEFAULT_PRIORITY = 32768 |
| 41 | DESC_STR_LEN = 256 |
| 42 | SERIAL_NUM_LEN = 32 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 43 | OFPQ_ALL = 4294967295 |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 44 | OFPQ_MIN_RATE_UNCFG = 65535 |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 45 | |
Rich Lane | 2e079da | 2014-10-29 15:30:24 -0700 | [diff] [blame] | 46 | # Identifiers from group of_bsn_pdu_slot_num |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 47 | BSN_PDU_SLOT_NUM_ANY = 255 |
| 48 | |
Rich Lane | 2e079da | 2014-10-29 15:30:24 -0700 | [diff] [blame] | 49 | of_bsn_pdu_slot_num_map = { |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 50 | 255: 'BSN_PDU_SLOT_NUM_ANY', |
| 51 | } |
| 52 | |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 53 | # Identifiers from group ofp_action_type |
| 54 | OFPAT_OUTPUT = 0 |
| 55 | OFPAT_SET_VLAN_VID = 1 |
| 56 | OFPAT_SET_VLAN_PCP = 2 |
| 57 | OFPAT_STRIP_VLAN = 3 |
| 58 | OFPAT_SET_DL_SRC = 4 |
| 59 | OFPAT_SET_DL_DST = 5 |
| 60 | OFPAT_SET_NW_SRC = 6 |
| 61 | OFPAT_SET_NW_DST = 7 |
| 62 | OFPAT_SET_NW_TOS = 8 |
| 63 | OFPAT_SET_TP_SRC = 9 |
| 64 | OFPAT_SET_TP_DST = 10 |
| 65 | OFPAT_ENQUEUE = 11 |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 66 | OFPAT_EXPERIMENTER = 65535 |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 67 | |
| 68 | ofp_action_type_map = { |
| 69 | 0: 'OFPAT_OUTPUT', |
| 70 | 1: 'OFPAT_SET_VLAN_VID', |
| 71 | 2: 'OFPAT_SET_VLAN_PCP', |
| 72 | 3: 'OFPAT_STRIP_VLAN', |
| 73 | 4: 'OFPAT_SET_DL_SRC', |
| 74 | 5: 'OFPAT_SET_DL_DST', |
| 75 | 6: 'OFPAT_SET_NW_SRC', |
| 76 | 7: 'OFPAT_SET_NW_DST', |
| 77 | 8: 'OFPAT_SET_NW_TOS', |
| 78 | 9: 'OFPAT_SET_TP_SRC', |
| 79 | 10: 'OFPAT_SET_TP_DST', |
| 80 | 11: 'OFPAT_ENQUEUE', |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 81 | 65535: 'OFPAT_EXPERIMENTER', |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 82 | } |
| 83 | |
| 84 | # Identifiers from group ofp_bad_action_code |
| 85 | OFPBAC_BAD_TYPE = 0 |
| 86 | OFPBAC_BAD_LEN = 1 |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 87 | OFPBAC_BAD_EXPERIMENTER = 2 |
| 88 | OFPBAC_BAD_EXPERIMENTER_TYPE = 3 |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 89 | OFPBAC_BAD_OUT_PORT = 4 |
| 90 | OFPBAC_BAD_ARGUMENT = 5 |
| 91 | OFPBAC_EPERM = 6 |
| 92 | OFPBAC_TOO_MANY = 7 |
| 93 | OFPBAC_BAD_QUEUE = 8 |
| 94 | |
| 95 | ofp_bad_action_code_map = { |
| 96 | 0: 'OFPBAC_BAD_TYPE', |
| 97 | 1: 'OFPBAC_BAD_LEN', |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 98 | 2: 'OFPBAC_BAD_EXPERIMENTER', |
| 99 | 3: 'OFPBAC_BAD_EXPERIMENTER_TYPE', |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 100 | 4: 'OFPBAC_BAD_OUT_PORT', |
| 101 | 5: 'OFPBAC_BAD_ARGUMENT', |
| 102 | 6: 'OFPBAC_EPERM', |
| 103 | 7: 'OFPBAC_TOO_MANY', |
| 104 | 8: 'OFPBAC_BAD_QUEUE', |
| 105 | } |
| 106 | |
| 107 | # Identifiers from group ofp_bad_request_code |
| 108 | OFPBRC_BAD_VERSION = 0 |
| 109 | OFPBRC_BAD_TYPE = 1 |
| 110 | OFPBRC_BAD_STAT = 2 |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 111 | OFPBRC_BAD_EXPERIMENTER = 3 |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 112 | OFPBRC_BAD_SUBTYPE = 4 |
| 113 | OFPBRC_EPERM = 5 |
| 114 | OFPBRC_BAD_LEN = 6 |
| 115 | OFPBRC_BUFFER_EMPTY = 7 |
| 116 | OFPBRC_BUFFER_UNKNOWN = 8 |
| 117 | |
| 118 | ofp_bad_request_code_map = { |
| 119 | 0: 'OFPBRC_BAD_VERSION', |
| 120 | 1: 'OFPBRC_BAD_TYPE', |
| 121 | 2: 'OFPBRC_BAD_STAT', |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 122 | 3: 'OFPBRC_BAD_EXPERIMENTER', |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 123 | 4: 'OFPBRC_BAD_SUBTYPE', |
| 124 | 5: 'OFPBRC_EPERM', |
| 125 | 6: 'OFPBRC_BAD_LEN', |
| 126 | 7: 'OFPBRC_BUFFER_EMPTY', |
| 127 | 8: 'OFPBRC_BUFFER_UNKNOWN', |
| 128 | } |
| 129 | |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 130 | # Identifiers from group ofp_bsn_vport_l2gre_flags |
| 131 | OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID = 1 |
| 132 | OF_BSN_VPORT_L2GRE_DSCP_ASSIGN = 2 |
| 133 | OF_BSN_VPORT_L2GRE_DSCP_COPY = 4 |
Rich Lane | 5587ab1 | 2014-06-30 11:19:09 -0700 | [diff] [blame] | 134 | OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID = 8 |
Rich Lane | f9530c4 | 2014-09-15 09:59:43 -0700 | [diff] [blame] | 135 | OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID = 16 |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 136 | |
| 137 | ofp_bsn_vport_l2gre_flags_map = { |
| 138 | 1: 'OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID', |
| 139 | 2: 'OF_BSN_VPORT_L2GRE_DSCP_ASSIGN', |
| 140 | 4: 'OF_BSN_VPORT_L2GRE_DSCP_COPY', |
Rich Lane | 5587ab1 | 2014-06-30 11:19:09 -0700 | [diff] [blame] | 141 | 8: 'OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID', |
Rich Lane | f9530c4 | 2014-09-15 09:59:43 -0700 | [diff] [blame] | 142 | 16: 'OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID', |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 143 | } |
| 144 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 145 | # Identifiers from group ofp_bsn_vport_q_in_q_untagged |
| 146 | OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535 |
| 147 | |
| 148 | ofp_bsn_vport_q_in_q_untagged_map = { |
| 149 | 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED', |
| 150 | } |
| 151 | |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 152 | # Identifiers from group ofp_bsn_vport_status |
| 153 | OF_BSN_VPORT_STATUS_OK = 0 |
| 154 | OF_BSN_VPORT_STATUS_FAILED = 1 |
| 155 | |
| 156 | ofp_bsn_vport_status_map = { |
| 157 | 0: 'OF_BSN_VPORT_STATUS_OK', |
| 158 | 1: 'OF_BSN_VPORT_STATUS_FAILED', |
| 159 | } |
| 160 | |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 161 | # Identifiers from group ofp_capabilities |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 162 | OFPC_FLOW_STATS = 1 |
| 163 | OFPC_TABLE_STATS = 2 |
| 164 | OFPC_PORT_STATS = 4 |
| 165 | OFPC_STP = 8 |
| 166 | OFPC_RESERVED = 16 |
| 167 | OFPC_IP_REASM = 32 |
| 168 | OFPC_QUEUE_STATS = 64 |
| 169 | OFPC_ARP_MATCH_IP = 128 |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 170 | |
| 171 | ofp_capabilities_map = { |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 172 | 1: 'OFPC_FLOW_STATS', |
| 173 | 2: 'OFPC_TABLE_STATS', |
| 174 | 4: 'OFPC_PORT_STATS', |
| 175 | 8: 'OFPC_STP', |
| 176 | 16: 'OFPC_RESERVED', |
| 177 | 32: 'OFPC_IP_REASM', |
| 178 | 64: 'OFPC_QUEUE_STATS', |
| 179 | 128: 'OFPC_ARP_MATCH_IP', |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 180 | } |
| 181 | |
| 182 | # Identifiers from group ofp_config_flags |
| 183 | OFPC_FRAG_NORMAL = 0 |
| 184 | OFPC_FRAG_DROP = 1 |
| 185 | OFPC_FRAG_REASM = 2 |
| 186 | OFPC_FRAG_MASK = 3 |
| 187 | |
| 188 | ofp_config_flags_map = { |
| 189 | 0: 'OFPC_FRAG_NORMAL', |
| 190 | 1: 'OFPC_FRAG_DROP', |
| 191 | 2: 'OFPC_FRAG_REASM', |
| 192 | 3: 'OFPC_FRAG_MASK', |
| 193 | } |
| 194 | |
| 195 | # Identifiers from group ofp_error_type |
| 196 | OFPET_HELLO_FAILED = 0 |
| 197 | OFPET_BAD_REQUEST = 1 |
| 198 | OFPET_BAD_ACTION = 2 |
| 199 | OFPET_FLOW_MOD_FAILED = 3 |
| 200 | OFPET_PORT_MOD_FAILED = 4 |
| 201 | OFPET_QUEUE_OP_FAILED = 5 |
| 202 | |
| 203 | ofp_error_type_map = { |
| 204 | 0: 'OFPET_HELLO_FAILED', |
| 205 | 1: 'OFPET_BAD_REQUEST', |
| 206 | 2: 'OFPET_BAD_ACTION', |
| 207 | 3: 'OFPET_FLOW_MOD_FAILED', |
| 208 | 4: 'OFPET_PORT_MOD_FAILED', |
| 209 | 5: 'OFPET_QUEUE_OP_FAILED', |
| 210 | } |
| 211 | |
| 212 | # Identifiers from group ofp_flow_mod_command |
| 213 | OFPFC_ADD = 0 |
| 214 | OFPFC_MODIFY = 1 |
| 215 | OFPFC_MODIFY_STRICT = 2 |
| 216 | OFPFC_DELETE = 3 |
| 217 | OFPFC_DELETE_STRICT = 4 |
| 218 | |
| 219 | ofp_flow_mod_command_map = { |
| 220 | 0: 'OFPFC_ADD', |
| 221 | 1: 'OFPFC_MODIFY', |
| 222 | 2: 'OFPFC_MODIFY_STRICT', |
| 223 | 3: 'OFPFC_DELETE', |
| 224 | 4: 'OFPFC_DELETE_STRICT', |
| 225 | } |
| 226 | |
| 227 | # Identifiers from group ofp_flow_mod_failed_code |
| 228 | OFPFMFC_ALL_TABLES_FULL = 0 |
| 229 | OFPFMFC_OVERLAP = 1 |
| 230 | OFPFMFC_EPERM = 2 |
| 231 | OFPFMFC_BAD_EMERG_TIMEOUT = 3 |
| 232 | OFPFMFC_BAD_COMMAND = 4 |
| 233 | OFPFMFC_UNSUPPORTED = 5 |
| 234 | |
| 235 | ofp_flow_mod_failed_code_map = { |
| 236 | 0: 'OFPFMFC_ALL_TABLES_FULL', |
| 237 | 1: 'OFPFMFC_OVERLAP', |
| 238 | 2: 'OFPFMFC_EPERM', |
| 239 | 3: 'OFPFMFC_BAD_EMERG_TIMEOUT', |
| 240 | 4: 'OFPFMFC_BAD_COMMAND', |
| 241 | 5: 'OFPFMFC_UNSUPPORTED', |
| 242 | } |
| 243 | |
| 244 | # Identifiers from group ofp_flow_mod_flags |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 245 | OFPFF_SEND_FLOW_REM = 1 |
| 246 | OFPFF_CHECK_OVERLAP = 2 |
| 247 | OFPFF_EMERG = 4 |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 248 | |
| 249 | ofp_flow_mod_flags_map = { |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 250 | 1: 'OFPFF_SEND_FLOW_REM', |
| 251 | 2: 'OFPFF_CHECK_OVERLAP', |
| 252 | 4: 'OFPFF_EMERG', |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 253 | } |
| 254 | |
| 255 | # Identifiers from group ofp_flow_removed_reason |
| 256 | OFPRR_IDLE_TIMEOUT = 0 |
| 257 | OFPRR_HARD_TIMEOUT = 1 |
| 258 | OFPRR_DELETE = 2 |
| 259 | |
| 260 | ofp_flow_removed_reason_map = { |
| 261 | 0: 'OFPRR_IDLE_TIMEOUT', |
| 262 | 1: 'OFPRR_HARD_TIMEOUT', |
| 263 | 2: 'OFPRR_DELETE', |
| 264 | } |
| 265 | |
| 266 | # Identifiers from group ofp_flow_wildcards |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 267 | OFPFW_IN_PORT = 1 |
| 268 | OFPFW_DL_VLAN = 2 |
| 269 | OFPFW_DL_SRC = 4 |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 270 | OFPFW_NW_DST_BITS = 6 |
| 271 | OFPFW_NW_SRC_BITS = 6 |
| 272 | OFPFW_NW_SRC_SHIFT = 8 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 273 | OFPFW_DL_DST = 8 |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 274 | OFPFW_NW_DST_SHIFT = 14 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 275 | OFPFW_DL_TYPE = 16 |
| 276 | OFPFW_NW_PROTO = 32 |
| 277 | OFPFW_TP_SRC = 64 |
| 278 | OFPFW_TP_DST = 128 |
| 279 | OFPFW_NW_SRC_ALL = 8192 |
| 280 | OFPFW_NW_SRC_MASK = 16128 |
| 281 | OFPFW_NW_DST_ALL = 524288 |
| 282 | OFPFW_NW_DST_MASK = 1032192 |
| 283 | OFPFW_DL_VLAN_PCP = 1048576 |
| 284 | OFPFW_NW_TOS = 2097152 |
| 285 | OFPFW_ALL = 4194303 |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 286 | |
| 287 | ofp_flow_wildcards_map = { |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 288 | 1: 'OFPFW_IN_PORT', |
| 289 | 2: 'OFPFW_DL_VLAN', |
| 290 | 4: 'OFPFW_DL_SRC', |
| 291 | 8: 'OFPFW_DL_DST', |
| 292 | 16: 'OFPFW_DL_TYPE', |
| 293 | 32: 'OFPFW_NW_PROTO', |
| 294 | 64: 'OFPFW_TP_SRC', |
| 295 | 128: 'OFPFW_TP_DST', |
| 296 | 1048576: 'OFPFW_DL_VLAN_PCP', |
| 297 | 2097152: 'OFPFW_NW_TOS', |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 298 | } |
| 299 | |
| 300 | # Identifiers from group ofp_hello_failed_code |
| 301 | OFPHFC_INCOMPATIBLE = 0 |
| 302 | OFPHFC_EPERM = 1 |
| 303 | |
| 304 | ofp_hello_failed_code_map = { |
| 305 | 0: 'OFPHFC_INCOMPATIBLE', |
| 306 | 1: 'OFPHFC_EPERM', |
| 307 | } |
| 308 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 309 | # Identifiers from group ofp_nicira_controller_role |
| 310 | NX_ROLE_OTHER = 0 |
| 311 | NX_ROLE_MASTER = 1 |
| 312 | NX_ROLE_SLAVE = 2 |
| 313 | |
| 314 | ofp_nicira_controller_role_map = { |
| 315 | 0: 'NX_ROLE_OTHER', |
| 316 | 1: 'NX_ROLE_MASTER', |
| 317 | 2: 'NX_ROLE_SLAVE', |
| 318 | } |
| 319 | |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 320 | # Identifiers from group ofp_packet_in_reason |
| 321 | OFPR_NO_MATCH = 0 |
| 322 | OFPR_ACTION = 1 |
| 323 | |
| 324 | ofp_packet_in_reason_map = { |
| 325 | 0: 'OFPR_NO_MATCH', |
| 326 | 1: 'OFPR_ACTION', |
| 327 | } |
| 328 | |
| 329 | # Identifiers from group ofp_port |
| 330 | OFPP_MAX = 0xff00 |
| 331 | OFPP_IN_PORT = 0xfff8 |
| 332 | OFPP_TABLE = 0xfff9 |
| 333 | OFPP_NORMAL = 0xfffa |
| 334 | OFPP_FLOOD = 0xfffb |
| 335 | OFPP_ALL = 0xfffc |
| 336 | OFPP_CONTROLLER = 0xfffd |
| 337 | OFPP_LOCAL = 0xfffe |
| 338 | OFPP_NONE = 0xffff |
| 339 | |
| 340 | ofp_port_map = { |
| 341 | 0xff00: 'OFPP_MAX', |
| 342 | 0xfff8: 'OFPP_IN_PORT', |
| 343 | 0xfff9: 'OFPP_TABLE', |
| 344 | 0xfffa: 'OFPP_NORMAL', |
| 345 | 0xfffb: 'OFPP_FLOOD', |
| 346 | 0xfffc: 'OFPP_ALL', |
| 347 | 0xfffd: 'OFPP_CONTROLLER', |
| 348 | 0xfffe: 'OFPP_LOCAL', |
| 349 | 0xffff: 'OFPP_NONE', |
| 350 | } |
| 351 | |
| 352 | # Identifiers from group ofp_port_config |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 353 | OFPPC_PORT_DOWN = 1 |
| 354 | OFPPC_NO_STP = 2 |
| 355 | OFPPC_NO_RECV = 4 |
| 356 | OFPPC_NO_RECV_STP = 8 |
| 357 | OFPPC_NO_FLOOD = 16 |
| 358 | OFPPC_NO_FWD = 32 |
| 359 | OFPPC_NO_PACKET_IN = 64 |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 360 | OFPPC_BSN_MIRROR_DEST = 2147483648 |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 361 | |
| 362 | ofp_port_config_map = { |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 363 | 1: 'OFPPC_PORT_DOWN', |
| 364 | 2: 'OFPPC_NO_STP', |
| 365 | 4: 'OFPPC_NO_RECV', |
| 366 | 8: 'OFPPC_NO_RECV_STP', |
| 367 | 16: 'OFPPC_NO_FLOOD', |
| 368 | 32: 'OFPPC_NO_FWD', |
| 369 | 64: 'OFPPC_NO_PACKET_IN', |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 370 | 2147483648: 'OFPPC_BSN_MIRROR_DEST', |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 371 | } |
| 372 | |
| 373 | # Identifiers from group ofp_port_features |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 374 | OFPPF_10MB_HD = 1 |
| 375 | OFPPF_10MB_FD = 2 |
| 376 | OFPPF_100MB_HD = 4 |
| 377 | OFPPF_100MB_FD = 8 |
| 378 | OFPPF_1GB_HD = 16 |
| 379 | OFPPF_1GB_FD = 32 |
| 380 | OFPPF_10GB_FD = 64 |
| 381 | OFPPF_COPPER = 128 |
| 382 | OFPPF_FIBER = 256 |
| 383 | OFPPF_AUTONEG = 512 |
| 384 | OFPPF_PAUSE = 1024 |
| 385 | OFPPF_PAUSE_ASYM = 2048 |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 386 | |
| 387 | ofp_port_features_map = { |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 388 | 1: 'OFPPF_10MB_HD', |
| 389 | 2: 'OFPPF_10MB_FD', |
| 390 | 4: 'OFPPF_100MB_HD', |
| 391 | 8: 'OFPPF_100MB_FD', |
| 392 | 16: 'OFPPF_1GB_HD', |
| 393 | 32: 'OFPPF_1GB_FD', |
| 394 | 64: 'OFPPF_10GB_FD', |
| 395 | 128: 'OFPPF_COPPER', |
| 396 | 256: 'OFPPF_FIBER', |
| 397 | 512: 'OFPPF_AUTONEG', |
| 398 | 1024: 'OFPPF_PAUSE', |
| 399 | 2048: 'OFPPF_PAUSE_ASYM', |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 400 | } |
| 401 | |
| 402 | # Identifiers from group ofp_port_mod_failed_code |
| 403 | OFPPMFC_BAD_PORT = 0 |
| 404 | OFPPMFC_BAD_HW_ADDR = 1 |
| 405 | |
| 406 | ofp_port_mod_failed_code_map = { |
| 407 | 0: 'OFPPMFC_BAD_PORT', |
| 408 | 1: 'OFPPMFC_BAD_HW_ADDR', |
| 409 | } |
| 410 | |
| 411 | # Identifiers from group ofp_port_reason |
| 412 | OFPPR_ADD = 0 |
| 413 | OFPPR_DELETE = 1 |
| 414 | OFPPR_MODIFY = 2 |
| 415 | |
| 416 | ofp_port_reason_map = { |
| 417 | 0: 'OFPPR_ADD', |
| 418 | 1: 'OFPPR_DELETE', |
| 419 | 2: 'OFPPR_MODIFY', |
| 420 | } |
| 421 | |
| 422 | # Identifiers from group ofp_port_state |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 423 | OFPPS_LINK_DOWN = 1 |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 424 | OFPPS_STP_LISTEN = 0 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 425 | OFPPS_STP_LEARN = 256 |
| 426 | OFPPS_STP_FORWARD = 512 |
| 427 | OFPPS_STP_BLOCK = 768 |
| 428 | OFPPS_STP_MASK = 768 |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 429 | |
| 430 | ofp_port_state_map = { |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 431 | 1: 'OFPPS_LINK_DOWN', |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 432 | 0: 'OFPPS_STP_LISTEN', |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 433 | 256: 'OFPPS_STP_LEARN', |
| 434 | 512: 'OFPPS_STP_FORWARD', |
| 435 | 768: 'OFPPS_STP_BLOCK', |
| 436 | 768: 'OFPPS_STP_MASK', |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 437 | } |
| 438 | |
| 439 | # Identifiers from group ofp_queue_op_failed_code |
| 440 | OFPQOFC_BAD_PORT = 0 |
| 441 | OFPQOFC_BAD_QUEUE = 1 |
| 442 | OFPQOFC_EPERM = 2 |
| 443 | |
| 444 | ofp_queue_op_failed_code_map = { |
| 445 | 0: 'OFPQOFC_BAD_PORT', |
| 446 | 1: 'OFPQOFC_BAD_QUEUE', |
| 447 | 2: 'OFPQOFC_EPERM', |
| 448 | } |
| 449 | |
| 450 | # Identifiers from group ofp_queue_properties |
| 451 | OFPQT_NONE = 0 |
| 452 | OFPQT_MIN_RATE = 1 |
| 453 | |
| 454 | ofp_queue_properties_map = { |
| 455 | 0: 'OFPQT_NONE', |
| 456 | 1: 'OFPQT_MIN_RATE', |
| 457 | } |
| 458 | |
| 459 | # Identifiers from group ofp_stats_reply_flags |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 460 | OFPSF_REPLY_MORE = 1 |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 461 | |
| 462 | ofp_stats_reply_flags_map = { |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 463 | 1: 'OFPSF_REPLY_MORE', |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 464 | } |
| 465 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 466 | # Identifiers from group ofp_stats_request_flags |
| 467 | |
| 468 | ofp_stats_request_flags_map = { |
| 469 | } |
| 470 | |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 471 | # Identifiers from group ofp_stats_type |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 472 | OFPST_DESC = 0 |
| 473 | OFPST_FLOW = 1 |
| 474 | OFPST_AGGREGATE = 2 |
| 475 | OFPST_TABLE = 3 |
| 476 | OFPST_PORT = 4 |
| 477 | OFPST_QUEUE = 5 |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 478 | OFPST_EXPERIMENTER = 65535 |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 479 | |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 480 | ofp_stats_type_map = { |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 481 | 0: 'OFPST_DESC', |
| 482 | 1: 'OFPST_FLOW', |
| 483 | 2: 'OFPST_AGGREGATE', |
| 484 | 3: 'OFPST_TABLE', |
| 485 | 4: 'OFPST_PORT', |
| 486 | 5: 'OFPST_QUEUE', |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 487 | 65535: 'OFPST_EXPERIMENTER', |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 488 | } |
| 489 | |
| 490 | # Identifiers from group ofp_type |
| 491 | OFPT_HELLO = 0 |
| 492 | OFPT_ERROR = 1 |
| 493 | OFPT_ECHO_REQUEST = 2 |
| 494 | OFPT_ECHO_REPLY = 3 |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 495 | OFPT_EXPERIMENTER = 4 |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 496 | OFPT_FEATURES_REQUEST = 5 |
| 497 | OFPT_FEATURES_REPLY = 6 |
| 498 | OFPT_GET_CONFIG_REQUEST = 7 |
| 499 | OFPT_GET_CONFIG_REPLY = 8 |
| 500 | OFPT_SET_CONFIG = 9 |
| 501 | OFPT_PACKET_IN = 10 |
| 502 | OFPT_FLOW_REMOVED = 11 |
| 503 | OFPT_PORT_STATUS = 12 |
| 504 | OFPT_PACKET_OUT = 13 |
| 505 | OFPT_FLOW_MOD = 14 |
| 506 | OFPT_PORT_MOD = 15 |
| 507 | OFPT_STATS_REQUEST = 16 |
| 508 | OFPT_STATS_REPLY = 17 |
| 509 | OFPT_BARRIER_REQUEST = 18 |
| 510 | OFPT_BARRIER_REPLY = 19 |
| 511 | OFPT_QUEUE_GET_CONFIG_REQUEST = 20 |
| 512 | OFPT_QUEUE_GET_CONFIG_REPLY = 21 |
| 513 | |
| 514 | ofp_type_map = { |
| 515 | 0: 'OFPT_HELLO', |
| 516 | 1: 'OFPT_ERROR', |
| 517 | 2: 'OFPT_ECHO_REQUEST', |
| 518 | 3: 'OFPT_ECHO_REPLY', |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 519 | 4: 'OFPT_EXPERIMENTER', |
Rich Lane | b658ddd | 2013-03-12 10:15:10 -0700 | [diff] [blame] | 520 | 5: 'OFPT_FEATURES_REQUEST', |
| 521 | 6: 'OFPT_FEATURES_REPLY', |
| 522 | 7: 'OFPT_GET_CONFIG_REQUEST', |
| 523 | 8: 'OFPT_GET_CONFIG_REPLY', |
| 524 | 9: 'OFPT_SET_CONFIG', |
| 525 | 10: 'OFPT_PACKET_IN', |
| 526 | 11: 'OFPT_FLOW_REMOVED', |
| 527 | 12: 'OFPT_PORT_STATUS', |
| 528 | 13: 'OFPT_PACKET_OUT', |
| 529 | 14: 'OFPT_FLOW_MOD', |
| 530 | 15: 'OFPT_PORT_MOD', |
| 531 | 16: 'OFPT_STATS_REQUEST', |
| 532 | 17: 'OFPT_STATS_REPLY', |
| 533 | 18: 'OFPT_BARRIER_REQUEST', |
| 534 | 19: 'OFPT_BARRIER_REPLY', |
| 535 | 20: 'OFPT_QUEUE_GET_CONFIG_REQUEST', |
| 536 | 21: 'OFPT_QUEUE_GET_CONFIG_REPLY', |
| 537 | } |
| 538 | |