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