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