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 | |
| 775 | struct of_port_desc { |
| 776 | of_port_no_t port_no; |
| 777 | uint16_t length; |
| 778 | pad(2); |
| 779 | of_mac_addr_t hw_addr; |
| 780 | pad(2); |
| 781 | of_port_name_t name; |
| 782 | enum ofp_port_config config; /* Bitmap of OFPPC_* flags. */ |
| 783 | enum ofp_port_state state; /* Bitmap of OFPPS_* flags. */ |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 784 | list(of_port_desc_prop_t) properties; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 785 | }; |
| 786 | |
| 787 | struct of_features_request : of_header { |
| 788 | uint8_t version; |
| 789 | uint8_t type == 5; |
| 790 | uint16_t length; |
| 791 | uint32_t xid; |
| 792 | }; |
| 793 | |
| 794 | struct of_features_reply : of_header { |
| 795 | uint8_t version; |
| 796 | uint8_t type == 6; |
| 797 | uint16_t length; |
| 798 | uint32_t xid; |
| 799 | uint64_t datapath_id; |
| 800 | uint32_t n_buffers; |
| 801 | uint8_t n_tables; |
| 802 | uint8_t auxiliary_id; |
| 803 | pad(2); |
| 804 | enum ofp_capabilities capabilities; |
| 805 | uint32_t reserved; |
| 806 | }; |
| 807 | |
| 808 | struct of_port_status : of_header { |
| 809 | uint8_t version; |
| 810 | uint8_t type == 12; |
| 811 | uint16_t length; |
| 812 | uint32_t xid; |
| 813 | enum ofp_port_reason reason; |
| 814 | pad(7); |
| 815 | of_port_desc_t desc; |
| 816 | }; |
| 817 | |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 818 | struct of_port_mod_prop { |
| 819 | uint16_t type == ?; /* One of OFPPMPT_*. */ |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 820 | uint16_t length; /* Length in bytes of this property. */ |
| 821 | }; |
| 822 | |
| 823 | struct of_port_mod : of_header { |
| 824 | uint8_t version; |
| 825 | uint8_t type == 16; |
| 826 | uint16_t length; |
| 827 | uint32_t xid; |
| 828 | of_port_no_t port_no; |
| 829 | pad(4); |
| 830 | of_mac_addr_t hw_addr; |
| 831 | pad(2); |
| 832 | uint32_t config; |
| 833 | uint32_t mask; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 834 | list(of_port_mod_prop_t) properties; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 835 | }; |
| 836 | |
Rich Lane | b4d24df | 2014-10-10 15:58:03 -0700 | [diff] [blame^] | 837 | struct of_match_v3(align=8, length_includes_align=False) { |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 838 | uint16_t type == 1; |
| 839 | uint16_t length; |
| 840 | list(of_oxm_t) oxm_list; |
| 841 | }; |
| 842 | |
| 843 | // This looks like an action header, but is standalone. See |
| 844 | // ofp_table_features_prop_actions |
| 845 | struct of_action_id { |
| 846 | uint16_t type; |
| 847 | uint16_t len; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 848 | of_octets_t exp_data; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 849 | }; |
| 850 | |
| 851 | struct of_action_output : of_action { |
| 852 | uint16_t type == 0; |
| 853 | uint16_t len; |
| 854 | of_port_no_t port; |
| 855 | uint16_t max_len; |
| 856 | pad(6); |
| 857 | }; |
| 858 | |
| 859 | struct of_action_copy_ttl_out : of_action { |
| 860 | uint16_t type == 11; |
| 861 | uint16_t len; |
| 862 | pad(4); |
| 863 | }; |
| 864 | |
| 865 | struct of_action_copy_ttl_in : of_action { |
| 866 | uint16_t type == 12; |
| 867 | uint16_t len; |
| 868 | pad(4); |
| 869 | }; |
| 870 | |
| 871 | struct of_action_set_mpls_ttl : of_action { |
| 872 | uint16_t type == 15; |
| 873 | uint16_t len; |
| 874 | uint8_t mpls_ttl; |
| 875 | pad(3); |
| 876 | }; |
| 877 | |
| 878 | struct of_action_dec_mpls_ttl : of_action { |
| 879 | uint16_t type == 16; |
| 880 | uint16_t len; |
| 881 | pad(4); |
| 882 | }; |
| 883 | |
| 884 | struct of_action_push_vlan : of_action { |
| 885 | uint16_t type == 17; |
| 886 | uint16_t len; |
| 887 | uint16_t ethertype; |
| 888 | pad(2); |
| 889 | }; |
| 890 | |
| 891 | struct of_action_pop_vlan : of_action { |
| 892 | uint16_t type == 18; |
| 893 | uint16_t len; |
| 894 | pad(4); |
| 895 | }; |
| 896 | |
| 897 | struct of_action_push_mpls : of_action { |
| 898 | uint16_t type == 19; |
| 899 | uint16_t len; |
| 900 | uint16_t ethertype; |
| 901 | pad(2); |
| 902 | }; |
| 903 | |
| 904 | struct of_action_pop_mpls : of_action { |
| 905 | uint16_t type == 20; |
| 906 | uint16_t len; |
| 907 | uint16_t ethertype; |
| 908 | pad(2); |
| 909 | }; |
| 910 | |
| 911 | struct of_action_set_queue : of_action { |
| 912 | uint16_t type == 21; |
| 913 | uint16_t len; |
| 914 | uint32_t queue_id; |
| 915 | }; |
| 916 | |
| 917 | struct of_action_group : of_action { |
| 918 | uint16_t type == 22; |
| 919 | uint16_t len; |
| 920 | uint32_t group_id; |
| 921 | }; |
| 922 | |
| 923 | struct of_action_set_nw_ttl : of_action { |
| 924 | uint16_t type == 23; |
| 925 | uint16_t len; |
| 926 | uint8_t nw_ttl; |
| 927 | pad(3); |
| 928 | }; |
| 929 | |
| 930 | struct of_action_dec_nw_ttl : of_action { |
| 931 | uint16_t type == 24; |
| 932 | uint16_t len; |
| 933 | pad(4); |
| 934 | }; |
| 935 | |
| 936 | struct of_action_set_field(align=8, length_includes_align=True) : of_action { |
| 937 | uint16_t type == 25; |
| 938 | uint16_t len; |
| 939 | of_oxm_t field; |
| 940 | }; |
| 941 | |
| 942 | struct of_action_experimenter(align=8, length_includes_align=True): of_action { |
| 943 | uint16_t type == 65535; |
| 944 | uint16_t len; |
| 945 | uint32_t experimenter == ?; |
| 946 | of_octets_t data; |
| 947 | }; |
| 948 | |
| 949 | struct of_action_pop_pbb : of_action { |
| 950 | uint16_t type == 27; |
| 951 | uint16_t len; |
| 952 | pad(4); |
| 953 | }; |
| 954 | |
| 955 | struct of_action_push_pbb : of_action { |
| 956 | uint16_t type == 26; |
| 957 | uint16_t len; |
| 958 | uint16_t ethertype; |
| 959 | pad(2); |
| 960 | }; |
| 961 | |
| 962 | struct of_action { |
| 963 | uint16_t type == ?; |
| 964 | uint16_t len; |
| 965 | pad(4); |
| 966 | }; |
| 967 | |
| 968 | struct of_instruction_id { |
| 969 | uint16_t type; |
| 970 | uint16_t len; |
| 971 | }; |
| 972 | |
| 973 | struct of_instruction { |
| 974 | uint16_t type == ?; |
| 975 | uint16_t len; |
| 976 | }; |
| 977 | |
| 978 | struct of_instruction_goto_table : of_instruction { |
| 979 | uint16_t type == 1; |
| 980 | uint16_t len; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 981 | of_octets_t exp_data; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 982 | }; |
| 983 | |
| 984 | struct of_instruction_write_metadata : of_instruction { |
| 985 | uint16_t type == 2; |
| 986 | uint16_t len; |
| 987 | pad(4); |
| 988 | uint64_t metadata; |
| 989 | uint64_t metadata_mask; |
| 990 | }; |
| 991 | |
| 992 | struct of_instruction_write_actions : of_instruction { |
| 993 | uint16_t type == 3; |
| 994 | uint16_t len; |
| 995 | pad(4); |
| 996 | list(of_action_t) actions; |
| 997 | }; |
| 998 | |
| 999 | struct of_instruction_apply_actions : of_instruction { |
| 1000 | uint16_t type == 4; |
| 1001 | uint16_t len; |
| 1002 | pad(4); |
| 1003 | list(of_action_t) actions; |
| 1004 | }; |
| 1005 | |
| 1006 | struct of_instruction_clear_actions : of_instruction { |
| 1007 | uint16_t type == 5; |
| 1008 | uint16_t len; |
| 1009 | pad(4); |
| 1010 | }; |
| 1011 | |
| 1012 | struct of_instruction_meter : of_instruction { |
| 1013 | uint16_t type == 6; |
| 1014 | uint16_t len; |
| 1015 | uint32_t meter_id; |
| 1016 | }; |
| 1017 | |
| 1018 | struct of_instruction_experimenter : of_instruction { |
| 1019 | uint16_t type == 65535; |
| 1020 | uint16_t len; |
| 1021 | uint32_t experimenter == ?; |
| 1022 | of_octets_t data; |
| 1023 | }; |
| 1024 | |
| 1025 | struct of_flow_mod : of_header { |
| 1026 | uint8_t version; |
| 1027 | uint8_t type == 14; |
| 1028 | uint16_t length; |
| 1029 | uint32_t xid; |
| 1030 | uint64_t cookie; |
| 1031 | uint64_t cookie_mask; |
| 1032 | uint8_t table_id; |
| 1033 | of_fm_cmd_t _command == ?; |
| 1034 | uint16_t idle_timeout; |
| 1035 | uint16_t hard_timeout; |
| 1036 | uint16_t priority; |
| 1037 | uint32_t buffer_id; |
| 1038 | of_port_no_t out_port; |
| 1039 | uint32_t out_group; |
| 1040 | enum ofp_flow_mod_flags flags; |
| 1041 | pad(2); |
| 1042 | of_match_t match; |
| 1043 | list(of_instruction_t) instructions; |
| 1044 | }; |
| 1045 | |
| 1046 | struct of_flow_add : of_flow_mod { |
| 1047 | uint8_t version; |
| 1048 | uint8_t type == 14; |
| 1049 | uint16_t length; |
| 1050 | uint32_t xid; |
| 1051 | uint64_t cookie; |
| 1052 | uint64_t cookie_mask; |
| 1053 | uint8_t table_id; |
| 1054 | of_fm_cmd_t _command == 0; |
| 1055 | uint16_t idle_timeout; |
| 1056 | uint16_t hard_timeout; |
| 1057 | uint16_t priority; |
| 1058 | uint32_t buffer_id; |
| 1059 | of_port_no_t out_port; |
| 1060 | uint32_t out_group; |
| 1061 | enum ofp_flow_mod_flags flags; |
| 1062 | uint16_t importance; |
| 1063 | of_match_t match; |
| 1064 | list(of_instruction_t) instructions; |
| 1065 | }; |
| 1066 | |
| 1067 | struct of_flow_modify : of_flow_mod { |
| 1068 | uint8_t version; |
| 1069 | uint8_t type == 14; |
| 1070 | uint16_t length; |
| 1071 | uint32_t xid; |
| 1072 | uint64_t cookie; |
| 1073 | uint64_t cookie_mask; |
| 1074 | uint8_t table_id; |
| 1075 | of_fm_cmd_t _command == 1; |
| 1076 | uint16_t idle_timeout; |
| 1077 | uint16_t hard_timeout; |
| 1078 | uint16_t priority; |
| 1079 | uint32_t buffer_id; |
| 1080 | of_port_no_t out_port; |
| 1081 | uint32_t out_group; |
| 1082 | enum ofp_flow_mod_flags flags; |
| 1083 | uint16_t importance; |
| 1084 | of_match_t match; |
| 1085 | list(of_instruction_t) instructions; |
| 1086 | }; |
| 1087 | |
| 1088 | struct of_flow_modify_strict : of_flow_mod { |
| 1089 | uint8_t version; |
| 1090 | uint8_t type == 14; |
| 1091 | uint16_t length; |
| 1092 | uint32_t xid; |
| 1093 | uint64_t cookie; |
| 1094 | uint64_t cookie_mask; |
| 1095 | uint8_t table_id; |
| 1096 | of_fm_cmd_t _command == 2; |
| 1097 | uint16_t idle_timeout; |
| 1098 | uint16_t hard_timeout; |
| 1099 | uint16_t priority; |
| 1100 | uint32_t buffer_id; |
| 1101 | of_port_no_t out_port; |
| 1102 | uint32_t out_group; |
| 1103 | enum ofp_flow_mod_flags flags; |
| 1104 | uint16_t importance; |
| 1105 | of_match_t match; |
| 1106 | list(of_instruction_t) instructions; |
| 1107 | }; |
| 1108 | |
| 1109 | struct of_flow_delete : of_flow_mod { |
| 1110 | uint8_t version; |
| 1111 | uint8_t type == 14; |
| 1112 | uint16_t length; |
| 1113 | uint32_t xid; |
| 1114 | uint64_t cookie; |
| 1115 | uint64_t cookie_mask; |
| 1116 | uint8_t table_id; |
| 1117 | of_fm_cmd_t _command == 3; |
| 1118 | uint16_t idle_timeout; |
| 1119 | uint16_t hard_timeout; |
| 1120 | uint16_t priority; |
| 1121 | uint32_t buffer_id; |
| 1122 | of_port_no_t out_port; |
| 1123 | uint32_t out_group; |
| 1124 | enum ofp_flow_mod_flags flags; |
| 1125 | uint16_t importance; |
| 1126 | of_match_t match; |
| 1127 | list(of_instruction_t) instructions; |
| 1128 | }; |
| 1129 | |
| 1130 | struct of_flow_delete_strict : of_flow_mod { |
| 1131 | uint8_t version; |
| 1132 | uint8_t type == 14; |
| 1133 | uint16_t length; |
| 1134 | uint32_t xid; |
| 1135 | uint64_t cookie; |
| 1136 | uint64_t cookie_mask; |
| 1137 | uint8_t table_id; |
| 1138 | of_fm_cmd_t _command == 4; |
| 1139 | uint16_t idle_timeout; |
| 1140 | uint16_t hard_timeout; |
| 1141 | uint16_t priority; |
| 1142 | uint32_t buffer_id; |
| 1143 | of_port_no_t out_port; |
| 1144 | uint32_t out_group; |
| 1145 | enum ofp_flow_mod_flags flags; |
| 1146 | uint16_t importance; |
| 1147 | of_match_t match; |
| 1148 | list(of_instruction_t) instructions; |
| 1149 | }; |
| 1150 | |
| 1151 | struct of_bucket { |
| 1152 | uint16_t len; |
| 1153 | uint16_t weight; |
| 1154 | of_port_no_t watch_port; |
| 1155 | uint32_t watch_group; |
| 1156 | pad(4); |
| 1157 | list(of_action_t) actions; |
| 1158 | }; |
| 1159 | |
| 1160 | struct of_group_mod : of_header { |
| 1161 | uint8_t version; |
| 1162 | uint8_t type == 15; |
| 1163 | uint16_t length; |
| 1164 | uint32_t xid; |
| 1165 | enum ofp_group_mod_command command == ?; |
| 1166 | enum ofp_group_type group_type; |
| 1167 | pad(1); |
| 1168 | uint32_t group_id; |
| 1169 | list(of_bucket_t) buckets; |
| 1170 | }; |
| 1171 | |
| 1172 | struct of_group_add : of_group_mod { |
| 1173 | uint8_t version; |
| 1174 | uint8_t type == 15; |
| 1175 | uint16_t length; |
| 1176 | uint32_t xid; |
| 1177 | enum ofp_group_mod_command command == 0; |
| 1178 | enum ofp_group_type group_type; |
| 1179 | pad(1); |
| 1180 | uint32_t group_id; |
| 1181 | list(of_bucket_t) buckets; |
| 1182 | }; |
| 1183 | |
| 1184 | struct of_group_modify : of_group_mod { |
| 1185 | uint8_t version; |
| 1186 | uint8_t type == 15; |
| 1187 | uint16_t length; |
| 1188 | uint32_t xid; |
| 1189 | enum ofp_group_mod_command command == 1; |
| 1190 | enum ofp_group_type group_type; |
| 1191 | pad(1); |
| 1192 | uint32_t group_id; |
| 1193 | list(of_bucket_t) buckets; |
| 1194 | }; |
| 1195 | |
| 1196 | struct of_group_delete : of_group_mod { |
| 1197 | uint8_t version; |
| 1198 | uint8_t type == 15; |
| 1199 | uint16_t length; |
| 1200 | uint32_t xid; |
| 1201 | enum ofp_group_mod_command command == 2; |
| 1202 | enum ofp_group_type group_type; |
| 1203 | pad(1); |
| 1204 | uint32_t group_id; |
| 1205 | list(of_bucket_t) buckets; |
| 1206 | }; |
| 1207 | |
| 1208 | struct of_packet_out : of_header { |
| 1209 | uint8_t version; |
| 1210 | uint8_t type == 13; |
| 1211 | uint16_t length; |
| 1212 | uint32_t xid; |
| 1213 | uint32_t buffer_id; |
| 1214 | of_port_no_t in_port; |
| 1215 | uint16_t actions_len; |
| 1216 | pad(6); |
| 1217 | list(of_action_t) actions; |
| 1218 | of_octets_t data; |
| 1219 | }; |
| 1220 | |
| 1221 | struct of_packet_in : of_header { |
| 1222 | uint8_t version; |
| 1223 | uint8_t type == 10; |
| 1224 | uint16_t length; |
| 1225 | uint32_t xid; |
| 1226 | uint32_t buffer_id; |
| 1227 | uint16_t total_len; |
| 1228 | uint8_t reason; |
| 1229 | uint8_t table_id; |
| 1230 | uint64_t cookie; |
| 1231 | of_match_t match; |
| 1232 | pad(2); |
| 1233 | of_octets_t data; /* FIXME: Ensure total_len gets updated */ |
| 1234 | }; |
| 1235 | |
| 1236 | struct of_flow_removed : of_header { |
| 1237 | uint8_t version; |
| 1238 | uint8_t type == 11; |
| 1239 | uint16_t length; |
| 1240 | uint32_t xid; |
| 1241 | uint64_t cookie; |
| 1242 | uint16_t priority; |
| 1243 | uint8_t reason; |
| 1244 | uint8_t table_id; |
| 1245 | uint32_t duration_sec; |
| 1246 | uint32_t duration_nsec; |
| 1247 | uint16_t idle_timeout; |
| 1248 | uint16_t hard_timeout; |
| 1249 | uint64_t packet_count; |
| 1250 | uint64_t byte_count; |
| 1251 | of_match_t match; |
| 1252 | }; |
| 1253 | |
| 1254 | struct of_meter_band { |
| 1255 | uint16_t type == ?; |
| 1256 | uint16_t len; |
| 1257 | // uint32_t rate; // These are excluded b/c this is the header |
| 1258 | // uint32_t burst_size; // These are excluded b/c this is the header |
| 1259 | }; |
| 1260 | |
| 1261 | struct of_meter_band_drop : of_meter_band { |
| 1262 | uint16_t type == 1; |
| 1263 | uint16_t len; |
| 1264 | uint32_t rate; |
| 1265 | uint32_t burst_size; |
| 1266 | pad(4); |
| 1267 | }; |
| 1268 | |
| 1269 | struct of_meter_band_dscp_remark : of_meter_band { |
| 1270 | uint16_t type == 2; |
| 1271 | uint16_t len; |
| 1272 | uint32_t rate; |
| 1273 | uint32_t burst_size; |
| 1274 | uint8_t prec_level; |
| 1275 | pad(3); |
| 1276 | }; |
| 1277 | |
| 1278 | struct of_meter_band_experimenter : of_meter_band { |
| 1279 | uint16_t type == 65535; |
| 1280 | uint16_t len; |
| 1281 | uint32_t rate; |
| 1282 | uint32_t burst_size; |
| 1283 | uint32_t experimenter; |
| 1284 | }; |
| 1285 | |
| 1286 | struct of_meter_mod : of_header { |
| 1287 | uint8_t version; |
| 1288 | uint8_t type == 29; |
| 1289 | uint16_t length; |
| 1290 | uint32_t xid; |
| 1291 | uint16_t command; |
| 1292 | uint16_t flags; |
| 1293 | uint32_t meter_id; |
| 1294 | list(of_meter_band_t) bands; |
| 1295 | }; |
| 1296 | |
| 1297 | struct of_error_msg : of_header { |
| 1298 | uint8_t version; |
| 1299 | uint8_t type == 1; |
| 1300 | uint16_t length; |
| 1301 | uint32_t xid; |
| 1302 | uint16_t err_type == ?; |
| 1303 | }; |
| 1304 | |
| 1305 | struct of_hello_failed_error_msg : of_error_msg { |
| 1306 | uint8_t version; |
| 1307 | uint8_t type == 1; |
| 1308 | uint16_t length; |
| 1309 | uint32_t xid; |
| 1310 | uint16_t err_type == 0; |
| 1311 | enum ofp_hello_failed_code code; |
| 1312 | of_octets_t data; |
| 1313 | }; |
| 1314 | |
| 1315 | struct of_bad_request_error_msg : of_error_msg { |
| 1316 | uint8_t version; |
| 1317 | uint8_t type == 1; |
| 1318 | uint16_t length; |
| 1319 | uint32_t xid; |
| 1320 | uint16_t err_type == 1; |
| 1321 | enum ofp_bad_request_code code; |
| 1322 | of_octets_t data; |
| 1323 | }; |
| 1324 | |
| 1325 | struct of_bad_action_error_msg : of_error_msg { |
| 1326 | uint8_t version; |
| 1327 | uint8_t type == 1; |
| 1328 | uint16_t length; |
| 1329 | uint32_t xid; |
| 1330 | uint16_t err_type == 2; |
| 1331 | enum ofp_bad_action_code code; |
| 1332 | of_octets_t data; |
| 1333 | }; |
| 1334 | |
| 1335 | struct of_bad_instruction_error_msg : of_error_msg { |
| 1336 | uint8_t version; |
| 1337 | uint8_t type == 1; |
| 1338 | uint16_t length; |
| 1339 | uint32_t xid; |
| 1340 | uint16_t err_type == 3; |
| 1341 | enum ofp_bad_instruction_code code; |
| 1342 | of_octets_t data; |
| 1343 | }; |
| 1344 | |
| 1345 | struct of_bad_match_error_msg : of_error_msg { |
| 1346 | uint8_t version; |
| 1347 | uint8_t type == 1; |
| 1348 | uint16_t length; |
| 1349 | uint32_t xid; |
| 1350 | uint16_t err_type == 4; |
| 1351 | enum ofp_bad_match_code code; |
| 1352 | of_octets_t data; |
| 1353 | }; |
| 1354 | |
| 1355 | struct of_flow_mod_failed_error_msg : of_error_msg { |
| 1356 | uint8_t version; |
| 1357 | uint8_t type == 1; |
| 1358 | uint16_t length; |
| 1359 | uint32_t xid; |
| 1360 | uint16_t err_type == 5; |
| 1361 | enum ofp_flow_mod_failed_code code; |
| 1362 | of_octets_t data; |
| 1363 | }; |
| 1364 | |
| 1365 | struct of_group_mod_failed_error_msg : of_error_msg { |
| 1366 | uint8_t version; |
| 1367 | uint8_t type == 1; |
| 1368 | uint16_t length; |
| 1369 | uint32_t xid; |
| 1370 | uint16_t err_type == 6; |
| 1371 | enum ofp_group_mod_failed_code code; |
| 1372 | of_octets_t data; |
| 1373 | }; |
| 1374 | |
| 1375 | struct of_port_mod_failed_error_msg : of_error_msg { |
| 1376 | uint8_t version; |
| 1377 | uint8_t type == 1; |
| 1378 | uint16_t length; |
| 1379 | uint32_t xid; |
| 1380 | uint16_t err_type == 7; |
| 1381 | enum ofp_port_mod_failed_code code; |
| 1382 | of_octets_t data; |
| 1383 | }; |
| 1384 | |
| 1385 | struct of_table_mod_failed_error_msg : of_error_msg { |
| 1386 | uint8_t version; |
| 1387 | uint8_t type == 1; |
| 1388 | uint16_t length; |
| 1389 | uint32_t xid; |
| 1390 | uint16_t err_type == 8; |
| 1391 | enum ofp_table_mod_failed_code code; |
| 1392 | of_octets_t data; |
| 1393 | }; |
| 1394 | |
| 1395 | struct of_queue_op_failed_error_msg : of_error_msg { |
| 1396 | uint8_t version; |
| 1397 | uint8_t type == 1; |
| 1398 | uint16_t length; |
| 1399 | uint32_t xid; |
| 1400 | uint16_t err_type == 9; |
| 1401 | enum ofp_queue_op_failed_code code; |
| 1402 | of_octets_t data; |
| 1403 | }; |
| 1404 | |
| 1405 | struct of_switch_config_failed_error_msg : of_error_msg { |
| 1406 | uint8_t version; |
| 1407 | uint8_t type == 1; |
| 1408 | uint16_t length; |
| 1409 | uint32_t xid; |
| 1410 | uint16_t err_type == 10; |
| 1411 | enum ofp_switch_config_failed_code code; |
| 1412 | of_octets_t data; |
| 1413 | }; |
| 1414 | |
| 1415 | struct of_role_request_failed_error_msg : of_error_msg { |
| 1416 | uint8_t version; |
| 1417 | uint8_t type == 1; |
| 1418 | uint16_t length; |
| 1419 | uint32_t xid; |
| 1420 | uint16_t err_type == 11; |
| 1421 | enum ofp_role_request_failed_code code; |
| 1422 | of_octets_t data; |
| 1423 | }; |
| 1424 | |
| 1425 | struct of_meter_mod_failed_error_msg : of_error_msg { |
| 1426 | uint8_t version; |
| 1427 | uint8_t type == 1; |
| 1428 | uint16_t length; |
| 1429 | uint32_t xid; |
| 1430 | uint16_t err_type == 12; |
| 1431 | enum ofp_meter_mod_failed_code code; |
| 1432 | of_octets_t data; |
| 1433 | }; |
| 1434 | |
| 1435 | struct of_table_features_failed_error_msg : of_error_msg { |
| 1436 | uint8_t version; |
| 1437 | uint8_t type == 1; |
| 1438 | uint16_t length; |
| 1439 | uint32_t xid; |
| 1440 | uint16_t err_type == 13; |
| 1441 | enum ofp_table_features_failed_code code; |
| 1442 | of_octets_t data; |
| 1443 | }; |
| 1444 | |
| 1445 | struct of_experimenter_error_msg : of_error_msg { |
| 1446 | uint8_t version; |
| 1447 | uint8_t type == 1; |
| 1448 | uint16_t length; |
| 1449 | uint32_t xid; |
| 1450 | uint16_t err_type == 0xffff; |
| 1451 | uint16_t subtype; |
| 1452 | uint32_t experimenter; |
| 1453 | of_octets_t data; |
| 1454 | }; |
| 1455 | |
| 1456 | // STATS ENTRIES: flow, table, port, queue, group stats, group desc stats |
| 1457 | |
| 1458 | struct of_flow_stats_entry { |
| 1459 | uint16_t length; |
| 1460 | uint8_t table_id; |
| 1461 | pad(1); |
| 1462 | uint32_t duration_sec; |
| 1463 | uint32_t duration_nsec; |
| 1464 | uint16_t priority; |
| 1465 | uint16_t idle_timeout; |
| 1466 | uint16_t hard_timeout; |
| 1467 | enum ofp_flow_mod_flags flags; |
| 1468 | uint16_t importance; |
| 1469 | pad(2); |
| 1470 | uint64_t cookie; |
| 1471 | uint64_t packet_count; |
| 1472 | uint64_t byte_count; |
| 1473 | of_match_t match; |
| 1474 | list(of_instruction_t) instructions; |
| 1475 | }; |
| 1476 | |
| 1477 | |
| 1478 | struct of_table_stats_entry { |
| 1479 | uint8_t table_id; |
| 1480 | pad(3); |
| 1481 | uint32_t active_count; |
| 1482 | uint64_t lookup_count; |
| 1483 | uint64_t matched_count; |
| 1484 | }; |
| 1485 | |
| 1486 | /* Common header for all port stats properties. */ |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1487 | struct of_port_stats_prop { |
| 1488 | uint16_t type == ?; /* One of OFPPSPT_*. */ |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1489 | uint16_t length; /* Length in bytes of this property. */ |
| 1490 | }; |
| 1491 | |
| 1492 | /* Ethernet port stats property. */ |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1493 | struct of_port_stats_prop_ethernet : of_port_stats_prop { |
| 1494 | uint16_t type == 0; /* OFPPSPT_ETHERNET. */ |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1495 | uint16_t length; /* Length in bytes of this property. */ |
| 1496 | pad(4); |
| 1497 | |
| 1498 | uint64_t rx_frame_err; /* Number of frame alignment errors. */ |
| 1499 | uint64_t rx_over_err; /* Number of packets with RX overrun. */ |
| 1500 | uint64_t rx_crc_err; /* Number of CRC errors. */ |
| 1501 | uint64_t collisions; /* Number of collisions. */ |
| 1502 | }; |
| 1503 | |
| 1504 | /* Optical port stats property. */ |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1505 | struct of_port_stats_prop_optical : of_port_stats_prop { |
| 1506 | uint16_t type == 1; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1507 | uint16_t length; |
| 1508 | pad(4); |
| 1509 | |
| 1510 | uint32_t flags; |
| 1511 | uint32_t tx_freq_lmda; |
| 1512 | uint32_t tx_offset; |
| 1513 | uint32_t tx_grid_span; |
| 1514 | uint32_t rx_freq_lmda; |
| 1515 | uint32_t rx_offset; |
| 1516 | uint32_t rx_grid_span; |
| 1517 | uint16_t tx_pwr; |
| 1518 | uint16_t rx_pwr; |
| 1519 | uint16_t bias_current; |
| 1520 | uint16_t temperature; |
| 1521 | }; |
| 1522 | |
| 1523 | /* Experimenter port stats property. */ |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1524 | struct of_port_stats_prop_experimenter : of_port_stats_prop { |
| 1525 | uint16_t type == 0xffff; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1526 | uint16_t length; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1527 | uint32_t experimenter == ?; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1528 | uint32_t exp_type; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1529 | of_octets_t experimenter_data; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1530 | }; |
| 1531 | |
| 1532 | struct of_port_stats_entry { |
| 1533 | uint16_t length; |
| 1534 | pad(2); |
| 1535 | of_port_no_t port_no; |
| 1536 | uint64_t rx_packets; |
| 1537 | uint64_t tx_packets; |
| 1538 | uint64_t rx_bytes; |
| 1539 | uint64_t tx_bytes; |
| 1540 | uint64_t rx_dropped; |
| 1541 | uint64_t tx_dropped; |
| 1542 | uint64_t rx_errors; |
| 1543 | uint64_t tx_errors; |
| 1544 | uint32_t duration_sec; |
| 1545 | uint32_t duration_nsec; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1546 | list(of_port_stats_prop_t) properties; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1547 | }; |
| 1548 | |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1549 | struct of_queue_stats_prop { |
| 1550 | uint16_t type == ?; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1551 | uint16_t length; |
| 1552 | }; |
| 1553 | |
| 1554 | struct of_queue_stats_entry { |
| 1555 | uint16_t length; |
| 1556 | pad(6); |
| 1557 | of_port_no_t port_no; |
| 1558 | uint32_t queue_id; |
| 1559 | uint64_t tx_bytes; |
| 1560 | uint64_t tx_packets; |
| 1561 | uint64_t tx_errors; |
| 1562 | uint32_t duration_sec; |
| 1563 | uint32_t duration_nsec; |
| 1564 | |
| 1565 | |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1566 | list(of_queue_stats_prop_t) properties; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1567 | }; |
| 1568 | |
| 1569 | struct of_bucket_counter { |
| 1570 | uint64_t packet_count; |
| 1571 | uint64_t byte_count; |
| 1572 | }; |
| 1573 | |
| 1574 | struct of_group_stats_entry { |
| 1575 | uint16_t length; |
| 1576 | pad(2); |
| 1577 | uint32_t group_id; |
| 1578 | uint32_t ref_count; |
| 1579 | pad(4); |
| 1580 | uint64_t packet_count; |
| 1581 | uint64_t byte_count; |
| 1582 | uint32_t duration_sec; |
| 1583 | uint32_t duration_nsec; |
| 1584 | list(of_bucket_counter_t) bucket_stats; |
| 1585 | }; |
| 1586 | |
| 1587 | struct of_group_desc_stats_entry { |
| 1588 | uint16_t length; |
| 1589 | enum ofp_group_type group_type; |
| 1590 | pad(1); |
| 1591 | uint32_t group_id; |
| 1592 | list(of_bucket_t) buckets; |
| 1593 | }; |
| 1594 | |
| 1595 | // STATS: |
| 1596 | // Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi |
| 1597 | |
| 1598 | struct of_stats_request : of_header { |
| 1599 | uint8_t version; |
| 1600 | uint8_t type == 18; |
| 1601 | uint16_t length; |
| 1602 | uint32_t xid; |
| 1603 | uint16_t stats_type == ?; |
| 1604 | enum ofp_stats_request_flags flags; |
| 1605 | pad(4); |
| 1606 | }; |
| 1607 | |
| 1608 | struct of_stats_reply : of_header { |
| 1609 | uint8_t version; |
| 1610 | uint8_t type == 19; |
| 1611 | uint16_t length; |
| 1612 | uint32_t xid; |
| 1613 | uint16_t stats_type == ?; |
| 1614 | enum ofp_stats_reply_flags flags; |
| 1615 | pad(4); |
| 1616 | }; |
| 1617 | |
| 1618 | struct of_desc_stats_request : of_stats_request { |
| 1619 | uint8_t version; |
| 1620 | uint8_t type == 18; |
| 1621 | uint16_t length; |
| 1622 | uint32_t xid; |
| 1623 | uint16_t stats_type == 0; |
| 1624 | enum ofp_stats_request_flags flags; |
| 1625 | pad(4); |
| 1626 | }; |
| 1627 | |
| 1628 | struct of_desc_stats_reply : of_stats_reply { |
| 1629 | uint8_t version; |
| 1630 | uint8_t type == 19; |
| 1631 | uint16_t length; |
| 1632 | uint32_t xid; |
| 1633 | uint16_t stats_type == 0; |
| 1634 | enum ofp_stats_reply_flags flags; |
| 1635 | pad(4); |
| 1636 | of_desc_str_t mfr_desc; |
| 1637 | of_desc_str_t hw_desc; |
| 1638 | of_desc_str_t sw_desc; |
| 1639 | of_serial_num_t serial_num; |
| 1640 | of_desc_str_t dp_desc; |
| 1641 | }; |
| 1642 | |
| 1643 | struct of_flow_stats_request : of_stats_request { |
| 1644 | uint8_t version; |
| 1645 | uint8_t type == 18; |
| 1646 | uint16_t length; |
| 1647 | uint32_t xid; |
| 1648 | uint16_t stats_type == 1; |
| 1649 | enum ofp_stats_request_flags flags; |
| 1650 | pad(4); |
| 1651 | uint8_t table_id; |
| 1652 | pad(3); |
| 1653 | of_port_no_t out_port; |
| 1654 | uint32_t out_group; |
| 1655 | pad(4); |
| 1656 | uint64_t cookie; |
| 1657 | uint64_t cookie_mask; |
| 1658 | of_match_t match; |
| 1659 | }; |
| 1660 | |
| 1661 | struct of_flow_stats_reply : of_stats_reply { |
| 1662 | uint8_t version; |
| 1663 | uint8_t type == 19; |
| 1664 | uint16_t length; |
| 1665 | uint32_t xid; |
| 1666 | uint16_t stats_type == 1; |
| 1667 | enum ofp_stats_reply_flags flags; |
| 1668 | pad(4); |
| 1669 | list(of_flow_stats_entry_t) entries; |
| 1670 | }; |
| 1671 | |
| 1672 | struct of_aggregate_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 == 2; |
| 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_aggregate_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 == 2; |
| 1696 | enum ofp_stats_reply_flags flags; |
| 1697 | pad(4); |
| 1698 | uint64_t packet_count; |
| 1699 | uint64_t byte_count; |
| 1700 | uint32_t flow_count; |
| 1701 | pad(4); |
| 1702 | }; |
| 1703 | |
| 1704 | struct of_table_stats_request : of_stats_request { |
| 1705 | uint8_t version; |
| 1706 | uint8_t type == 18; |
| 1707 | uint16_t length; |
| 1708 | uint32_t xid; |
| 1709 | uint16_t stats_type == 3; |
| 1710 | enum ofp_stats_request_flags flags; |
| 1711 | pad(4); |
| 1712 | }; |
| 1713 | |
| 1714 | struct of_table_stats_reply : of_stats_reply { |
| 1715 | uint8_t version; |
| 1716 | uint8_t type == 19; |
| 1717 | uint16_t length; |
| 1718 | uint32_t xid; |
| 1719 | uint16_t stats_type == 3; |
| 1720 | enum ofp_stats_reply_flags flags; |
| 1721 | pad(4); |
| 1722 | list(of_table_stats_entry_t) entries; |
| 1723 | }; |
| 1724 | |
| 1725 | struct of_experimenter_stats_request : of_stats_request { |
| 1726 | uint8_t version; |
| 1727 | uint8_t type == 18; |
| 1728 | uint16_t length; |
| 1729 | uint32_t xid; |
| 1730 | uint16_t stats_type == 0xffff; |
| 1731 | enum ofp_stats_request_flags flags; |
| 1732 | pad(4); |
| 1733 | uint32_t experimenter == ?; |
| 1734 | uint32_t subtype; |
| 1735 | }; |
| 1736 | |
| 1737 | struct of_experimenter_stats_reply : of_stats_reply { |
| 1738 | uint8_t version; |
| 1739 | uint8_t type == 19; |
| 1740 | uint16_t length; |
| 1741 | uint32_t xid; |
| 1742 | uint16_t stats_type == 0xffff; |
| 1743 | enum ofp_stats_reply_flags flags; |
| 1744 | pad(4); |
| 1745 | uint32_t experimenter == ?; |
| 1746 | uint32_t subtype; |
| 1747 | }; |
| 1748 | |
| 1749 | // FIXME: These are padded to 8 byte align beyond the length indicated |
| 1750 | |
| 1751 | struct of_table_feature_prop { |
| 1752 | uint16_t type == ?; |
| 1753 | uint16_t length; |
| 1754 | }; |
| 1755 | |
| 1756 | struct of_table_feature_prop_instructions : of_table_feature_prop { |
| 1757 | uint16_t type == 0; |
| 1758 | uint16_t length; |
| 1759 | // FIXME Check if instruction_t is right for ids here |
| 1760 | list(of_instruction_id_t) instruction_ids; |
| 1761 | }; |
| 1762 | |
| 1763 | struct of_table_feature_prop_instructions_miss : of_table_feature_prop { |
| 1764 | uint16_t type == 1; |
| 1765 | uint16_t length; |
| 1766 | list(of_instruction_id_t) instruction_ids; |
| 1767 | }; |
| 1768 | |
| 1769 | struct of_table_feature_prop_next_tables : of_table_feature_prop { |
| 1770 | uint16_t type == 2; |
| 1771 | uint16_t length; |
| 1772 | list(of_uint8_t) next_table_ids; |
| 1773 | }; |
| 1774 | |
| 1775 | struct of_table_feature_prop_next_tables_miss : of_table_feature_prop { |
| 1776 | uint16_t type == 3; |
| 1777 | uint16_t length; |
| 1778 | list(of_uint8_t) next_table_ids; |
| 1779 | }; |
| 1780 | |
| 1781 | struct of_table_feature_prop_write_actions : of_table_feature_prop { |
| 1782 | uint16_t type == 4; |
| 1783 | uint16_t length; |
| 1784 | list(of_action_id_t) action_ids; |
| 1785 | }; |
| 1786 | |
| 1787 | struct of_table_feature_prop_write_actions_miss : of_table_feature_prop { |
| 1788 | uint16_t type == 5; |
| 1789 | uint16_t length; |
| 1790 | list(of_action_id_t) action_ids; |
| 1791 | }; |
| 1792 | |
| 1793 | struct of_table_feature_prop_apply_actions : of_table_feature_prop { |
| 1794 | uint16_t type == 6; |
| 1795 | uint16_t length; |
| 1796 | list(of_action_id_t) action_ids; |
| 1797 | }; |
| 1798 | |
| 1799 | struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop { |
| 1800 | uint16_t type == 7; |
| 1801 | uint16_t length; |
| 1802 | list(of_action_id_t) action_ids; |
| 1803 | }; |
| 1804 | |
| 1805 | struct of_table_feature_prop_match : of_table_feature_prop { |
| 1806 | uint16_t type == 8; |
| 1807 | uint16_t length; |
| 1808 | list(of_uint32_t) oxm_ids; |
| 1809 | }; |
| 1810 | |
| 1811 | struct of_table_feature_prop_wildcards : of_table_feature_prop { |
| 1812 | uint16_t type == 10; |
| 1813 | uint16_t length; |
| 1814 | list(of_uint32_t) oxm_ids; |
| 1815 | }; |
| 1816 | |
| 1817 | struct of_table_feature_prop_write_setfield : of_table_feature_prop { |
| 1818 | uint16_t type == 12; |
| 1819 | uint16_t length; |
| 1820 | list(of_uint32_t) oxm_ids; |
| 1821 | }; |
| 1822 | |
| 1823 | struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop { |
| 1824 | uint16_t type == 13; |
| 1825 | uint16_t length; |
| 1826 | list(of_uint32_t) oxm_ids; |
| 1827 | }; |
| 1828 | |
| 1829 | struct of_table_feature_prop_apply_setfield : of_table_feature_prop { |
| 1830 | uint16_t type == 14; |
| 1831 | uint16_t length; |
| 1832 | list(of_uint32_t) oxm_ids; |
| 1833 | }; |
| 1834 | |
| 1835 | struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop { |
| 1836 | uint16_t type == 15; |
| 1837 | uint16_t length; |
| 1838 | list(of_uint32_t) oxm_ids; |
| 1839 | }; |
| 1840 | |
| 1841 | struct of_table_feature_prop_experimenter : of_table_feature_prop { |
| 1842 | uint16_t type == 65534; |
| 1843 | uint16_t length; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1844 | uint32_t experimenter == ?; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1845 | uint32_t subtype; |
| 1846 | of_octets_t experimenter_data; |
| 1847 | }; |
| 1848 | |
| 1849 | struct of_table_feature_prop_experimenter_miss : of_table_feature_prop { |
| 1850 | uint16_t type == 65535; |
| 1851 | uint16_t length; |
Rich Lane | 7f503ee | 2014-09-26 14:18:58 -0700 | [diff] [blame] | 1852 | uint32_t experimenter == ?; |
alshabib | 9f50e48 | 2014-08-23 17:10:57 -0500 | [diff] [blame] | 1853 | uint32_t subtype; |
| 1854 | of_octets_t experimenter_data; |
| 1855 | }; |
| 1856 | |
| 1857 | struct of_table_features { |
| 1858 | uint16_t length; |
| 1859 | uint8_t table_id; |
| 1860 | pad(5); |
| 1861 | of_table_name_t name; |
| 1862 | uint64_t metadata_match; |
| 1863 | uint64_t metadata_write; |
| 1864 | uint32_t config; |
| 1865 | uint32_t max_entries; |
| 1866 | list(of_table_feature_prop_t) properties; |
| 1867 | }; |
| 1868 | |
| 1869 | struct of_meter_features { |
| 1870 | uint32_t max_meter; |
| 1871 | uint32_t band_types; |
| 1872 | uint32_t capabilities; |
| 1873 | uint8_t max_bands; |
| 1874 | uint8_t max_color; |
| 1875 | pad(2); |
| 1876 | }; |
| 1877 | |
| 1878 | struct of_port_stats_request : of_stats_request { |
| 1879 | uint8_t version; |
| 1880 | uint8_t type == 18; |
| 1881 | uint16_t length; |
| 1882 | uint32_t xid; |
| 1883 | uint16_t stats_type == 4; |
| 1884 | enum ofp_stats_request_flags flags; |
| 1885 | pad(4); |
| 1886 | of_port_no_t port_no; |
| 1887 | pad(4); |
| 1888 | }; |
| 1889 | |
| 1890 | struct of_port_stats_reply : of_stats_reply { |
| 1891 | uint8_t version; |
| 1892 | uint8_t type == 19; |
| 1893 | uint16_t length; |
| 1894 | uint32_t xid; |
| 1895 | uint16_t stats_type == 4; |
| 1896 | enum ofp_stats_reply_flags flags; |
| 1897 | pad(4); |
| 1898 | list(of_port_stats_entry_t) entries; |
| 1899 | }; |
| 1900 | |
| 1901 | struct of_queue_stats_request : of_stats_request { |
| 1902 | uint8_t version; |
| 1903 | uint8_t type == 18; |
| 1904 | uint16_t length; |
| 1905 | uint32_t xid; |
| 1906 | uint16_t stats_type == 5; |
| 1907 | enum ofp_stats_request_flags flags; |
| 1908 | pad(4); |
| 1909 | of_port_no_t port_no; |
| 1910 | uint32_t queue_id; |
| 1911 | }; |
| 1912 | |
| 1913 | struct of_queue_stats_reply : of_stats_reply { |
| 1914 | uint8_t version; |
| 1915 | uint8_t type == 19; |
| 1916 | uint16_t length; |
| 1917 | uint32_t xid; |
| 1918 | uint16_t stats_type == 5; |
| 1919 | enum ofp_stats_reply_flags flags; |
| 1920 | pad(4); |
| 1921 | list(of_queue_stats_entry_t) entries; |
| 1922 | }; |
| 1923 | |
| 1924 | struct of_group_stats_request : of_stats_request { |
| 1925 | uint8_t version; |
| 1926 | uint8_t type == 18; |
| 1927 | uint16_t length; |
| 1928 | uint32_t xid; |
| 1929 | uint16_t stats_type == 6; |
| 1930 | enum ofp_stats_request_flags flags; |
| 1931 | pad(4); |
| 1932 | uint32_t group_id; |
| 1933 | pad(4); |
| 1934 | }; |
| 1935 | |
| 1936 | struct of_group_stats_reply : of_stats_reply { |
| 1937 | uint8_t version; |
| 1938 | uint8_t type == 19; |
| 1939 | uint16_t length; |
| 1940 | uint32_t xid; |
| 1941 | uint16_t stats_type == 6; |
| 1942 | enum ofp_stats_reply_flags flags; |
| 1943 | pad(4); |
| 1944 | list(of_group_stats_entry_t) entries; |
| 1945 | }; |
| 1946 | |
| 1947 | struct of_group_desc_stats_request : of_stats_request { |
| 1948 | uint8_t version; |
| 1949 | uint8_t type == 18; |
| 1950 | uint16_t length; |
| 1951 | uint32_t xid; |
| 1952 | uint16_t stats_type == 7; |
| 1953 | enum ofp_stats_request_flags flags; |
| 1954 | pad(4); |
| 1955 | }; |
| 1956 | |
| 1957 | struct of_group_desc_stats_reply : of_stats_reply { |
| 1958 | uint8_t version; |
| 1959 | uint8_t type == 19; |
| 1960 | uint16_t length; |
| 1961 | uint32_t xid; |
| 1962 | uint16_t stats_type == 7; |
| 1963 | enum ofp_stats_reply_flags flags; |
| 1964 | pad(4); |
| 1965 | list(of_group_desc_stats_entry_t) entries; |
| 1966 | }; |
| 1967 | |
| 1968 | struct of_group_features_stats_request : of_stats_request { |
| 1969 | uint8_t version; |
| 1970 | uint8_t type == 18; |
| 1971 | uint16_t length; |
| 1972 | uint32_t xid; |
| 1973 | uint16_t stats_type == 8; |
| 1974 | enum ofp_stats_request_flags flags; |
| 1975 | pad(4); |
| 1976 | }; |
| 1977 | |
| 1978 | struct of_group_features_stats_reply : of_stats_reply { |
| 1979 | uint8_t version; |
| 1980 | uint8_t type == 19; |
| 1981 | uint16_t length; |
| 1982 | uint32_t xid; |
| 1983 | uint16_t stats_type == 8; |
| 1984 | enum ofp_stats_reply_flags flags; |
| 1985 | pad(4); |
| 1986 | uint32_t types; |
| 1987 | uint32_t capabilities; |
| 1988 | uint32_t max_groups_all; |
| 1989 | uint32_t max_groups_select; |
| 1990 | uint32_t max_groups_indirect; |
| 1991 | uint32_t max_groups_ff; |
| 1992 | uint32_t actions_all; |
| 1993 | uint32_t actions_select; |
| 1994 | uint32_t actions_indirect; |
| 1995 | uint32_t actions_ff; |
| 1996 | }; |
| 1997 | |
| 1998 | struct of_meter_stats_request : of_stats_request { |
| 1999 | uint8_t version; |
| 2000 | uint8_t type == 18; |
| 2001 | uint16_t length; |
| 2002 | uint32_t xid; |
| 2003 | uint16_t stats_type == 9; |
| 2004 | enum ofp_stats_request_flags flags; |
| 2005 | pad(4); |
| 2006 | uint32_t meter_id; |
| 2007 | pad(4); |
| 2008 | }; |
| 2009 | |
| 2010 | struct of_meter_stats_reply : of_stats_reply { |
| 2011 | uint8_t version; |
| 2012 | uint8_t type == 19; |
| 2013 | uint16_t length; |
| 2014 | uint32_t xid; |
| 2015 | uint16_t stats_type == 9; |
| 2016 | enum ofp_stats_reply_flags flags; |
| 2017 | pad(4); |
| 2018 | list(of_meter_stats_t) entries; |
| 2019 | }; |
| 2020 | |
| 2021 | struct of_meter_config_stats_request : of_stats_request { |
| 2022 | uint8_t version; |
| 2023 | uint8_t type == 18; |
| 2024 | uint16_t length; |
| 2025 | uint32_t xid; |
| 2026 | uint16_t stats_type == 10; |
| 2027 | enum ofp_stats_request_flags flags; |
| 2028 | pad(4); |
| 2029 | uint32_t meter_id; |
| 2030 | pad(4); |
| 2031 | }; |
| 2032 | |
| 2033 | struct of_meter_config_stats_reply : of_stats_reply { |
| 2034 | uint8_t version; |
| 2035 | uint8_t type == 19; |
| 2036 | uint16_t length; |
| 2037 | uint32_t xid; |
| 2038 | uint16_t stats_type == 10; |
| 2039 | enum ofp_stats_reply_flags flags; |
| 2040 | pad(4); |
| 2041 | list(of_meter_band_t) entries; |
| 2042 | }; |
| 2043 | |
| 2044 | // FIXME stats added to get things working |
| 2045 | struct of_meter_features_stats_request : of_stats_request { |
| 2046 | uint8_t version; |
| 2047 | uint8_t type == 18; |
| 2048 | uint16_t length; |
| 2049 | uint32_t xid; |
| 2050 | uint16_t stats_type == 11; |
| 2051 | enum ofp_stats_request_flags flags; |
| 2052 | pad(4); |
| 2053 | }; |
| 2054 | |
| 2055 | // FIXME stats added to get things working |
| 2056 | struct of_meter_features_stats_reply : of_stats_reply { |
| 2057 | uint8_t version; |
| 2058 | uint8_t type == 19; |
| 2059 | uint16_t length; |
| 2060 | uint32_t xid; |
| 2061 | uint16_t stats_type == 11; |
| 2062 | enum ofp_stats_reply_flags flags; |
| 2063 | pad(4); |
| 2064 | of_meter_features_t features; |
| 2065 | }; |
| 2066 | |
| 2067 | // FIXME stats added to get things working |
| 2068 | struct of_table_features_stats_request : of_stats_request { |
| 2069 | uint8_t version; |
| 2070 | uint8_t type == 18; |
| 2071 | uint16_t length; |
| 2072 | uint32_t xid; |
| 2073 | uint16_t stats_type == 12; |
| 2074 | enum ofp_stats_request_flags flags; |
| 2075 | pad(4); |
| 2076 | list(of_table_features_t) entries; |
| 2077 | }; |
| 2078 | |
| 2079 | // FIXME stats added to get things working |
| 2080 | struct of_table_features_stats_reply : of_stats_reply { |
| 2081 | uint8_t version; |
| 2082 | uint8_t type == 19; |
| 2083 | uint16_t length; |
| 2084 | uint32_t xid; |
| 2085 | uint16_t stats_type == 12; |
| 2086 | enum ofp_stats_reply_flags flags; |
| 2087 | pad(4); |
| 2088 | list(of_table_features_t) entries; |
| 2089 | }; |
| 2090 | |
| 2091 | // FIXME stats added to get things working |
| 2092 | struct of_port_desc_stats_request : of_stats_request { |
| 2093 | uint8_t version; |
| 2094 | uint8_t type == 18; |
| 2095 | uint16_t length; |
| 2096 | uint32_t xid; |
| 2097 | uint16_t stats_type == 13; |
| 2098 | enum ofp_stats_request_flags flags; |
| 2099 | pad(4); |
| 2100 | }; |
| 2101 | |
| 2102 | // FIXME stats added to get things working |
| 2103 | struct of_port_desc_stats_reply : of_stats_reply { |
| 2104 | uint8_t version; |
| 2105 | uint8_t type == 19; |
| 2106 | uint16_t length; |
| 2107 | uint32_t xid; |
| 2108 | uint16_t stats_type == 13; |
| 2109 | enum ofp_stats_reply_flags flags; |
| 2110 | pad(4); |
| 2111 | list(of_port_desc_t) entries; |
| 2112 | }; |
| 2113 | |
| 2114 | struct of_meter_band_stats { |
| 2115 | uint64_t packet_band_count; |
| 2116 | uint64_t byte_band_count; |
| 2117 | }; |
| 2118 | |
| 2119 | struct of_meter_stats { |
| 2120 | uint32_t meter_id; |
| 2121 | uint16_t len; |
| 2122 | pad(6); |
| 2123 | uint32_t flow_count; |
| 2124 | uint64_t packet_in_count; |
| 2125 | uint64_t byte_in_count; |
| 2126 | uint32_t duration_sec; |
| 2127 | uint32_t duration_nsec; |
| 2128 | list(of_meter_band_stats_t) band_stats; |
| 2129 | }; |
| 2130 | |
| 2131 | struct of_meter_config { |
| 2132 | uint16_t length; |
| 2133 | uint16_t flags; |
| 2134 | uint32_t meter_id; |
| 2135 | list(of_meter_band_t) entries; |
| 2136 | }; |
| 2137 | |
| 2138 | // END OF STATS OBJECTS |
| 2139 | |
| 2140 | struct of_queue_prop { |
| 2141 | uint16_t type == ?; |
| 2142 | uint16_t len; |
| 2143 | pad(4); |
| 2144 | }; |
| 2145 | |
| 2146 | struct of_queue_prop_min_rate : of_queue_prop { |
| 2147 | uint16_t type == 1; |
| 2148 | uint16_t len; |
| 2149 | pad(4); |
| 2150 | uint16_t rate; |
| 2151 | pad(6); |
| 2152 | }; |
| 2153 | |
| 2154 | struct of_queue_prop_max_rate : of_queue_prop { |
| 2155 | uint16_t type == 2; |
| 2156 | uint16_t len; |
| 2157 | pad(4); |
| 2158 | uint16_t rate; |
| 2159 | pad(6); |
| 2160 | }; |
| 2161 | |
| 2162 | struct of_queue_prop_experimenter : of_queue_prop { |
| 2163 | uint16_t type == 65535; |
| 2164 | uint16_t len; |
| 2165 | pad(4); |
| 2166 | uint32_t experimenter == ?; |
| 2167 | pad(4); |
| 2168 | of_octets_t data; |
| 2169 | }; |
| 2170 | |
| 2171 | struct of_packet_queue { |
| 2172 | uint32_t queue_id; |
| 2173 | of_port_no_t port; |
| 2174 | uint16_t len; |
| 2175 | pad(6); |
| 2176 | list(of_queue_prop_t) properties; |
| 2177 | }; |
| 2178 | |
| 2179 | struct of_queue_get_config_request : of_header { |
| 2180 | uint8_t version; |
| 2181 | uint8_t type == 22; |
| 2182 | uint16_t length; |
| 2183 | uint32_t xid; |
| 2184 | of_port_no_t port; |
| 2185 | pad(4); |
| 2186 | }; |
| 2187 | |
| 2188 | struct of_queue_get_config_reply : of_header { |
| 2189 | uint8_t version; |
| 2190 | uint8_t type == 23; |
| 2191 | uint16_t length; |
| 2192 | uint32_t xid; |
| 2193 | of_port_no_t port; |
| 2194 | pad(4); |
| 2195 | list(of_packet_queue_t) queues; |
| 2196 | }; |
| 2197 | |
| 2198 | struct of_role_request : of_header { |
| 2199 | uint8_t version; |
| 2200 | uint8_t type == 24; |
| 2201 | uint16_t length; |
| 2202 | uint32_t xid; |
| 2203 | enum ofp_controller_role role; |
| 2204 | pad(4); |
| 2205 | uint64_t generation_id; |
| 2206 | }; |
| 2207 | |
| 2208 | struct of_role_reply : of_header { |
| 2209 | uint8_t version; |
| 2210 | uint8_t type == 25; |
| 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 | //////////////////////////////////////////////////////////////// |
| 2219 | // FIXME understand async; where do bitmasks live? |
| 2220 | // Determine bitmap type for masks below. |
| 2221 | // DOCUMENT masks where uint32_t[0] is interest for equal/master |
| 2222 | // while uint32_t[1] is interest for slave |
| 2223 | //////////////////////////////////////////////////////////////// |
| 2224 | |
| 2225 | struct of_async_get_request : of_header { |
| 2226 | uint8_t version; |
| 2227 | uint8_t type == 26; |
| 2228 | uint16_t length; |
| 2229 | uint32_t xid; |
| 2230 | uint32_t packet_in_mask_equal_master; |
| 2231 | uint32_t packet_in_mask_slave; |
| 2232 | uint32_t port_status_mask_equal_master; |
| 2233 | uint32_t port_status_mask_slave; |
| 2234 | uint32_t flow_removed_mask_equal_master; |
| 2235 | uint32_t flow_removed_mask_slave; |
| 2236 | }; |
| 2237 | |
| 2238 | struct of_async_get_reply : of_header { |
| 2239 | uint8_t version; |
| 2240 | uint8_t type == 27; |
| 2241 | uint16_t length; |
| 2242 | uint32_t xid; |
| 2243 | uint32_t packet_in_mask_equal_master; |
| 2244 | uint32_t packet_in_mask_slave; |
| 2245 | uint32_t port_status_mask_equal_master; |
| 2246 | uint32_t port_status_mask_slave; |
| 2247 | uint32_t flow_removed_mask_equal_master; |
| 2248 | uint32_t flow_removed_mask_slave; |
| 2249 | }; |
| 2250 | |
| 2251 | struct of_async_set : of_header { |
| 2252 | uint8_t version; |
| 2253 | uint8_t type == 28; |
| 2254 | uint16_t length; |
| 2255 | uint32_t xid; |
| 2256 | uint32_t packet_in_mask_equal_master; |
| 2257 | uint32_t packet_in_mask_slave; |
| 2258 | uint32_t port_status_mask_equal_master; |
| 2259 | uint32_t port_status_mask_slave; |
| 2260 | uint32_t flow_removed_mask_equal_master; |
| 2261 | uint32_t flow_removed_mask_slave; |
| 2262 | }; |