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