alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1 | // Copyright 2013, Big Switch Networks, Inc. |
| 2 | // |
| 3 | // LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with |
| 4 | // the following special exception: |
| 5 | // |
| 6 | // LOXI Exception |
| 7 | // |
| 8 | // As a special exception to the terms of the EPL, you may distribute libraries |
| 9 | // generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided |
| 10 | // that copyright and licensing notices generated by LoxiGen are not altered or removed |
| 11 | // from the LoxiGen Libraries and the notice provided below is (i) included in |
| 12 | // the LoxiGen Libraries, if distributed in source code form and (ii) included in any |
| 13 | // documentation for the LoxiGen Libraries, if distributed in binary form. |
| 14 | // |
| 15 | // Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler." |
| 16 | // |
| 17 | // You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain |
| 18 | // a copy of the EPL at: |
| 19 | // |
| 20 | // http://www.eclipse.org/legal/epl-v10.html |
| 21 | // |
| 22 | // Unless required by applicable law or agreed to in writing, software |
| 23 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 24 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 25 | // EPL for the specific language governing permissions and limitations |
| 26 | // under the EPL. |
| 27 | // |
| 28 | // Also derived from the OpenFlow header files which have these copyrights: |
| 29 | // Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University |
| 30 | // Copyright (c) 2011, 2012 Open Networking Foundation |
| 31 | |
| 32 | #version 5 |
| 33 | |
| 34 | enum macro_definitions { |
| 35 | OFP_MAX_TABLE_NAME_LEN = 32, |
| 36 | OFP_MAX_PORT_NAME_LEN = 16, |
| 37 | |
| 38 | OFP_TCP_PORT = 6653, |
| 39 | OFP_SSL_PORT = 6653, |
| 40 | |
| 41 | OFP_ETH_ALEN = 6, |
| 42 | |
| 43 | OFP_DEFAULT_MISS_SEND_LEN = 128, |
| 44 | |
| 45 | OFP_VLAN_NONE = 0, |
| 46 | |
| 47 | OFP_FLOW_PERMANENT = 0, |
| 48 | |
| 49 | OFP_DEFAULT_PRIORITY = 0x8000, |
| 50 | |
| 51 | OFP_NO_BUFFER = 0xffffffff, |
| 52 | |
| 53 | DESC_STR_LEN = 256, |
| 54 | SERIAL_NUM_LEN = 32, |
| 55 | |
| 56 | OFPQ_ALL = 0xffffffff, |
| 57 | OFPQ_MAX_RATE_UNCFG = 0xffff, |
| 58 | OFPQ_MIN_RATE_UNCFG = 0xffff, |
| 59 | }; |
| 60 | |
| 61 | enum ofp_port(wire_type=uint32_t) { |
| 62 | OFPP_MAX = 0xffffff00, |
| 63 | OFPP_IN_PORT = 0xfffffff8, |
| 64 | OFPP_TABLE = 0xfffffff9, |
| 65 | OFPP_NORMAL = 0xfffffffa, |
| 66 | OFPP_FLOOD = 0xfffffffb, |
| 67 | OFPP_ALL = 0xfffffffc, |
| 68 | OFPP_CONTROLLER = 0xfffffffd, |
| 69 | OFPP_LOCAL = 0xfffffffe, |
| 70 | OFPP_ANY = 0xffffffff, |
| 71 | }; |
| 72 | |
| 73 | enum ofp_type(wire_type=uint8_t) { |
| 74 | OFPT_HELLO = 0, |
| 75 | OFPT_ERROR = 1, |
| 76 | OFPT_ECHO_REQUEST = 2, |
| 77 | OFPT_ECHO_REPLY = 3, |
| 78 | OFPT_EXPERIMENTER = 4, |
| 79 | OFPT_FEATURES_REQUEST = 5, |
| 80 | OFPT_FEATURES_REPLY = 6, |
| 81 | OFPT_GET_CONFIG_REQUEST = 7, |
| 82 | OFPT_GET_CONFIG_REPLY = 8, |
| 83 | OFPT_SET_CONFIG = 9, |
| 84 | OFPT_PACKET_IN = 10, |
| 85 | OFPT_FLOW_REMOVED = 11, |
| 86 | OFPT_PORT_STATUS = 12, |
| 87 | OFPT_PACKET_OUT = 13, |
| 88 | OFPT_FLOW_MOD = 14, |
| 89 | OFPT_GROUP_MOD = 15, |
| 90 | OFPT_PORT_MOD = 16, |
| 91 | OFPT_TABLE_MOD = 17, |
| 92 | OFPT_STATS_REQUEST = 18, |
| 93 | OFPT_STATS_REPLY = 19, |
| 94 | OFPT_BARRIER_REQUEST = 20, |
| 95 | OFPT_BARRIER_REPLY = 21, |
| 96 | OFPT_ROLE_REQUEST = 24, |
| 97 | OFPT_ROLE_REPLY = 25, |
| 98 | OFPT_GET_ASYNC_REQUEST = 26, |
| 99 | OFPT_GET_ASYNC_REPLY = 27, |
| 100 | OFPT_SET_ASYNC = 28, |
| 101 | OFPT_METER_MOD = 29, |
| 102 | OFPT_ROLE_STATUS = 30, |
| 103 | OFPT_TABLE_STATUS = 31, |
| 104 | OFPT_REQUESTFORWARD = 32, |
| 105 | OFPT_BUNDLE_CONTROL = 33, |
| 106 | OFPT_BUNDLE_ADD_MESSAGE = 34, |
| 107 | }; |
| 108 | |
| 109 | enum ofp_config_flags(wire_type=uint16_t, bitmask=True) { |
| 110 | OFPC_FRAG_NORMAL = 0, |
| 111 | OFPC_FRAG_DROP = 1, |
| 112 | OFPC_FRAG_REASM = 2, |
| 113 | OFPC_FRAG_MASK = 3, |
| 114 | }; |
| 115 | |
| 116 | enum ofp_table_config(wire_type=uint32_t, bitmask=True) { |
| 117 | OFPTC_DEPRECATED_MASK = 0x3, |
| 118 | OFPTC_EVICTION = 0x4, |
| 119 | OFPTC_VACANCY_EVENTS = 0x8, |
| 120 | }; |
| 121 | |
| 122 | enum ofp_table(wire_type=uint8_t, complete=False) { |
| 123 | OFPTT_MAX = 0xfe, |
| 124 | OFPTT_ALL = 0xff, |
| 125 | }; |
| 126 | |
| 127 | enum ofp_capabilities(wire_type=uint32_t, bitmask=True) { |
| 128 | OFPC_FLOW_STATS = 0x1, |
| 129 | OFPC_TABLE_STATS = 0x2, |
| 130 | OFPC_PORT_STATS = 0x4, |
| 131 | OFPC_GROUP_STATS = 0x8, |
| 132 | OFPC_IP_REASM = 0x20, |
| 133 | OFPC_QUEUE_STATS = 0x40, |
| 134 | OFPC_PORT_BLOCKED = 0x100, |
| 135 | }; |
| 136 | |
| 137 | enum ofp_port_config(wire_type=uint32_t, bitmask=True) { |
| 138 | OFPPC_PORT_DOWN = 0x1, |
| 139 | OFPPC_NO_RECV = 0x4, |
| 140 | OFPPC_NO_FWD = 0x20, |
| 141 | OFPPC_NO_PACKET_IN = 0x40, |
| 142 | OFPPC_BSN_MIRROR_DEST = 0x80000000, |
| 143 | }; |
| 144 | |
| 145 | enum ofp_port_state(wire_type=uint32_t, bitmask=True) { |
| 146 | OFPPS_LINK_DOWN = 0x1, |
| 147 | OFPPS_BLOCKED = 0x2, |
| 148 | OFPPS_LIVE = 0x4, |
| 149 | }; |
| 150 | |
| 151 | enum ofp_port_features(wire_type=uint32_t, bitmask=True) { |
| 152 | OFPPF_10MB_HD = 0x1, |
| 153 | OFPPF_10MB_FD = 0x2, |
| 154 | OFPPF_100MB_HD = 0x4, |
| 155 | OFPPF_100MB_FD = 0x8, |
| 156 | OFPPF_1GB_HD = 0x10, |
| 157 | OFPPF_1GB_FD = 0x20, |
| 158 | OFPPF_10GB_FD = 0x40, |
| 159 | OFPPF_40GB_FD = 0x80, |
| 160 | OFPPF_100GB_FD = 0x100, |
| 161 | OFPPF_1TB_FD = 0x200, |
| 162 | OFPPF_OTHER = 0x400, |
| 163 | OFPPF_COPPER = 0x800, |
| 164 | OFPPF_FIBER = 0x1000, |
| 165 | OFPPF_AUTONEG = 0x2000, |
| 166 | OFPPF_PAUSE = 0x4000, |
| 167 | OFPPF_PAUSE_ASYM = 0x8000, |
| 168 | }; |
| 169 | |
| 170 | enum ofp_port_reason(wire_type=uint8_t) { |
| 171 | OFPPR_ADD = 0, |
| 172 | OFPPR_DELETE = 1, |
| 173 | OFPPR_MODIFY = 2, |
| 174 | }; |
| 175 | |
| 176 | enum ofp_match_type(wire_type=uint16_t) { |
| 177 | OFPMT_STANDARD = 0, |
| 178 | OFPMT_OXM = 1, |
| 179 | }; |
| 180 | |
| 181 | enum ofp_oxm_class(wire_type=uint16_t) { |
| 182 | OFPXMC_NXM_0 = 0, |
| 183 | OFPXMC_NXM_1 = 1, |
| 184 | OFPXMC_OPENFLOW_BASIC = 0x8000, |
| 185 | OFPXMC_EXPERIMENTER = 0xffff, |
| 186 | }; |
| 187 | |
| 188 | enum ofp_vlan_id(wire_type=uint16_t) { |
| 189 | OFPVID_NONE = 0, |
| 190 | OFPVID_PRESENT = 0x1000, |
| 191 | }; |
| 192 | |
| 193 | // FIXME: OF spec specified this as '9' bits, implicitly adding |
| 194 | // to full byte |
| 195 | enum ofp_ipv6exthdr_flags(wire_type=uint16_t, bitmask=True) { |
| 196 | OFPIEH_NONEXT = 0x1, |
| 197 | OFPIEH_ESP = 0x2, |
| 198 | OFPIEH_AUTH = 0x4, |
| 199 | OFPIEH_DEST = 0x8, |
| 200 | OFPIEH_FRAG = 0x10, |
| 201 | OFPIEH_ROUTER = 0x20, |
| 202 | OFPIEH_HOP = 0x40, |
| 203 | OFPIEH_UNREP = 0x80, |
| 204 | OFPIEH_UNSEQ = 0x100, |
| 205 | }; |
| 206 | |
| 207 | enum ofp_action_type(wire_type=uint16_t) { |
| 208 | OFPAT_OUTPUT = 0, |
| 209 | OFPAT_COPY_TTL_OUT = 0xb, |
| 210 | OFPAT_COPY_TTL_IN = 0xc, |
| 211 | OFPAT_SET_MPLS_TTL = 0xf, |
| 212 | OFPAT_DEC_MPLS_TTL = 0x10, |
| 213 | OFPAT_PUSH_VLAN = 0x11, |
| 214 | OFPAT_POP_VLAN = 0x12, |
| 215 | OFPAT_PUSH_MPLS = 0x13, |
| 216 | OFPAT_POP_MPLS = 0x14, |
| 217 | OFPAT_SET_QUEUE = 0x15, |
| 218 | OFPAT_GROUP = 0x16, |
| 219 | OFPAT_SET_NW_TTL = 0x17, |
| 220 | OFPAT_DEC_NW_TTL = 0x18, |
| 221 | OFPAT_SET_FIELD = 0x19, |
| 222 | OFPAT_PUSH_PBB = 0x1a, |
| 223 | OFPAT_POP_PBB = 0x1b, |
| 224 | OFPAT_EXPERIMENTER = 0xffff, |
| 225 | }; |
| 226 | |
| 227 | enum ofp_controller_max_len(wire_type=uint16_t, complete=False) { |
| 228 | OFPCML_MAX = 0xffe5, |
| 229 | OFPCML_NO_BUFFER = 0xffff, |
| 230 | }; |
| 231 | |
| 232 | enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) { |
| 233 | OFPIT_GOTO_TABLE = 0x1, |
| 234 | OFPIT_WRITE_METADATA = 0x2, |
| 235 | OFPIT_WRITE_ACTIONS = 0x3, |
| 236 | OFPIT_APPLY_ACTIONS = 0x4, |
| 237 | OFPIT_CLEAR_ACTIONS = 0x5, |
| 238 | OFPIT_METER = 0x6, |
| 239 | OFPIT_EXPERIMENTER = 0xffff, |
| 240 | }; |
| 241 | |
| 242 | enum ofp_flow_mod_command(wire_type=uint8_t) { |
| 243 | OFPFC_ADD = 0, |
| 244 | OFPFC_MODIFY = 1, |
| 245 | OFPFC_MODIFY_STRICT = 2, |
| 246 | OFPFC_DELETE = 3, |
| 247 | OFPFC_DELETE_STRICT = 4, |
| 248 | }; |
| 249 | |
| 250 | enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) { |
| 251 | OFPFF_SEND_FLOW_REM = 0x1, |
| 252 | OFPFF_CHECK_OVERLAP = 0x2, |
| 253 | OFPFF_RESET_COUNTS = 0x4, |
| 254 | OFPFF_NO_PKT_COUNTS = 0x8, |
| 255 | OFPFF_NO_BYT_COUNTS = 0x10, |
| 256 | |
| 257 | /* Non-standard, enabled by an experimenter message */ |
| 258 | /* See the bsn_flow_idle input file */ |
| 259 | OFPFF_BSN_SEND_IDLE = 0x80, |
| 260 | }; |
| 261 | |
| 262 | enum ofp_group(wire_type=uint32_t, complete=False) { |
| 263 | OFPG_MAX = 0xffffff00, |
| 264 | OFPG_ALL = 0xfffffffc, |
| 265 | OFPG_ANY = 0xffffffff, |
| 266 | }; |
| 267 | |
| 268 | enum ofp_group_mod_command(wire_type=uint16_t) { |
| 269 | OFPGC_ADD = 0, |
| 270 | OFPGC_MODIFY = 1, |
| 271 | OFPGC_DELETE = 2, |
| 272 | }; |
| 273 | |
| 274 | enum ofp_group_type(wire_type=uint8_t) { |
| 275 | OFPGT_ALL = 0, |
| 276 | OFPGT_SELECT = 1, |
| 277 | OFPGT_INDIRECT = 2, |
| 278 | OFPGT_FF = 3, |
| 279 | }; |
| 280 | |
| 281 | enum ofp_packet_in_reason(wire_type=uint8_t) { |
| 282 | OFPR_NO_MATCH = 0, |
| 283 | OFPR_ACTION = 1, |
| 284 | OFPR_INVALID_TTL = 2, |
| 285 | OFPR_ACTION_SET = 3, |
| 286 | OFPR_GROUP = 4, |
| 287 | OFPR_PACKET_OUT = 5, |
| 288 | |
| 289 | // non-standard BSN extensions. OF does not have a standard-conformant |
| 290 | // way to extend the set of packet_in reasons |
| 291 | OFPR_BSN_NEW_HOST = 128, |
| 292 | OFPR_BSN_STATION_MOVE = 129, |
| 293 | OFPR_BSN_BAD_VLAN = 130, |
| 294 | OFPR_BSN_DESTINATION_LOOKUP_FAILURE = 131, |
| 295 | OFPR_BSN_NO_ROUTE = 132, |
| 296 | OFPR_BSN_ICMP_ECHO_REQUEST = 133, |
| 297 | OFPR_BSN_DEST_NETWORK_UNREACHABLE = 134, |
| 298 | OFPR_BSN_DEST_HOST_UNREACHABLE = 135, |
| 299 | OFPR_BSN_DEST_PORT_UNREACHABLE = 136, |
| 300 | OFPR_BSN_FRAGMENTATION_REQUIRED = 137, |
| 301 | OFPR_BSN_ARP = 139, |
| 302 | OFPR_BSN_DHCP = 140, |
| 303 | OFPR_BSN_DEBUG = 141, |
| 304 | OFPR_BSN_PACKET_OF_DEATH = 142, |
| 305 | }; |
| 306 | |
| 307 | enum ofp_flow_removed_reason(wire_type=uint8_t) { |
| 308 | OFPRR_IDLE_TIMEOUT = 0, |
| 309 | OFPRR_HARD_TIMEOUT = 1, |
| 310 | OFPRR_DELETE = 2, |
| 311 | OFPRR_GROUP_DELETE = 3, |
| 312 | OFPRR_METER_DELETE = 4, |
| 313 | OFPRR_EVICTION = 5, |
| 314 | }; |
| 315 | |
| 316 | enum ofp_meter(wire_type=uint32_t, complete=False) { |
| 317 | OFPM_MAX = 0xffff0000, |
| 318 | OFPM_SLOWPATH = 0xfffffffd, |
| 319 | OFPM_CONTROLLER = 0xfffffffe, |
| 320 | OFPM_ALL = 0xffffffff, |
| 321 | }; |
| 322 | |
| 323 | enum ofp_meter_band_type(wire_type=uint16_t) { |
| 324 | OFPMBT_DROP = 0x1, |
| 325 | OFPMBT_DSCP_REMARK = 0x2, |
| 326 | OFPMBT_EXPERIMENTER = 0xffff, |
| 327 | }; |
| 328 | |
| 329 | enum ofp_meter_mod_command(wire_type=uint16_t) { |
| 330 | OFPMC_ADD = 0, |
| 331 | OFPMC_MODIFY = 1, |
| 332 | OFPMC_DELETE = 2, |
| 333 | }; |
| 334 | |
| 335 | enum ofp_meter_flags(wire_type=uint16_t, bitmask=True) { |
| 336 | OFPMF_KBPS = 0x1, |
| 337 | OFPMF_PKTPS = 0x2, |
| 338 | OFPMF_BURST = 0x4, |
| 339 | OFPMF_STATS = 0x8, |
| 340 | }; |
| 341 | |
| 342 | enum ofp_error_type(wire_type=uint16_t) { |
| 343 | OFPET_HELLO_FAILED = 0, |
| 344 | OFPET_BAD_REQUEST = 1, |
| 345 | OFPET_BAD_ACTION = 2, |
| 346 | OFPET_BAD_INSTRUCTION = 3, |
| 347 | OFPET_BAD_MATCH = 4, |
| 348 | OFPET_FLOW_MOD_FAILED = 5, |
| 349 | OFPET_GROUP_MOD_FAILED = 6, |
| 350 | OFPET_PORT_MOD_FAILED = 7, |
| 351 | OFPET_TABLE_MOD_FAILED = 8, |
| 352 | OFPET_QUEUE_OP_FAILED = 9, |
| 353 | OFPET_SWITCH_CONFIG_FAILED = 10, |
| 354 | OFPET_ROLE_REQUEST_FAILED = 11, |
| 355 | OFPET_METER_MOD_FAILED = 12, |
| 356 | OFPET_TABLE_FEATURES_FAILED = 13, |
| 357 | OFPET_BAD_PROPERTY = 14, |
| 358 | OFPET_ASYNC_CONFIG_FAILED = 15, |
| 359 | OFPET_FLOW_MONITOR_FAILED = 16, |
| 360 | OFPET_BUNDLE_FAILED = 17, |
| 361 | OFPET_EXPERIMENTER = 0xffff, |
| 362 | }; |
| 363 | |
| 364 | enum ofp_hello_failed_code(wire_type=uint16_t) { |
| 365 | OFPHFC_INCOMPATIBLE = 0, |
| 366 | OFPHFC_EPERM = 1, |
| 367 | }; |
| 368 | |
| 369 | enum ofp_bad_request_code(wire_type=uint16_t) { |
| 370 | OFPBRC_BAD_VERSION = 0, |
| 371 | OFPBRC_BAD_TYPE = 1, |
| 372 | OFPBRC_BAD_STAT = 2, |
| 373 | OFPBRC_BAD_EXPERIMENTER = 3, |
| 374 | OFPBRC_BAD_EXPERIMENTER_TYPE = 4, |
| 375 | OFPBRC_EPERM = 5, |
| 376 | OFPBRC_BAD_LEN = 6, |
| 377 | OFPBRC_BUFFER_EMPTY = 7, |
| 378 | OFPBRC_BUFFER_UNKNOWN = 8, |
| 379 | OFPBRC_BAD_TABLE_ID = 9, |
| 380 | OFPBRC_IS_SLAVE = 10, |
| 381 | OFPBRC_BAD_PORT = 11, |
| 382 | OFPBRC_BAD_PACKET = 12, |
| 383 | OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13, |
| 384 | OFPBRC_MULTIPART_REQUEST_TIMEOUT = 14, |
| 385 | OFPBRC_MULTIPART_REPLY_TIMEOUT = 15, |
| 386 | }; |
| 387 | |
| 388 | enum ofp_bad_action_code(wire_type=uint16_t) { |
| 389 | OFPBAC_BAD_TYPE = 0, |
| 390 | OFPBAC_BAD_LEN = 1, |
| 391 | OFPBAC_BAD_EXPERIMENTER = 2, |
| 392 | OFPBAC_BAD_EXPERIMENTER_TYPE = 3, |
| 393 | OFPBAC_BAD_OUT_PORT = 4, |
| 394 | OFPBAC_BAD_ARGUMENT = 5, |
| 395 | OFPBAC_EPERM = 6, |
| 396 | OFPBAC_TOO_MANY = 7, |
| 397 | OFPBAC_BAD_QUEUE = 8, |
| 398 | OFPBAC_BAD_OUT_GROUP = 9, |
| 399 | OFPBAC_MATCH_INCONSISTENT = 10, |
| 400 | OFPBAC_UNSUPPORTED_ORDER = 11, |
| 401 | OFPBAC_BAD_TAG = 12, |
| 402 | OFPBAC_BAD_SET_TYPE = 13, |
| 403 | OFPBAC_BAD_SET_LEN = 14, |
| 404 | OFPBAC_BAD_SET_ARGUMENT = 15, |
| 405 | }; |
| 406 | |
| 407 | enum ofp_bad_instruction_code(wire_type=uint16_t) { |
| 408 | OFPBIC_UNKNOWN_INST = 0, |
| 409 | OFPBIC_UNSUP_INST = 1, |
| 410 | OFPBIC_BAD_TABLE_ID = 2, |
| 411 | OFPBIC_UNSUP_METADATA = 3, |
| 412 | OFPBIC_UNSUP_METADATA_MASK = 4, |
| 413 | OFPBIC_BAD_EXPERIMENTER = 5, |
| 414 | OFPBIC_BAD_EXPERIMENTER_TYPE = 6, |
| 415 | OFPBIC_BAD_LEN = 7, |
| 416 | OFPBIC_EPERM = 8, |
| 417 | OFPBIC_DUP_INST = 9, |
| 418 | }; |
| 419 | |
| 420 | enum ofp_bad_match_code(wire_type=uint16_t) { |
| 421 | OFPBMC_BAD_TYPE = 0, |
| 422 | OFPBMC_BAD_LEN = 1, |
| 423 | OFPBMC_BAD_TAG = 2, |
| 424 | OFPBMC_BAD_DL_ADDR_MASK = 3, |
| 425 | OFPBMC_BAD_NW_ADDR_MASK = 4, |
| 426 | OFPBMC_BAD_WILDCARDS = 5, |
| 427 | OFPBMC_BAD_FIELD = 6, |
| 428 | OFPBMC_BAD_VALUE = 7, |
| 429 | OFPBMC_BAD_MASK = 8, |
| 430 | OFPBMC_BAD_PREREQ = 9, |
| 431 | OFPBMC_DUP_FIELD = 10, |
| 432 | OFPBMC_EPERM = 11, |
| 433 | }; |
| 434 | |
| 435 | enum ofp_flow_mod_failed_code(wire_type=uint16_t) { |
| 436 | OFPFMFC_UNKNOWN = 0, |
| 437 | OFPFMFC_TABLE_FULL = 1, |
| 438 | OFPFMFC_BAD_TABLE_ID = 2, |
| 439 | OFPFMFC_OVERLAP = 3, |
| 440 | OFPFMFC_EPERM = 4, |
| 441 | OFPFMFC_BAD_TIMEOUT = 5, |
| 442 | OFPFMFC_BAD_COMMAND = 6, |
| 443 | OFPFMFC_BAD_FLAGS = 7, |
| 444 | OFPFMFC_CANT_SYNC = 8, |
| 445 | OFPFMFC_BAD_PRIORITY = 9, |
| 446 | }; |
| 447 | |
| 448 | enum ofp_group_mod_failed_code(wire_type=uint16_t) { |
| 449 | OFPGMFC_GROUP_EXISTS = 0, |
| 450 | OFPGMFC_INVALID_GROUP = 1, |
| 451 | OFPGMFC_WEIGHT_UNSUPPORTED = 2, |
| 452 | OFPGMFC_OUT_OF_GROUPS = 3, |
| 453 | OFPGMFC_OUT_OF_BUCKETS = 4, |
| 454 | OFPGMFC_CHAINING_UNSUPPORTED = 5, |
| 455 | OFPGMFC_WATCH_UNSUPPORTED = 6, |
| 456 | OFPGMFC_LOOP = 7, |
| 457 | OFPGMFC_UNKNOWN_GROUP = 8, |
| 458 | OFPGMFC_CHAINED_GROUP = 9, |
| 459 | OFPGMFC_BAD_TYPE = 10, |
| 460 | OFPGMFC_BAD_COMMAND = 11, |
| 461 | OFPGMFC_BAD_BUCKET = 12, |
| 462 | OFPGMFC_BAD_WATCH = 13, |
| 463 | OFPGMFC_EPERM = 14, |
| 464 | }; |
| 465 | |
| 466 | enum ofp_port_mod_failed_code(wire_type=uint16_t) { |
| 467 | OFPPMFC_BAD_PORT = 0, |
| 468 | OFPPMFC_BAD_HW_ADDR = 1, |
| 469 | OFPPMFC_BAD_CONFIG = 2, |
| 470 | OFPPMFC_BAD_ADVERTISE = 3, |
| 471 | OFPPMFC_EPERM = 4, |
| 472 | }; |
| 473 | |
| 474 | enum ofp_table_mod_failed_code(wire_type=uint16_t) { |
| 475 | OFPTMFC_BAD_TABLE = 0, |
| 476 | OFPTMFC_BAD_CONFIG = 1, |
| 477 | OFPTMFC_EPERM = 2, |
| 478 | }; |
| 479 | |
| 480 | enum ofp_queue_op_failed_code(wire_type=uint16_t) { |
| 481 | OFPQOFC_BAD_PORT = 0, |
| 482 | OFPQOFC_BAD_QUEUE = 1, |
| 483 | OFPQOFC_EPERM = 2, |
| 484 | }; |
| 485 | |
| 486 | enum ofp_switch_config_failed_code(wire_type=uint16_t) { |
| 487 | OFPSCFC_BAD_FLAGS = 0, |
| 488 | OFPSCFC_BAD_LEN = 1, |
| 489 | OFPSCFC_EPERM = 2, |
| 490 | }; |
| 491 | |
| 492 | enum ofp_role_request_failed_code(wire_type=uint16_t){ |
| 493 | OFPRRFC_STALE = 0, |
| 494 | OFPRRFC_UNSUP = 1, |
| 495 | OFPRRFC_BAD_ROLE = 2, |
| 496 | }; |
| 497 | |
| 498 | enum ofp_meter_mod_failed_code(wire_type=uint16_t) { |
| 499 | OFPMMFC_UNKNOWN = 0, |
| 500 | OFPMMFC_METER_EXISTS = 1, |
| 501 | OFPMMFC_INVALID_METER = 2, |
| 502 | OFPMMFC_UNKNOWN_METER = 3, |
| 503 | OFPMMFC_BAD_COMMAND = 4, |
| 504 | OFPMMFC_BAD_FLAGS = 5, |
| 505 | OFPMMFC_BAD_RATE = 6, |
| 506 | OFPMMFC_BAD_BURST = 7, |
| 507 | OFPMMFC_BAD_BAND = 8, |
| 508 | OFPMMFC_BAD_BAND_VALUE = 9, |
| 509 | OFPMMFC_OUT_OF_METERS = 10, |
| 510 | OFPMMFC_OUT_OF_BANDS = 11, |
| 511 | }; |
| 512 | |
| 513 | enum ofp_table_features_failed_code(wire_type=uint16_t) { |
| 514 | OFPTFFC_BAD_TABLE = 0, |
| 515 | OFPTFFC_BAD_METADATA = 1, |
| 516 | OFPTFFC_EPERM = 5, |
| 517 | }; |
| 518 | |
| 519 | enum ofp_bad_property_code(wire_type=uint16_t) { |
| 520 | OFPBPC_BAD_TYPE = 0, /* Unknown property type. */ |
| 521 | OFPBPC_BAD_LEN = 1, /* Length problem in property. */ |
| 522 | OFPBPC_BAD_VALUE = 2, /* Unsupported property value. */ |
| 523 | OFPBPC_TOO_MANY = 3, /* Can’t handle this many properties. */ |
| 524 | OFPBPC_DUP_TYPE = 4, /* A property type was duplicated. */ |
| 525 | OFPBPC_BAD_EXPERIMENTER = 5, /* Unknown experimenter id specified. */ |
| 526 | OFPBPC_BAD_EXP_TYPE = 6, /* Unknown exp_type for experimenter id. */ |
| 527 | OFPBPC_BAD_EXP_VALUE = 7, /* Unknown value for experimenter id. */ |
| 528 | OFPBPC_EPERM = 8, /* Permissions error. */ |
| 529 | }; |
| 530 | |
| 531 | |
| 532 | enum ofp_async_config_failed_code(wire_type=uint16_t) { |
| 533 | OFPACFC_INVALID = 0, /* One mask is invalid. */ |
| 534 | OFPACFC_UNSUPPORTED = 1, /* Requested configuration not supported. */ |
| 535 | OFPACFC_EPERM = 2, /* Permissions error. */ |
| 536 | }; |
| 537 | |
| 538 | enum ofp_flow_monitor_failed_code(wire_type=uint16_t) { |
| 539 | OFPMOFC_UNKNOWN = 0, /* Unspecified error. */ |
| 540 | OFPMOFC_MONITOR_EXISTS = 1, /* Monitor not added because a Monitor ADD |
| 541 | * attempted to replace an existing Monitor. */ |
| 542 | OFPMOFC_INVALID_MONITOR = 2, /* Monitor not added because Monitor specified |
| 543 | * is invalid. */ |
| 544 | OFPMOFC_UNKNOWN_MONITOR = 3, /* Monitor not modified because a Monitor |
| 545 | MODIFY attempted to modify a non-existent |
| 546 | Monitor. */ |
| 547 | OFPMOFC_BAD_COMMAND = 4, /* Unsupported or unknown command. */ |
| 548 | OFPMOFC_BAD_FLAGS = 5, /* Flag configuration unsupported. */ |
| 549 | OFPMOFC_BAD_TABLE_ID = 6, /* Specified table does not exist. */ |
| 550 | OFPMOFC_BAD_OUT = 7, /* Error in output port/group. */ |
| 551 | }; |
| 552 | |
| 553 | enum ofp_bundle_failed_code(wire_type=uint16_t) { |
| 554 | OFPBFC_UNKNOWN = 0, /* Unspecified error. */ |
| 555 | OFPBFC_EPERM = 1, /* Permissions error. */ |
| 556 | OFPBFC_BAD_ID = 2, /* Bundle ID doesn’t exist. */ |
| 557 | OFPBFC_BUNDLE_EXIST = 3, /* Bundle ID already exist. */ |
| 558 | OFPBFC_BUNDLE_CLOSED = 4, /* Bundle ID is closed. */ |
| 559 | OFPBFC_OUT_OF_BUNDLES = 5, /* Too many bundles IDs. */ |
| 560 | OFPBFC_BAD_TYPE = 6, /* Unsupported or unknown message control type. */ |
| 561 | OFPBFC_BAD_FLAGS = 7, /* Unsupported, unknown, or inconsistent flags. */ |
| 562 | OFPBFC_MSG_BAD_LEN = 8, /* Length problem in included message. */ |
| 563 | OFPBFC_MSG_BAD_XID = 9, /* Inconsistent or duplicate XID. */ |
| 564 | OFPBFC_MSG_UNSUP = 10, /* Unsupported message in this bundle. */ |
| 565 | OFPBFC_MSG_CONFLICT = 11, /* Unsupported message combination in this bundle. */ |
| 566 | OFPBFC_MSG_TOO_MANY = 12, /* Cant handle this many messages in bundle. */ |
| 567 | OFPBFC_MSG_FAILED = 13, /* One message in bundle failed. */ |
| 568 | OFPBFC_TIMEOUT = 14, /* Bundle is taking too long. */ |
| 569 | OFPBFC_BUNDLE_IN_PROGRESS = 15, /* Bundle is locking the resource. */ |
| 570 | }; |
| 571 | |
| 572 | /* Port stats property types. |
| 573 | */ |
| 574 | enum ofp_port_stats_prop_type(wire_type=uint16_t) { |
| 575 | OFPPSPT_ETHERNET = 0, /* Ethernet property. */ |
| 576 | OFPPSPT_OPTICAL = 1, /* Optical property. */ |
| 577 | OFPPSPT_EXPERIMENTER = 0xFFFF, /* Experimenter property. */ |
| 578 | }; |
| 579 | |
| 580 | |
| 581 | enum ofp_stats_type(wire_type=uint16_t) { |
| 582 | OFPST_DESC = 0, |
| 583 | OFPST_FLOW = 1, |
| 584 | OFPST_AGGREGATE = 2, |
| 585 | OFPST_TABLE = 3, |
| 586 | OFPST_PORT = 4, |
| 587 | OFPST_QUEUE = 5, |
| 588 | OFPST_GROUP = 6, |
| 589 | OFPST_GROUP_DESC = 7, |
| 590 | OFPST_GROUP_FEATURES = 8, |
| 591 | OFPST_METER = 9, |
| 592 | OFPST_METER_CONFIG = 10, |
| 593 | OFPST_METER_FEATURES = 11, |
| 594 | OFPST_TABLE_FEATURES = 12, |
| 595 | OFPST_PORT_DESC = 13, |
| 596 | OFPMP_TABLE_DESC = 14, |
| 597 | OFPMP_QUEUE_DESC = 15, |
| 598 | OFPMP_FLOW_MONITOR = 16, |
| 599 | OFPST_EXPERIMENTER = 0xffff, |
| 600 | }; |
| 601 | |
| 602 | enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) { |
| 603 | OFPSF_REQ_MORE = 0x1, |
| 604 | }; |
| 605 | |
| 606 | enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) { |
| 607 | OFPSF_REPLY_MORE = 0x1, |
| 608 | }; |
| 609 | |
| 610 | enum ofp_table_feature_prop_type(wire_type=uint16_t) { |
| 611 | OFPTFPT_INSTRUCTIONS = 0, |
| 612 | OFPTFPT_INSTRUCTIONS_MISS = 1, |
| 613 | OFPTFPT_NEXT_TABLES = 2, |
| 614 | OFPTFPT_NEXT_TABLES_MISS = 3, |
| 615 | OFPTFPT_WRITE_ACTIONS = 4, |
| 616 | OFPTFPT_WRITE_ACTIONS_MISS = 5, |
| 617 | OFPTFPT_APPLY_ACTIONS = 6, |
| 618 | OFPTFPT_APPLY_ACTIONS_MISS = 7, |
| 619 | OFPTFPT_MATCH = 8, |
| 620 | OFPTFPT_WILDCARDS = 0xa, |
| 621 | OFPTFPT_WRITE_SETFIELD = 0xc, |
| 622 | OFPTFPT_WRITE_SETFIELD_MISS = 0xd, |
| 623 | OFPTFPT_APPLY_SETFIELD = 0xe, |
| 624 | OFPTFPT_APPLY_SETFIELD_MISS = 0xf, |
| 625 | OFPTFPT_TABLE_SYNC_FROM = 0x10, |
| 626 | OFPTFPT_EXPERIMENTER = 0xfffe, |
| 627 | OFPTFPT_EXPERIMENTER_MISS = 0xffff, |
| 628 | }; |
| 629 | |
| 630 | enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) { |
| 631 | OFPGFC_SELECT_WEIGHT = 0x1, |
| 632 | OFPGFC_SELECT_LIVENESS = 0x2, |
| 633 | OFPGFC_CHAINING = 0x4, |
| 634 | OFPGFC_CHAINING_CHECKS = 0x8, |
| 635 | }; |
| 636 | |
| 637 | enum ofp_controller_role(wire_type=uint32_t) { |
| 638 | OFPCR_ROLE_NOCHANGE = 0, |
| 639 | OFPCR_ROLE_EQUAL = 1, |
| 640 | OFPCR_ROLE_MASTER = 2, |
| 641 | OFPCR_ROLE_SLAVE = 3, |
| 642 | }; |
| 643 | |
| 644 | enum ofp_hello_elem_type(wire_type=uint16_t) { |
| 645 | OFPHET_VERSIONBITMAP = 1, |
| 646 | }; |
| 647 | |
| 648 | /* XXX rename to of_message */ |
| 649 | struct of_header { |
| 650 | uint8_t version; |
| 651 | uint8_t type == ?; |
| 652 | uint16_t length; |
| 653 | uint32_t xid; |
| 654 | }; |
| 655 | |
| 656 | struct of_uint64 { |
| 657 | uint64_t value; |
| 658 | }; |
| 659 | |
| 660 | // Special structures used for managing scalar list elements |
| 661 | struct of_uint32 { |
| 662 | uint32_t value; |
| 663 | }; |
| 664 | |
| 665 | // Special structures used for managing scalar list elements |
| 666 | struct of_uint8 { |
| 667 | uint8_t value; |
| 668 | }; |
| 669 | |
| 670 | struct of_hello_elem { |
| 671 | uint16_t type == ?; |
| 672 | uint16_t length; |
| 673 | }; |
| 674 | |
| 675 | struct of_hello_elem_versionbitmap : of_hello_elem { |
| 676 | uint16_t type == 1; |
| 677 | uint16_t length; |
| 678 | list(of_uint32_t) bitmaps; |
| 679 | }; |
| 680 | |
| 681 | struct of_hello : of_header { |
| 682 | uint8_t version; |
| 683 | uint8_t type == 0; |
| 684 | uint16_t length; |
| 685 | uint32_t xid; |
| 686 | list(of_hello_elem_t) elements; |
| 687 | }; |
| 688 | |
| 689 | struct of_echo_request : of_header { |
| 690 | uint8_t version; |
| 691 | uint8_t type == 2; |
| 692 | uint16_t length; |
| 693 | uint32_t xid; |
| 694 | of_octets_t data; |
| 695 | }; |
| 696 | |
| 697 | struct of_echo_reply : of_header { |
| 698 | uint8_t version; |
| 699 | uint8_t type == 3; |
| 700 | uint16_t length; |
| 701 | uint32_t xid; |
| 702 | of_octets_t data; |
| 703 | }; |
| 704 | |
| 705 | struct of_experimenter : of_header { |
| 706 | uint8_t version; |
| 707 | uint8_t type == 4; |
| 708 | uint16_t length; |
| 709 | uint32_t xid; |
| 710 | uint32_t experimenter == ?; |
| 711 | uint32_t subtype; |
| 712 | of_octets_t data; |
| 713 | }; |
| 714 | |
| 715 | struct of_barrier_request : of_header { |
| 716 | uint8_t version; |
| 717 | uint8_t type == 20; |
| 718 | uint16_t length; |
| 719 | uint32_t xid; |
| 720 | }; |
| 721 | |
| 722 | struct of_barrier_reply : of_header { |
| 723 | uint8_t version; |
| 724 | uint8_t type == 21; |
| 725 | uint16_t length; |
| 726 | uint32_t xid; |
| 727 | }; |
| 728 | |
| 729 | struct of_get_config_request : of_header { |
| 730 | uint8_t version; |
| 731 | uint8_t type == 7; |
| 732 | uint16_t length; |
| 733 | uint32_t xid; |
| 734 | }; |
| 735 | |
| 736 | struct of_get_config_reply : of_header { |
| 737 | uint8_t version; |
| 738 | uint8_t type == 8; |
| 739 | uint16_t length; |
| 740 | uint32_t xid; |
| 741 | enum ofp_config_flags flags; |
| 742 | uint16_t miss_send_len; |
| 743 | }; |
| 744 | |
| 745 | struct of_set_config : of_header { |
| 746 | uint8_t version; |
| 747 | uint8_t type == 9; |
| 748 | uint16_t length; |
| 749 | uint32_t xid; |
| 750 | enum ofp_config_flags flags; |
| 751 | uint16_t miss_send_len; |
| 752 | }; |
| 753 | |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 754 | struct of_table_mod_prop { |
| 755 | uint16_t type == ?; /* One of OFPTMPT_*. */ |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 756 | uint16_t length; /* Length in bytes of this property. */ |
| 757 | }; |
| 758 | |
| 759 | struct of_table_mod : of_header { |
| 760 | uint8_t version; |
| 761 | uint8_t type == 17; |
| 762 | uint16_t length; |
| 763 | uint32_t xid; |
| 764 | uint8_t table_id; |
| 765 | pad(3); |
| 766 | uint32_t config; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 767 | list(of_table_mod_prop_t) properties; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 768 | }; |
| 769 | |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 770 | struct of_port_desc_prop { |
| 771 | uint16_t type == ?; /* One of OFPPDPT_*. */ |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 772 | uint16_t length; /* Length in bytes of this property. */ |
| 773 | }; |
| 774 | |
Rich Lane | c6463c3 | 2014-10-10 17:13:27 -0700 | [diff] [blame] | 775 | struct of_port_desc_prop_ethernet : of_port_desc_prop { |
| 776 | uint16_t type == 0; |
| 777 | uint16_t length; |
| 778 | pad(4); |
| 779 | uint32_t curr; |
| 780 | uint32_t advertised; |
| 781 | uint32_t supported; |
| 782 | uint32_t peer; |
| 783 | uint32_t curr_speed; |
| 784 | uint32_t max_speed; |
| 785 | }; |
| 786 | |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 787 | struct of_port_desc { |
| 788 | of_port_no_t port_no; |
| 789 | uint16_t length; |
| 790 | pad(2); |
| 791 | of_mac_addr_t hw_addr; |
| 792 | pad(2); |
| 793 | of_port_name_t name; |
| 794 | enum ofp_port_config config; /* Bitmap of OFPPC_* flags. */ |
| 795 | enum ofp_port_state state; /* Bitmap of OFPPS_* flags. */ |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 796 | list(of_port_desc_prop_t) properties; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 797 | }; |
| 798 | |
| 799 | struct of_features_request : of_header { |
| 800 | uint8_t version; |
| 801 | uint8_t type == 5; |
| 802 | uint16_t length; |
| 803 | uint32_t xid; |
| 804 | }; |
| 805 | |
| 806 | struct of_features_reply : of_header { |
| 807 | uint8_t version; |
| 808 | uint8_t type == 6; |
| 809 | uint16_t length; |
| 810 | uint32_t xid; |
| 811 | uint64_t datapath_id; |
| 812 | uint32_t n_buffers; |
| 813 | uint8_t n_tables; |
| 814 | uint8_t auxiliary_id; |
| 815 | pad(2); |
| 816 | enum ofp_capabilities capabilities; |
| 817 | uint32_t reserved; |
| 818 | }; |
| 819 | |
| 820 | struct of_port_status : of_header { |
| 821 | uint8_t version; |
| 822 | uint8_t type == 12; |
| 823 | uint16_t length; |
| 824 | uint32_t xid; |
| 825 | enum ofp_port_reason reason; |
| 826 | pad(7); |
| 827 | of_port_desc_t desc; |
| 828 | }; |
| 829 | |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 830 | struct of_port_mod_prop { |
| 831 | uint16_t type == ?; /* One of OFPPMPT_*. */ |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 832 | uint16_t length; /* Length in bytes of this property. */ |
| 833 | }; |
| 834 | |
Rich Lane | 23e5c82 | 2014-10-14 10:47:29 -0700 | [diff] [blame] | 835 | struct of_port_mod_prop_ethernet : of_port_mod_prop { |
| 836 | uint16_t type == 0; |
| 837 | uint16_t length; |
| 838 | uint32_t advertise; |
| 839 | }; |
| 840 | |
| 841 | struct of_port_mod_prop_optical : of_port_mod_prop { |
| 842 | uint16_t type == 1; |
| 843 | uint16_t length; |
| 844 | uint32_t configure; |
| 845 | uint32_t freq_ldma; |
| 846 | uint32_t fl_offset; /* TODO signed */ |
| 847 | uint32_t grid_span; |
| 848 | uint32_t tx_pwr; |
| 849 | }; |
| 850 | |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 851 | struct of_port_mod : of_header { |
| 852 | uint8_t version; |
| 853 | uint8_t type == 16; |
| 854 | uint16_t length; |
| 855 | uint32_t xid; |
| 856 | of_port_no_t port_no; |
| 857 | pad(4); |
| 858 | of_mac_addr_t hw_addr; |
| 859 | pad(2); |
| 860 | uint32_t config; |
| 861 | uint32_t mask; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 862 | list(of_port_mod_prop_t) properties; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 863 | }; |
| 864 | |
Rich Lane | b4d24df | 2014-10-10 15:58:03 -0700 | [diff] [blame] | 865 | struct of_match_v3(align=8, length_includes_align=False) { |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 866 | uint16_t type == 1; |
| 867 | uint16_t length; |
| 868 | list(of_oxm_t) oxm_list; |
| 869 | }; |
| 870 | |
| 871 | // This looks like an action header, but is standalone. See |
| 872 | // ofp_table_features_prop_actions |
| 873 | struct of_action_id { |
| 874 | uint16_t type; |
| 875 | uint16_t len; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 876 | of_octets_t exp_data; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 877 | }; |
| 878 | |
| 879 | struct of_action_output : of_action { |
| 880 | uint16_t type == 0; |
| 881 | uint16_t len; |
| 882 | of_port_no_t port; |
| 883 | uint16_t max_len; |
| 884 | pad(6); |
| 885 | }; |
| 886 | |
| 887 | struct of_action_copy_ttl_out : of_action { |
| 888 | uint16_t type == 11; |
| 889 | uint16_t len; |
| 890 | pad(4); |
| 891 | }; |
| 892 | |
| 893 | struct of_action_copy_ttl_in : of_action { |
| 894 | uint16_t type == 12; |
| 895 | uint16_t len; |
| 896 | pad(4); |
| 897 | }; |
| 898 | |
| 899 | struct of_action_set_mpls_ttl : of_action { |
| 900 | uint16_t type == 15; |
| 901 | uint16_t len; |
| 902 | uint8_t mpls_ttl; |
| 903 | pad(3); |
| 904 | }; |
| 905 | |
| 906 | struct of_action_dec_mpls_ttl : of_action { |
| 907 | uint16_t type == 16; |
| 908 | uint16_t len; |
| 909 | pad(4); |
| 910 | }; |
| 911 | |
| 912 | struct of_action_push_vlan : of_action { |
| 913 | uint16_t type == 17; |
| 914 | uint16_t len; |
| 915 | uint16_t ethertype; |
| 916 | pad(2); |
| 917 | }; |
| 918 | |
| 919 | struct of_action_pop_vlan : of_action { |
| 920 | uint16_t type == 18; |
| 921 | uint16_t len; |
| 922 | pad(4); |
| 923 | }; |
| 924 | |
| 925 | struct of_action_push_mpls : of_action { |
| 926 | uint16_t type == 19; |
| 927 | uint16_t len; |
| 928 | uint16_t ethertype; |
| 929 | pad(2); |
| 930 | }; |
| 931 | |
| 932 | struct of_action_pop_mpls : of_action { |
| 933 | uint16_t type == 20; |
| 934 | uint16_t len; |
| 935 | uint16_t ethertype; |
| 936 | pad(2); |
| 937 | }; |
| 938 | |
| 939 | struct of_action_set_queue : of_action { |
| 940 | uint16_t type == 21; |
| 941 | uint16_t len; |
| 942 | uint32_t queue_id; |
| 943 | }; |
| 944 | |
| 945 | struct of_action_group : of_action { |
| 946 | uint16_t type == 22; |
| 947 | uint16_t len; |
| 948 | uint32_t group_id; |
| 949 | }; |
| 950 | |
| 951 | struct of_action_set_nw_ttl : of_action { |
| 952 | uint16_t type == 23; |
| 953 | uint16_t len; |
| 954 | uint8_t nw_ttl; |
| 955 | pad(3); |
| 956 | }; |
| 957 | |
| 958 | struct of_action_dec_nw_ttl : of_action { |
| 959 | uint16_t type == 24; |
| 960 | uint16_t len; |
| 961 | pad(4); |
| 962 | }; |
| 963 | |
| 964 | struct of_action_set_field(align=8, length_includes_align=True) : of_action { |
| 965 | uint16_t type == 25; |
| 966 | uint16_t len; |
| 967 | of_oxm_t field; |
| 968 | }; |
| 969 | |
| 970 | struct of_action_experimenter(align=8, length_includes_align=True): of_action { |
| 971 | uint16_t type == 65535; |
| 972 | uint16_t len; |
| 973 | uint32_t experimenter == ?; |
| 974 | of_octets_t data; |
| 975 | }; |
| 976 | |
| 977 | struct of_action_pop_pbb : of_action { |
| 978 | uint16_t type == 27; |
| 979 | uint16_t len; |
| 980 | pad(4); |
| 981 | }; |
| 982 | |
| 983 | struct of_action_push_pbb : of_action { |
| 984 | uint16_t type == 26; |
| 985 | uint16_t len; |
| 986 | uint16_t ethertype; |
| 987 | pad(2); |
| 988 | }; |
| 989 | |
| 990 | struct of_action { |
| 991 | uint16_t type == ?; |
| 992 | uint16_t len; |
| 993 | pad(4); |
| 994 | }; |
| 995 | |
| 996 | struct of_instruction_id { |
| 997 | uint16_t type; |
| 998 | uint16_t len; |
| 999 | }; |
| 1000 | |
| 1001 | struct of_instruction { |
| 1002 | uint16_t type == ?; |
| 1003 | uint16_t len; |
| 1004 | }; |
| 1005 | |
| 1006 | struct of_instruction_goto_table : of_instruction { |
| 1007 | uint16_t type == 1; |
| 1008 | uint16_t len; |
Rich Lane | 94af378 | 2014-10-10 15:59:36 -0700 | [diff] [blame] | 1009 | uint8_t table_id; |
| 1010 | pad(3); |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1011 | }; |
| 1012 | |
| 1013 | struct of_instruction_write_metadata : of_instruction { |
| 1014 | uint16_t type == 2; |
| 1015 | uint16_t len; |
| 1016 | pad(4); |
| 1017 | uint64_t metadata; |
| 1018 | uint64_t metadata_mask; |
| 1019 | }; |
| 1020 | |
| 1021 | struct of_instruction_write_actions : of_instruction { |
| 1022 | uint16_t type == 3; |
| 1023 | uint16_t len; |
| 1024 | pad(4); |
| 1025 | list(of_action_t) actions; |
| 1026 | }; |
| 1027 | |
| 1028 | struct of_instruction_apply_actions : of_instruction { |
| 1029 | uint16_t type == 4; |
| 1030 | uint16_t len; |
| 1031 | pad(4); |
| 1032 | list(of_action_t) actions; |
| 1033 | }; |
| 1034 | |
| 1035 | struct of_instruction_clear_actions : of_instruction { |
| 1036 | uint16_t type == 5; |
| 1037 | uint16_t len; |
| 1038 | pad(4); |
| 1039 | }; |
| 1040 | |
| 1041 | struct of_instruction_meter : of_instruction { |
| 1042 | uint16_t type == 6; |
| 1043 | uint16_t len; |
| 1044 | uint32_t meter_id; |
| 1045 | }; |
| 1046 | |
| 1047 | struct of_instruction_experimenter : of_instruction { |
| 1048 | uint16_t type == 65535; |
| 1049 | uint16_t len; |
| 1050 | uint32_t experimenter == ?; |
| 1051 | of_octets_t data; |
| 1052 | }; |
| 1053 | |
| 1054 | struct of_flow_mod : of_header { |
| 1055 | uint8_t version; |
| 1056 | uint8_t type == 14; |
| 1057 | uint16_t length; |
| 1058 | uint32_t xid; |
| 1059 | uint64_t cookie; |
| 1060 | uint64_t cookie_mask; |
| 1061 | uint8_t table_id; |
| 1062 | of_fm_cmd_t _command == ?; |
| 1063 | uint16_t idle_timeout; |
| 1064 | uint16_t hard_timeout; |
| 1065 | uint16_t priority; |
| 1066 | uint32_t buffer_id; |
| 1067 | of_port_no_t out_port; |
| 1068 | uint32_t out_group; |
| 1069 | enum ofp_flow_mod_flags flags; |
| 1070 | pad(2); |
| 1071 | of_match_t match; |
| 1072 | list(of_instruction_t) instructions; |
| 1073 | }; |
| 1074 | |
| 1075 | struct of_flow_add : of_flow_mod { |
| 1076 | uint8_t version; |
| 1077 | uint8_t type == 14; |
| 1078 | uint16_t length; |
| 1079 | uint32_t xid; |
| 1080 | uint64_t cookie; |
| 1081 | uint64_t cookie_mask; |
| 1082 | uint8_t table_id; |
| 1083 | of_fm_cmd_t _command == 0; |
| 1084 | uint16_t idle_timeout; |
| 1085 | uint16_t hard_timeout; |
| 1086 | uint16_t priority; |
| 1087 | uint32_t buffer_id; |
| 1088 | of_port_no_t out_port; |
| 1089 | uint32_t out_group; |
| 1090 | enum ofp_flow_mod_flags flags; |
| 1091 | uint16_t importance; |
| 1092 | of_match_t match; |
| 1093 | list(of_instruction_t) instructions; |
| 1094 | }; |
| 1095 | |
| 1096 | struct of_flow_modify : of_flow_mod { |
| 1097 | uint8_t version; |
| 1098 | uint8_t type == 14; |
| 1099 | uint16_t length; |
| 1100 | uint32_t xid; |
| 1101 | uint64_t cookie; |
| 1102 | uint64_t cookie_mask; |
| 1103 | uint8_t table_id; |
| 1104 | of_fm_cmd_t _command == 1; |
| 1105 | uint16_t idle_timeout; |
| 1106 | uint16_t hard_timeout; |
| 1107 | uint16_t priority; |
| 1108 | uint32_t buffer_id; |
| 1109 | of_port_no_t out_port; |
| 1110 | uint32_t out_group; |
| 1111 | enum ofp_flow_mod_flags flags; |
| 1112 | uint16_t importance; |
| 1113 | of_match_t match; |
| 1114 | list(of_instruction_t) instructions; |
| 1115 | }; |
| 1116 | |
| 1117 | struct of_flow_modify_strict : of_flow_mod { |
| 1118 | uint8_t version; |
| 1119 | uint8_t type == 14; |
| 1120 | uint16_t length; |
| 1121 | uint32_t xid; |
| 1122 | uint64_t cookie; |
| 1123 | uint64_t cookie_mask; |
| 1124 | uint8_t table_id; |
| 1125 | of_fm_cmd_t _command == 2; |
| 1126 | uint16_t idle_timeout; |
| 1127 | uint16_t hard_timeout; |
| 1128 | uint16_t priority; |
| 1129 | uint32_t buffer_id; |
| 1130 | of_port_no_t out_port; |
| 1131 | uint32_t out_group; |
| 1132 | enum ofp_flow_mod_flags flags; |
| 1133 | uint16_t importance; |
| 1134 | of_match_t match; |
| 1135 | list(of_instruction_t) instructions; |
| 1136 | }; |
| 1137 | |
| 1138 | struct of_flow_delete : of_flow_mod { |
| 1139 | uint8_t version; |
| 1140 | uint8_t type == 14; |
| 1141 | uint16_t length; |
| 1142 | uint32_t xid; |
| 1143 | uint64_t cookie; |
| 1144 | uint64_t cookie_mask; |
| 1145 | uint8_t table_id; |
| 1146 | of_fm_cmd_t _command == 3; |
| 1147 | uint16_t idle_timeout; |
| 1148 | uint16_t hard_timeout; |
| 1149 | uint16_t priority; |
| 1150 | uint32_t buffer_id; |
| 1151 | of_port_no_t out_port; |
| 1152 | uint32_t out_group; |
| 1153 | enum ofp_flow_mod_flags flags; |
| 1154 | uint16_t importance; |
| 1155 | of_match_t match; |
| 1156 | list(of_instruction_t) instructions; |
| 1157 | }; |
| 1158 | |
| 1159 | struct of_flow_delete_strict : of_flow_mod { |
| 1160 | uint8_t version; |
| 1161 | uint8_t type == 14; |
| 1162 | uint16_t length; |
| 1163 | uint32_t xid; |
| 1164 | uint64_t cookie; |
| 1165 | uint64_t cookie_mask; |
| 1166 | uint8_t table_id; |
| 1167 | of_fm_cmd_t _command == 4; |
| 1168 | uint16_t idle_timeout; |
| 1169 | uint16_t hard_timeout; |
| 1170 | uint16_t priority; |
| 1171 | uint32_t buffer_id; |
| 1172 | of_port_no_t out_port; |
| 1173 | uint32_t out_group; |
| 1174 | enum ofp_flow_mod_flags flags; |
| 1175 | uint16_t importance; |
| 1176 | of_match_t match; |
| 1177 | list(of_instruction_t) instructions; |
| 1178 | }; |
| 1179 | |
| 1180 | struct of_bucket { |
| 1181 | uint16_t len; |
| 1182 | uint16_t weight; |
| 1183 | of_port_no_t watch_port; |
| 1184 | uint32_t watch_group; |
| 1185 | pad(4); |
| 1186 | list(of_action_t) actions; |
| 1187 | }; |
| 1188 | |
| 1189 | struct of_group_mod : of_header { |
| 1190 | uint8_t version; |
| 1191 | uint8_t type == 15; |
| 1192 | uint16_t length; |
| 1193 | uint32_t xid; |
| 1194 | enum ofp_group_mod_command command == ?; |
| 1195 | enum ofp_group_type group_type; |
| 1196 | pad(1); |
| 1197 | uint32_t group_id; |
| 1198 | list(of_bucket_t) buckets; |
| 1199 | }; |
| 1200 | |
| 1201 | struct of_group_add : of_group_mod { |
| 1202 | uint8_t version; |
| 1203 | uint8_t type == 15; |
| 1204 | uint16_t length; |
| 1205 | uint32_t xid; |
| 1206 | enum ofp_group_mod_command command == 0; |
| 1207 | enum ofp_group_type group_type; |
| 1208 | pad(1); |
| 1209 | uint32_t group_id; |
| 1210 | list(of_bucket_t) buckets; |
| 1211 | }; |
| 1212 | |
| 1213 | struct of_group_modify : of_group_mod { |
| 1214 | uint8_t version; |
| 1215 | uint8_t type == 15; |
| 1216 | uint16_t length; |
| 1217 | uint32_t xid; |
| 1218 | enum ofp_group_mod_command command == 1; |
| 1219 | enum ofp_group_type group_type; |
| 1220 | pad(1); |
| 1221 | uint32_t group_id; |
| 1222 | list(of_bucket_t) buckets; |
| 1223 | }; |
| 1224 | |
| 1225 | struct of_group_delete : of_group_mod { |
| 1226 | uint8_t version; |
| 1227 | uint8_t type == 15; |
| 1228 | uint16_t length; |
| 1229 | uint32_t xid; |
| 1230 | enum ofp_group_mod_command command == 2; |
| 1231 | enum ofp_group_type group_type; |
| 1232 | pad(1); |
| 1233 | uint32_t group_id; |
| 1234 | list(of_bucket_t) buckets; |
| 1235 | }; |
| 1236 | |
| 1237 | struct of_packet_out : of_header { |
| 1238 | uint8_t version; |
| 1239 | uint8_t type == 13; |
| 1240 | uint16_t length; |
| 1241 | uint32_t xid; |
| 1242 | uint32_t buffer_id; |
| 1243 | of_port_no_t in_port; |
| 1244 | uint16_t actions_len; |
| 1245 | pad(6); |
| 1246 | list(of_action_t) actions; |
| 1247 | of_octets_t data; |
| 1248 | }; |
| 1249 | |
| 1250 | struct of_packet_in : of_header { |
| 1251 | uint8_t version; |
| 1252 | uint8_t type == 10; |
| 1253 | uint16_t length; |
| 1254 | uint32_t xid; |
| 1255 | uint32_t buffer_id; |
| 1256 | uint16_t total_len; |
| 1257 | uint8_t reason; |
| 1258 | uint8_t table_id; |
| 1259 | uint64_t cookie; |
| 1260 | of_match_t match; |
| 1261 | pad(2); |
| 1262 | of_octets_t data; /* FIXME: Ensure total_len gets updated */ |
| 1263 | }; |
| 1264 | |
| 1265 | struct of_flow_removed : of_header { |
| 1266 | uint8_t version; |
| 1267 | uint8_t type == 11; |
| 1268 | uint16_t length; |
| 1269 | uint32_t xid; |
| 1270 | uint64_t cookie; |
| 1271 | uint16_t priority; |
| 1272 | uint8_t reason; |
| 1273 | uint8_t table_id; |
| 1274 | uint32_t duration_sec; |
| 1275 | uint32_t duration_nsec; |
| 1276 | uint16_t idle_timeout; |
| 1277 | uint16_t hard_timeout; |
| 1278 | uint64_t packet_count; |
| 1279 | uint64_t byte_count; |
| 1280 | of_match_t match; |
| 1281 | }; |
| 1282 | |
| 1283 | struct of_meter_band { |
| 1284 | uint16_t type == ?; |
| 1285 | uint16_t len; |
| 1286 | // uint32_t rate; // These are excluded b/c this is the header |
| 1287 | // uint32_t burst_size; // These are excluded b/c this is the header |
| 1288 | }; |
| 1289 | |
| 1290 | struct of_meter_band_drop : of_meter_band { |
| 1291 | uint16_t type == 1; |
| 1292 | uint16_t len; |
| 1293 | uint32_t rate; |
| 1294 | uint32_t burst_size; |
| 1295 | pad(4); |
| 1296 | }; |
| 1297 | |
| 1298 | struct of_meter_band_dscp_remark : of_meter_band { |
| 1299 | uint16_t type == 2; |
| 1300 | uint16_t len; |
| 1301 | uint32_t rate; |
| 1302 | uint32_t burst_size; |
| 1303 | uint8_t prec_level; |
| 1304 | pad(3); |
| 1305 | }; |
| 1306 | |
| 1307 | struct of_meter_band_experimenter : of_meter_band { |
| 1308 | uint16_t type == 65535; |
| 1309 | uint16_t len; |
| 1310 | uint32_t rate; |
| 1311 | uint32_t burst_size; |
| 1312 | uint32_t experimenter; |
| 1313 | }; |
| 1314 | |
| 1315 | struct of_meter_mod : of_header { |
| 1316 | uint8_t version; |
| 1317 | uint8_t type == 29; |
| 1318 | uint16_t length; |
| 1319 | uint32_t xid; |
| 1320 | uint16_t command; |
| 1321 | uint16_t flags; |
| 1322 | uint32_t meter_id; |
| 1323 | list(of_meter_band_t) bands; |
| 1324 | }; |
| 1325 | |
| 1326 | struct of_error_msg : of_header { |
| 1327 | uint8_t version; |
| 1328 | uint8_t type == 1; |
| 1329 | uint16_t length; |
| 1330 | uint32_t xid; |
| 1331 | uint16_t err_type == ?; |
| 1332 | }; |
| 1333 | |
| 1334 | struct of_hello_failed_error_msg : of_error_msg { |
| 1335 | uint8_t version; |
| 1336 | uint8_t type == 1; |
| 1337 | uint16_t length; |
| 1338 | uint32_t xid; |
| 1339 | uint16_t err_type == 0; |
| 1340 | enum ofp_hello_failed_code code; |
| 1341 | of_octets_t data; |
| 1342 | }; |
| 1343 | |
| 1344 | struct of_bad_request_error_msg : of_error_msg { |
| 1345 | uint8_t version; |
| 1346 | uint8_t type == 1; |
| 1347 | uint16_t length; |
| 1348 | uint32_t xid; |
| 1349 | uint16_t err_type == 1; |
| 1350 | enum ofp_bad_request_code code; |
| 1351 | of_octets_t data; |
| 1352 | }; |
| 1353 | |
| 1354 | struct of_bad_action_error_msg : of_error_msg { |
| 1355 | uint8_t version; |
| 1356 | uint8_t type == 1; |
| 1357 | uint16_t length; |
| 1358 | uint32_t xid; |
| 1359 | uint16_t err_type == 2; |
| 1360 | enum ofp_bad_action_code code; |
| 1361 | of_octets_t data; |
| 1362 | }; |
| 1363 | |
| 1364 | struct of_bad_instruction_error_msg : of_error_msg { |
| 1365 | uint8_t version; |
| 1366 | uint8_t type == 1; |
| 1367 | uint16_t length; |
| 1368 | uint32_t xid; |
| 1369 | uint16_t err_type == 3; |
| 1370 | enum ofp_bad_instruction_code code; |
| 1371 | of_octets_t data; |
| 1372 | }; |
| 1373 | |
| 1374 | struct of_bad_match_error_msg : of_error_msg { |
| 1375 | uint8_t version; |
| 1376 | uint8_t type == 1; |
| 1377 | uint16_t length; |
| 1378 | uint32_t xid; |
| 1379 | uint16_t err_type == 4; |
| 1380 | enum ofp_bad_match_code code; |
| 1381 | of_octets_t data; |
| 1382 | }; |
| 1383 | |
| 1384 | struct of_flow_mod_failed_error_msg : of_error_msg { |
| 1385 | uint8_t version; |
| 1386 | uint8_t type == 1; |
| 1387 | uint16_t length; |
| 1388 | uint32_t xid; |
| 1389 | uint16_t err_type == 5; |
| 1390 | enum ofp_flow_mod_failed_code code; |
| 1391 | of_octets_t data; |
| 1392 | }; |
| 1393 | |
| 1394 | struct of_group_mod_failed_error_msg : of_error_msg { |
| 1395 | uint8_t version; |
| 1396 | uint8_t type == 1; |
| 1397 | uint16_t length; |
| 1398 | uint32_t xid; |
| 1399 | uint16_t err_type == 6; |
| 1400 | enum ofp_group_mod_failed_code code; |
| 1401 | of_octets_t data; |
| 1402 | }; |
| 1403 | |
| 1404 | struct of_port_mod_failed_error_msg : of_error_msg { |
| 1405 | uint8_t version; |
| 1406 | uint8_t type == 1; |
| 1407 | uint16_t length; |
| 1408 | uint32_t xid; |
| 1409 | uint16_t err_type == 7; |
| 1410 | enum ofp_port_mod_failed_code code; |
| 1411 | of_octets_t data; |
| 1412 | }; |
| 1413 | |
| 1414 | struct of_table_mod_failed_error_msg : of_error_msg { |
| 1415 | uint8_t version; |
| 1416 | uint8_t type == 1; |
| 1417 | uint16_t length; |
| 1418 | uint32_t xid; |
| 1419 | uint16_t err_type == 8; |
| 1420 | enum ofp_table_mod_failed_code code; |
| 1421 | of_octets_t data; |
| 1422 | }; |
| 1423 | |
| 1424 | struct of_queue_op_failed_error_msg : of_error_msg { |
| 1425 | uint8_t version; |
| 1426 | uint8_t type == 1; |
| 1427 | uint16_t length; |
| 1428 | uint32_t xid; |
| 1429 | uint16_t err_type == 9; |
| 1430 | enum ofp_queue_op_failed_code code; |
| 1431 | of_octets_t data; |
| 1432 | }; |
| 1433 | |
| 1434 | struct of_switch_config_failed_error_msg : of_error_msg { |
| 1435 | uint8_t version; |
| 1436 | uint8_t type == 1; |
| 1437 | uint16_t length; |
| 1438 | uint32_t xid; |
| 1439 | uint16_t err_type == 10; |
| 1440 | enum ofp_switch_config_failed_code code; |
| 1441 | of_octets_t data; |
| 1442 | }; |
| 1443 | |
| 1444 | struct of_role_request_failed_error_msg : of_error_msg { |
| 1445 | uint8_t version; |
| 1446 | uint8_t type == 1; |
| 1447 | uint16_t length; |
| 1448 | uint32_t xid; |
| 1449 | uint16_t err_type == 11; |
| 1450 | enum ofp_role_request_failed_code code; |
| 1451 | of_octets_t data; |
| 1452 | }; |
| 1453 | |
| 1454 | struct of_meter_mod_failed_error_msg : of_error_msg { |
| 1455 | uint8_t version; |
| 1456 | uint8_t type == 1; |
| 1457 | uint16_t length; |
| 1458 | uint32_t xid; |
| 1459 | uint16_t err_type == 12; |
| 1460 | enum ofp_meter_mod_failed_code code; |
| 1461 | of_octets_t data; |
| 1462 | }; |
| 1463 | |
| 1464 | struct of_table_features_failed_error_msg : of_error_msg { |
| 1465 | uint8_t version; |
| 1466 | uint8_t type == 1; |
| 1467 | uint16_t length; |
| 1468 | uint32_t xid; |
| 1469 | uint16_t err_type == 13; |
| 1470 | enum ofp_table_features_failed_code code; |
| 1471 | of_octets_t data; |
| 1472 | }; |
| 1473 | |
| 1474 | struct of_experimenter_error_msg : of_error_msg { |
| 1475 | uint8_t version; |
| 1476 | uint8_t type == 1; |
| 1477 | uint16_t length; |
| 1478 | uint32_t xid; |
| 1479 | uint16_t err_type == 0xffff; |
| 1480 | uint16_t subtype; |
| 1481 | uint32_t experimenter; |
| 1482 | of_octets_t data; |
| 1483 | }; |
| 1484 | |
| 1485 | // STATS ENTRIES: flow, table, port, queue, group stats, group desc stats |
| 1486 | |
| 1487 | struct of_flow_stats_entry { |
| 1488 | uint16_t length; |
| 1489 | uint8_t table_id; |
| 1490 | pad(1); |
| 1491 | uint32_t duration_sec; |
| 1492 | uint32_t duration_nsec; |
| 1493 | uint16_t priority; |
| 1494 | uint16_t idle_timeout; |
| 1495 | uint16_t hard_timeout; |
| 1496 | enum ofp_flow_mod_flags flags; |
| 1497 | uint16_t importance; |
| 1498 | pad(2); |
| 1499 | uint64_t cookie; |
| 1500 | uint64_t packet_count; |
| 1501 | uint64_t byte_count; |
| 1502 | of_match_t match; |
| 1503 | list(of_instruction_t) instructions; |
| 1504 | }; |
| 1505 | |
| 1506 | |
| 1507 | struct of_table_stats_entry { |
| 1508 | uint8_t table_id; |
| 1509 | pad(3); |
| 1510 | uint32_t active_count; |
| 1511 | uint64_t lookup_count; |
| 1512 | uint64_t matched_count; |
| 1513 | }; |
| 1514 | |
| 1515 | /* Common header for all port stats properties. */ |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1516 | struct of_port_stats_prop { |
| 1517 | uint16_t type == ?; /* One of OFPPSPT_*. */ |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1518 | uint16_t length; /* Length in bytes of this property. */ |
| 1519 | }; |
| 1520 | |
| 1521 | /* Ethernet port stats property. */ |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1522 | struct of_port_stats_prop_ethernet : of_port_stats_prop { |
| 1523 | uint16_t type == 0; /* OFPPSPT_ETHERNET. */ |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1524 | uint16_t length; /* Length in bytes of this property. */ |
| 1525 | pad(4); |
| 1526 | |
| 1527 | uint64_t rx_frame_err; /* Number of frame alignment errors. */ |
| 1528 | uint64_t rx_over_err; /* Number of packets with RX overrun. */ |
| 1529 | uint64_t rx_crc_err; /* Number of CRC errors. */ |
| 1530 | uint64_t collisions; /* Number of collisions. */ |
| 1531 | }; |
| 1532 | |
| 1533 | /* Optical port stats property. */ |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1534 | struct of_port_stats_prop_optical : of_port_stats_prop { |
| 1535 | uint16_t type == 1; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1536 | uint16_t length; |
| 1537 | pad(4); |
| 1538 | |
| 1539 | uint32_t flags; |
| 1540 | uint32_t tx_freq_lmda; |
| 1541 | uint32_t tx_offset; |
| 1542 | uint32_t tx_grid_span; |
| 1543 | uint32_t rx_freq_lmda; |
| 1544 | uint32_t rx_offset; |
| 1545 | uint32_t rx_grid_span; |
| 1546 | uint16_t tx_pwr; |
| 1547 | uint16_t rx_pwr; |
| 1548 | uint16_t bias_current; |
| 1549 | uint16_t temperature; |
| 1550 | }; |
| 1551 | |
| 1552 | /* Experimenter port stats property. */ |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1553 | struct of_port_stats_prop_experimenter : of_port_stats_prop { |
| 1554 | uint16_t type == 0xffff; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1555 | uint16_t length; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1556 | uint32_t experimenter == ?; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1557 | uint32_t exp_type; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1558 | of_octets_t experimenter_data; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1559 | }; |
| 1560 | |
| 1561 | struct of_port_stats_entry { |
| 1562 | uint16_t length; |
| 1563 | pad(2); |
| 1564 | of_port_no_t port_no; |
Rich Lane | 90651c4 | 2014-10-10 16:19:30 -0700 | [diff] [blame] | 1565 | uint32_t duration_sec; |
| 1566 | uint32_t duration_nsec; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1567 | uint64_t rx_packets; |
| 1568 | uint64_t tx_packets; |
| 1569 | uint64_t rx_bytes; |
| 1570 | uint64_t tx_bytes; |
| 1571 | uint64_t rx_dropped; |
| 1572 | uint64_t tx_dropped; |
| 1573 | uint64_t rx_errors; |
| 1574 | uint64_t tx_errors; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1575 | list(of_port_stats_prop_t) properties; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1576 | }; |
| 1577 | |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1578 | struct of_queue_stats_prop { |
| 1579 | uint16_t type == ?; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1580 | uint16_t length; |
| 1581 | }; |
| 1582 | |
| 1583 | struct of_queue_stats_entry { |
| 1584 | uint16_t length; |
| 1585 | pad(6); |
| 1586 | of_port_no_t port_no; |
| 1587 | uint32_t queue_id; |
| 1588 | uint64_t tx_bytes; |
| 1589 | uint64_t tx_packets; |
| 1590 | uint64_t tx_errors; |
| 1591 | uint32_t duration_sec; |
| 1592 | uint32_t duration_nsec; |
| 1593 | |
| 1594 | |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1595 | list(of_queue_stats_prop_t) properties; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1596 | }; |
| 1597 | |
| 1598 | struct of_bucket_counter { |
| 1599 | uint64_t packet_count; |
| 1600 | uint64_t byte_count; |
| 1601 | }; |
| 1602 | |
| 1603 | struct of_group_stats_entry { |
| 1604 | uint16_t length; |
| 1605 | pad(2); |
| 1606 | uint32_t group_id; |
| 1607 | uint32_t ref_count; |
| 1608 | pad(4); |
| 1609 | uint64_t packet_count; |
| 1610 | uint64_t byte_count; |
| 1611 | uint32_t duration_sec; |
| 1612 | uint32_t duration_nsec; |
| 1613 | list(of_bucket_counter_t) bucket_stats; |
| 1614 | }; |
| 1615 | |
| 1616 | struct of_group_desc_stats_entry { |
| 1617 | uint16_t length; |
| 1618 | enum ofp_group_type group_type; |
| 1619 | pad(1); |
| 1620 | uint32_t group_id; |
| 1621 | list(of_bucket_t) buckets; |
| 1622 | }; |
| 1623 | |
| 1624 | // STATS: |
| 1625 | // Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi |
| 1626 | |
| 1627 | struct of_stats_request : of_header { |
| 1628 | uint8_t version; |
| 1629 | uint8_t type == 18; |
| 1630 | uint16_t length; |
| 1631 | uint32_t xid; |
| 1632 | uint16_t stats_type == ?; |
| 1633 | enum ofp_stats_request_flags flags; |
| 1634 | pad(4); |
| 1635 | }; |
| 1636 | |
| 1637 | struct of_stats_reply : of_header { |
| 1638 | uint8_t version; |
| 1639 | uint8_t type == 19; |
| 1640 | uint16_t length; |
| 1641 | uint32_t xid; |
| 1642 | uint16_t stats_type == ?; |
| 1643 | enum ofp_stats_reply_flags flags; |
| 1644 | pad(4); |
| 1645 | }; |
| 1646 | |
| 1647 | struct of_desc_stats_request : of_stats_request { |
| 1648 | uint8_t version; |
| 1649 | uint8_t type == 18; |
| 1650 | uint16_t length; |
| 1651 | uint32_t xid; |
| 1652 | uint16_t stats_type == 0; |
| 1653 | enum ofp_stats_request_flags flags; |
| 1654 | pad(4); |
| 1655 | }; |
| 1656 | |
| 1657 | struct of_desc_stats_reply : of_stats_reply { |
| 1658 | uint8_t version; |
| 1659 | uint8_t type == 19; |
| 1660 | uint16_t length; |
| 1661 | uint32_t xid; |
| 1662 | uint16_t stats_type == 0; |
| 1663 | enum ofp_stats_reply_flags flags; |
| 1664 | pad(4); |
| 1665 | of_desc_str_t mfr_desc; |
| 1666 | of_desc_str_t hw_desc; |
| 1667 | of_desc_str_t sw_desc; |
| 1668 | of_serial_num_t serial_num; |
| 1669 | of_desc_str_t dp_desc; |
| 1670 | }; |
| 1671 | |
| 1672 | struct of_flow_stats_request : of_stats_request { |
| 1673 | uint8_t version; |
| 1674 | uint8_t type == 18; |
| 1675 | uint16_t length; |
| 1676 | uint32_t xid; |
| 1677 | uint16_t stats_type == 1; |
| 1678 | enum ofp_stats_request_flags flags; |
| 1679 | pad(4); |
| 1680 | uint8_t table_id; |
| 1681 | pad(3); |
| 1682 | of_port_no_t out_port; |
| 1683 | uint32_t out_group; |
| 1684 | pad(4); |
| 1685 | uint64_t cookie; |
| 1686 | uint64_t cookie_mask; |
| 1687 | of_match_t match; |
| 1688 | }; |
| 1689 | |
| 1690 | struct of_flow_stats_reply : of_stats_reply { |
| 1691 | uint8_t version; |
| 1692 | uint8_t type == 19; |
| 1693 | uint16_t length; |
| 1694 | uint32_t xid; |
| 1695 | uint16_t stats_type == 1; |
| 1696 | enum ofp_stats_reply_flags flags; |
| 1697 | pad(4); |
| 1698 | list(of_flow_stats_entry_t) entries; |
| 1699 | }; |
| 1700 | |
| 1701 | struct of_aggregate_stats_request : of_stats_request { |
| 1702 | uint8_t version; |
| 1703 | uint8_t type == 18; |
| 1704 | uint16_t length; |
| 1705 | uint32_t xid; |
| 1706 | uint16_t stats_type == 2; |
| 1707 | enum ofp_stats_request_flags flags; |
| 1708 | pad(4); |
| 1709 | uint8_t table_id; |
| 1710 | pad(3); |
| 1711 | of_port_no_t out_port; |
| 1712 | uint32_t out_group; |
| 1713 | pad(4); |
| 1714 | uint64_t cookie; |
| 1715 | uint64_t cookie_mask; |
| 1716 | of_match_t match; |
| 1717 | }; |
| 1718 | |
| 1719 | struct of_aggregate_stats_reply : of_stats_reply { |
| 1720 | uint8_t version; |
| 1721 | uint8_t type == 19; |
| 1722 | uint16_t length; |
| 1723 | uint32_t xid; |
| 1724 | uint16_t stats_type == 2; |
| 1725 | enum ofp_stats_reply_flags flags; |
| 1726 | pad(4); |
| 1727 | uint64_t packet_count; |
| 1728 | uint64_t byte_count; |
| 1729 | uint32_t flow_count; |
| 1730 | pad(4); |
| 1731 | }; |
| 1732 | |
| 1733 | struct of_table_stats_request : of_stats_request { |
| 1734 | uint8_t version; |
| 1735 | uint8_t type == 18; |
| 1736 | uint16_t length; |
| 1737 | uint32_t xid; |
| 1738 | uint16_t stats_type == 3; |
| 1739 | enum ofp_stats_request_flags flags; |
| 1740 | pad(4); |
| 1741 | }; |
| 1742 | |
| 1743 | struct of_table_stats_reply : of_stats_reply { |
| 1744 | uint8_t version; |
| 1745 | uint8_t type == 19; |
| 1746 | uint16_t length; |
| 1747 | uint32_t xid; |
| 1748 | uint16_t stats_type == 3; |
| 1749 | enum ofp_stats_reply_flags flags; |
| 1750 | pad(4); |
| 1751 | list(of_table_stats_entry_t) entries; |
| 1752 | }; |
| 1753 | |
| 1754 | struct of_experimenter_stats_request : of_stats_request { |
| 1755 | uint8_t version; |
| 1756 | uint8_t type == 18; |
| 1757 | uint16_t length; |
| 1758 | uint32_t xid; |
| 1759 | uint16_t stats_type == 0xffff; |
| 1760 | enum ofp_stats_request_flags flags; |
| 1761 | pad(4); |
| 1762 | uint32_t experimenter == ?; |
| 1763 | uint32_t subtype; |
| 1764 | }; |
| 1765 | |
| 1766 | struct of_experimenter_stats_reply : of_stats_reply { |
| 1767 | uint8_t version; |
| 1768 | uint8_t type == 19; |
| 1769 | uint16_t length; |
| 1770 | uint32_t xid; |
| 1771 | uint16_t stats_type == 0xffff; |
| 1772 | enum ofp_stats_reply_flags flags; |
| 1773 | pad(4); |
| 1774 | uint32_t experimenter == ?; |
| 1775 | uint32_t subtype; |
| 1776 | }; |
| 1777 | |
| 1778 | // FIXME: These are padded to 8 byte align beyond the length indicated |
| 1779 | |
| 1780 | struct of_table_feature_prop { |
| 1781 | uint16_t type == ?; |
| 1782 | uint16_t length; |
| 1783 | }; |
| 1784 | |
| 1785 | struct of_table_feature_prop_instructions : of_table_feature_prop { |
| 1786 | uint16_t type == 0; |
| 1787 | uint16_t length; |
| 1788 | // FIXME Check if instruction_t is right for ids here |
| 1789 | list(of_instruction_id_t) instruction_ids; |
| 1790 | }; |
| 1791 | |
| 1792 | struct of_table_feature_prop_instructions_miss : of_table_feature_prop { |
| 1793 | uint16_t type == 1; |
| 1794 | uint16_t length; |
| 1795 | list(of_instruction_id_t) instruction_ids; |
| 1796 | }; |
| 1797 | |
| 1798 | struct of_table_feature_prop_next_tables : of_table_feature_prop { |
| 1799 | uint16_t type == 2; |
| 1800 | uint16_t length; |
| 1801 | list(of_uint8_t) next_table_ids; |
| 1802 | }; |
| 1803 | |
| 1804 | struct of_table_feature_prop_next_tables_miss : of_table_feature_prop { |
| 1805 | uint16_t type == 3; |
| 1806 | uint16_t length; |
| 1807 | list(of_uint8_t) next_table_ids; |
| 1808 | }; |
| 1809 | |
| 1810 | struct of_table_feature_prop_write_actions : of_table_feature_prop { |
| 1811 | uint16_t type == 4; |
| 1812 | uint16_t length; |
| 1813 | list(of_action_id_t) action_ids; |
| 1814 | }; |
| 1815 | |
| 1816 | struct of_table_feature_prop_write_actions_miss : of_table_feature_prop { |
| 1817 | uint16_t type == 5; |
| 1818 | uint16_t length; |
| 1819 | list(of_action_id_t) action_ids; |
| 1820 | }; |
| 1821 | |
| 1822 | struct of_table_feature_prop_apply_actions : of_table_feature_prop { |
| 1823 | uint16_t type == 6; |
| 1824 | uint16_t length; |
| 1825 | list(of_action_id_t) action_ids; |
| 1826 | }; |
| 1827 | |
| 1828 | struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop { |
| 1829 | uint16_t type == 7; |
| 1830 | uint16_t length; |
| 1831 | list(of_action_id_t) action_ids; |
| 1832 | }; |
| 1833 | |
| 1834 | struct of_table_feature_prop_match : of_table_feature_prop { |
| 1835 | uint16_t type == 8; |
| 1836 | uint16_t length; |
| 1837 | list(of_uint32_t) oxm_ids; |
| 1838 | }; |
| 1839 | |
| 1840 | struct of_table_feature_prop_wildcards : of_table_feature_prop { |
| 1841 | uint16_t type == 10; |
| 1842 | uint16_t length; |
| 1843 | list(of_uint32_t) oxm_ids; |
| 1844 | }; |
| 1845 | |
| 1846 | struct of_table_feature_prop_write_setfield : of_table_feature_prop { |
| 1847 | uint16_t type == 12; |
| 1848 | uint16_t length; |
| 1849 | list(of_uint32_t) oxm_ids; |
| 1850 | }; |
| 1851 | |
| 1852 | struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop { |
| 1853 | uint16_t type == 13; |
| 1854 | uint16_t length; |
| 1855 | list(of_uint32_t) oxm_ids; |
| 1856 | }; |
| 1857 | |
| 1858 | struct of_table_feature_prop_apply_setfield : of_table_feature_prop { |
| 1859 | uint16_t type == 14; |
| 1860 | uint16_t length; |
| 1861 | list(of_uint32_t) oxm_ids; |
| 1862 | }; |
| 1863 | |
| 1864 | struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop { |
| 1865 | uint16_t type == 15; |
| 1866 | uint16_t length; |
| 1867 | list(of_uint32_t) oxm_ids; |
| 1868 | }; |
| 1869 | |
| 1870 | struct of_table_feature_prop_experimenter : of_table_feature_prop { |
| 1871 | uint16_t type == 65534; |
| 1872 | uint16_t length; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1873 | uint32_t experimenter == ?; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1874 | uint32_t subtype; |
| 1875 | of_octets_t experimenter_data; |
| 1876 | }; |
| 1877 | |
| 1878 | struct of_table_feature_prop_experimenter_miss : of_table_feature_prop { |
| 1879 | uint16_t type == 65535; |
| 1880 | uint16_t length; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1881 | uint32_t experimenter == ?; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1882 | uint32_t subtype; |
| 1883 | of_octets_t experimenter_data; |
| 1884 | }; |
| 1885 | |
| 1886 | struct of_table_features { |
| 1887 | uint16_t length; |
| 1888 | uint8_t table_id; |
| 1889 | pad(5); |
| 1890 | of_table_name_t name; |
| 1891 | uint64_t metadata_match; |
| 1892 | uint64_t metadata_write; |
| 1893 | uint32_t config; |
| 1894 | uint32_t max_entries; |
| 1895 | list(of_table_feature_prop_t) properties; |
| 1896 | }; |
| 1897 | |
| 1898 | struct of_meter_features { |
| 1899 | uint32_t max_meter; |
| 1900 | uint32_t band_types; |
| 1901 | uint32_t capabilities; |
| 1902 | uint8_t max_bands; |
| 1903 | uint8_t max_color; |
| 1904 | pad(2); |
| 1905 | }; |
| 1906 | |
| 1907 | struct of_port_stats_request : of_stats_request { |
| 1908 | uint8_t version; |
| 1909 | uint8_t type == 18; |
| 1910 | uint16_t length; |
| 1911 | uint32_t xid; |
| 1912 | uint16_t stats_type == 4; |
| 1913 | enum ofp_stats_request_flags flags; |
| 1914 | pad(4); |
| 1915 | of_port_no_t port_no; |
| 1916 | pad(4); |
| 1917 | }; |
| 1918 | |
| 1919 | struct of_port_stats_reply : of_stats_reply { |
| 1920 | uint8_t version; |
| 1921 | uint8_t type == 19; |
| 1922 | uint16_t length; |
| 1923 | uint32_t xid; |
| 1924 | uint16_t stats_type == 4; |
| 1925 | enum ofp_stats_reply_flags flags; |
| 1926 | pad(4); |
| 1927 | list(of_port_stats_entry_t) entries; |
| 1928 | }; |
| 1929 | |
| 1930 | struct of_queue_stats_request : of_stats_request { |
| 1931 | uint8_t version; |
| 1932 | uint8_t type == 18; |
| 1933 | uint16_t length; |
| 1934 | uint32_t xid; |
| 1935 | uint16_t stats_type == 5; |
| 1936 | enum ofp_stats_request_flags flags; |
| 1937 | pad(4); |
| 1938 | of_port_no_t port_no; |
| 1939 | uint32_t queue_id; |
| 1940 | }; |
| 1941 | |
| 1942 | struct of_queue_stats_reply : of_stats_reply { |
| 1943 | uint8_t version; |
| 1944 | uint8_t type == 19; |
| 1945 | uint16_t length; |
| 1946 | uint32_t xid; |
| 1947 | uint16_t stats_type == 5; |
| 1948 | enum ofp_stats_reply_flags flags; |
| 1949 | pad(4); |
| 1950 | list(of_queue_stats_entry_t) entries; |
| 1951 | }; |
| 1952 | |
| 1953 | struct of_group_stats_request : of_stats_request { |
| 1954 | uint8_t version; |
| 1955 | uint8_t type == 18; |
| 1956 | uint16_t length; |
| 1957 | uint32_t xid; |
| 1958 | uint16_t stats_type == 6; |
| 1959 | enum ofp_stats_request_flags flags; |
| 1960 | pad(4); |
| 1961 | uint32_t group_id; |
| 1962 | pad(4); |
| 1963 | }; |
| 1964 | |
| 1965 | struct of_group_stats_reply : of_stats_reply { |
| 1966 | uint8_t version; |
| 1967 | uint8_t type == 19; |
| 1968 | uint16_t length; |
| 1969 | uint32_t xid; |
| 1970 | uint16_t stats_type == 6; |
| 1971 | enum ofp_stats_reply_flags flags; |
| 1972 | pad(4); |
| 1973 | list(of_group_stats_entry_t) entries; |
| 1974 | }; |
| 1975 | |
| 1976 | struct of_group_desc_stats_request : of_stats_request { |
| 1977 | uint8_t version; |
| 1978 | uint8_t type == 18; |
| 1979 | uint16_t length; |
| 1980 | uint32_t xid; |
| 1981 | uint16_t stats_type == 7; |
| 1982 | enum ofp_stats_request_flags flags; |
| 1983 | pad(4); |
| 1984 | }; |
| 1985 | |
| 1986 | struct of_group_desc_stats_reply : of_stats_reply { |
| 1987 | uint8_t version; |
| 1988 | uint8_t type == 19; |
| 1989 | uint16_t length; |
| 1990 | uint32_t xid; |
| 1991 | uint16_t stats_type == 7; |
| 1992 | enum ofp_stats_reply_flags flags; |
| 1993 | pad(4); |
| 1994 | list(of_group_desc_stats_entry_t) entries; |
| 1995 | }; |
| 1996 | |
| 1997 | struct of_group_features_stats_request : of_stats_request { |
| 1998 | uint8_t version; |
| 1999 | uint8_t type == 18; |
| 2000 | uint16_t length; |
| 2001 | uint32_t xid; |
| 2002 | uint16_t stats_type == 8; |
| 2003 | enum ofp_stats_request_flags flags; |
| 2004 | pad(4); |
| 2005 | }; |
| 2006 | |
| 2007 | struct of_group_features_stats_reply : of_stats_reply { |
| 2008 | uint8_t version; |
| 2009 | uint8_t type == 19; |
| 2010 | uint16_t length; |
| 2011 | uint32_t xid; |
| 2012 | uint16_t stats_type == 8; |
| 2013 | enum ofp_stats_reply_flags flags; |
| 2014 | pad(4); |
| 2015 | uint32_t types; |
| 2016 | uint32_t capabilities; |
| 2017 | uint32_t max_groups_all; |
| 2018 | uint32_t max_groups_select; |
| 2019 | uint32_t max_groups_indirect; |
| 2020 | uint32_t max_groups_ff; |
| 2021 | uint32_t actions_all; |
| 2022 | uint32_t actions_select; |
| 2023 | uint32_t actions_indirect; |
| 2024 | uint32_t actions_ff; |
| 2025 | }; |
| 2026 | |
| 2027 | struct of_meter_stats_request : of_stats_request { |
| 2028 | uint8_t version; |
| 2029 | uint8_t type == 18; |
| 2030 | uint16_t length; |
| 2031 | uint32_t xid; |
| 2032 | uint16_t stats_type == 9; |
| 2033 | enum ofp_stats_request_flags flags; |
| 2034 | pad(4); |
| 2035 | uint32_t meter_id; |
| 2036 | pad(4); |
| 2037 | }; |
| 2038 | |
| 2039 | struct of_meter_stats_reply : of_stats_reply { |
| 2040 | uint8_t version; |
| 2041 | uint8_t type == 19; |
| 2042 | uint16_t length; |
| 2043 | uint32_t xid; |
| 2044 | uint16_t stats_type == 9; |
| 2045 | enum ofp_stats_reply_flags flags; |
| 2046 | pad(4); |
| 2047 | list(of_meter_stats_t) entries; |
| 2048 | }; |
| 2049 | |
| 2050 | struct of_meter_config_stats_request : of_stats_request { |
| 2051 | uint8_t version; |
| 2052 | uint8_t type == 18; |
| 2053 | uint16_t length; |
| 2054 | uint32_t xid; |
| 2055 | uint16_t stats_type == 10; |
| 2056 | enum ofp_stats_request_flags flags; |
| 2057 | pad(4); |
| 2058 | uint32_t meter_id; |
| 2059 | pad(4); |
| 2060 | }; |
| 2061 | |
| 2062 | struct of_meter_config_stats_reply : of_stats_reply { |
| 2063 | uint8_t version; |
| 2064 | uint8_t type == 19; |
| 2065 | uint16_t length; |
| 2066 | uint32_t xid; |
| 2067 | uint16_t stats_type == 10; |
| 2068 | enum ofp_stats_reply_flags flags; |
| 2069 | pad(4); |
| 2070 | list(of_meter_band_t) entries; |
| 2071 | }; |
| 2072 | |
| 2073 | // FIXME stats added to get things working |
| 2074 | struct of_meter_features_stats_request : of_stats_request { |
| 2075 | uint8_t version; |
| 2076 | uint8_t type == 18; |
| 2077 | uint16_t length; |
| 2078 | uint32_t xid; |
| 2079 | uint16_t stats_type == 11; |
| 2080 | enum ofp_stats_request_flags flags; |
| 2081 | pad(4); |
| 2082 | }; |
| 2083 | |
| 2084 | // FIXME stats added to get things working |
| 2085 | struct of_meter_features_stats_reply : of_stats_reply { |
| 2086 | uint8_t version; |
| 2087 | uint8_t type == 19; |
| 2088 | uint16_t length; |
| 2089 | uint32_t xid; |
| 2090 | uint16_t stats_type == 11; |
| 2091 | enum ofp_stats_reply_flags flags; |
| 2092 | pad(4); |
| 2093 | of_meter_features_t features; |
| 2094 | }; |
| 2095 | |
| 2096 | // FIXME stats added to get things working |
| 2097 | struct of_table_features_stats_request : of_stats_request { |
| 2098 | uint8_t version; |
| 2099 | uint8_t type == 18; |
| 2100 | uint16_t length; |
| 2101 | uint32_t xid; |
| 2102 | uint16_t stats_type == 12; |
| 2103 | enum ofp_stats_request_flags flags; |
| 2104 | pad(4); |
| 2105 | list(of_table_features_t) entries; |
| 2106 | }; |
| 2107 | |
| 2108 | // FIXME stats added to get things working |
| 2109 | struct of_table_features_stats_reply : of_stats_reply { |
| 2110 | uint8_t version; |
| 2111 | uint8_t type == 19; |
| 2112 | uint16_t length; |
| 2113 | uint32_t xid; |
| 2114 | uint16_t stats_type == 12; |
| 2115 | enum ofp_stats_reply_flags flags; |
| 2116 | pad(4); |
| 2117 | list(of_table_features_t) entries; |
| 2118 | }; |
| 2119 | |
| 2120 | // FIXME stats added to get things working |
| 2121 | struct of_port_desc_stats_request : of_stats_request { |
| 2122 | uint8_t version; |
| 2123 | uint8_t type == 18; |
| 2124 | uint16_t length; |
| 2125 | uint32_t xid; |
| 2126 | uint16_t stats_type == 13; |
| 2127 | enum ofp_stats_request_flags flags; |
| 2128 | pad(4); |
| 2129 | }; |
| 2130 | |
| 2131 | // FIXME stats added to get things working |
| 2132 | struct of_port_desc_stats_reply : of_stats_reply { |
| 2133 | uint8_t version; |
| 2134 | uint8_t type == 19; |
| 2135 | uint16_t length; |
| 2136 | uint32_t xid; |
| 2137 | uint16_t stats_type == 13; |
| 2138 | enum ofp_stats_reply_flags flags; |
| 2139 | pad(4); |
| 2140 | list(of_port_desc_t) entries; |
| 2141 | }; |
| 2142 | |
| 2143 | struct of_meter_band_stats { |
| 2144 | uint64_t packet_band_count; |
| 2145 | uint64_t byte_band_count; |
| 2146 | }; |
| 2147 | |
| 2148 | struct of_meter_stats { |
| 2149 | uint32_t meter_id; |
| 2150 | uint16_t len; |
| 2151 | pad(6); |
| 2152 | uint32_t flow_count; |
| 2153 | uint64_t packet_in_count; |
| 2154 | uint64_t byte_in_count; |
| 2155 | uint32_t duration_sec; |
| 2156 | uint32_t duration_nsec; |
| 2157 | list(of_meter_band_stats_t) band_stats; |
| 2158 | }; |
| 2159 | |
| 2160 | struct of_meter_config { |
| 2161 | uint16_t length; |
| 2162 | uint16_t flags; |
| 2163 | uint32_t meter_id; |
| 2164 | list(of_meter_band_t) entries; |
| 2165 | }; |
| 2166 | |
| 2167 | // END OF STATS OBJECTS |
| 2168 | |
| 2169 | struct of_queue_prop { |
| 2170 | uint16_t type == ?; |
| 2171 | uint16_t len; |
| 2172 | pad(4); |
| 2173 | }; |
| 2174 | |
| 2175 | struct of_queue_prop_min_rate : of_queue_prop { |
| 2176 | uint16_t type == 1; |
| 2177 | uint16_t len; |
| 2178 | pad(4); |
| 2179 | uint16_t rate; |
| 2180 | pad(6); |
| 2181 | }; |
| 2182 | |
| 2183 | struct of_queue_prop_max_rate : of_queue_prop { |
| 2184 | uint16_t type == 2; |
| 2185 | uint16_t len; |
| 2186 | pad(4); |
| 2187 | uint16_t rate; |
| 2188 | pad(6); |
| 2189 | }; |
| 2190 | |
| 2191 | struct of_queue_prop_experimenter : of_queue_prop { |
| 2192 | uint16_t type == 65535; |
| 2193 | uint16_t len; |
| 2194 | pad(4); |
| 2195 | uint32_t experimenter == ?; |
| 2196 | pad(4); |
| 2197 | of_octets_t data; |
| 2198 | }; |
| 2199 | |
| 2200 | struct of_packet_queue { |
| 2201 | uint32_t queue_id; |
| 2202 | of_port_no_t port; |
| 2203 | uint16_t len; |
| 2204 | pad(6); |
| 2205 | list(of_queue_prop_t) properties; |
| 2206 | }; |
| 2207 | |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 2208 | struct of_role_request : of_header { |
| 2209 | uint8_t version; |
| 2210 | uint8_t type == 24; |
| 2211 | uint16_t length; |
| 2212 | uint32_t xid; |
| 2213 | enum ofp_controller_role role; |
| 2214 | pad(4); |
| 2215 | uint64_t generation_id; |
| 2216 | }; |
| 2217 | |
| 2218 | struct of_role_reply : of_header { |
| 2219 | uint8_t version; |
| 2220 | uint8_t type == 25; |
| 2221 | uint16_t length; |
| 2222 | uint32_t xid; |
| 2223 | enum ofp_controller_role role; |
| 2224 | pad(4); |
| 2225 | uint64_t generation_id; |
| 2226 | }; |
| 2227 | |
| 2228 | //////////////////////////////////////////////////////////////// |
| 2229 | // FIXME understand async; where do bitmasks live? |
| 2230 | // Determine bitmap type for masks below. |
| 2231 | // DOCUMENT masks where uint32_t[0] is interest for equal/master |
| 2232 | // while uint32_t[1] is interest for slave |
| 2233 | //////////////////////////////////////////////////////////////// |
| 2234 | |
| 2235 | struct of_async_get_request : of_header { |
| 2236 | uint8_t version; |
| 2237 | uint8_t type == 26; |
| 2238 | uint16_t length; |
| 2239 | uint32_t xid; |
| 2240 | uint32_t packet_in_mask_equal_master; |
| 2241 | uint32_t packet_in_mask_slave; |
| 2242 | uint32_t port_status_mask_equal_master; |
| 2243 | uint32_t port_status_mask_slave; |
| 2244 | uint32_t flow_removed_mask_equal_master; |
| 2245 | uint32_t flow_removed_mask_slave; |
| 2246 | }; |
| 2247 | |
| 2248 | struct of_async_get_reply : of_header { |
| 2249 | uint8_t version; |
| 2250 | uint8_t type == 27; |
| 2251 | uint16_t length; |
| 2252 | uint32_t xid; |
| 2253 | uint32_t packet_in_mask_equal_master; |
| 2254 | uint32_t packet_in_mask_slave; |
| 2255 | uint32_t port_status_mask_equal_master; |
| 2256 | uint32_t port_status_mask_slave; |
| 2257 | uint32_t flow_removed_mask_equal_master; |
| 2258 | uint32_t flow_removed_mask_slave; |
| 2259 | }; |
| 2260 | |
| 2261 | struct of_async_set : of_header { |
| 2262 | uint8_t version; |
| 2263 | uint8_t type == 28; |
| 2264 | uint16_t length; |
| 2265 | uint32_t xid; |
| 2266 | uint32_t packet_in_mask_equal_master; |
| 2267 | uint32_t packet_in_mask_slave; |
| 2268 | uint32_t port_status_mask_equal_master; |
| 2269 | uint32_t port_status_mask_slave; |
| 2270 | uint32_t flow_removed_mask_equal_master; |
| 2271 | uint32_t flow_removed_mask_slave; |
| 2272 | }; |