Murat Parlakisik | f95672c | 2016-12-05 00:53:17 -0800 | [diff] [blame^] | 1 | |
| 2 | #version 6 |
| 3 | |
| 4 | /* ------------------------------------------- MACRO DEFINITIONS ------------------------------ */ |
| 5 | enum macro_definitions { |
| 6 | OFP_MAX_TABLE_NAME_LEN = 32, |
| 7 | OFP_MAX_PORT_NAME_LEN = 16, |
| 8 | |
| 9 | OFP_TCP_PORT = 6653, |
| 10 | OFP_SSL_PORT = 6653, |
| 11 | |
| 12 | OFP_ETH_ALEN = 6, |
| 13 | |
| 14 | OFP_DEFAULT_MISS_SEND_LEN = 128, |
| 15 | |
| 16 | OFP_VLAN_NONE = 0, |
| 17 | |
| 18 | OFP_FLOW_PERMANENT = 0, |
| 19 | |
| 20 | OFP_DEFAULT_PRIORITY = 0x8000, |
| 21 | |
| 22 | OFP_NO_BUFFER = 0xffffffff, |
| 23 | |
| 24 | DESC_STR_LEN = 256, |
| 25 | SERIAL_NUM_LEN = 32, |
| 26 | |
| 27 | OFPQ_ALL = 0xffffffff, |
| 28 | OFPQ_MAX_RATE_UNCFG = 0xffff, |
| 29 | OFPQ_MIN_RATE_UNCFG = 0xffff, |
| 30 | }; |
| 31 | |
| 32 | /* ------------------------------------------- SPECIAL STRUCTURES ---------------------------------- */ |
| 33 | |
| 34 | struct of_uint64 { |
| 35 | uint64_t value; |
| 36 | }; |
| 37 | |
| 38 | struct of_uint32 { |
| 39 | uint32_t value; |
| 40 | }; |
| 41 | |
| 42 | struct of_uint8 { |
| 43 | uint8_t value; |
| 44 | }; |
| 45 | |
| 46 | /* ------------------------------------------- HEADER ------------------------------------- */ |
| 47 | |
| 48 | /* Type for header */ |
| 49 | enum ofp_type(wire_type=uint8_t) { |
| 50 | OFPT_HELLO = 0, |
| 51 | OFPT_ERROR = 1, |
| 52 | OFPT_ECHO_REQUEST = 2, |
| 53 | OFPT_ECHO_REPLY = 3, |
| 54 | OFPT_EXPERIMENTER = 4, |
| 55 | OFPT_FEATURES_REQUEST = 5, |
| 56 | OFPT_FEATURES_REPLY = 6, |
| 57 | OFPT_GET_CONFIG_REQUEST = 7, |
| 58 | OFPT_GET_CONFIG_REPLY = 8, |
| 59 | OFPT_SET_CONFIG = 9, |
| 60 | OFPT_PACKET_IN = 10, |
| 61 | OFPT_FLOW_REMOVED = 11, |
| 62 | OFPT_PORT_STATUS = 12, |
| 63 | OFPT_PACKET_OUT = 13, |
| 64 | OFPT_FLOW_MOD = 14, |
| 65 | OFPT_GROUP_MOD = 15, |
| 66 | OFPT_PORT_MOD = 16, |
| 67 | OFPT_TABLE_MOD = 17, |
| 68 | OFPT_STATS_REQUEST = 18, /* Tüm sürümler için ayný olsun diye multipart yerine stats */ |
| 69 | OFPT_STATS_REPLY = 19, /* Tüm sürümler için ayný olsun diye multipart yerine stats */ |
| 70 | OFPT_BARRIER_REQUEST = 20, |
| 71 | OFPT_BARRIER_REPLY = 21, |
| 72 | OFPT_ROLE_REQUEST = 24, |
| 73 | OFPT_ROLE_REPLY = 25, |
| 74 | OFPT_GET_ASYNC_REQUEST = 26, |
| 75 | OFPT_GET_ASYNC_REPLY = 27, |
| 76 | OFPT_SET_ASYNC = 28, |
| 77 | OFPT_METER_MOD = 29, |
| 78 | OFPT_ROLE_STATUS = 30, |
| 79 | OFPT_TABLE_STATUS = 31, |
| 80 | OFPT_REQUESTFORWARD = 32, |
| 81 | OFPT_BUNDLE_CONTROL = 33, |
| 82 | OFPT_BUNDLE_ADD_MESSAGE = 34, |
| 83 | OFPT_CONTROLLER_STATUS = 35, /* 1.4 den sonra yeni gelmis */ |
| 84 | }; |
| 85 | |
| 86 | /* Header on all OpenFlow packets */ |
| 87 | struct of_header { |
| 88 | uint8_t version; |
| 89 | uint8_t type == ?; |
| 90 | uint16_t length; |
| 91 | uint32_t xid; |
| 92 | }; |
| 93 | |
| 94 | |
| 95 | /* ----------------------------------- HEADER TYPES (FOR DIFFERENT PACKETS) ------------------------- */ |
| 96 | |
| 97 | /* Namespaces */ |
| 98 | /* Used in header_type */ |
| 99 | enum ofp_header_type_namespace(wire_type=uint16_t, stable=True) { |
| 100 | OFPHTN_ONF = 0, |
| 101 | OFPHTN_ETHERTYPE = 1, |
| 102 | OFPHTN_IP_PROTO = 2, |
| 103 | OFPHTN_UDP_TCP_PORT = 3, |
| 104 | OFPHTN_IPV4_OPTION = 4, |
| 105 | }; |
| 106 | |
| 107 | /* ONF namespaces */ |
| 108 | enum ofp_header_type_onf(wire_type=uint16_t, stable=True, complete=False) { |
| 109 | OFPHTO_ETHERNET = 0, |
| 110 | OFPHTO_NO_HEADER = 1, |
| 111 | OFPHTO_OXM_EXPERIMENTER = 0xFFFF, |
| 112 | }; |
| 113 | |
| 114 | /* Header type structure. */ |
| 115 | struct of_header_type { |
| 116 | enum ofp_header_type_namespace namespace == ?; |
| 117 | uint16_t ns_type; |
| 118 | }; |
| 119 | |
| 120 | /* --------------------------------------------------- PORT -------------------------------------------------- */ |
| 121 | |
| 122 | /* Port numbering */ |
| 123 | /* Tüm sürümler için ayný olsun diye ofp_port_no yerine port */ |
| 124 | enum ofp_port(wire_type=uint32_t) { |
| 125 | OFPP_MAX = 0xffffff00, |
| 126 | OFPP_UNSET = 0xfffffff7, |
| 127 | OFPP_IN_PORT = 0xfffffff8, |
| 128 | OFPP_TABLE = 0xfffffff9, |
| 129 | OFPP_NORMAL = 0xfffffffa, |
| 130 | OFPP_FLOOD = 0xfffffffb, |
| 131 | OFPP_ALL = 0xfffffffc, |
| 132 | OFPP_CONTROLLER = 0xfffffffd, |
| 133 | OFPP_LOCAL = 0xfffffffe, |
| 134 | OFPP_ANY = 0xffffffff, |
| 135 | }; |
| 136 | |
| 137 | /* Flags to indicate behavior of the physical port */ |
| 138 | /* Used in of_port_desc and ofp_port_mod message */ |
| 139 | enum ofp_port_config(wire_type=uint32_t, bitmask=True) { |
| 140 | OFPPC_PORT_DOWN = 0x1, |
| 141 | OFPPC_NO_RECV = 0x4, |
| 142 | OFPPC_NO_FWD = 0x20, |
| 143 | OFPPC_NO_PACKET_IN = 0x40, |
| 144 | OFPPC_BSN_MIRROR_DEST = 0x80000000, /* header dosyalarýnda bulunmuyor */ |
| 145 | }; |
| 146 | |
| 147 | /* Current state of the physical port */ |
| 148 | /* Not configurable from the controller */ |
| 149 | /* Used in of_port_desc */ |
| 150 | enum ofp_port_state(wire_type=uint32_t, bitmask=True) { |
| 151 | OFPPS_LINK_DOWN = 0x1, |
| 152 | OFPPS_BLOCKED = 0x2, |
| 153 | OFPPS_LIVE = 0x4, |
| 154 | }; |
| 155 | |
| 156 | /* Port description property types */ |
| 157 | /* not in before */ |
| 158 | /* Used in of_port_desc_prop_ethernet */ |
| 159 | enum ofp_port_desc_prop_type { |
| 160 | OFPPDPT_ETHERNET = 0, |
| 161 | OFPPDPT_OPTICAL = 1, |
| 162 | OFPPDPT_PIPELINE_INPUT = 2, |
| 163 | OFPPDPT_PIPELINE_OUTPUT = 3, |
| 164 | OFPPDPT_RECIRCULATE = 4, |
| 165 | OFPPDPT_EXPERIMENTER = 0xFFFF, |
| 166 | }; |
| 167 | |
| 168 | /* Features of ports available in a datapath. */ |
| 169 | enum ofp_port_features(wire_type=uint32_t, bitmask=True) { |
| 170 | OFPPF_10MB_HD = 0x1, |
| 171 | OFPPF_10MB_FD = 0x2, |
| 172 | OFPPF_100MB_HD = 0x4, |
| 173 | OFPPF_100MB_FD = 0x8, |
| 174 | OFPPF_1GB_HD = 0x10, |
| 175 | OFPPF_1GB_FD = 0x20, |
| 176 | OFPPF_10GB_FD = 0x40, |
| 177 | OFPPF_40GB_FD = 0x80, |
| 178 | OFPPF_100GB_FD = 0x100, |
| 179 | OFPPF_1TB_FD = 0x200, |
| 180 | OFPPF_OTHER = 0x400, |
| 181 | OFPPF_COPPER = 0x800, |
| 182 | OFPPF_FIBER = 0x1000, |
| 183 | OFPPF_AUTONEG = 0x2000, |
| 184 | OFPPF_PAUSE = 0x4000, |
| 185 | OFPPF_PAUSE_ASYM = 0x8000, |
| 186 | OFPPF_BSN_BREAKOUT_CAPABLE = 0x80000000, /* not in spec. */ |
| 187 | }; |
| 188 | |
| 189 | /* Features of optical ports available in switch. */ |
| 190 | enum ofp_optical_port_features(wire_type=uint32_t, bitmask=True) { |
| 191 | OFPOPF_RX_TUNE = 0x1, |
| 192 | OFPOPF_TX_TUNE = 0x2, |
| 193 | OFPOPF_TX_PWR = 0x4, |
| 194 | OFPOPF_USE_FREQ = 0x8, |
| 195 | }; |
| 196 | |
| 197 | /* Description of a port */ |
| 198 | /* Tüm sürümler için ayný olsun diye ofp_port yerine of_port_desc */ |
| 199 | struct of_port_desc { |
| 200 | of_port_no_t port_no; |
| 201 | uint16_t length; |
| 202 | pad(2); |
| 203 | of_mac_addr_t hw_addr; |
| 204 | pad(2); |
| 205 | of_port_name_t name; |
| 206 | enum ofp_port_config config; /* Bitmap of OFPPC_* flags. */ |
| 207 | enum ofp_port_state state; /* Bitmap of OFPPS_* flags. */ |
| 208 | list(of_port_desc_prop_t) properties; |
| 209 | }; |
| 210 | |
| 211 | /* Common header for all port description properties. */ |
| 212 | struct of_port_desc_prop { |
| 213 | uint16_t type == ?; |
| 214 | uint16_t length; |
| 215 | }; |
| 216 | |
| 217 | /* Ethernet port description property. */ |
| 218 | struct of_port_desc_prop_ethernet : of_port_desc_prop { |
| 219 | uint16_t type == 0; |
| 220 | uint16_t length; |
| 221 | pad(4); |
| 222 | uint32_t curr; |
| 223 | uint32_t advertised; |
| 224 | uint32_t supported; |
| 225 | uint32_t peer; |
| 226 | uint32_t curr_speed; |
| 227 | uint32_t max_speed; |
| 228 | }; |
| 229 | |
| 230 | /* Optical port description property. */ |
| 231 | struct of_port_desc_prop_optical : of_port_desc_prop { |
| 232 | uint16_t type == 1; |
| 233 | uint16_t length; |
| 234 | pad(4); |
| 235 | uint32_t supported; |
| 236 | uint32_t tx_min_freq_lmda; |
| 237 | uint32_t tx_max_freq_lmda; |
| 238 | uint32_t tx_grid_freq_lmda; |
| 239 | uint32_t rx_min_freq_lmda; |
| 240 | uint32_t rx_max_freq_lmda; |
| 241 | uint32_t rx_grid_freq_lmda; |
| 242 | uint16_t tx_pwr_min; |
| 243 | uint16_t tx_pwr_max; |
| 244 | }; |
| 245 | |
| 246 | /* Ingress pipeline fields description property */ |
| 247 | /* In 1.5.1 spec ofp_port_desc_prop_oxm */ |
| 248 | struct of_port_desc_prop_ingress { |
| 249 | uint16_t type == 2; |
| 250 | uint16_t length; |
| 251 | of_octets_t oxm_ids; |
| 252 | }; |
| 253 | |
| 254 | /* Egress pipeline fields description property */ |
| 255 | /* In 1.5.1 spec ofp_port_desc_prop_oxm */ |
| 256 | struct of_port_desc_prop_egress { |
| 257 | uint16_t type == 3; |
| 258 | uint16_t length; |
| 259 | of_octets_t oxm_ids; |
| 260 | }; |
| 261 | |
| 262 | /* Recirculate port description property. */ |
| 263 | struct ofp_port_desc_prop_recirculate { |
| 264 | uint16_t type == 4; |
| 265 | uint16_t length; |
| 266 | of_octets_t port_nos; |
| 267 | }; |
| 268 | |
| 269 | |
| 270 | /* Experimenter port description property. */ |
| 271 | struct of_port_desc_prop_experimenter : of_port_desc_prop { |
| 272 | uint16_t type == 0xffff; |
| 273 | uint16_t length; |
| 274 | uint32_t experimenter == ?; |
| 275 | uint32_t exp_type; |
| 276 | }; |
| 277 | |
| 278 | /* ----------------------------------------------- FLOW MATCH -------------------------------------- */ |
| 279 | |
| 280 | /* Match Type */ |
| 281 | /* Standard deprecated olmuþ */ |
| 282 | enum ofp_match_type(wire_type=uint16_t) { |
| 283 | OFPMT_STANDARD = 0, |
| 284 | OFPMT_OXM = 1, |
| 285 | }; |
| 286 | |
| 287 | /* OXM Class IDs */ |
| 288 | enum ofp_oxm_class(wire_type=uint16_t) { |
| 289 | OFPXMC_NXM_0 = 0, |
| 290 | OFPXMC_NXM_1 = 1, |
| 291 | OFPXMC_OPENFLOW_BASIC = 0x8000, |
| 292 | OFPXMC_PACKET_REGS = 0x8001, |
| 293 | OFPXMC_EXPERIMENTER = 0xffff, |
| 294 | }; |
| 295 | |
| 296 | |
| 297 | /* VLAN id set or not */ |
| 298 | enum ofp_vlan_id(wire_type=uint16_t) { |
| 299 | OFPVID_NONE = 0, |
| 300 | OFPVID_PRESENT = 0x1000, |
| 301 | }; |
| 302 | |
| 303 | // FIXME: OF spec specified this as '9' bits, implicitly adding to full byte |
| 304 | /* Bit definitions for IPv6 Extension Header pseudo-field. */ |
| 305 | enum ofp_ipv6exthdr_flags(wire_type=uint16_t, bitmask=True) { |
| 306 | OFPIEH_NONEXT = 0x1, |
| 307 | OFPIEH_ESP = 0x2, |
| 308 | OFPIEH_AUTH = 0x4, |
| 309 | OFPIEH_DEST = 0x8, |
| 310 | OFPIEH_FRAG = 0x10, |
| 311 | OFPIEH_ROUTER = 0x20, |
| 312 | OFPIEH_HOP = 0x40, |
| 313 | OFPIEH_UNREP = 0x80, |
| 314 | OFPIEH_UNSEQ = 0x100, |
| 315 | }; |
| 316 | |
| 317 | /* Flow Match */ |
| 318 | /* standard-1.0 içinde v1 olarak var */ |
| 319 | /* standard-1.1 içinde v2 olarak var */ |
| 320 | /* standard-1.2 den itibaren v3 olarak deðiþmiþ ve oxm classlarý oluþturulmuþ */ |
| 321 | struct of_match_v3(align=8, length_includes_align=False) { |
| 322 | uint16_t type == 1; |
| 323 | uint16_t length; |
| 324 | list(of_oxm_t) oxm_list; |
| 325 | }; |
| 326 | |
| 327 | /* --------------------------------------------------------- FLOW STATS ----------------------------------------------- */ |
| 328 | |
| 329 | /* stats oxs class */ |
| 330 | /* not in 1.4 */ |
| 331 | enum ofp_oxs_class(wire_type=uint16_t) { |
| 332 | OFPXSC_OPENFLOW_BASIC = 0x8002, |
| 333 | OFPXSC_EXPERIMENTER = 0xFFFF, |
| 334 | }; |
| 335 | |
| 336 | struct of_stat_v6 (align=8, length_includes_align=False){ |
| 337 | pad(2); /* reserved */ |
| 338 | uint16_t length; |
| 339 | list(of_oxs_t) oxs_fields; |
| 340 | }; |
| 341 | |
| 342 | /* ---------------------------------------------------- FLOW INSTRUCTIONS --------------------------------------- */ |
| 343 | |
| 344 | /* instruction types */ |
| 345 | enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) { |
| 346 | OFPIT_GOTO_TABLE = 0x1, |
| 347 | OFPIT_WRITE_METADATA = 0x2, |
| 348 | OFPIT_WRITE_ACTIONS = 0x3, |
| 349 | OFPIT_APPLY_ACTIONS = 0x4, |
| 350 | OFPIT_CLEAR_ACTIONS = 0x5, |
| 351 | OFPIT_DEPRECATED = 0x6, |
| 352 | OFPIT_STAT_TRIGGER = 0x7, |
| 353 | OFPIT_EXPERIMENTER = 0xffff, |
| 354 | }; |
| 355 | |
| 356 | /* stat trigger instruction flags */ |
| 357 | /* not in 1.4 */ |
| 358 | enum ofp_stat_trigger_flags(wire_type=uint32_t, bitmask=True) { |
| 359 | OFPSTF_PERIODIC = 0x1, |
| 360 | OFPSTF_ONLY_FIRST = 0x2, |
| 361 | }; |
| 362 | |
| 363 | /* Instruction Header */ |
| 364 | struct of_instruction { |
| 365 | uint16_t type == ?; |
| 366 | uint16_t len; |
| 367 | }; |
| 368 | |
| 369 | /* Instruction structure for OFPIT_GOTO_TABLE */ |
| 370 | struct of_instruction_goto_table : of_instruction { |
| 371 | uint16_t type == 1; |
| 372 | uint16_t len; |
| 373 | uint8_t table_id; |
| 374 | pad(3); |
| 375 | }; |
| 376 | |
| 377 | /* Instruction structure for OFPIT_WRITE_METADATA */ |
| 378 | struct of_instruction_write_metadata : of_instruction { |
| 379 | uint16_t type == 2; |
| 380 | uint16_t len; |
| 381 | pad(4); |
| 382 | uint64_t metadata; |
| 383 | uint64_t metadata_mask; |
| 384 | }; |
| 385 | |
| 386 | /* Instruction structure for OFPIT_WRITE */ |
| 387 | struct of_instruction_write_actions : of_instruction { |
| 388 | uint16_t type == 3; |
| 389 | uint16_t len; |
| 390 | pad(4); |
| 391 | list(of_action_t) actions; |
| 392 | }; |
| 393 | |
| 394 | /* Instruction structure for OFPIT_APPLY */ |
| 395 | struct of_instruction_apply_actions : of_instruction { |
| 396 | uint16_t type == 4; |
| 397 | uint16_t len; |
| 398 | pad(4); |
| 399 | list(of_action_t) actions; |
| 400 | }; |
| 401 | |
| 402 | /* Instruction structure for OFPIT_CLEAR */ |
| 403 | struct of_instruction_clear_actions : of_instruction { |
| 404 | uint16_t type == 5; |
| 405 | uint16_t len; |
| 406 | pad(4); |
| 407 | }; |
| 408 | |
| 409 | /* Instruction structure for OFPIT_STAT_TRIGGER */ |
| 410 | /* not in 1.4 */ |
| 411 | struct of_instruction_stat_trigger : of_instruction { |
| 412 | uint16_t type == 7; |
| 413 | uint16_t len; |
| 414 | enum ofp_stat_trigger_flags flags; |
| 415 | list(of_oxs_t) thresholds; |
| 416 | }; |
| 417 | |
| 418 | /* Instruction structure for experimental instructions */ |
| 419 | struct of_instruction_experimenter : of_instruction { |
| 420 | uint16_t type == 65535; |
| 421 | uint16_t len; |
| 422 | uint32_t experimenter == ?; |
| 423 | of_octets_t data; |
| 424 | }; |
| 425 | |
| 426 | /* --------------------------------------------------------- ACTION STRUCTURES ----------------------------------------- */ |
| 427 | |
| 428 | /* action types */ |
| 429 | enum ofp_action_type(wire_type=uint16_t) { |
| 430 | OFPAT_OUTPUT = 0, |
| 431 | OFPAT_COPY_TTL_OUT = 0xb, |
| 432 | OFPAT_COPY_TTL_IN = 0xc, |
| 433 | OFPAT_SET_MPLS_TTL = 0xf, |
| 434 | OFPAT_DEC_MPLS_TTL = 0x10, |
| 435 | OFPAT_PUSH_VLAN = 0x11, |
| 436 | OFPAT_POP_VLAN = 0x12, |
| 437 | OFPAT_PUSH_MPLS = 0x13, |
| 438 | OFPAT_POP_MPLS = 0x14, |
| 439 | OFPAT_SET_QUEUE = 0x15, |
| 440 | OFPAT_GROUP = 0x16, |
| 441 | OFPAT_SET_NW_TTL = 0x17, |
| 442 | OFPAT_DEC_NW_TTL = 0x18, |
| 443 | OFPAT_SET_FIELD = 0x19, |
| 444 | OFPAT_PUSH_PBB = 0x1a, |
| 445 | OFPAT_POP_PBB = 0x1b, |
| 446 | OFPAT_COPY_FIELD = 0x1c, |
| 447 | OFPAT_METER = 0x1d, |
| 448 | OFPAT_EXPERIMENTER = 0xffff, |
| 449 | }; |
| 450 | |
| 451 | /* Action header that is common to all actions */ |
| 452 | struct of_action { |
| 453 | uint16_t type == ?; |
| 454 | uint16_t len; |
| 455 | }; |
| 456 | |
| 457 | /* Action structure for OFPAT_OUTPUT */ |
| 458 | struct of_action_output : of_action { |
| 459 | uint16_t type == 0; |
| 460 | uint16_t len; |
| 461 | of_port_no_t port; |
| 462 | uint16_t max_len; |
| 463 | pad(6); |
| 464 | }; |
| 465 | |
| 466 | /*The max_len indicates the maximum amount of data from a packet that should be sent when the port is OFPP_CONTROLLER*/ |
| 467 | enum ofp_controller_max_len(wire_type=uint16_t, complete=False) { |
| 468 | OFPCML_MAX = 0xffe5, |
| 469 | OFPCML_NO_BUFFER = 0xffff, |
| 470 | }; |
| 471 | |
| 472 | /* Action structure for OFPAT_GROUP. */ |
| 473 | struct of_action_group : of_action { |
| 474 | uint16_t type == 22; |
| 475 | uint16_t len; |
| 476 | uint32_t group_id; |
| 477 | }; |
| 478 | |
| 479 | /* Action structure for OFPAT_SET_QUEUE. */ |
| 480 | struct of_action_set_queue : of_action { |
| 481 | uint16_t type == 21; |
| 482 | uint16_t len; |
| 483 | uint32_t queue_id; |
| 484 | }; |
| 485 | |
| 486 | /* Action structure for OFPAT_METER */ |
| 487 | struct of_action_meter : of_action { |
| 488 | uint16_t type == 29; |
| 489 | uint16_t len; |
| 490 | uint32_t meter_id; |
| 491 | }; |
| 492 | |
| 493 | /* Action structure for OFPAT_SET_MPLS_TTL. */ |
| 494 | struct of_action_set_mpls_ttl : of_action { |
| 495 | uint16_t type == 15; |
| 496 | uint16_t len; |
| 497 | uint8_t mpls_ttl; |
| 498 | pad(3); |
| 499 | }; |
| 500 | |
| 501 | /* Action structure for OFPAT_COPY_TTL_OUT */ |
| 502 | struct of_action_copy_ttl_out : of_action { |
| 503 | uint16_t type == 11; |
| 504 | uint16_t len; |
| 505 | pad(4); |
| 506 | }; |
| 507 | |
| 508 | /* Action structure for OFPAT_COPY_TTL_IN */ |
| 509 | struct of_action_copy_ttl_in : of_action { |
| 510 | uint16_t type == 12; |
| 511 | uint16_t len; |
| 512 | pad(4); |
| 513 | }; |
| 514 | |
| 515 | /* Action structure for OFPAT_DEC_MPLS_TTL */ |
| 516 | struct of_action_dec_mpls_ttl : of_action { |
| 517 | uint16_t type == 16; |
| 518 | uint16_t len; |
| 519 | pad(4); |
| 520 | }; |
| 521 | |
| 522 | /* Action structure for OFPAT_DEC_NW_TTL */ |
| 523 | struct of_action_dec_nw_ttl : of_action { |
| 524 | uint16_t type == 24; |
| 525 | uint16_t len; |
| 526 | pad(4); |
| 527 | }; |
| 528 | |
| 529 | /* Action structure for OFPAT_POP_VLAN */ |
| 530 | struct of_action_pop_vlan : of_action { |
| 531 | uint16_t type == 18; |
| 532 | uint16_t len; |
| 533 | pad(4); |
| 534 | }; |
| 535 | |
| 536 | /* Action structure for OFPAT_POP_PBB */ |
| 537 | struct of_action_pop_pbb : of_action { |
| 538 | uint16_t type == 27; |
| 539 | uint16_t len; |
| 540 | pad(4); |
| 541 | }; |
| 542 | |
| 543 | /* Action structure for OFPAT_SET_NW_TTL. */ |
| 544 | struct of_action_set_nw_ttl : of_action { |
| 545 | uint16_t type == 23; |
| 546 | uint16_t len; |
| 547 | uint8_t nw_ttl; |
| 548 | pad(3); |
| 549 | }; |
| 550 | |
| 551 | /* Action structure for OFPAT_PUSH_VLAN */ |
| 552 | struct of_action_push_vlan : of_action { |
| 553 | uint16_t type == 17; |
| 554 | uint16_t len; |
| 555 | uint16_t ethertype; |
| 556 | pad(2); |
| 557 | }; |
| 558 | |
| 559 | /* Action structure for OFPAT_PUSH_MPLS */ |
| 560 | struct of_action_push_mpls : of_action { |
| 561 | uint16_t type == 19; |
| 562 | uint16_t len; |
| 563 | uint16_t ethertype; |
| 564 | pad(2); |
| 565 | }; |
| 566 | |
| 567 | /* Action structure for OFPAT_PUSH_PBB */ |
| 568 | struct of_action_push_pbb : of_action { |
| 569 | uint16_t type == 26; |
| 570 | uint16_t len; |
| 571 | uint16_t ethertype; |
| 572 | pad(2); |
| 573 | }; |
| 574 | |
| 575 | /* Action structure for OFPAT_POP_MPLS */ |
| 576 | struct of_action_pop_mpls : of_action { |
| 577 | uint16_t type == 20; |
| 578 | uint16_t len; |
| 579 | uint16_t ethertype; |
| 580 | pad(2); |
| 581 | }; |
| 582 | |
| 583 | /* Action structure for OFPAT_SET_FIELD */ |
| 584 | struct of_action_set_field(align=8, length_includes_align=True) : of_action { |
| 585 | uint16_t type == 25; |
| 586 | uint16_t len; |
| 587 | of_oxm_t field; |
| 588 | }; |
| 589 | |
| 590 | /* Action structure for OFPAT_COPY_FIELD */ |
| 591 | /* not in 1.4 */ |
| 592 | struct ofp_action_copy_field { |
| 593 | uint16_t type == 28; |
| 594 | uint16_t len; |
| 595 | uint16_t n_bits; |
| 596 | uint16_t src_offset; |
| 597 | uint16_t dst_offset; |
| 598 | pad(2); |
| 599 | list(of_oxm_t) oxm_ids; |
| 600 | }; |
| 601 | |
| 602 | /* Action header for OFPAT_EXPERIMENTER */ |
| 603 | struct of_action_experimenter(align=8, length_includes_align=True): of_action { |
| 604 | uint16_t type == 65535; |
| 605 | uint16_t len; |
| 606 | uint32_t experimenter == ?; |
| 607 | }; |
| 608 | |
| 609 | /* ---------------------------------------------------------- CONTROLLER STATUS STRUCTURE ------------------------- */ |
| 610 | /* not in 1.4 */ |
| 611 | |
| 612 | /* Why is the controller status being reported? */ |
| 613 | enum ofp_controller_status_reason(wire_type=uint8_t) { |
| 614 | OFPCSR_REQUEST = 0, |
| 615 | OFPCSR_CHANNEL_STATUS = 1, |
| 616 | OFPCSR_ROLE = 2, |
| 617 | OFPCSR_CONTROLLER_ADDED = 3, |
| 618 | OFPCSR_CONTROLLER_REMOVED = 4, |
| 619 | OFPCSR_SHORT_ID = 5, |
| 620 | OFPCSR_EXPERIMENTER = 6, |
| 621 | }; |
| 622 | |
| 623 | /* Control channel status. */ |
| 624 | enum ofp_control_channel_status(wire_type=uint8_t) { |
| 625 | OFPCT_STATUS_UP = 0, |
| 626 | OFPCT_STATUS_DOWN = 1, |
| 627 | }; |
| 628 | |
| 629 | /* Controller status property types */ |
| 630 | enum ofp_controller_status_prop_type { |
| 631 | OFPCSPT_URI = 0, |
| 632 | OFPCSPT_EXPERIMENTER = 0xFFFF, |
| 633 | }; |
| 634 | |
| 635 | /* Common header for all Controller Status Properties */ |
| 636 | struct of_controller_status_prop { |
| 637 | uint16_t type == ?; |
| 638 | uint16_t length; |
| 639 | }; |
| 640 | |
| 641 | struct of_controller_status_entry { |
| 642 | uint16_t length; |
| 643 | uint16_t short_id; |
| 644 | enum ofp_controller_role role; |
| 645 | enum ofp_controller_status_reason reason; |
| 646 | enum ofp_control_channel_status channel_status; |
| 647 | pad(6); |
| 648 | list(of_controller_status_prop_t) properties; |
| 649 | }; |
| 650 | |
| 651 | /* Body of OFPMP_CONTROLLER_STATUS reply message and body of async OFPT_CONTROLLER_STATUS message */ |
| 652 | struct of_controller_status : of_header { |
| 653 | uint8_t version; |
| 654 | uint8_t type == 35; |
| 655 | uint16_t length; |
| 656 | uint32_t xid; |
| 657 | of_controller_status_entry_t entry; |
| 658 | }; |
| 659 | |
| 660 | /* Connection URI controller status property */ |
| 661 | struct ofp_controller_status_prop_uri : of_controller_status_prop { |
| 662 | uint16_t type == 0; |
| 663 | uint16_t length; |
| 664 | of_controller_uri_t uri; |
| 665 | }; |
| 666 | |
| 667 | /* Experimenter controller status property */ |
| 668 | struct ofp_controller_status_prop_experimenter : of_controller_status_prop { |
| 669 | uint16_t type == 0xffff; |
| 670 | uint16_t length; |
| 671 | uint32_t experimenter == ?; |
| 672 | uint32_t exp_type; |
| 673 | }; |
| 674 | |
| 675 | /* -------------------------------------------------- MESSAGES --------------------------------------------- */ |
| 676 | |
| 677 | /* Capabilities supported by the datapath. */ |
| 678 | enum ofp_capabilities(wire_type=uint32_t, bitmask=True) { |
| 679 | OFPC_FLOW_STATS = 0x1, |
| 680 | OFPC_TABLE_STATS = 0x2, |
| 681 | OFPC_PORT_STATS = 0x4, |
| 682 | OFPC_GROUP_STATS = 0x8, |
| 683 | OFPC_IP_REASM = 0x20, |
| 684 | OFPC_QUEUE_STATS = 0x40, |
| 685 | OFPC_PORT_BLOCKED = 0x100, |
| 686 | OFPC_BUNDLES = 0x200, |
| 687 | OFPC_FLOW_MONITORING = 0x400, |
| 688 | }; |
| 689 | |
| 690 | /* Handling of IP fragments. */ |
| 691 | enum ofp_config_flags(wire_type=uint16_t, bitmask=True) { |
| 692 | OFPC_FRAG_NORMAL = 0, |
| 693 | OFPC_FRAG_DROP = 1, |
| 694 | OFPC_FRAG_REASM = 2, |
| 695 | OFPC_FRAG_MASK = 3, |
| 696 | }; |
| 697 | |
| 698 | /* Table numbering. Tables can use any number up to OFPT_MAX. */ |
| 699 | enum ofp_table(wire_type=uint8_t, complete=False) { |
| 700 | OFPTT_MAX = 0xfe, |
| 701 | OFPTT_ALL = 0xff, |
| 702 | }; |
| 703 | |
| 704 | |
| 705 | /* Flags to configure the table. */ |
| 706 | enum ofp_table_config(wire_type=uint32_t, bitmask=True) { |
| 707 | OFPTC_DEPRECATED_MASK = 0x3, |
| 708 | OFPTC_EVICTION = 0x4, |
| 709 | OFPTC_VACANCY_EVENTS = 0x8, |
| 710 | }; |
| 711 | |
| 712 | /* Eviction flags. */ |
| 713 | enum ofp_table_mod_prop_eviction_flag(wire_type=uint32_t, bitmask=True) { |
| 714 | OFPTMPEF_OTHER = 0x1, |
| 715 | OFPTMPEF_IMPORTANCE = 0x2, |
| 716 | OFPTMPEF_LIFETIME = 0x4, |
| 717 | }; |
| 718 | |
| 719 | /* flow mod command */ |
| 720 | enum ofp_flow_mod_command(wire_type=uint8_t) { |
| 721 | OFPFC_ADD = 0, |
| 722 | OFPFC_MODIFY = 1, |
| 723 | OFPFC_MODIFY_STRICT = 2, |
| 724 | OFPFC_DELETE = 3, |
| 725 | OFPFC_DELETE_STRICT = 4, |
| 726 | }; |
| 727 | |
| 728 | /* flow mod flags */ |
| 729 | enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) { |
| 730 | OFPFF_SEND_FLOW_REM = 0x1, |
| 731 | OFPFF_CHECK_OVERLAP = 0x2, |
| 732 | OFPFF_RESET_COUNTS = 0x4, |
| 733 | OFPFF_NO_PKT_COUNTS = 0x8, |
| 734 | OFPFF_NO_BYT_COUNTS = 0x10, |
| 735 | |
| 736 | /* Non-standard, enabled by an experimenter message */ |
| 737 | /* See the bsn_flow_idle input file */ |
| 738 | OFPFF_BSN_SEND_IDLE = 0x80, |
| 739 | }; |
| 740 | |
| 741 | /* Group commands */ |
| 742 | enum ofp_group_mod_command(wire_type=uint16_t) { |
| 743 | OFPGC_ADD = 0, |
| 744 | OFPGC_MODIFY = 1, |
| 745 | OFPGC_DELETE = 2, |
| 746 | OFPGC_INSERT_BUCKET = 3, |
| 747 | OFPGC_REMOVE_BUCKET = 5, |
| 748 | }; |
| 749 | |
| 750 | /* Group types */ |
| 751 | enum ofp_group_type(wire_type=uint8_t) { |
| 752 | OFPGT_ALL = 0, |
| 753 | OFPGT_SELECT = 1, |
| 754 | OFPGT_INDIRECT = 2, |
| 755 | OFPGT_FF = 3, |
| 756 | }; |
| 757 | |
| 758 | /* Group numbering. Groups can use any number up to OFPG_MAX. */ |
| 759 | enum ofp_group(wire_type=uint32_t, complete=False) { |
| 760 | OFPG_MAX = 0xffffff00, |
| 761 | OFPG_ALL = 0xfffffffc, |
| 762 | OFPG_ANY = 0xffffffff, |
| 763 | }; |
| 764 | |
| 765 | /* Bucket Id can be any value between 0 and OFPG_BUCKET_MAX */ |
| 766 | enum ofp_group_bucket(wire_type=uint32_t) { |
| 767 | OFPG_BUCKET_MAX = 0xffffff00, |
| 768 | OFPG_BUCKET_FIRST = 0xfffffffd, |
| 769 | OFPG_BUCKET_LAST = 0xfffffffe, |
| 770 | OFPG_BUCKET_ALL = 0xffffffff, |
| 771 | }; |
| 772 | |
| 773 | /* Group bucket property types. */ |
| 774 | enum ofp_group_bucket_prop_type { |
| 775 | OFPGBPT_WEIGHT = 0, |
| 776 | OFPGBPT_WATCH_PORT = 1, |
| 777 | OFPGBPT_WATCH_GROUP = 2, |
| 778 | OFPGBPT_EXPERIMENTER = 0xFFFF, |
| 779 | }; |
| 780 | |
| 781 | /* Group property types. */ |
| 782 | enum ofp_group_prop_type { |
| 783 | OFPGPT_EXPERIMENTER = 0xFFFF, |
| 784 | }; |
| 785 | |
| 786 | /* Port mod property types */ |
| 787 | enum ofp_port_mod_prop_type { |
| 788 | OFPPMPT_ETHERNET = 0, |
| 789 | OFPPMPT_OPTICAL = 1, |
| 790 | OFPPMPT_EXPERIMENTER = 0xFFFF, |
| 791 | }; |
| 792 | |
| 793 | /* Meter numbering. Flow meters can use any number up to OFPM_MAX. */ |
| 794 | enum ofp_meter(wire_type=uint32_t, complete=False) { |
| 795 | OFPM_MAX = 0xffff0000, |
| 796 | OFPM_SLOWPATH = 0xfffffffd, |
| 797 | OFPM_CONTROLLER = 0xfffffffe, |
| 798 | OFPM_ALL = 0xffffffff, |
| 799 | }; |
| 800 | |
| 801 | /* Meter commands */ |
| 802 | enum ofp_meter_mod_command(wire_type=uint16_t) { |
| 803 | OFPMC_ADD = 0, |
| 804 | OFPMC_MODIFY = 1, |
| 805 | OFPMC_DELETE = 2, |
| 806 | }; |
| 807 | |
| 808 | /* Meter configuration flags */ |
| 809 | enum ofp_meter_flags(wire_type=uint16_t, bitmask=True) { |
| 810 | OFPMF_KBPS = 0x1, |
| 811 | OFPMF_PKTPS = 0x2, |
| 812 | OFPMF_BURST = 0x4, |
| 813 | OFPMF_STATS = 0x8, |
| 814 | }; |
| 815 | |
| 816 | /* Meter band types */ |
| 817 | enum ofp_meter_band_type(wire_type=uint16_t) { |
| 818 | OFPMBT_DROP = 0x1, |
| 819 | OFPMBT_DSCP_REMARK = 0x2, |
| 820 | OFPMBT_EXPERIMENTER = 0xffff, |
| 821 | }; |
| 822 | |
| 823 | /* Multipart request flags */ |
| 824 | enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) { |
| 825 | OFPSF_REQ_MORE = 0x1, |
| 826 | }; |
| 827 | |
| 828 | /* Multipart reply flags */ |
| 829 | enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) { |
| 830 | OFPSF_REPLY_MORE = 0x1, |
| 831 | }; |
| 832 | |
| 833 | /* |
| 834 | * Multipart Message Types |
| 835 | * |
| 836 | * OF1.5 renames the OFPMP/ST for: |
| 837 | * flow (1) -> flow_desc (1) |
| 838 | * aggregate (2) -> aggregate_stats (2) |
| 839 | * table (3) -> table_stats (3) |
| 840 | * group (6) -> group_stats (6) |
| 841 | * meter (9) -> meter_stats (9) |
| 842 | * meter_config (10) -> meter_desc (10) |
| 843 | * |
| 844 | * OF1.4 renamed: |
| 845 | * queue (5) -> queue_stats (5) |
| 846 | * which was retained as "queue" in standard-1.4. |
| 847 | * |
| 848 | * Using different names for the same message |
| 849 | * in Loxi causes duplicate enum entries that |
| 850 | * map to essentially the same underlying message. |
| 851 | * For simpliciy, we can retain the original, |
| 852 | * OF1.3-, naming convention to reduce complexity. |
| 853 | * This is why OF1.4+ ofp_stats_type enums from |
| 854 | * OF1.3- remain as OFPST_* and do not appear as |
| 855 | * OFPMP_*. |
| 856 | * |
| 857 | * Using the _STATS is certainly more explicit; |
| 858 | * however, that would perhaps necessitate changing |
| 859 | * OF1.3- OFPMP/ST names, which would break existing |
| 860 | * applications that use OF1.3- OFPMP/ST names. |
| 861 | */ |
| 862 | enum ofp_stats_type(wire_type=uint16_t) { |
| 863 | OFPST_DESC = 0, |
| 864 | OFPST_FLOW = 1, /* omit _desc */ |
| 865 | OFPST_AGGREGATE = 2, /* omit _stats */ |
| 866 | OFPST_TABLE = 3, /* omit _stats */ |
| 867 | OFPST_PORT = 4, /* omit _stats; historically omitted */ |
| 868 | OFPST_QUEUE = 5, /* omit _stats */ |
| 869 | OFPST_GROUP = 6, /* omit _stats */ |
| 870 | OFPST_GROUP_DESC = 7, |
| 871 | OFPST_GROUP_FEATURES = 8, |
| 872 | OFPST_METER = 9, /* omit_stats */ |
| 873 | OFPST_METER_CONFIG = 10, /* retain OFPST_ prefix; retain _config */ |
| 874 | OFPST_METER_FEATURES = 11, |
| 875 | OFPST_TABLE_FEATURES = 12, |
| 876 | OFPST_PORT_DESC = 13, |
| 877 | OFPMP_TABLE_DESC = 14, |
| 878 | OFPMP_QUEUE_DESC = 15, |
| 879 | OFPMP_FLOW_MONITOR = 16, |
| 880 | OFPMP_FLOW_LIGHTWEIGHT = 17, /* omit _stats; use _lightweight to imply no desc included */ |
| 881 | OFPMP_CONTROLLER_STATUS = 18, |
| 882 | OFPMP_BUNDLE_FEATURES = 19, |
| 883 | OFPST_EXPERIMENTER = 0xffff, |
| 884 | }; |
| 885 | |
| 886 | /* Reason for generating flow stats. */ |
| 887 | enum ofp_flow_stats_reason(wire_type=uint8_t) { |
| 888 | OFPFSR_STATS_REQUEST = 0, |
| 889 | OFPFSR_STAT_TRIGGER = 1, |
| 890 | }; |
| 891 | |
| 892 | /* Port stats property types. */ |
| 893 | enum ofp_port_stats_prop_type(wire_type=uint16_t) { |
| 894 | OFPPSPT_ETHERNET = 0, /* Ethernet property. */ |
| 895 | OFPPSPT_OPTICAL = 1, /* Optical property. */ |
| 896 | OFPPSPT_EXPERIMENTER = 0xFFFF, /* Experimenter property. */ |
| 897 | }; |
| 898 | |
| 899 | /* Flags is one of OFPOSF_ below */ |
| 900 | enum ofp_port_stats_optical_flags(wire_type=uint32_t, bitmask=True) { |
| 901 | OFPOSF_RX_TUNE = 0x1, |
| 902 | OFPOSF_TX_TUNE = 0x2, |
| 903 | OFPOSF_TX_PWR = 0x4, |
| 904 | OFPOSF_RX_PWR = 0x10, |
| 905 | OFPOSF_TX_BIAS = 0x20, |
| 906 | OFPOSF_TX_TEMP = 0x40, |
| 907 | }; |
| 908 | |
| 909 | /* queue statistics property types */ |
| 910 | enum ofp_queue_stats_prop_type { |
| 911 | OFPQSPT_EXPERIMENTER = 0xffff |
| 912 | }; |
| 913 | |
| 914 | /* queue description property types */ |
| 915 | enum ofp_queue_desc_prop_type { |
| 916 | OFPQDPT_MIN_RATE = 1, |
| 917 | OFPQDPT_MAX_RATE = 2, |
| 918 | OFPQDPT_EXPERIMENTER = 0xffff, |
| 919 | }; |
| 920 | |
| 921 | /* Group configuration flags */ |
| 922 | enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) { |
| 923 | OFPGFC_SELECT_WEIGHT = 0x1, |
| 924 | OFPGFC_SELECT_LIVENESS = 0x2, |
| 925 | OFPGFC_CHAINING = 0x4, |
| 926 | OFPGFC_CHAINING_CHECKS = 0x8, |
| 927 | }; |
| 928 | |
| 929 | /* Meter feature flags */ |
| 930 | enum ofp_meter_feature_flags(wire_type=uint32_t, bitmask=True) { |
| 931 | OFPMFF_ACTION_SET = 0x1, |
| 932 | OFPMFF_ANY_POSITION = 0x2, |
| 933 | OFPMFF_MULTI_LIST = 0x4, |
| 934 | }; |
| 935 | |
| 936 | /* Table Features request commands */ |
| 937 | enum ofp_table_features_command(wire_type=uint8_t) { |
| 938 | OFPTFC_REPLACE = 0, |
| 939 | OFPTFC_MODIFY = 1, |
| 940 | OFPTFC_ENABLE = 2, |
| 941 | OFPTFC_DISABLE = 3, |
| 942 | }; |
| 943 | |
| 944 | /* Flags of features supported by the table. */ |
| 945 | enum ofp_table_feature_flag (wire_type=uint32_t, bitmask=True) { |
| 946 | OFPTFF_INGRESS_TABLE = 0x1, |
| 947 | OFPTFF_EGRESS_TABLE = 0x2, |
| 948 | OFPTFF_FIRST_EGRESS = 0x10, |
| 949 | }; |
| 950 | |
| 951 | /* Table Feature property types. */ |
| 952 | enum ofp_table_feature_prop_type(wire_type=uint16_t) { |
| 953 | OFPTFPT_INSTRUCTIONS = 0, |
| 954 | OFPTFPT_INSTRUCTIONS_MISS = 1, |
| 955 | OFPTFPT_NEXT_TABLES = 2, |
| 956 | OFPTFPT_NEXT_TABLES_MISS = 3, |
| 957 | OFPTFPT_WRITE_ACTIONS = 4, |
| 958 | OFPTFPT_WRITE_ACTIONS_MISS = 5, |
| 959 | OFPTFPT_APPLY_ACTIONS = 6, |
| 960 | OFPTFPT_APPLY_ACTIONS_MISS = 7, |
| 961 | OFPTFPT_MATCH = 8, |
| 962 | OFPTFPT_WILDCARDS = 0xa, |
| 963 | OFPTFPT_WRITE_SETFIELD = 0xc, |
| 964 | OFPTFPT_WRITE_SETFIELD_MISS = 0xd, |
| 965 | OFPTFPT_APPLY_SETFIELD = 0xe, |
| 966 | OFPTFPT_APPLY_SETFIELD_MISS = 0xf, |
| 967 | OFPTFPT_TABLE_SYNC_FROM = 0x10, |
| 968 | OFPTFPT_WRITE_COPYFIELD = 18, |
| 969 | OFPTFPT_WRITE_COPYFIELD_MISS = 19, |
| 970 | OFPTFPT_APPLY_COPYFIELD = 20, |
| 971 | OFPTFPT_APPLY_COPYFIELD_MISS = 21, |
| 972 | OFPTFPT_PACKET_TYPES = 22, |
| 973 | OFPTFPT_EXPERIMENTER = 0xfffe, |
| 974 | OFPTFPT_EXPERIMENTER_MISS = 0xffff, |
| 975 | }; |
| 976 | |
| 977 | /* Table Mod property types.*/ |
| 978 | enum ofp_table_mod_prop_type { |
| 979 | OFPTMPT_EVICTION = 0x2, |
| 980 | OFPTMPT_VACANCY = 0x3, |
| 981 | OFPTMPT_EXPERIMENTER = 0xFFFF, |
| 982 | }; |
| 983 | |
| 984 | |
| 985 | /* controller roles */ |
| 986 | enum ofp_controller_role(wire_type=uint32_t) { |
| 987 | OFPCR_ROLE_NOCHANGE = 0, |
| 988 | OFPCR_ROLE_EQUAL = 1, |
| 989 | OFPCR_ROLE_MASTER = 2, |
| 990 | OFPCR_ROLE_SLAVE = 3, |
| 991 | }; |
| 992 | |
| 993 | /* Bundle control message types */ |
| 994 | enum ofp_bundle_ctrl_type(wire_type=uint16_t) { |
| 995 | OFPBCT_OPEN_REQUEST = 0, |
| 996 | OFPBCT_OPEN_REPLY = 1, |
| 997 | OFPBCT_CLOSE_REQUEST = 2, |
| 998 | OFPBCT_CLOSE_REPLY = 3, |
| 999 | OFPBCT_COMMIT_REQUEST = 4, |
| 1000 | OFPBCT_COMMIT_REPLY = 5, |
| 1001 | OFPBCT_DISCARD_REQUEST = 6, |
| 1002 | OFPBCT_DISCARD_REPLY = 7, |
| 1003 | }; |
| 1004 | |
| 1005 | /* Bundle configuration flags. */ |
| 1006 | enum ofp_bundle_flags(wire_type=uint16_t, bitmask=True) { |
| 1007 | OFPBF_ATOMIC = 1, |
| 1008 | OFPBF_ORDERED = 2, |
| 1009 | OFPBF_TIME = 4, |
| 1010 | }; |
| 1011 | |
| 1012 | /* Bundle features property types. */ |
| 1013 | enum ofp_bundle_features_prop_type { |
| 1014 | OFPTMPBF_TIME_CAPABILITY = 0x1, |
| 1015 | OFPTMPBF_EXPERIMENTER = 0xFFFF, |
| 1016 | }; |
| 1017 | |
| 1018 | |
| 1019 | /* Bundle property types. */ |
| 1020 | enum ofp_bundle_prop_type { |
| 1021 | OFPBPT_TIME = 1, |
| 1022 | OFPBPT_EXPERIMENTER = 0xFFFF, |
| 1023 | }; |
| 1024 | |
| 1025 | |
| 1026 | /* Async Config property types.*/ |
| 1027 | enum ofp_async_config_prop_type { |
| 1028 | OFPACPT_PACKET_IN_SLAVE = 0, |
| 1029 | OFPACPT_PACKET_IN_MASTER = 1, |
| 1030 | OFPACPT_PORT_STATUS_SLAVE = 2, |
| 1031 | OFPACPT_PORT_STATUS_MASTER = 3, |
| 1032 | OFPACPT_FLOW_REMOVED_SLAVE = 4, |
| 1033 | OFPACPT_FLOW_REMOVED_MASTER = 5, |
| 1034 | OFPACPT_ROLE_STATUS_SLAVE = 6, |
| 1035 | OFPACPT_ROLE_STATUS_MASTER = 7, |
| 1036 | OFPACPT_TABLE_STATUS_SLAVE = 8, |
| 1037 | OFPACPT_TABLE_STATUS_MASTER = 9, |
| 1038 | OFPACPT_REQUESTFORWARD_SLAVE = 10, |
| 1039 | OFPACPT_REQUESTFORWARD_MASTER = 11, |
| 1040 | OFPACPT_FLOW_STATS_SLAVE = 12, |
| 1041 | OFPACPT_FLOW_STATS_MASTER = 13, |
| 1042 | OFPACPT_CONT_STATUS_SLAVE = 14, |
| 1043 | OFPACPT_CONT_STATUS_MASTER = 15, |
| 1044 | OFPACPT_EXPERIMENTER_SLAVE = 0xFFFE, |
| 1045 | OFPACPT_EXPERIMENTER_MASTER = 0xFFFF, |
| 1046 | }; |
| 1047 | |
| 1048 | /* Why is this packet being sent to the controller? */ |
| 1049 | enum ofp_packet_in_reason(wire_type=uint8_t) { |
| 1050 | OFPR_NO_MATCH = 0, |
| 1051 | OFPR_ACTION = 1, |
| 1052 | OFPR_INVALID_TTL = 2, |
| 1053 | OFPR_ACTION_SET = 3, |
| 1054 | OFPR_GROUP = 4, |
| 1055 | OFPR_PACKET_OUT = 5, |
| 1056 | |
| 1057 | // non-standard BSN extensions. OF does not have a standard-conformant |
| 1058 | // way to extend the set of packet_in reasons |
| 1059 | OFPR_BSN_NEW_HOST = 128, |
| 1060 | OFPR_BSN_STATION_MOVE = 129, |
| 1061 | OFPR_BSN_BAD_VLAN = 130, |
| 1062 | OFPR_BSN_DESTINATION_LOOKUP_FAILURE = 131, |
| 1063 | OFPR_BSN_NO_ROUTE = 132, |
| 1064 | OFPR_BSN_ICMP_ECHO_REQUEST = 133, |
| 1065 | OFPR_BSN_DEST_NETWORK_UNREACHABLE = 134, |
| 1066 | OFPR_BSN_DEST_HOST_UNREACHABLE = 135, |
| 1067 | OFPR_BSN_DEST_PORT_UNREACHABLE = 136, |
| 1068 | OFPR_BSN_FRAGMENTATION_REQUIRED = 137, |
| 1069 | OFPR_BSN_ARP = 139, |
| 1070 | OFPR_BSN_DHCP = 140, |
| 1071 | OFPR_BSN_DEBUG = 141, |
| 1072 | OFPR_BSN_PACKET_OF_DEATH = 142, |
| 1073 | }; |
| 1074 | |
| 1075 | /* Why was this flow removed? */ |
| 1076 | enum ofp_flow_removed_reason(wire_type=uint8_t) { |
| 1077 | OFPRR_IDLE_TIMEOUT = 0, |
| 1078 | OFPRR_HARD_TIMEOUT = 1, |
| 1079 | OFPRR_DELETE = 2, |
| 1080 | OFPRR_GROUP_DELETE = 3, |
| 1081 | OFPRR_METER_DELETE = 4, |
| 1082 | OFPRR_EVICTION = 5, |
| 1083 | }; |
| 1084 | |
| 1085 | /* What changed about the physical port */ |
| 1086 | enum ofp_port_reason(wire_type=uint8_t) { |
| 1087 | OFPPR_ADD = 0, |
| 1088 | OFPPR_DELETE = 1, |
| 1089 | OFPPR_MODIFY = 2, |
| 1090 | }; |
| 1091 | |
| 1092 | /* What changed about the controller role */ |
| 1093 | enum ofp_controller_role_reason(wire_type=uint8_t) { |
| 1094 | OFPCRR_MASTER_REQUEST = 0, |
| 1095 | OFPCRR_CONFIG = 1, |
| 1096 | OFPCRR_EXPERIMENTER = 2, |
| 1097 | }; |
| 1098 | |
| 1099 | /* Role property types.*/ |
| 1100 | enum ofp_role_prop_type { |
| 1101 | OFPRPT_EXPERIMENTER = 0xFFFF, |
| 1102 | }; |
| 1103 | |
| 1104 | /* What changed about the table */ |
| 1105 | enum ofp_table_reason(wire_type=uint8_t) { |
| 1106 | OFPTR_VACANCY_DOWN = 3, |
| 1107 | OFPTR_VACANCY_UP = 4, |
| 1108 | }; |
| 1109 | |
| 1110 | /* Request forward reason */ |
| 1111 | enum ofp_requestforward_reason { |
| 1112 | OFPRFR_GROUP_MOD = 0, |
| 1113 | OFPRFR_METER_MOD = 1, |
| 1114 | }; |
| 1115 | |
| 1116 | /* Hello elements types. */ |
| 1117 | enum ofp_hello_elem_type(wire_type=uint16_t) { |
| 1118 | OFPHET_VERSIONBITMAP = 1, |
| 1119 | }; |
| 1120 | |
| 1121 | /* Values for type in ofp_error_message */ |
| 1122 | enum ofp_error_type(wire_type=uint16_t) { |
| 1123 | OFPET_HELLO_FAILED = 0, |
| 1124 | OFPET_BAD_REQUEST = 1, |
| 1125 | OFPET_BAD_ACTION = 2, |
| 1126 | OFPET_BAD_INSTRUCTION = 3, |
| 1127 | OFPET_BAD_MATCH = 4, |
| 1128 | OFPET_FLOW_MOD_FAILED = 5, |
| 1129 | OFPET_GROUP_MOD_FAILED = 6, |
| 1130 | OFPET_PORT_MOD_FAILED = 7, |
| 1131 | OFPET_TABLE_MOD_FAILED = 8, |
| 1132 | OFPET_QUEUE_OP_FAILED = 9, |
| 1133 | OFPET_SWITCH_CONFIG_FAILED = 10, |
| 1134 | OFPET_ROLE_REQUEST_FAILED = 11, |
| 1135 | OFPET_METER_MOD_FAILED = 12, |
| 1136 | OFPET_TABLE_FEATURES_FAILED = 13, |
| 1137 | OFPET_BAD_PROPERTY = 14, |
| 1138 | OFPET_ASYNC_CONFIG_FAILED = 15, |
| 1139 | OFPET_FLOW_MONITOR_FAILED = 16, |
| 1140 | OFPET_BUNDLE_FAILED = 17, |
| 1141 | OFPET_EXPERIMENTER = 0xffff, |
| 1142 | }; |
| 1143 | |
| 1144 | /* ofp_error_msg code values for OFPET_HELLO_FAILED */ |
| 1145 | enum ofp_hello_failed_code(wire_type=uint16_t) { |
| 1146 | OFPHFC_INCOMPATIBLE = 0, |
| 1147 | OFPHFC_EPERM = 1, |
| 1148 | }; |
| 1149 | |
| 1150 | /* ofp_error_msg code values for OFPET_BAD_REQUEST. */ |
| 1151 | enum ofp_bad_request_code(wire_type=uint16_t) { |
| 1152 | OFPBRC_BAD_VERSION = 0, |
| 1153 | OFPBRC_BAD_TYPE = 1, |
| 1154 | OFPBRC_BAD_STAT = 2, |
| 1155 | OFPBRC_BAD_EXPERIMENTER = 3, |
| 1156 | OFPBRC_BAD_EXPERIMENTER_TYPE = 4, |
| 1157 | OFPBRC_EPERM = 5, |
| 1158 | OFPBRC_BAD_LEN = 6, |
| 1159 | OFPBRC_BUFFER_EMPTY = 7, |
| 1160 | OFPBRC_BUFFER_UNKNOWN = 8, |
| 1161 | OFPBRC_BAD_TABLE_ID = 9, |
| 1162 | OFPBRC_IS_SLAVE = 10, |
| 1163 | OFPBRC_BAD_PORT = 11, |
| 1164 | OFPBRC_BAD_PACKET = 12, |
| 1165 | OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13, |
| 1166 | OFPBRC_MULTIPART_REQUEST_TIMEOUT = 14, |
| 1167 | OFPBRC_MULTIPART_REPLY_TIMEOUT = 15, |
| 1168 | OFPBRC_MULTIPART_BAD_SCHED = 16, |
| 1169 | OFPBRC_PIPELINE_FIELDS_ONLY = 17, |
| 1170 | OFPBRC_UNKNOWN = 18, |
| 1171 | }; |
| 1172 | |
| 1173 | /* ofp_error_msg code values for OFPET_BAD_ACTION. */ |
| 1174 | enum ofp_bad_action_code(wire_type=uint16_t) { |
| 1175 | OFPBAC_BAD_TYPE = 0, |
| 1176 | OFPBAC_BAD_LEN = 1, |
| 1177 | OFPBAC_BAD_EXPERIMENTER = 2, |
| 1178 | OFPBAC_BAD_EXPERIMENTER_TYPE = 3, |
| 1179 | OFPBAC_BAD_OUT_PORT = 4, |
| 1180 | OFPBAC_BAD_ARGUMENT = 5, |
| 1181 | OFPBAC_EPERM = 6, |
| 1182 | OFPBAC_TOO_MANY = 7, |
| 1183 | OFPBAC_BAD_QUEUE = 8, |
| 1184 | OFPBAC_BAD_OUT_GROUP = 9, |
| 1185 | OFPBAC_MATCH_INCONSISTENT = 10, |
| 1186 | OFPBAC_UNSUPPORTED_ORDER = 11, |
| 1187 | OFPBAC_BAD_TAG = 12, |
| 1188 | OFPBAC_BAD_SET_TYPE = 13, |
| 1189 | OFPBAC_BAD_SET_LEN = 14, |
| 1190 | OFPBAC_BAD_SET_ARGUMENT = 15, |
| 1191 | OFPBAC_BAD_SET_MASK = 16, |
| 1192 | OFPBAC_BAD_METER = 17, |
| 1193 | }; |
| 1194 | |
| 1195 | /* ofp_error_msg code values for OFPET_BAD_INSTRUCTION. */ |
| 1196 | enum ofp_bad_instruction_code(wire_type=uint16_t) { |
| 1197 | OFPBIC_UNKNOWN_INST = 0, |
| 1198 | OFPBIC_UNSUP_INST = 1, |
| 1199 | OFPBIC_BAD_TABLE_ID = 2, |
| 1200 | OFPBIC_UNSUP_METADATA = 3, |
| 1201 | OFPBIC_UNSUP_METADATA_MASK = 4, |
| 1202 | OFPBIC_BAD_EXPERIMENTER = 5, |
| 1203 | OFPBIC_BAD_EXPERIMENTER_TYPE = 6, |
| 1204 | OFPBIC_BAD_LEN = 7, |
| 1205 | OFPBIC_EPERM = 8, |
| 1206 | OFPBIC_DUP_INST = 9, |
| 1207 | }; |
| 1208 | |
| 1209 | /* ofp_error_msg code values for OFPET_BAD_MATCH. */ |
| 1210 | enum ofp_bad_match_code(wire_type=uint16_t) { |
| 1211 | OFPBMC_BAD_TYPE = 0, |
| 1212 | OFPBMC_BAD_LEN = 1, |
| 1213 | OFPBMC_BAD_TAG = 2, |
| 1214 | OFPBMC_BAD_DL_ADDR_MASK = 3, |
| 1215 | OFPBMC_BAD_NW_ADDR_MASK = 4, |
| 1216 | OFPBMC_BAD_WILDCARDS = 5, |
| 1217 | OFPBMC_BAD_FIELD = 6, |
| 1218 | OFPBMC_BAD_VALUE = 7, |
| 1219 | OFPBMC_BAD_MASK = 8, |
| 1220 | OFPBMC_BAD_PREREQ = 9, |
| 1221 | OFPBMC_DUP_FIELD = 10, |
| 1222 | OFPBMC_EPERM = 11, |
| 1223 | }; |
| 1224 | |
| 1225 | /* ofp_error_msg code values for OFPET_FLOW_MOD_FAILED. */ |
| 1226 | enum ofp_flow_mod_failed_code(wire_type=uint16_t) { |
| 1227 | OFPFMFC_UNKNOWN = 0, |
| 1228 | OFPFMFC_TABLE_FULL = 1, |
| 1229 | OFPFMFC_BAD_TABLE_ID = 2, |
| 1230 | OFPFMFC_OVERLAP = 3, |
| 1231 | OFPFMFC_EPERM = 4, |
| 1232 | OFPFMFC_BAD_TIMEOUT = 5, |
| 1233 | OFPFMFC_BAD_COMMAND = 6, |
| 1234 | OFPFMFC_BAD_FLAGS = 7, |
| 1235 | OFPFMFC_CANT_SYNC = 8, |
| 1236 | OFPFMFC_BAD_PRIORITY = 9, |
| 1237 | OFPFMFC_IS_SYNC = 10, |
| 1238 | }; |
| 1239 | |
| 1240 | /* flags bits in struct of_flow_monitor_request. */ |
| 1241 | enum ofp_flow_monitor_flags (wire_type=uint16_t, bitmask=True){ |
| 1242 | OFPFMF_INITIAL = 0x1, |
| 1243 | OFPFMF_ADD = 0x2, |
| 1244 | OFPFMF_REMOVED = 0x4, |
| 1245 | OFPFMF_MODIFY = 0x8, |
| 1246 | OFPFMF_INSTRUCTIONS = 0x10, |
| 1247 | OFPFMF_NO_ABBREV = 0x20, |
| 1248 | OFPFMF_ONLY_OWN = 0x40, |
| 1249 | }; |
| 1250 | |
| 1251 | /* ofp_error_msg code values for OFPET_GROUP_MOD_FAILED. */ |
| 1252 | enum ofp_group_mod_failed_code(wire_type=uint16_t) { |
| 1253 | OFPGMFC_GROUP_EXISTS = 0, |
| 1254 | OFPGMFC_INVALID_GROUP = 1, |
| 1255 | OFPGMFC_WEIGHT_UNSUPPORTED = 2, |
| 1256 | OFPGMFC_OUT_OF_GROUPS = 3, |
| 1257 | OFPGMFC_OUT_OF_BUCKETS = 4, |
| 1258 | OFPGMFC_CHAINING_UNSUPPORTED = 5, |
| 1259 | OFPGMFC_WATCH_UNSUPPORTED = 6, |
| 1260 | OFPGMFC_LOOP = 7, |
| 1261 | OFPGMFC_UNKNOWN_GROUP = 8, |
| 1262 | OFPGMFC_CHAINED_GROUP = 9, |
| 1263 | OFPGMFC_BAD_TYPE = 10, |
| 1264 | OFPGMFC_BAD_COMMAND = 11, |
| 1265 | OFPGMFC_BAD_BUCKET = 12, |
| 1266 | OFPGMFC_BAD_WATCH = 13, |
| 1267 | OFPGMFC_EPERM = 14, |
| 1268 | OFPGMFC_UNKNOWN_BUCKET = 15, |
| 1269 | OFPGMFC_BUCKET_EXISTS = 16, |
| 1270 | }; |
| 1271 | |
| 1272 | /* ofp_error_msg code values for OFPET_PORT_MOD_FAILED. */ |
| 1273 | enum ofp_port_mod_failed_code(wire_type=uint16_t) { |
| 1274 | OFPPMFC_BAD_PORT = 0, |
| 1275 | OFPPMFC_BAD_HW_ADDR = 1, |
| 1276 | OFPPMFC_BAD_CONFIG = 2, |
| 1277 | OFPPMFC_BAD_ADVERTISE = 3, |
| 1278 | OFPPMFC_EPERM = 4, |
| 1279 | }; |
| 1280 | |
| 1281 | /* ofp_error_msg code values for OFPET_TABLE_MOD_FAILED. */ |
| 1282 | enum ofp_table_mod_failed_code(wire_type=uint16_t) { |
| 1283 | OFPTMFC_BAD_TABLE = 0, |
| 1284 | OFPTMFC_BAD_CONFIG = 1, |
| 1285 | OFPTMFC_EPERM = 2, |
| 1286 | }; |
| 1287 | |
| 1288 | /* ofp_error msg code values for OFPET_QUEUE_OP_FAILED */ |
| 1289 | enum ofp_queue_op_failed_code(wire_type=uint16_t) { |
| 1290 | OFPQOFC_BAD_PORT = 0, |
| 1291 | OFPQOFC_BAD_QUEUE = 1, |
| 1292 | OFPQOFC_EPERM = 2, |
| 1293 | }; |
| 1294 | |
| 1295 | /* ofp_error_msg code values for OFPET_SWITCH_CONFIG_FAILED */ |
| 1296 | enum ofp_switch_config_failed_code(wire_type=uint16_t) { |
| 1297 | OFPSCFC_BAD_FLAGS = 0, |
| 1298 | OFPSCFC_BAD_LEN = 1, |
| 1299 | OFPSCFC_EPERM = 2, |
| 1300 | OFPRRFC_ID_UNSUP = 3, |
| 1301 | OFPRRFC_ID_IN_USE = 4, |
| 1302 | }; |
| 1303 | |
| 1304 | /* ofp_error_msg code values for OFPET_ROLE_REQUEST_FAILED. */ |
| 1305 | enum ofp_role_request_failed_code(wire_type=uint16_t){ |
| 1306 | OFPRRFC_STALE = 0, |
| 1307 | OFPRRFC_UNSUP = 1, |
| 1308 | OFPRRFC_BAD_ROLE = 2, |
| 1309 | }; |
| 1310 | |
| 1311 | /* ofp_error_msg code values for OFPET_METER_MOD_FAILED */ |
| 1312 | enum ofp_meter_mod_failed_code(wire_type=uint16_t) { |
| 1313 | OFPMMFC_UNKNOWN = 0, |
| 1314 | OFPMMFC_METER_EXISTS = 1, |
| 1315 | OFPMMFC_INVALID_METER = 2, |
| 1316 | OFPMMFC_UNKNOWN_METER = 3, |
| 1317 | OFPMMFC_BAD_COMMAND = 4, |
| 1318 | OFPMMFC_BAD_FLAGS = 5, |
| 1319 | OFPMMFC_BAD_RATE = 6, |
| 1320 | OFPMMFC_BAD_BURST = 7, |
| 1321 | OFPMMFC_BAD_BAND = 8, |
| 1322 | OFPMMFC_BAD_BAND_VALUE = 9, |
| 1323 | OFPMMFC_OUT_OF_METERS = 10, |
| 1324 | OFPMMFC_OUT_OF_BANDS = 11, |
| 1325 | }; |
| 1326 | |
| 1327 | /* ofp_error_msg code values for OFPET_TABLE_FEATURES_FAILED */ |
| 1328 | enum ofp_table_features_failed_code(wire_type=uint16_t) { |
| 1329 | OFPTFFC_BAD_TABLE = 0, |
| 1330 | OFPTFFC_BAD_METADATA = 1, |
| 1331 | OFPTFFC_EPERM = 5, |
| 1332 | OFPTFFC_BAD_CAPA = 6, |
| 1333 | OFPTFFC_BAD_MAX_ENT = 7, |
| 1334 | OFPTFFC_BAD_FEATURES = 8, |
| 1335 | OFPTFFC_BAD_COMMAND = 9, |
| 1336 | OFPTFFC_TOO_MANY = 10, |
| 1337 | }; |
| 1338 | |
| 1339 | /* ofp_error_msg code values for OFPET_BAD_PROPERTY. */ |
| 1340 | enum ofp_bad_property_code(wire_type=uint16_t) { |
| 1341 | OFPBPC_BAD_TYPE = 0, |
| 1342 | OFPBPC_BAD_LEN = 1, |
| 1343 | OFPBPC_BAD_VALUE = 2, |
| 1344 | OFPBPC_TOO_MANY = 3, |
| 1345 | OFPBPC_DUP_TYPE = 4, |
| 1346 | OFPBPC_BAD_EXPERIMENTER = 5, |
| 1347 | OFPBPC_BAD_EXP_TYPE = 6, |
| 1348 | OFPBPC_BAD_EXP_VALUE = 7, |
| 1349 | OFPBPC_EPERM = 8, |
| 1350 | }; |
| 1351 | |
| 1352 | /* ofp_error_msg code values for OFPET_ASYNC_CONFIG_FAILED. */ |
| 1353 | enum ofp_async_config_failed_code(wire_type=uint16_t) { |
| 1354 | OFPACFC_INVALID = 0, |
| 1355 | OFPACFC_UNSUPPORTED = 1, |
| 1356 | OFPACFC_EPERM = 2, |
| 1357 | }; |
| 1358 | |
| 1359 | /* ofp_error_msg code values for OFPET_FLOW_MONITOR_FAILED. */ |
| 1360 | enum ofp_flow_monitor_failed_code(wire_type=uint16_t) { |
| 1361 | OFPMOFC_UNKNOWN = 0, |
| 1362 | OFPMOFC_MONITOR_EXISTS = 1, |
| 1363 | OFPMOFC_INVALID_MONITOR = 2, |
| 1364 | OFPMOFC_UNKNOWN_MONITOR = 3, |
| 1365 | OFPMOFC_BAD_COMMAND = 4, |
| 1366 | OFPMOFC_BAD_FLAGS = 5, |
| 1367 | OFPMOFC_BAD_TABLE_ID = 6, |
| 1368 | OFPMOFC_BAD_OUT = 7, |
| 1369 | }; |
| 1370 | |
| 1371 | /* ofp_error_msg code values for OFPET_BUNDLE_FAILED. */ |
| 1372 | enum ofp_bundle_failed_code(wire_type=uint16_t) { |
| 1373 | OFPBFC_UNKNOWN = 0, |
| 1374 | OFPBFC_EPERM = 1, |
| 1375 | OFPBFC_BAD_ID = 2, |
| 1376 | OFPBFC_BUNDLE_EXIST = 3, |
| 1377 | OFPBFC_BUNDLE_CLOSED = 4, |
| 1378 | OFPBFC_OUT_OF_BUNDLES = 5, |
| 1379 | OFPBFC_BAD_TYPE = 6, |
| 1380 | OFPBFC_BAD_FLAGS = 7, |
| 1381 | OFPBFC_MSG_BAD_LEN = 8, |
| 1382 | OFPBFC_MSG_BAD_XID = 9, |
| 1383 | OFPBFC_MSG_UNSUP = 10, |
| 1384 | OFPBFC_MSG_CONFLICT = 11, |
| 1385 | OFPBFC_MSG_TOO_MANY = 12, |
| 1386 | OFPBFC_MSG_FAILED = 13, |
| 1387 | OFPBFC_TIMEOUT = 14, |
| 1388 | OFPBFC_BUNDLE_IN_PROGRESS = 15, |
| 1389 | OFPBFC_SCHED_NOT_SUPPORTED = 16, |
| 1390 | OFPBFC_SCHED_FUTURE = 17, |
| 1391 | OFPBFC_SCHED_PAST = 18, |
| 1392 | }; |
| 1393 | |
| 1394 | enum ofp_bundle_feature_flags(wire_type=uint32_t, bitmask=True) { |
| 1395 | OFPBF_TIMESTAMP = 0x1, |
| 1396 | OFPBF_TIME_SET_SCHED = 0x2, |
| 1397 | }; |
| 1398 | |
| 1399 | /* Configure/Modify behavior of a flow table */ |
| 1400 | struct of_table_mod : of_header { |
| 1401 | uint8_t version; |
| 1402 | uint8_t type == 17; |
| 1403 | uint16_t length; |
| 1404 | uint32_t xid; |
| 1405 | uint8_t table_id; |
| 1406 | pad(3); |
| 1407 | uint32_t config; |
| 1408 | list(of_table_mod_prop_t) properties; |
| 1409 | }; |
| 1410 | |
| 1411 | /* Common header for all Table Mod Properties */ |
| 1412 | struct of_table_mod_prop { |
| 1413 | uint16_t type == ?; |
| 1414 | uint16_t length; |
| 1415 | }; |
| 1416 | |
| 1417 | /* Eviction table mod Property. Mostly used in OFPMP_TABLE_DESC replies. */ |
| 1418 | struct of_table_mod_prop_eviction : of_table_mod_prop { |
| 1419 | uint16_t type == 2; |
| 1420 | uint16_t length; |
| 1421 | enum ofp_table_mod_prop_eviction_flag flags; |
| 1422 | }; |
| 1423 | |
| 1424 | /* Vacancy table mod property */ |
| 1425 | struct of_table_mod_prop_vacancy : of_table_mod_prop { |
| 1426 | uint16_t type == 3; |
| 1427 | uint16_t length; |
| 1428 | uint8_t vacancy_down; |
| 1429 | uint8_t vacancy_up; |
| 1430 | uint8_t vacancy; |
| 1431 | pad(1); |
| 1432 | }; |
| 1433 | |
| 1434 | /* Experimenter table mod property */ |
| 1435 | struct of_table_mod_prop_experimenter : of_table_mod_prop { |
| 1436 | uint16_t type == 0xffff; |
| 1437 | uint16_t length; |
| 1438 | uint32_t experimenter == ?; |
| 1439 | uint32_t exp_type; |
| 1440 | }; |
| 1441 | |
| 1442 | /* Flow setup and teardown (controller -> datapath). */ |
| 1443 | struct of_flow_mod : of_header { |
| 1444 | uint8_t version; |
| 1445 | uint8_t type == 14; |
| 1446 | uint16_t length; |
| 1447 | uint32_t xid; |
| 1448 | uint64_t cookie; |
| 1449 | uint64_t cookie_mask; |
| 1450 | uint8_t table_id; |
| 1451 | of_fm_cmd_t _command == ?; |
| 1452 | uint16_t idle_timeout; |
| 1453 | uint16_t hard_timeout; |
| 1454 | uint16_t priority; |
| 1455 | uint32_t buffer_id; |
| 1456 | of_port_no_t out_port; |
| 1457 | uint32_t out_group; |
| 1458 | enum ofp_flow_mod_flags flags; |
| 1459 | uint16_t importance; |
| 1460 | of_match_t match; |
| 1461 | list(of_instruction_t) instructions; |
| 1462 | }; |
| 1463 | |
| 1464 | /* Group setup and teardown (controller -> datapath). */ |
| 1465 | struct of_group_mod : of_header { |
| 1466 | uint8_t version; |
| 1467 | uint8_t type == 15; |
| 1468 | uint16_t length; |
| 1469 | uint32_t xid; |
| 1470 | enum ofp_group_mod_command command == ?; |
| 1471 | enum ofp_group_type group_type; |
| 1472 | pad(1); |
| 1473 | uint32_t group_id; |
| 1474 | uint16_t bucket_array_len == length(buckets); |
| 1475 | pad(2); |
| 1476 | enum ofp_group_bucket command_bucket_id; |
| 1477 | list(of_bucket_t) buckets; |
| 1478 | list(of_group_prop_t) properties; |
| 1479 | }; |
| 1480 | |
| 1481 | /* Bucket for use in groups. */ |
| 1482 | struct of_bucket { |
| 1483 | uint16_t len; |
| 1484 | uint16_t action_array_len == length(actions); |
| 1485 | enum ofp_group_bucket bucket_id; |
| 1486 | list(of_action_t) actions; |
| 1487 | list(of_group_bucket_prop_t) properties; |
| 1488 | }; |
| 1489 | |
| 1490 | /* Common header for all group bucket properties. */ |
| 1491 | struct of_group_bucket_prop { |
| 1492 | uint16_t type == ?; |
| 1493 | uint16_t length; |
| 1494 | }; |
| 1495 | |
| 1496 | /* Group bucket weight property, for select groups only. */ |
| 1497 | struct of_group_bucket_prop_weight : of_group_bucket_prop { |
| 1498 | uint16_t type == 0; |
| 1499 | uint16_t length; |
| 1500 | uint16_t weight; |
| 1501 | pad(2); |
| 1502 | }; |
| 1503 | |
| 1504 | /* Group bucket watch port */ |
| 1505 | struct of_group_bucket_prop_watch_port : of_group_bucket_prop { |
| 1506 | uint16_t type == 1; |
| 1507 | uint16_t length; |
| 1508 | uint32_t watch; |
| 1509 | }; |
| 1510 | |
| 1511 | /* Group bucket watch group */ |
| 1512 | struct of_group_bucket_prop_watch_group : of_group_bucket_prop{ |
| 1513 | uint16_t type == 2; |
| 1514 | uint16_t length; |
| 1515 | uint32_t watch; |
| 1516 | }; |
| 1517 | |
| 1518 | /* Experimenter group bucket property */ |
| 1519 | struct of_group_bucket_prop_experimenter : of_group_bucket_prop { |
| 1520 | uint16_t type == 3; |
| 1521 | uint16_t length; |
| 1522 | uint32_t experimenter == ?; |
| 1523 | uint32_t exp_type; |
| 1524 | }; |
| 1525 | |
| 1526 | /* Common header for all group properties. */ |
| 1527 | struct of_group_prop { |
| 1528 | uint16_t type == ?; |
| 1529 | uint16_t length; |
| 1530 | }; |
| 1531 | |
| 1532 | /* Experimenter group property */ |
| 1533 | struct of_group_prop_experimenter { |
| 1534 | uint16_t type == 65535; |
| 1535 | uint16_t length; |
| 1536 | uint32_t experimenter == ?; |
| 1537 | uint32_t exp_type; |
| 1538 | }; |
| 1539 | |
| 1540 | /* Modify behavior of the physical port */ |
| 1541 | struct of_port_mod : of_header { |
| 1542 | uint8_t version; |
| 1543 | uint8_t type == 16; |
| 1544 | uint16_t length; |
| 1545 | uint32_t xid; |
| 1546 | of_port_no_t port_no; |
| 1547 | pad(4); |
| 1548 | of_mac_addr_t hw_addr; |
| 1549 | pad(2); |
| 1550 | enum ofp_port_config config; |
| 1551 | enum ofp_port_config mask; |
| 1552 | list(of_port_mod_prop_t) properties; |
| 1553 | }; |
| 1554 | |
| 1555 | /* Common header for all port mod properties. */ |
| 1556 | struct of_port_mod_prop { |
| 1557 | uint16_t type == ?; |
| 1558 | uint16_t length; |
| 1559 | }; |
| 1560 | |
| 1561 | /* Ethernet port mod property. */ |
| 1562 | struct of_port_mod_prop_ethernet : of_port_mod_prop { |
| 1563 | uint16_t type == 0; |
| 1564 | uint16_t length; |
| 1565 | enum ofp_port_features advertise; |
| 1566 | }; |
| 1567 | |
| 1568 | /* Optical port mod property */ |
| 1569 | struct of_port_mod_prop_optical : of_port_mod_prop { |
| 1570 | uint16_t type == 1; |
| 1571 | uint16_t length; |
| 1572 | uint32_t configure; |
| 1573 | uint32_t freq_ldma; |
| 1574 | uint32_t fl_offset; /* TODO signed */ |
| 1575 | uint32_t grid_span; |
| 1576 | uint32_t tx_pwr; |
| 1577 | }; |
| 1578 | |
| 1579 | /* Experimenter port mod property. */ |
| 1580 | struct of_port_mod_prop_experimenter : of_port_mod_prop { |
| 1581 | uint16_t type == 0xffff; |
| 1582 | uint16_t length; |
| 1583 | uint32_t experimenter == ?; |
| 1584 | uint32_t exp_type; |
| 1585 | }; |
| 1586 | |
| 1587 | /* Meter configuration. OFPT_METER_MOD. */ |
| 1588 | struct of_meter_mod : of_header { |
| 1589 | uint8_t version; |
| 1590 | uint8_t type == 29; |
| 1591 | uint16_t length; |
| 1592 | uint32_t xid; |
| 1593 | enum ofp_meter_mod_command command; |
| 1594 | enum ofp_meter_flags flags; |
| 1595 | uint32_t meter_id; |
| 1596 | list(of_meter_band_t) bands; |
| 1597 | }; |
| 1598 | |
| 1599 | /* Common header for all meter bands */ |
| 1600 | struct of_meter_band { |
| 1601 | uint16_t type == ?; |
| 1602 | uint16_t len; |
| 1603 | // uint32_t rate; // These are excluded b/c this is the header |
| 1604 | // uint32_t burst_size; // These are excluded b/c this is the header |
| 1605 | }; |
| 1606 | |
| 1607 | /* OFPMBT_DROP band - drop packets */ |
| 1608 | struct of_meter_band_drop : of_meter_band { |
| 1609 | uint16_t type == 1; |
| 1610 | uint16_t len; |
| 1611 | uint32_t rate; |
| 1612 | uint32_t burst_size; |
| 1613 | pad(4); |
| 1614 | }; |
| 1615 | |
| 1616 | /* OFPMBT_DSCP_REMARK band - Remark DSCP in the IP header */ |
| 1617 | struct of_meter_band_dscp_remark : of_meter_band { |
| 1618 | uint16_t type == 2; |
| 1619 | uint16_t len; |
| 1620 | uint32_t rate; |
| 1621 | uint32_t burst_size; |
| 1622 | uint8_t prec_level; |
| 1623 | pad(3); |
| 1624 | }; |
| 1625 | |
| 1626 | /* OFPMBT_EXPERIMENTER band - Experimenter type. |
| 1627 | * The rest of the band is experimenter-defined. */ |
| 1628 | struct of_meter_band_experimenter : of_meter_band { |
| 1629 | uint16_t type == 65535; |
| 1630 | uint16_t len; |
| 1631 | uint32_t rate; |
| 1632 | uint32_t burst_size; |
| 1633 | uint32_t experimenter; |
| 1634 | }; |
| 1635 | |
| 1636 | /* Multipart Request */ |
| 1637 | struct of_stats_request : of_header { |
| 1638 | uint8_t version; |
| 1639 | uint8_t type == 18; |
| 1640 | uint16_t length; |
| 1641 | uint32_t xid; |
| 1642 | uint16_t stats_type == ?; |
| 1643 | enum ofp_stats_request_flags flags; |
| 1644 | pad(4); |
| 1645 | }; |
| 1646 | |
| 1647 | /* Multipart Reply */ |
| 1648 | struct of_stats_reply : of_header { |
| 1649 | uint8_t version; |
| 1650 | uint8_t type == 19; |
| 1651 | uint16_t length; |
| 1652 | uint32_t xid; |
| 1653 | uint16_t stats_type == ?; |
| 1654 | enum ofp_stats_reply_flags flags; |
| 1655 | pad(4); |
| 1656 | }; |
| 1657 | |
| 1658 | /* Body for ofp_multipart_request of type OFPST_FLOW(_DESC) */ |
| 1659 | struct of_flow_stats_request : of_stats_request { |
| 1660 | uint8_t version; |
| 1661 | uint8_t type == 18; |
| 1662 | uint16_t length; |
| 1663 | uint32_t xid; |
| 1664 | uint16_t stats_type == 1; |
| 1665 | enum ofp_stats_request_flags flags; |
| 1666 | pad(4); |
| 1667 | uint8_t table_id; |
| 1668 | pad(3); |
| 1669 | of_port_no_t out_port; |
| 1670 | uint32_t out_group; |
| 1671 | pad(4); |
| 1672 | uint64_t cookie; |
| 1673 | uint64_t cookie_mask; |
| 1674 | of_match_t match; |
| 1675 | }; |
| 1676 | |
| 1677 | /* Body for ofp_multipart_reply of type OFPST_FLOW(_DESC) */ |
| 1678 | struct of_flow_stats_reply : of_stats_reply { |
| 1679 | uint8_t version; |
| 1680 | uint8_t type == 19; |
| 1681 | uint16_t length; |
| 1682 | uint32_t xid; |
| 1683 | uint16_t stats_type == 1; |
| 1684 | enum ofp_stats_reply_flags flags; |
| 1685 | pad(4); |
| 1686 | list(of_flow_stats_entry_t) entries; |
| 1687 | }; |
| 1688 | |
| 1689 | /* Body for ofp_multipart_request of type OFPMP_FLOW_(STATS)LIGHTWEIGHT */ |
| 1690 | struct of_flow_lightweight_stats_request : of_stats_request { |
| 1691 | uint8_t version; |
| 1692 | uint8_t type == 18; |
| 1693 | uint16_t length; |
| 1694 | uint32_t xid; |
| 1695 | uint16_t stats_type == 17; |
| 1696 | enum ofp_stats_request_flags flags; |
| 1697 | pad(4); |
| 1698 | uint8_t table_id; |
| 1699 | pad(3); |
| 1700 | of_port_no_t out_port; |
| 1701 | uint32_t out_group; |
| 1702 | pad(4); |
| 1703 | uint64_t cookie; |
| 1704 | uint64_t cookie_mask; |
| 1705 | of_match_t match; |
| 1706 | }; |
| 1707 | |
| 1708 | /* Entry for OFPST_FLOW */ |
| 1709 | struct of_flow_stats_entry { |
| 1710 | uint16_t length; |
| 1711 | pad(2); |
| 1712 | uint8_t table_id; |
| 1713 | pad(1); |
| 1714 | uint16_t priority; |
| 1715 | uint16_t idle_timeout; |
| 1716 | uint16_t hard_timeout; |
| 1717 | enum ofp_flow_mod_flags flags; |
| 1718 | uint16_t importance; |
| 1719 | uint64_t cookie; |
| 1720 | of_match_t match; |
| 1721 | of_stat_t stats; |
| 1722 | list(of_instruction_t) instructions; |
| 1723 | }; |
| 1724 | |
| 1725 | /* Entry for OFPMP_FLOW_(STATS)LIGHTWEIGHT */ |
| 1726 | struct of_flow_lightweight_stats_entry { |
| 1727 | uint16_t length; |
| 1728 | pad(2); |
| 1729 | uint8_t table_id; |
| 1730 | enum ofp_flow_stats_reason reason; |
| 1731 | uint16_t priority; |
| 1732 | of_match_t match; |
| 1733 | of_stat_t stats; |
| 1734 | }; |
| 1735 | |
| 1736 | /* Body of reply to OFPST_FLOW_(STATS)LIGHTWEIGHT request */ |
| 1737 | struct of_flow_lightweight_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 == 17; |
| 1743 | enum ofp_stats_reply_flags flags; |
| 1744 | pad(4); |
| 1745 | list(of_flow_lightweight_stats_entry_t) entries; |
| 1746 | }; |
| 1747 | |
| 1748 | /* Body for ofp_multipart_request of type OFPMP_AGGREGATE_STATS. */ |
| 1749 | struct of_aggregate_stats_request : of_stats_request { |
| 1750 | uint8_t version; |
| 1751 | uint8_t type == 18; |
| 1752 | uint16_t length; |
| 1753 | uint32_t xid; |
| 1754 | uint16_t stats_type == 2; |
| 1755 | enum ofp_stats_request_flags flags; |
| 1756 | pad(4); |
| 1757 | uint8_t table_id; |
| 1758 | pad(3); |
| 1759 | of_port_no_t out_port; |
| 1760 | uint32_t out_group; |
| 1761 | pad(4); |
| 1762 | uint64_t cookie; |
| 1763 | uint64_t cookie_mask; |
| 1764 | of_match_t match; |
| 1765 | }; |
| 1766 | |
| 1767 | /* Body of reply to OFPMP_AGGREGATE_STATS request. */ |
| 1768 | struct of_aggregate_stats_reply : of_stats_reply { |
| 1769 | uint8_t version; |
| 1770 | uint8_t type == 19; |
| 1771 | uint16_t length; |
| 1772 | uint32_t xid; |
| 1773 | uint16_t stats_type == 2; |
| 1774 | enum ofp_stats_reply_flags flags; |
| 1775 | pad(4); |
| 1776 | of_stat_t stats; |
| 1777 | }; |
| 1778 | |
| 1779 | |
| 1780 | /* Body for ofp_multipart_request of types OFPMP_PORT_STATS */ |
| 1781 | struct of_port_stats_request : of_stats_request { |
| 1782 | uint8_t version; |
| 1783 | uint8_t type == 18; |
| 1784 | uint16_t length; |
| 1785 | uint32_t xid; |
| 1786 | uint16_t stats_type == 4; |
| 1787 | enum ofp_stats_request_flags flags; |
| 1788 | pad(4); |
| 1789 | of_port_no_t port_no; |
| 1790 | pad(4); |
| 1791 | }; |
| 1792 | |
| 1793 | struct of_port_stats_entry { |
| 1794 | uint16_t length; |
| 1795 | pad(2); |
| 1796 | of_port_no_t port_no; |
| 1797 | uint32_t duration_sec; |
| 1798 | uint32_t duration_nsec; |
| 1799 | uint64_t rx_packets; |
| 1800 | uint64_t tx_packets; |
| 1801 | uint64_t rx_bytes; |
| 1802 | uint64_t tx_bytes; |
| 1803 | uint64_t rx_dropped; |
| 1804 | uint64_t tx_dropped; |
| 1805 | uint64_t rx_errors; |
| 1806 | uint64_t tx_errors; |
| 1807 | list(of_port_stats_prop_t) properties; |
| 1808 | }; |
| 1809 | |
| 1810 | /* Body of reply to OFPMP_PORT_STATS request. */ |
| 1811 | struct of_port_stats_reply : of_stats_reply { |
| 1812 | uint8_t version; |
| 1813 | uint8_t type == 19; |
| 1814 | uint16_t length; |
| 1815 | uint32_t xid; |
| 1816 | uint16_t stats_type == 4; |
| 1817 | enum ofp_stats_reply_flags flags; |
| 1818 | pad(4); |
| 1819 | list(of_port_stats_entry_t) entries; |
| 1820 | }; |
| 1821 | |
| 1822 | /* Common header for all port stats properties. */ |
| 1823 | struct of_port_stats_prop { |
| 1824 | uint16_t type == ?; |
| 1825 | uint16_t length; |
| 1826 | }; |
| 1827 | |
| 1828 | /* Ethernet port stats property. */ |
| 1829 | struct of_port_stats_prop_ethernet : of_port_stats_prop { |
| 1830 | uint16_t type == 0; |
| 1831 | uint16_t length; |
| 1832 | pad(4); |
| 1833 | uint64_t rx_frame_err; |
| 1834 | uint64_t rx_over_err; |
| 1835 | uint64_t rx_crc_err; |
| 1836 | uint64_t collisions; |
| 1837 | }; |
| 1838 | |
| 1839 | /* Optical port stats property. */ |
| 1840 | struct of_port_stats_prop_optical : of_port_stats_prop { |
| 1841 | uint16_t type == 1; |
| 1842 | uint16_t length; |
| 1843 | pad(4); |
| 1844 | uint32_t flags; |
| 1845 | uint32_t tx_freq_lmda; |
| 1846 | uint32_t tx_offset; |
| 1847 | uint32_t tx_grid_span; |
| 1848 | uint32_t rx_freq_lmda; |
| 1849 | uint32_t rx_offset; |
| 1850 | uint32_t rx_grid_span; |
| 1851 | uint16_t tx_pwr; |
| 1852 | uint16_t rx_pwr; |
| 1853 | uint16_t bias_current; |
| 1854 | uint16_t temperature; |
| 1855 | }; |
| 1856 | |
| 1857 | /* Experimenter port stats property. */ |
| 1858 | struct of_port_stats_prop_experimenter : of_port_stats_prop { |
| 1859 | uint16_t type == 0xffff; |
| 1860 | uint16_t length; |
| 1861 | uint32_t experimenter == ?; |
| 1862 | uint32_t exp_type; |
| 1863 | }; |
| 1864 | |
| 1865 | /* Body for ofp_multipart_request of OFPMP_PORT_DESC. */ |
| 1866 | struct of_port_desc_stats_request : of_stats_request { |
| 1867 | uint8_t version; |
| 1868 | uint8_t type == 18; |
| 1869 | uint16_t length; |
| 1870 | uint32_t xid; |
| 1871 | uint16_t stats_type == 13; |
| 1872 | enum ofp_stats_request_flags flags; |
| 1873 | pad(4); |
| 1874 | of_port_no_t port_no; |
| 1875 | pad(4); |
| 1876 | }; |
| 1877 | |
| 1878 | /* Body for ofp_multipart_reply of OFPMP_PORT_DESC. */ |
| 1879 | struct of_port_desc_stats_reply : of_stats_reply { |
| 1880 | uint8_t version; |
| 1881 | uint8_t type == 19; |
| 1882 | uint16_t length; |
| 1883 | uint32_t xid; |
| 1884 | uint16_t stats_type == 13; |
| 1885 | enum ofp_stats_reply_flags flags; |
| 1886 | pad(4); |
| 1887 | list(of_port_desc_t) entries; |
| 1888 | }; |
| 1889 | |
| 1890 | /* Body for ofp_multipart_request of OFPMP_QUEUE_STATS. */ |
| 1891 | struct of_queue_stats_request : of_stats_request { |
| 1892 | uint8_t version; |
| 1893 | uint8_t type == 18; |
| 1894 | uint16_t length; |
| 1895 | uint32_t xid; |
| 1896 | uint16_t stats_type == 5; |
| 1897 | enum ofp_stats_request_flags flags; |
| 1898 | pad(4); |
| 1899 | of_port_no_t port_no; |
| 1900 | uint32_t queue_id; |
| 1901 | }; |
| 1902 | |
| 1903 | struct of_queue_stats_entry { |
| 1904 | uint16_t length; |
| 1905 | pad(6); |
| 1906 | of_port_no_t port_no; |
| 1907 | uint32_t queue_id; |
| 1908 | uint64_t tx_bytes; |
| 1909 | uint64_t tx_packets; |
| 1910 | uint64_t tx_errors; |
| 1911 | uint32_t duration_sec; |
| 1912 | uint32_t duration_nsec; |
| 1913 | list(of_queue_stats_prop_t) properties; |
| 1914 | }; |
| 1915 | |
| 1916 | struct of_queue_stats_reply : of_stats_reply { |
| 1917 | uint8_t version; |
| 1918 | uint8_t type == 19; |
| 1919 | uint16_t length; |
| 1920 | uint32_t xid; |
| 1921 | uint16_t stats_type == 5; |
| 1922 | enum ofp_stats_reply_flags flags; |
| 1923 | pad(4); |
| 1924 | list(of_queue_stats_entry_t) entries; |
| 1925 | }; |
| 1926 | |
| 1927 | /* Common header for all queue properties */ |
| 1928 | struct of_queue_stats_prop { |
| 1929 | uint16_t type == ?; |
| 1930 | uint16_t length; |
| 1931 | }; |
| 1932 | |
| 1933 | /* Experimenter queue property description. */ |
| 1934 | struct of_queue_stats_prop_experimenter : of_queue_stats_prop { |
| 1935 | uint16_t type == 0xffff; |
| 1936 | uint16_t length; |
| 1937 | uint32_t experimenter == ?; |
| 1938 | uint32_t exp_type; |
| 1939 | }; |
| 1940 | |
| 1941 | /* Body for ofp_multipart_request of OFPMP_QUEUE_DESC */ |
| 1942 | struct of_queue_desc_stats_request : of_stats_request { |
| 1943 | uint8_t version; |
| 1944 | uint8_t type == 18; |
| 1945 | uint16_t length; |
| 1946 | uint32_t xid; |
| 1947 | uint16_t stats_type == 15; |
| 1948 | enum ofp_stats_request_flags flags; |
| 1949 | pad(4); |
| 1950 | of_port_no_t port_no; |
| 1951 | uint32_t queue_id; |
| 1952 | }; |
| 1953 | |
| 1954 | struct of_queue_desc { |
| 1955 | uint32_t port_no; |
| 1956 | uint32_t queue_id; |
| 1957 | uint16_t length; |
| 1958 | pad(6); |
| 1959 | list(of_queue_desc_prop_t) properties; |
| 1960 | }; |
| 1961 | |
| 1962 | /* Body of reply to OFPMP_QUEUE_DESC request. */ |
| 1963 | struct of_queue_desc_stats_reply : of_stats_reply { |
| 1964 | uint8_t version; |
| 1965 | uint8_t type == 19; |
| 1966 | uint16_t length; |
| 1967 | uint32_t xid; |
| 1968 | uint16_t stats_type == 15; |
| 1969 | enum ofp_stats_reply_flags flags; |
| 1970 | pad(4); |
| 1971 | list(of_queue_desc_t) entries; |
| 1972 | }; |
| 1973 | |
| 1974 | /* Common header for all queue properties */ |
| 1975 | struct of_queue_desc_prop { |
| 1976 | uint16_t type == ?; |
| 1977 | uint16_t length; |
| 1978 | }; |
| 1979 | |
| 1980 | /* Min-Rate queue property description. */ |
| 1981 | struct of_queue_desc_prop_min_rate : of_queue_desc_prop { |
| 1982 | uint16_t type == 1; |
| 1983 | uint16_t length; |
| 1984 | uint16_t rate; |
| 1985 | pad(2); |
| 1986 | }; |
| 1987 | |
| 1988 | /* Max-Rate queue property description. */ |
| 1989 | struct of_queue_desc_prop_max_rate : of_queue_desc_prop { |
| 1990 | uint16_t type == 2; |
| 1991 | uint16_t length; |
| 1992 | uint16_t rate; |
| 1993 | pad(2); |
| 1994 | }; |
| 1995 | |
| 1996 | /* Experimenter queue property description. */ |
| 1997 | struct of_queue_desc_prop_experimenter : of_queue_desc_prop { |
| 1998 | uint16_t type == 0xffff; |
| 1999 | uint16_t length; |
| 2000 | uint32_t experimenter == ?; |
| 2001 | uint32_t exp_type; |
| 2002 | }; |
| 2003 | |
| 2004 | /* Body of OFPMP_GROUP_STATS */ |
| 2005 | struct of_group_stats_request : of_stats_request { |
| 2006 | uint8_t version; |
| 2007 | uint8_t type == 18; |
| 2008 | uint16_t length; |
| 2009 | uint32_t xid; |
| 2010 | uint16_t stats_type == 6; |
| 2011 | enum ofp_stats_request_flags flags; |
| 2012 | pad(4); |
| 2013 | uint32_t group_id; |
| 2014 | pad(4); |
| 2015 | }; |
| 2016 | |
| 2017 | struct of_group_stats_entry { |
| 2018 | uint16_t length; |
| 2019 | pad(2); |
| 2020 | uint32_t group_id; |
| 2021 | uint32_t ref_count; |
| 2022 | pad(4); |
| 2023 | uint64_t packet_count; |
| 2024 | uint64_t byte_count; |
| 2025 | uint32_t duration_sec; |
| 2026 | uint32_t duration_nsec; |
| 2027 | list(of_bucket_counter_t) bucket_stats; |
| 2028 | }; |
| 2029 | |
| 2030 | /* Body of reply to OFPMP_GROUP_STATS request. */ |
| 2031 | struct of_group_stats_reply : of_stats_reply { |
| 2032 | uint8_t version; |
| 2033 | uint8_t type == 19; |
| 2034 | uint16_t length; |
| 2035 | uint32_t xid; |
| 2036 | uint16_t stats_type == 6; |
| 2037 | enum ofp_stats_reply_flags flags; |
| 2038 | pad(4); |
| 2039 | list(of_group_stats_entry_t) entries; |
| 2040 | }; |
| 2041 | |
| 2042 | /* Used in group stats replies. */ |
| 2043 | struct of_bucket_counter { |
| 2044 | uint64_t packet_count; |
| 2045 | uint64_t byte_count; |
| 2046 | }; |
| 2047 | |
| 2048 | /* Body of OFPMP_GROUP_DESC requests. */ |
| 2049 | struct of_group_desc_stats_request : of_stats_request { |
| 2050 | uint8_t version; |
| 2051 | uint8_t type == 18; |
| 2052 | uint16_t length; |
| 2053 | uint32_t xid; |
| 2054 | uint16_t stats_type == 7; |
| 2055 | enum ofp_stats_request_flags flags; |
| 2056 | pad(4); |
| 2057 | uint32_t group_id; |
| 2058 | pad(4); |
| 2059 | }; |
| 2060 | |
| 2061 | struct of_group_desc_stats_entry { |
| 2062 | uint16_t length; |
| 2063 | enum ofp_group_type group_type; |
| 2064 | pad(1); |
| 2065 | uint32_t group_id; |
| 2066 | uint16_t bucket_array_len == length(buckets); |
| 2067 | pad(6); |
| 2068 | list(of_bucket_t) buckets; |
| 2069 | list(of_group_prop_t) properties; |
| 2070 | }; |
| 2071 | |
| 2072 | /* Body of reply to OFPMP_GROUP_DESC request. */ |
| 2073 | struct of_group_desc_stats_reply : of_stats_reply { |
| 2074 | uint8_t version; |
| 2075 | uint8_t type == 19; |
| 2076 | uint16_t length; |
| 2077 | uint32_t xid; |
| 2078 | uint16_t stats_type == 7; |
| 2079 | enum ofp_stats_reply_flags flags; |
| 2080 | pad(4); |
| 2081 | list(of_group_desc_stats_entry_t) entries; |
| 2082 | }; |
| 2083 | |
| 2084 | /* Body of OFPMP_GROUP_FEATURES request. Group features. */ |
| 2085 | struct of_group_features_stats_request : of_stats_request { |
| 2086 | uint8_t version; |
| 2087 | uint8_t type == 18; |
| 2088 | uint16_t length; |
| 2089 | uint32_t xid; |
| 2090 | uint16_t stats_type == 8; |
| 2091 | enum ofp_stats_request_flags flags; |
| 2092 | pad(4); |
| 2093 | }; |
| 2094 | |
| 2095 | /* Body of reply to OFPMP_GROUP_FEATURES request. Group features. */ |
| 2096 | struct of_group_features_stats_reply : of_stats_reply { |
| 2097 | uint8_t version; |
| 2098 | uint8_t type == 19; |
| 2099 | uint16_t length; |
| 2100 | uint32_t xid; |
| 2101 | uint16_t stats_type == 8; |
| 2102 | enum ofp_stats_reply_flags flags; |
| 2103 | pad(4); |
| 2104 | uint32_t types; |
| 2105 | enum ofp_group_capabilities capabilities; |
| 2106 | uint32_t max_groups_all; |
| 2107 | uint32_t max_groups_select; |
| 2108 | uint32_t max_groups_indirect; |
| 2109 | uint32_t max_groups_ff; |
| 2110 | uint32_t actions_all; |
| 2111 | uint32_t actions_select; |
| 2112 | uint32_t actions_indirect; |
| 2113 | uint32_t actions_ff; |
| 2114 | }; |
| 2115 | |
| 2116 | /* Body of OFPMP_METER_STATS request */ |
| 2117 | struct of_meter_stats_request : of_stats_request { |
| 2118 | uint8_t version; |
| 2119 | uint8_t type == 18; |
| 2120 | uint16_t length; |
| 2121 | uint32_t xid; |
| 2122 | uint16_t stats_type == 9; |
| 2123 | enum ofp_stats_request_flags flags; |
| 2124 | pad(4); |
| 2125 | uint32_t meter_id; |
| 2126 | pad(4); |
| 2127 | }; |
| 2128 | |
| 2129 | struct of_meter_stats { |
| 2130 | uint32_t meter_id; |
| 2131 | uint16_t len; |
| 2132 | pad(6); |
| 2133 | uint32_t ref_count; |
| 2134 | uint64_t packet_in_count; |
| 2135 | uint64_t byte_in_count; |
| 2136 | uint32_t duration_sec; |
| 2137 | uint32_t duration_nsec; |
| 2138 | list(of_meter_band_stats_t) band_stats; |
| 2139 | }; |
| 2140 | |
| 2141 | /* Body of reply to OFPMP_METER_STATS request */ |
| 2142 | struct of_meter_stats_reply : of_stats_reply { |
| 2143 | uint8_t version; |
| 2144 | uint8_t type == 19; |
| 2145 | uint16_t length; |
| 2146 | uint32_t xid; |
| 2147 | uint16_t stats_type == 9; |
| 2148 | enum ofp_stats_reply_flags flags; |
| 2149 | pad(4); |
| 2150 | list(of_meter_stats_t) entries; |
| 2151 | }; |
| 2152 | |
| 2153 | /* Statistics for each meter band */ |
| 2154 | struct of_meter_band_stats { |
| 2155 | uint64_t packet_band_count; |
| 2156 | uint64_t byte_band_count; |
| 2157 | }; |
| 2158 | |
| 2159 | /* Body of OFPMP_METER_DESC request */ |
| 2160 | struct of_meter_config_stats_request : of_stats_request { |
| 2161 | uint8_t version; |
| 2162 | uint8_t type == 18; |
| 2163 | uint16_t length; |
| 2164 | uint32_t xid; |
| 2165 | uint16_t stats_type == 10; |
| 2166 | enum ofp_stats_request_flags flags; |
| 2167 | pad(4); |
| 2168 | uint32_t meter_id; |
| 2169 | pad(4); |
| 2170 | }; |
| 2171 | |
| 2172 | struct of_meter_config { |
| 2173 | uint16_t length; |
| 2174 | enum ofp_meter_flags flags; |
| 2175 | uint32_t meter_id; |
| 2176 | list(of_meter_band_t) entries; |
| 2177 | }; |
| 2178 | |
| 2179 | /* Body of reply to OFPMP_METER_DESC request */ |
| 2180 | struct of_meter_config_stats_reply : of_stats_reply { |
| 2181 | uint8_t version; |
| 2182 | uint8_t type == 19; |
| 2183 | uint16_t length; |
| 2184 | uint32_t xid; |
| 2185 | uint16_t stats_type == 10; |
| 2186 | enum ofp_stats_reply_flags flags; |
| 2187 | pad(4); |
| 2188 | list(of_meter_config_t) entries; |
| 2189 | }; |
| 2190 | |
| 2191 | |
| 2192 | /* Body of OFPMP_METER_FEATURES request. */ |
| 2193 | struct of_meter_features_stats_request : of_stats_request { |
| 2194 | uint8_t version; |
| 2195 | uint8_t type == 18; |
| 2196 | uint16_t length; |
| 2197 | uint32_t xid; |
| 2198 | uint16_t stats_type == 11; |
| 2199 | enum ofp_stats_request_flags flags; |
| 2200 | pad(4); |
| 2201 | }; |
| 2202 | |
| 2203 | struct of_meter_features { |
| 2204 | uint32_t max_meter; |
| 2205 | uint32_t band_types; |
| 2206 | uint32_t capabilities; |
| 2207 | uint8_t max_bands; |
| 2208 | uint8_t max_color; |
| 2209 | pad(2); |
| 2210 | uint32_t features; |
| 2211 | pad(4); |
| 2212 | }; |
| 2213 | |
| 2214 | /* Body of reply to OFPMP_METER_FEATURES request. Meter features. */ |
| 2215 | struct of_meter_features_stats_reply : of_stats_reply { |
| 2216 | uint8_t version; |
| 2217 | uint8_t type == 19; |
| 2218 | uint16_t length; |
| 2219 | uint32_t xid; |
| 2220 | uint16_t stats_type == 11; |
| 2221 | enum ofp_stats_reply_flags flags; |
| 2222 | pad(4); |
| 2223 | of_meter_features_t features; |
| 2224 | |
| 2225 | }; |
| 2226 | |
| 2227 | /* Body of OFPMP_TABLE_STATS request. */ |
| 2228 | struct of_table_stats_request : of_stats_request { |
| 2229 | uint8_t version; |
| 2230 | uint8_t type == 18; |
| 2231 | uint16_t length; |
| 2232 | uint32_t xid; |
| 2233 | uint16_t stats_type == 3; |
| 2234 | enum ofp_stats_request_flags flags; |
| 2235 | pad(4); |
| 2236 | }; |
| 2237 | |
| 2238 | struct of_table_stats_entry { |
| 2239 | uint8_t table_id; |
| 2240 | pad(3); |
| 2241 | uint32_t active_count; |
| 2242 | uint64_t lookup_count; |
| 2243 | uint64_t matched_count; |
| 2244 | }; |
| 2245 | |
| 2246 | /* Body of reply to OFPMP_TABLE_STATS request. */ |
| 2247 | struct of_table_stats_reply : of_stats_reply { |
| 2248 | uint8_t version; |
| 2249 | uint8_t type == 19; |
| 2250 | uint16_t length; |
| 2251 | uint32_t xid; |
| 2252 | uint16_t stats_type == 3; |
| 2253 | enum ofp_stats_reply_flags flags; |
| 2254 | pad(4); |
| 2255 | list(of_table_stats_entry_t) entries; |
| 2256 | }; |
| 2257 | |
| 2258 | /* Flow monitor commands */ |
| 2259 | enum ofp_flow_monitor_command(wire_type=uint8_t) { |
| 2260 | OFPFMC_ADD = 0, |
| 2261 | OFPFMC_MODIFY = 1, |
| 2262 | OFPFMC_DELETE = 2, |
| 2263 | }; |
| 2264 | |
| 2265 | struct of_flow_monitor_entry { |
| 2266 | uint32_t monitor_id; |
| 2267 | uint32_t out_port; |
| 2268 | uint32_t out_group; |
| 2269 | enum ofp_flow_monitor_flags flags; |
| 2270 | uint8_t table_id; |
| 2271 | enum ofp_flow_monitor_command command; |
| 2272 | of_match_t match; |
| 2273 | }; |
| 2274 | |
| 2275 | /* Body of OFPMP_FLOW_MONITOR request */ |
| 2276 | struct of_flow_monitor_request : of_stats_request { |
| 2277 | uint8_t version; |
| 2278 | uint8_t type == 18; |
| 2279 | uint16_t length; |
| 2280 | uint32_t xid; |
| 2281 | uint16_t stats_type == 16; |
| 2282 | enum ofp_stats_request_flags flags; |
| 2283 | pad(4); |
| 2284 | list(of_flow_monitor_entry_t) entries; |
| 2285 | }; |
| 2286 | |
| 2287 | enum ofp_flow_update_event(wire_type=uint16_t) { |
| 2288 | OFPFME_INITIAL = 0, |
| 2289 | OFPFME_ADDED = 1, |
| 2290 | OFPFME_REMOVED = 2, |
| 2291 | OFPFME_MODIFIED = 3, |
| 2292 | OFPFME_ABBREV = 4, |
| 2293 | OFPFME_PAUSED = 5, |
| 2294 | OFPFME_RESUMED = 6, |
| 2295 | }; |
| 2296 | |
| 2297 | struct of_flow_monitor_reply_entry { |
| 2298 | uint16_t length; |
| 2299 | enum ofp_flow_update_event event; |
| 2300 | }; |
| 2301 | |
| 2302 | /* Body of OFPMP_FLOW_MONITOR reply */ |
| 2303 | struct of_flow_monitor_reply : of_stats_reply { |
| 2304 | uint8_t version; |
| 2305 | uint8_t type == 19; |
| 2306 | uint16_t length; |
| 2307 | uint32_t xid; |
| 2308 | uint16_t stats_type == 16; |
| 2309 | enum ofp_stats_reply_flags flags; |
| 2310 | pad(4); |
| 2311 | list(of_flow_monitor_reply_entry_t) entries; |
| 2312 | }; |
| 2313 | |
| 2314 | /* Body of OFPMP_TABLE_DESC request. */ |
| 2315 | struct of_table_desc_stats_request : of_stats_request { |
| 2316 | uint8_t version; |
| 2317 | uint8_t type == 18; |
| 2318 | uint16_t length; |
| 2319 | uint32_t xid; |
| 2320 | uint16_t stats_type == 14; |
| 2321 | enum ofp_stats_request_flags flags; |
| 2322 | pad(4); |
| 2323 | }; |
| 2324 | |
| 2325 | /* Body of reply to OFPMP_TABLE_DESC request. */ |
| 2326 | struct of_table_desc_stats_reply : of_stats_reply { |
| 2327 | uint8_t version; |
| 2328 | uint8_t type == 19; |
| 2329 | uint16_t length; |
| 2330 | uint32_t xid; |
| 2331 | uint16_t stats_type == 14; |
| 2332 | enum ofp_stats_reply_flags flags; |
| 2333 | pad(4); |
| 2334 | list(of_table_desc_t) entries; |
| 2335 | }; |
| 2336 | |
| 2337 | |
| 2338 | /* Body of OFPMP_TABLE_FEATURES request. */ |
| 2339 | struct of_table_features_stats_request : of_stats_request { |
| 2340 | uint8_t version; |
| 2341 | uint8_t type == 18; |
| 2342 | uint16_t length; |
| 2343 | uint32_t xid; |
| 2344 | uint16_t stats_type == 12; |
| 2345 | enum ofp_stats_request_flags flags; |
| 2346 | pad(4); |
| 2347 | list(of_table_features_t) entries; |
| 2348 | }; |
| 2349 | |
| 2350 | struct of_table_features { |
| 2351 | uint16_t length; |
| 2352 | uint8_t table_id; |
| 2353 | enum ofp_table_features_command command; |
| 2354 | enum ofp_table_feature_flag features; |
| 2355 | of_table_name_t name; |
| 2356 | uint64_t metadata_match; |
| 2357 | uint64_t metadata_write; |
| 2358 | enum ofp_table_config capabilities; |
| 2359 | uint32_t max_entries; |
| 2360 | list(of_table_feature_prop_t) properties; |
| 2361 | }; |
| 2362 | |
| 2363 | /* Body of reply to OFPMP_TABLE_FEATURES request. */ |
| 2364 | struct of_table_features_stats_reply : of_stats_reply { |
| 2365 | uint8_t version; |
| 2366 | uint8_t type == 19; |
| 2367 | uint16_t length; |
| 2368 | uint32_t xid; |
| 2369 | uint16_t stats_type == 12; |
| 2370 | enum ofp_stats_reply_flags flags; |
| 2371 | pad(4); |
| 2372 | list(of_table_features_t) entries; |
| 2373 | }; |
| 2374 | |
| 2375 | /* Common header for all Table Feature Properties */ |
| 2376 | struct of_table_feature_prop { |
| 2377 | uint16_t type == ?; |
| 2378 | uint16_t length; |
| 2379 | }; |
| 2380 | |
| 2381 | /* Instructions property */ |
| 2382 | struct of_table_feature_prop_instructions : of_table_feature_prop { |
| 2383 | uint16_t type == 0; |
| 2384 | uint16_t length; |
| 2385 | // FIXME Check if instruction_t is right for ids here |
| 2386 | list(of_instruction_id_t) instruction_ids; |
| 2387 | }; |
| 2388 | |
| 2389 | /* Instruction Miss property */ |
| 2390 | struct of_table_feature_prop_instructions_miss : of_table_feature_prop { |
| 2391 | uint16_t type == 1; |
| 2392 | uint16_t length; |
| 2393 | list(of_instruction_id_t) instruction_ids; |
| 2394 | }; |
| 2395 | |
| 2396 | /* Instruction ID */ |
| 2397 | struct of_instruction_id { |
| 2398 | uint16_t type; |
| 2399 | uint16_t len; |
| 2400 | of_octets_t exp_data; |
| 2401 | }; |
| 2402 | |
| 2403 | /* OFPTFPT_TABLE_SYNC_FROM property */ |
| 2404 | struct of_table_feature_prop_table_sync_from : of_table_feature_prop { |
| 2405 | uint16_t type == 16; |
| 2406 | uint16_t length; |
| 2407 | list(of_uint8_t) table_ids; |
| 2408 | }; |
| 2409 | |
| 2410 | /* OFPTFPT_NEXT_TABLES property */ |
| 2411 | struct of_table_feature_prop_next_tables : of_table_feature_prop { |
| 2412 | uint16_t type == 2; |
| 2413 | uint16_t length; |
| 2414 | list(of_uint8_t) next_table_ids; |
| 2415 | }; |
| 2416 | |
| 2417 | /* NEXT_TABLES_MISS property */ |
| 2418 | struct of_table_feature_prop_next_tables_miss : of_table_feature_prop { |
| 2419 | uint16_t type == 3; |
| 2420 | uint16_t length; |
| 2421 | list(of_uint8_t) next_table_ids; |
| 2422 | }; |
| 2423 | |
| 2424 | /* OFPTFPT_WRITE_ACTIONS property */ |
| 2425 | struct of_table_feature_prop_write_actions : of_table_feature_prop { |
| 2426 | uint16_t type == 4; |
| 2427 | uint16_t length; |
| 2428 | list(of_action_id_t) action_ids; |
| 2429 | }; |
| 2430 | |
| 2431 | /* FPTFPT_WRITE_ACTIONS_MISS property */ |
| 2432 | struct of_table_feature_prop_write_actions_miss : of_table_feature_prop { |
| 2433 | uint16_t type == 5; |
| 2434 | uint16_t length; |
| 2435 | list(of_action_id_t) action_ids; |
| 2436 | }; |
| 2437 | |
| 2438 | /* OFPTFPT_APPLY_ACTIONS property */ |
| 2439 | struct of_table_feature_prop_apply_actions : of_table_feature_prop { |
| 2440 | uint16_t type == 6; |
| 2441 | uint16_t length; |
| 2442 | list(of_action_id_t) action_ids; |
| 2443 | }; |
| 2444 | |
| 2445 | /* OFPTFPT_APPLY_ACTIONS_MISS property */ |
| 2446 | struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop { |
| 2447 | uint16_t type == 7; |
| 2448 | uint16_t length; |
| 2449 | list(of_action_id_t) action_ids; |
| 2450 | }; |
| 2451 | |
| 2452 | /* Action ID */ |
| 2453 | struct of_action_id { |
| 2454 | uint16_t type; |
| 2455 | uint16_t len; |
| 2456 | of_octets_t exp_data; |
| 2457 | }; |
| 2458 | |
| 2459 | /* OFPTFPT_MATCH property */ |
| 2460 | struct of_table_feature_prop_match : of_table_feature_prop { |
| 2461 | uint16_t type == 8; |
| 2462 | uint16_t length; |
| 2463 | list(of_uint32_t) oxm_ids; |
| 2464 | }; |
| 2465 | |
| 2466 | /* OFPTFPT_WILDCARDS property */ |
| 2467 | struct of_table_feature_prop_wildcards : of_table_feature_prop { |
| 2468 | uint16_t type == 10; |
| 2469 | uint16_t length; |
| 2470 | list(of_uint32_t) oxm_ids; |
| 2471 | }; |
| 2472 | |
| 2473 | /* OFPTFPT_WRITE_SETFIELD property */ |
| 2474 | struct of_table_feature_prop_write_setfield : of_table_feature_prop { |
| 2475 | uint16_t type == 12; |
| 2476 | uint16_t length; |
| 2477 | list(of_uint32_t) oxm_ids; |
| 2478 | }; |
| 2479 | |
| 2480 | /* OFPTFPT_WRITE_SETFIELD_MISS property */ |
| 2481 | struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop { |
| 2482 | uint16_t type == 13; |
| 2483 | uint16_t length; |
| 2484 | list(of_uint32_t) oxm_ids; |
| 2485 | }; |
| 2486 | |
| 2487 | /* OFPTFPT_APPLY_SETFIELD property */ |
| 2488 | struct of_table_feature_prop_apply_setfield : of_table_feature_prop { |
| 2489 | uint16_t type == 14; |
| 2490 | uint16_t length; |
| 2491 | list(of_uint32_t) oxm_ids; |
| 2492 | }; |
| 2493 | |
| 2494 | /* OFPTFPT_APPLY_SETFIELD_MISS property */ |
| 2495 | struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop { |
| 2496 | uint16_t type == 15; |
| 2497 | uint16_t length; |
| 2498 | list(of_uint32_t) oxm_ids; |
| 2499 | }; |
| 2500 | |
| 2501 | /* OFPTFPT_WRITE_COPYFIELD property */ |
| 2502 | struct of_table_feature_prop_write_copyfield : of_table_feature_prop { |
| 2503 | uint16_t type == 18; |
| 2504 | uint16_t length; |
| 2505 | list(of_uint32_t) oxm_ids; |
| 2506 | }; |
| 2507 | |
| 2508 | /* OFPTFPT_WRITE_COPYFIELD_MISS property */ |
| 2509 | struct of_table_feature_prop_write_copyfield_miss : of_table_feature_prop { |
| 2510 | uint16_t type == 19; |
| 2511 | uint16_t length; |
| 2512 | list(of_uint32_t) oxm_ids; |
| 2513 | }; |
| 2514 | |
| 2515 | /* OFPTFPT_APPLY_COPYFIELD property */ |
| 2516 | struct of_table_feature_prop_apply_copyfield : of_table_feature_prop { |
| 2517 | uint16_t type == 20; |
| 2518 | uint16_t length; |
| 2519 | list(of_uint32_t) oxm_ids; |
| 2520 | }; |
| 2521 | |
| 2522 | /* OFPTFPT_APPLY_COPYFIELD_MISS property */ |
| 2523 | struct of_table_feature_prop_apply_copyfield_miss : of_table_feature_prop { |
| 2524 | uint16_t type == 21; |
| 2525 | uint16_t length; |
| 2526 | list(of_uint32_t) oxm_ids; |
| 2527 | }; |
| 2528 | |
| 2529 | /* OFPTFPT_PACKET_TYPES property */ |
| 2530 | struct of_table_feature_prop_oxm_values { |
| 2531 | uint16_t type == 22; |
| 2532 | uint16_t length; |
| 2533 | of_octets_t oxm_values; |
| 2534 | }; |
| 2535 | |
| 2536 | /* OFPTFPT_EXPERIMENTER property */ |
| 2537 | struct of_table_feature_prop_experimenter : of_table_feature_prop { |
| 2538 | uint16_t type == 65534; |
| 2539 | uint16_t length; |
| 2540 | uint32_t experimenter == ?; |
| 2541 | uint32_t subtype; |
| 2542 | }; |
| 2543 | |
| 2544 | /* OFPTFPT_EXPERIMENTER_MISS property */ |
| 2545 | struct of_table_feature_prop_experimenter_miss : of_table_feature_prop { |
| 2546 | uint16_t type == 65535; |
| 2547 | uint16_t length; |
| 2548 | uint32_t experimenter == ?; |
| 2549 | uint32_t subtype; |
| 2550 | }; |
| 2551 | |
| 2552 | /* |
| 2553 | * Not supporting the flow monitor multipart messages. This message is |
| 2554 | * poorly designed because it includes a variable length match inside a |
| 2555 | * struct (ofp_flow_monitor_request) with no explicit length member. |
| 2556 | * I'm not writing the special case code to figure out the total length. |
| 2557 | */ |
| 2558 | |
| 2559 | |
| 2560 | /* Send packet (controller -> datapath). */ |
| 2561 | struct of_packet_out : of_header { |
| 2562 | uint8_t version; |
| 2563 | uint8_t type == 13; |
| 2564 | uint16_t length; |
| 2565 | uint32_t xid; |
| 2566 | uint32_t buffer_id; |
| 2567 | uint16_t actions_len == length(actions); |
| 2568 | pad(2); |
| 2569 | of_match_t match; |
| 2570 | list(of_action_t) actions; |
| 2571 | of_octets_t data; |
| 2572 | }; |
| 2573 | |
| 2574 | /* Barrier message request */ |
| 2575 | struct of_barrier_request : of_header { |
| 2576 | uint8_t version; |
| 2577 | uint8_t type == 20; |
| 2578 | uint16_t length; |
| 2579 | uint32_t xid; |
| 2580 | }; |
| 2581 | |
| 2582 | /* Barrier message request */ |
| 2583 | struct of_barrier_reply : of_header { |
| 2584 | uint8_t version; |
| 2585 | uint8_t type == 21; |
| 2586 | uint16_t length; |
| 2587 | uint32_t xid; |
| 2588 | }; |
| 2589 | |
| 2590 | /* Role request */ |
| 2591 | struct of_role_request : of_header { |
| 2592 | uint8_t version; |
| 2593 | uint8_t type == 24; |
| 2594 | uint16_t length; |
| 2595 | uint32_t xid; |
| 2596 | enum ofp_controller_role role; |
| 2597 | uint16_t short_id; |
| 2598 | pad(2); |
| 2599 | uint64_t generation_id; |
| 2600 | }; |
| 2601 | |
| 2602 | /* Role reply */ |
| 2603 | struct of_role_reply : of_header { |
| 2604 | uint8_t version; |
| 2605 | uint8_t type == 25; |
| 2606 | uint16_t length; |
| 2607 | uint32_t xid; |
| 2608 | enum ofp_controller_role role; |
| 2609 | uint16_t short_id; |
| 2610 | pad(2); |
| 2611 | uint64_t generation_id; |
| 2612 | }; |
| 2613 | |
| 2614 | /* Bundle control message */ |
| 2615 | struct of_bundle_ctrl_msg : of_header { |
| 2616 | uint8_t version; |
| 2617 | uint8_t type == 33; |
| 2618 | uint16_t length; |
| 2619 | uint32_t xid; |
| 2620 | uint32_t bundle_id; |
| 2621 | enum ofp_bundle_ctrl_type bundle_ctrl_type; |
| 2622 | enum ofp_bundle_flags flags; |
| 2623 | list(of_bundle_prop_t) properties; |
| 2624 | }; |
| 2625 | |
| 2626 | /* Bundle add message */ |
| 2627 | struct of_bundle_add_msg : of_header { |
| 2628 | uint8_t version; |
| 2629 | uint8_t type == 34; |
| 2630 | uint16_t length; |
| 2631 | uint32_t xid; |
| 2632 | uint32_t bundle_id; |
| 2633 | pad(1); |
| 2634 | enum ofp_bundle_flags flags; |
| 2635 | of_header_t message; |
| 2636 | list(of_bundle_prop_t) properties; |
| 2637 | }; |
| 2638 | |
| 2639 | /* Bundle property types. */ |
| 2640 | struct of_bundle_prop { |
| 2641 | uint16_t type == ?; |
| 2642 | uint16_t length; |
| 2643 | }; |
| 2644 | |
| 2645 | /* Bundle time property. */ |
| 2646 | struct of_bundle_prop_time : of_bundle_prop { |
| 2647 | uint16_t type == 1; |
| 2648 | uint16_t length; |
| 2649 | pad(4); |
| 2650 | list(of_time_t) scheduled_time; |
| 2651 | }; |
| 2652 | |
| 2653 | /* Experimenter bundle property */ |
| 2654 | struct of_bundle_prop_experimenter : of_bundle_prop { |
| 2655 | uint16_t type == 65535; |
| 2656 | uint16_t length; |
| 2657 | uint32_t experimenter == ?; |
| 2658 | uint32_t exp_type; |
| 2659 | }; |
| 2660 | |
| 2661 | /* Time Format. */ |
| 2662 | struct of_time { |
| 2663 | uint64_t seconds; |
| 2664 | uint32_t nanoseconds; |
| 2665 | pad(4); |
| 2666 | }; |
| 2667 | |
| 2668 | /* Common header for all async config Properties */ |
| 2669 | struct of_async_config_prop { |
| 2670 | uint16_t type == ?; |
| 2671 | uint16_t length; |
| 2672 | }; |
| 2673 | |
| 2674 | /* OFPACPT_PACKET_IN_SLAVE property */ |
| 2675 | struct of_async_config_prop_packet_in_slave : of_async_config_prop { |
| 2676 | uint16_t type == 0; |
| 2677 | uint16_t length; |
| 2678 | uint32_t mask; |
| 2679 | }; |
| 2680 | |
| 2681 | /* OFPACPT_PACKET_IN_MASTER property */ |
| 2682 | struct of_async_config_prop_packet_in_master : of_async_config_prop { |
| 2683 | uint16_t type == 1; |
| 2684 | uint16_t length; |
| 2685 | uint32_t mask; |
| 2686 | }; |
| 2687 | |
| 2688 | /* OFPACPT_PORT_STATUS_SLAVE property */ |
| 2689 | struct of_async_config_prop_port_status_slave : of_async_config_prop { |
| 2690 | uint16_t type == 2; |
| 2691 | uint16_t length; |
| 2692 | uint32_t mask; |
| 2693 | }; |
| 2694 | |
| 2695 | /* OFPACPT_PORT_STATUS_MASTER property */ |
| 2696 | struct of_async_config_prop_port_status_master : of_async_config_prop { |
| 2697 | uint16_t type == 3; |
| 2698 | uint16_t length; |
| 2699 | uint32_t mask; |
| 2700 | }; |
| 2701 | |
| 2702 | /* OFPACPT_FLOW_REMOVED_SLAVE property */ |
| 2703 | struct of_async_config_prop_flow_removed_slave : of_async_config_prop { |
| 2704 | uint16_t type == 4; |
| 2705 | uint16_t length; |
| 2706 | uint32_t mask; |
| 2707 | }; |
| 2708 | |
| 2709 | /* OFPACPT_FLOW_REMOVED_MASTER property */ |
| 2710 | struct of_async_config_prop_flow_removed_master : of_async_config_prop { |
| 2711 | uint16_t type == 5; |
| 2712 | uint16_t length; |
| 2713 | uint32_t mask; |
| 2714 | }; |
| 2715 | |
| 2716 | /* OFPACPT_ROLE_STATUS_SLAVE property */ |
| 2717 | struct of_async_config_prop_role_status_slave : of_async_config_prop { |
| 2718 | uint16_t type == 6; |
| 2719 | uint16_t length; |
| 2720 | uint32_t mask; |
| 2721 | }; |
| 2722 | |
| 2723 | /* OFPACPT_ROLE_STATUS_MASTER property */ |
| 2724 | struct of_async_config_prop_role_status_master : of_async_config_prop { |
| 2725 | uint16_t type == 7; |
| 2726 | uint16_t length; |
| 2727 | uint32_t mask; |
| 2728 | }; |
| 2729 | |
| 2730 | /* OFPACPT_TABLE_STATUS_SLAVE property */ |
| 2731 | struct of_async_config_prop_table_status_slave : of_async_config_prop { |
| 2732 | uint16_t type == 8; |
| 2733 | uint16_t length; |
| 2734 | uint32_t mask; |
| 2735 | }; |
| 2736 | |
| 2737 | /* OFPACPT_TABLE_STATUS_MASTER property */ |
| 2738 | struct of_async_config_prop_table_status_master : of_async_config_prop { |
| 2739 | uint16_t type == 9; |
| 2740 | uint16_t length; |
| 2741 | uint32_t mask; |
| 2742 | }; |
| 2743 | |
| 2744 | /* OFPACPT_REQUESTFORWARD_SLAVE property */ |
| 2745 | struct of_async_config_prop_requestforward_slave : of_async_config_prop { |
| 2746 | uint16_t type == 10; |
| 2747 | uint16_t length; |
| 2748 | uint32_t mask; |
| 2749 | }; |
| 2750 | |
| 2751 | /* OFPACPT_REQUESTFORWARD_MASTER property */ |
| 2752 | struct of_async_config_prop_requestforward_master : of_async_config_prop { |
| 2753 | uint16_t type == 11; |
| 2754 | uint16_t length; |
| 2755 | uint32_t mask; |
| 2756 | }; |
| 2757 | |
| 2758 | /* OFPACPT_FLOW_STATS_SLAVE property */ |
| 2759 | struct of_async_config_prop_flow_stats_slave : of_async_config_prop { |
| 2760 | uint16_t type == 12; |
| 2761 | uint16_t length; |
| 2762 | uint32_t mask; |
| 2763 | }; |
| 2764 | |
| 2765 | /* OFPACPT_FLOW_STATS_MASTER property */ |
| 2766 | struct of_async_config_prop_flow_stats_master : of_async_config_prop { |
| 2767 | uint16_t type == 13; |
| 2768 | uint16_t length; |
| 2769 | uint32_t mask; |
| 2770 | }; |
| 2771 | |
| 2772 | /* OFPACPT_CONT_STATUS_SLAVE property */ |
| 2773 | struct of_async_config_prop_cont_status_slave : of_async_config_prop { |
| 2774 | uint16_t type == 14; |
| 2775 | uint16_t length; |
| 2776 | uint32_t mask; |
| 2777 | }; |
| 2778 | |
| 2779 | /* OFPACPT_CONT_STATUS_MASTER property */ |
| 2780 | struct of_async_config_prop_cont_status_master : of_async_config_prop { |
| 2781 | uint16_t type == 15; |
| 2782 | uint16_t length; |
| 2783 | uint32_t mask; |
| 2784 | }; |
| 2785 | |
| 2786 | /* OFPTFPT_EXPERIMENTER_SLAVE property */ |
| 2787 | struct of_async_config_prop_experimenter_slave : of_async_config_prop { |
| 2788 | uint16_t type == 0xfffe; |
| 2789 | uint16_t length; |
| 2790 | //uint32_t experimenter == ?; |
| 2791 | //uint32_t exp_type; |
| 2792 | }; |
| 2793 | |
| 2794 | /* OFPTFPT_EXPERIMENTER_MASTER property */ |
| 2795 | struct of_async_config_prop_experimenter_master : of_async_config_prop { |
| 2796 | uint16_t type == 0xffff; |
| 2797 | uint16_t length; |
| 2798 | //uint32_t experimenter == ?; |
| 2799 | //uint32_t exp_type; |
| 2800 | }; |
| 2801 | |
| 2802 | /* Packet received on port (datapath -> controller). */ |
| 2803 | struct of_packet_in : of_header { |
| 2804 | uint8_t version; |
| 2805 | uint8_t type == 10; |
| 2806 | uint16_t length; |
| 2807 | uint32_t xid; |
| 2808 | uint32_t buffer_id; |
| 2809 | uint16_t total_len; |
| 2810 | uint8_t reason; |
| 2811 | uint8_t table_id; |
| 2812 | uint64_t cookie; |
| 2813 | of_match_t match; |
| 2814 | pad(2); |
| 2815 | of_octets_t data; |
| 2816 | }; |
| 2817 | |
| 2818 | /* Flow removed (datapath -> controller). */ |
| 2819 | struct of_flow_removed : of_header { |
| 2820 | uint8_t version; |
| 2821 | uint8_t type == 11; |
| 2822 | uint16_t length; |
| 2823 | uint32_t xid; |
| 2824 | uint8_t table_id; |
| 2825 | enum ofp_flow_removed_reason reason; |
| 2826 | uint16_t priority; |
| 2827 | uint16_t idle_timeout; |
| 2828 | uint16_t hard_timeout; |
| 2829 | uint64_t cookie; |
| 2830 | of_match_t match; |
| 2831 | of_stat_t stats; |
| 2832 | }; |
| 2833 | |
| 2834 | /* A physical port has changed in the datapath */ |
| 2835 | struct of_port_status : of_header { |
| 2836 | uint8_t version; |
| 2837 | uint8_t type == 12; |
| 2838 | uint16_t length; |
| 2839 | uint32_t xid; |
| 2840 | enum ofp_port_reason reason; |
| 2841 | pad(7); |
| 2842 | of_port_desc_t desc; |
| 2843 | }; |
| 2844 | |
| 2845 | /* Role status event message. */ |
| 2846 | struct of_role_status : of_header { |
| 2847 | uint8_t version; |
| 2848 | uint8_t type == 30; |
| 2849 | uint16_t length; |
| 2850 | uint32_t xid; |
| 2851 | enum ofp_controller_role role; |
| 2852 | enum ofp_controller_role_reason reason; |
| 2853 | pad(3); |
| 2854 | uint64_t generation_id; |
| 2855 | list(of_role_prop_t) properties; |
| 2856 | }; |
| 2857 | |
| 2858 | /* Common header for all Role Properties */ |
| 2859 | struct of_role_prop { |
| 2860 | uint16_t type == ?; |
| 2861 | uint16_t length; |
| 2862 | }; |
| 2863 | |
| 2864 | /* Experimenter role property */ |
| 2865 | struct of_role_prop_experimenter : of_role_prop { |
| 2866 | uint16_t type == 0xffff; |
| 2867 | uint16_t length; |
| 2868 | uint32_t experimenter == ?; |
| 2869 | uint32_t exp_type; |
| 2870 | }; |
| 2871 | |
| 2872 | /* Table descriotion */ |
| 2873 | struct of_table_desc { |
| 2874 | uint16_t length; |
| 2875 | uint8_t table_id; |
| 2876 | pad(1); |
| 2877 | enum ofp_table_config config; |
| 2878 | list(of_table_mod_prop_t) properties; |
| 2879 | }; |
| 2880 | |
| 2881 | |
| 2882 | /* A table config has changed in the datapath */ |
| 2883 | struct of_table_status : of_header { |
| 2884 | uint8_t version; |
| 2885 | uint8_t type == 31; |
| 2886 | uint16_t length; |
| 2887 | uint32_t xid; |
| 2888 | enum ofp_table_reason reason; |
| 2889 | pad(7); |
| 2890 | of_table_desc_t table; |
| 2891 | }; |
| 2892 | |
| 2893 | /* Group/Meter request forwarding. */ |
| 2894 | struct of_requestforward : of_header { |
| 2895 | uint8_t version; |
| 2896 | uint8_t type == 32; |
| 2897 | uint16_t length; |
| 2898 | uint32_t xid; |
| 2899 | of_header_t request; |
| 2900 | }; |
| 2901 | |
| 2902 | /* OFPT_HELLO. This message includes zero or more hello elements having |
| 2903 | * variable size. Unknown elements types must be ignored/skipped, to allow |
| 2904 | * for future extensions. */ |
| 2905 | struct of_hello : of_header { |
| 2906 | uint8_t version; |
| 2907 | uint8_t type == 0; |
| 2908 | uint16_t length; |
| 2909 | uint32_t xid; |
| 2910 | list(of_hello_elem_t) elements; |
| 2911 | }; |
| 2912 | |
| 2913 | /* Common header for all Hello Elements */ |
| 2914 | struct of_hello_elem { |
| 2915 | uint16_t type == ?; |
| 2916 | uint16_t length; |
| 2917 | }; |
| 2918 | |
| 2919 | /* Version bitmap Hello Element */ |
| 2920 | struct of_hello_elem_versionbitmap : of_hello_elem { |
| 2921 | uint16_t type == 1; |
| 2922 | uint16_t length; |
| 2923 | list(of_uint32_t) bitmaps; |
| 2924 | }; |
| 2925 | |
| 2926 | /* ECHO REQUEST */ |
| 2927 | struct of_echo_request : of_header { |
| 2928 | uint8_t version; |
| 2929 | uint8_t type == 2; |
| 2930 | uint16_t length; |
| 2931 | uint32_t xid; |
| 2932 | of_octets_t data; |
| 2933 | }; |
| 2934 | |
| 2935 | /* ECHO REPLY */ |
| 2936 | struct of_echo_reply : of_header { |
| 2937 | uint8_t version; |
| 2938 | uint8_t type == 3; |
| 2939 | uint16_t length; |
| 2940 | uint32_t xid; |
| 2941 | of_octets_t data; |
| 2942 | }; |
| 2943 | |
| 2944 | /* OFPT_ERROR: Error message. */ |
| 2945 | struct of_error_msg : of_header { |
| 2946 | uint8_t version; |
| 2947 | uint8_t type == 1; |
| 2948 | uint16_t length; |
| 2949 | uint32_t xid; |
| 2950 | uint16_t err_type == ?; |
| 2951 | }; |
| 2952 | |
| 2953 | /* Experimenter extension message. */ |
| 2954 | struct of_experimenter : of_header { |
| 2955 | uint8_t version; |
| 2956 | uint8_t type == 4; |
| 2957 | uint16_t length; |
| 2958 | uint32_t xid; |
| 2959 | uint32_t experimenter == ?; |
| 2960 | uint32_t subtype; |
| 2961 | of_octets_t data; |
| 2962 | }; |
| 2963 | |
| 2964 | /* Features Request */ |
| 2965 | struct of_features_request : of_header { |
| 2966 | uint8_t version; |
| 2967 | uint8_t type == 5; |
| 2968 | uint16_t length; |
| 2969 | uint32_t xid; |
| 2970 | }; |
| 2971 | |
| 2972 | /* Features Reply (ofp_switch_features) */ |
| 2973 | struct of_features_reply : of_header { |
| 2974 | uint8_t version; |
| 2975 | uint8_t type == 6; |
| 2976 | uint16_t length; |
| 2977 | uint32_t xid; |
| 2978 | uint64_t datapath_id; |
| 2979 | uint32_t n_buffers; |
| 2980 | uint8_t n_tables; |
| 2981 | uint8_t auxiliary_id; |
| 2982 | pad(2); |
| 2983 | enum ofp_capabilities capabilities; |
| 2984 | uint32_t reserved; |
| 2985 | }; |
| 2986 | |
| 2987 | /* Get Configuration Message */ |
| 2988 | struct of_get_config_request : of_header { |
| 2989 | uint8_t version; |
| 2990 | uint8_t type == 7; |
| 2991 | uint16_t length; |
| 2992 | uint32_t xid; |
| 2993 | }; |
| 2994 | |
| 2995 | /* Get Configuration Reply (ofp_switch_config) */ |
| 2996 | struct of_get_config_reply : of_header { |
| 2997 | uint8_t version; |
| 2998 | uint8_t type == 8; |
| 2999 | uint16_t length; |
| 3000 | uint32_t xid; |
| 3001 | enum ofp_config_flags flags; |
| 3002 | uint16_t miss_send_len; |
| 3003 | }; |
| 3004 | |
| 3005 | /* Set Configuration Message */ |
| 3006 | struct of_set_config : of_header { |
| 3007 | uint8_t version; |
| 3008 | uint8_t type == 9; |
| 3009 | uint16_t length; |
| 3010 | uint32_t xid; |
| 3011 | enum ofp_config_flags flags; |
| 3012 | uint16_t miss_send_len; |
| 3013 | }; |
| 3014 | |
| 3015 | /* Flow Add Message */ |
| 3016 | struct of_flow_add : of_flow_mod { |
| 3017 | uint8_t version; |
| 3018 | uint8_t type == 14; |
| 3019 | uint16_t length; |
| 3020 | uint32_t xid; |
| 3021 | uint64_t cookie; |
| 3022 | uint64_t cookie_mask; |
| 3023 | uint8_t table_id; |
| 3024 | of_fm_cmd_t _command == 0; |
| 3025 | uint16_t idle_timeout; |
| 3026 | uint16_t hard_timeout; |
| 3027 | uint16_t priority; |
| 3028 | uint32_t buffer_id; |
| 3029 | of_port_no_t out_port; |
| 3030 | uint32_t out_group; |
| 3031 | enum ofp_flow_mod_flags flags; |
| 3032 | uint16_t importance; |
| 3033 | of_match_t match; |
| 3034 | list(of_instruction_t) instructions; |
| 3035 | }; |
| 3036 | |
| 3037 | /* Flow Modify Message */ |
| 3038 | struct of_flow_modify : of_flow_mod { |
| 3039 | uint8_t version; |
| 3040 | uint8_t type == 14; |
| 3041 | uint16_t length; |
| 3042 | uint32_t xid; |
| 3043 | uint64_t cookie; |
| 3044 | uint64_t cookie_mask; |
| 3045 | uint8_t table_id; |
| 3046 | of_fm_cmd_t _command == 1; |
| 3047 | uint16_t idle_timeout; |
| 3048 | uint16_t hard_timeout; |
| 3049 | uint16_t priority; |
| 3050 | uint32_t buffer_id; |
| 3051 | of_port_no_t out_port; |
| 3052 | uint32_t out_group; |
| 3053 | enum ofp_flow_mod_flags flags; |
| 3054 | uint16_t importance; |
| 3055 | of_match_t match; |
| 3056 | list(of_instruction_t) instructions; |
| 3057 | }; |
| 3058 | |
| 3059 | /* Flow Modify Strict Message */ |
| 3060 | struct of_flow_modify_strict : of_flow_mod { |
| 3061 | uint8_t version; |
| 3062 | uint8_t type == 14; |
| 3063 | uint16_t length; |
| 3064 | uint32_t xid; |
| 3065 | uint64_t cookie; |
| 3066 | uint64_t cookie_mask; |
| 3067 | uint8_t table_id; |
| 3068 | of_fm_cmd_t _command == 2; |
| 3069 | uint16_t idle_timeout; |
| 3070 | uint16_t hard_timeout; |
| 3071 | uint16_t priority; |
| 3072 | uint32_t buffer_id; |
| 3073 | of_port_no_t out_port; |
| 3074 | uint32_t out_group; |
| 3075 | enum ofp_flow_mod_flags flags; |
| 3076 | uint16_t importance; |
| 3077 | of_match_t match; |
| 3078 | list(of_instruction_t) instructions; |
| 3079 | }; |
| 3080 | |
| 3081 | /* Flow Delete Message */ |
| 3082 | struct of_flow_delete : of_flow_mod { |
| 3083 | uint8_t version; |
| 3084 | uint8_t type == 14; |
| 3085 | uint16_t length; |
| 3086 | uint32_t xid; |
| 3087 | uint64_t cookie; |
| 3088 | uint64_t cookie_mask; |
| 3089 | uint8_t table_id; |
| 3090 | of_fm_cmd_t _command == 3; |
| 3091 | uint16_t idle_timeout; |
| 3092 | uint16_t hard_timeout; |
| 3093 | uint16_t priority; |
| 3094 | uint32_t buffer_id; |
| 3095 | of_port_no_t out_port; |
| 3096 | uint32_t out_group; |
| 3097 | enum ofp_flow_mod_flags flags; |
| 3098 | uint16_t importance; |
| 3099 | of_match_t match; |
| 3100 | list(of_instruction_t) instructions; |
| 3101 | }; |
| 3102 | |
| 3103 | /* Flow Delete Strict Message */ |
| 3104 | struct of_flow_delete_strict : of_flow_mod { |
| 3105 | uint8_t version; |
| 3106 | uint8_t type == 14; |
| 3107 | uint16_t length; |
| 3108 | uint32_t xid; |
| 3109 | uint64_t cookie; |
| 3110 | uint64_t cookie_mask; |
| 3111 | uint8_t table_id; |
| 3112 | of_fm_cmd_t _command == 4; |
| 3113 | uint16_t idle_timeout; |
| 3114 | uint16_t hard_timeout; |
| 3115 | uint16_t priority; |
| 3116 | uint32_t buffer_id; |
| 3117 | of_port_no_t out_port; |
| 3118 | uint32_t out_group; |
| 3119 | enum ofp_flow_mod_flags flags; |
| 3120 | uint16_t importance; |
| 3121 | of_match_t match; |
| 3122 | list(of_instruction_t) instructions; |
| 3123 | }; |
| 3124 | |
| 3125 | /* Group Add message */ |
| 3126 | struct of_group_add : of_group_mod { |
| 3127 | uint8_t version; |
| 3128 | uint8_t type == 15; |
| 3129 | uint16_t length; |
| 3130 | uint32_t xid; |
| 3131 | enum ofp_group_mod_command command == 0; |
| 3132 | enum ofp_group_type group_type; |
| 3133 | pad(1); |
| 3134 | uint32_t group_id; |
| 3135 | uint16_t bucket_array_len == length(buckets); |
| 3136 | pad(2); |
| 3137 | enum ofp_group_bucket command_bucket_id; |
| 3138 | list(of_bucket_t) buckets; |
| 3139 | list(of_group_prop_t) properties; |
| 3140 | }; |
| 3141 | |
| 3142 | /* Group Modify Message */ |
| 3143 | struct of_group_modify : of_group_mod { |
| 3144 | uint8_t version; |
| 3145 | uint8_t type == 15; |
| 3146 | uint16_t length; |
| 3147 | uint32_t xid; |
| 3148 | enum ofp_group_mod_command command == 1; |
| 3149 | enum ofp_group_type group_type; |
| 3150 | pad(1); |
| 3151 | uint32_t group_id; |
| 3152 | uint16_t bucket_array_len == length(buckets); |
| 3153 | pad(2); |
| 3154 | enum ofp_group_bucket command_bucket_id; |
| 3155 | list(of_bucket_t) buckets; |
| 3156 | list(of_group_prop_t) properties; |
| 3157 | }; |
| 3158 | |
| 3159 | /* Group Delete Message */ |
| 3160 | struct of_group_delete : of_group_mod { |
| 3161 | uint8_t version; |
| 3162 | uint8_t type == 15; |
| 3163 | uint16_t length; |
| 3164 | uint32_t xid; |
| 3165 | enum ofp_group_mod_command command == 2; |
| 3166 | enum ofp_group_type group_type; |
| 3167 | pad(1); |
| 3168 | uint32_t group_id; |
| 3169 | uint16_t bucket_array_len == length(buckets); |
| 3170 | pad(2); |
| 3171 | enum ofp_group_bucket command_bucket_id; |
| 3172 | list(of_bucket_t) buckets; |
| 3173 | list(of_group_prop_t) properties; |
| 3174 | }; |
| 3175 | |
| 3176 | /* Group Insert Bucket Message */ |
| 3177 | struct of_group_insert_bucket : of_group_mod { |
| 3178 | uint8_t version; |
| 3179 | uint8_t type == 15; |
| 3180 | uint16_t length; |
| 3181 | uint32_t xid; |
| 3182 | enum ofp_group_mod_command command == 3; |
| 3183 | enum ofp_group_type group_type; |
| 3184 | pad(1); |
| 3185 | uint32_t group_id; |
| 3186 | uint16_t bucket_array_len == length(buckets); |
| 3187 | pad(2); |
| 3188 | enum ofp_group_bucket command_bucket_id; |
| 3189 | list(of_bucket_t) buckets; |
| 3190 | list(of_group_prop_t) properties; |
| 3191 | }; |
| 3192 | |
| 3193 | /* Group Remove Bucket Message */ |
| 3194 | struct of_group_remove_bucket : of_group_mod { |
| 3195 | uint8_t version; |
| 3196 | uint8_t type == 15; |
| 3197 | uint16_t length; |
| 3198 | uint32_t xid; |
| 3199 | enum ofp_group_mod_command command == 5; |
| 3200 | enum ofp_group_type group_type; |
| 3201 | pad(1); |
| 3202 | uint32_t group_id; |
| 3203 | uint16_t bucket_array_len == length(buckets); |
| 3204 | pad(2); |
| 3205 | enum ofp_group_bucket command_bucket_id; |
| 3206 | list(of_bucket_t) buckets; |
| 3207 | list(of_group_prop_t) properties; |
| 3208 | }; |
| 3209 | |
| 3210 | /* Hello Failed Error Message */ |
| 3211 | struct of_hello_failed_error_msg : of_error_msg { |
| 3212 | uint8_t version; |
| 3213 | uint8_t type == 1; |
| 3214 | uint16_t length; |
| 3215 | uint32_t xid; |
| 3216 | uint16_t err_type == 0; |
| 3217 | enum ofp_hello_failed_code code; |
| 3218 | of_octets_t data; |
| 3219 | }; |
| 3220 | |
| 3221 | /* Bad Request Error Message */ |
| 3222 | struct of_bad_request_error_msg : of_error_msg { |
| 3223 | uint8_t version; |
| 3224 | uint8_t type == 1; |
| 3225 | uint16_t length; |
| 3226 | uint32_t xid; |
| 3227 | uint16_t err_type == 1; |
| 3228 | enum ofp_bad_request_code code; |
| 3229 | of_octets_t data; |
| 3230 | }; |
| 3231 | |
| 3232 | /* Bad Action Error Message */ |
| 3233 | struct of_bad_action_error_msg : of_error_msg { |
| 3234 | uint8_t version; |
| 3235 | uint8_t type == 1; |
| 3236 | uint16_t length; |
| 3237 | uint32_t xid; |
| 3238 | uint16_t err_type == 2; |
| 3239 | enum ofp_bad_action_code code; |
| 3240 | of_octets_t data; |
| 3241 | }; |
| 3242 | |
| 3243 | /* Bad Instruction Error Message */ |
| 3244 | struct of_bad_instruction_error_msg : of_error_msg { |
| 3245 | uint8_t version; |
| 3246 | uint8_t type == 1; |
| 3247 | uint16_t length; |
| 3248 | uint32_t xid; |
| 3249 | uint16_t err_type == 3; |
| 3250 | enum ofp_bad_instruction_code code; |
| 3251 | of_octets_t data; |
| 3252 | }; |
| 3253 | |
| 3254 | /* Bad Match Error Message */ |
| 3255 | struct of_bad_match_error_msg : of_error_msg { |
| 3256 | uint8_t version; |
| 3257 | uint8_t type == 1; |
| 3258 | uint16_t length; |
| 3259 | uint32_t xid; |
| 3260 | uint16_t err_type == 4; |
| 3261 | enum ofp_bad_match_code code; |
| 3262 | of_octets_t data; |
| 3263 | }; |
| 3264 | |
| 3265 | /* Flow Mod Failed Error Message */ |
| 3266 | struct of_flow_mod_failed_error_msg : of_error_msg { |
| 3267 | uint8_t version; |
| 3268 | uint8_t type == 1; |
| 3269 | uint16_t length; |
| 3270 | uint32_t xid; |
| 3271 | uint16_t err_type == 5; |
| 3272 | enum ofp_flow_mod_failed_code code; |
| 3273 | of_octets_t data; |
| 3274 | }; |
| 3275 | |
| 3276 | /* Group Mod Failed Error Message */ |
| 3277 | struct of_group_mod_failed_error_msg : of_error_msg { |
| 3278 | uint8_t version; |
| 3279 | uint8_t type == 1; |
| 3280 | uint16_t length; |
| 3281 | uint32_t xid; |
| 3282 | uint16_t err_type == 6; |
| 3283 | enum ofp_group_mod_failed_code code; |
| 3284 | of_octets_t data; |
| 3285 | }; |
| 3286 | |
| 3287 | /* Port Mod Failed Error Message */ |
| 3288 | struct of_port_mod_failed_error_msg : of_error_msg { |
| 3289 | uint8_t version; |
| 3290 | uint8_t type == 1; |
| 3291 | uint16_t length; |
| 3292 | uint32_t xid; |
| 3293 | uint16_t err_type == 7; |
| 3294 | enum ofp_port_mod_failed_code code; |
| 3295 | of_octets_t data; |
| 3296 | }; |
| 3297 | |
| 3298 | /* Table Mod Failed Error Message */ |
| 3299 | struct of_table_mod_failed_error_msg : of_error_msg { |
| 3300 | uint8_t version; |
| 3301 | uint8_t type == 1; |
| 3302 | uint16_t length; |
| 3303 | uint32_t xid; |
| 3304 | uint16_t err_type == 8; |
| 3305 | enum ofp_table_mod_failed_code code; |
| 3306 | of_octets_t data; |
| 3307 | }; |
| 3308 | |
| 3309 | /* Queue Op Failed Error Message */ |
| 3310 | struct of_queue_op_failed_error_msg : of_error_msg { |
| 3311 | uint8_t version; |
| 3312 | uint8_t type == 1; |
| 3313 | uint16_t length; |
| 3314 | uint32_t xid; |
| 3315 | uint16_t err_type == 9; |
| 3316 | enum ofp_queue_op_failed_code code; |
| 3317 | of_octets_t data; |
| 3318 | }; |
| 3319 | |
| 3320 | /* Switch Config Failed Error Message */ |
| 3321 | struct of_switch_config_failed_error_msg : of_error_msg { |
| 3322 | uint8_t version; |
| 3323 | uint8_t type == 1; |
| 3324 | uint16_t length; |
| 3325 | uint32_t xid; |
| 3326 | uint16_t err_type == 10; |
| 3327 | enum ofp_switch_config_failed_code code; |
| 3328 | of_octets_t data; |
| 3329 | }; |
| 3330 | |
| 3331 | /* Role Request Failed Error Message */ |
| 3332 | struct of_role_request_failed_error_msg : of_error_msg { |
| 3333 | uint8_t version; |
| 3334 | uint8_t type == 1; |
| 3335 | uint16_t length; |
| 3336 | uint32_t xid; |
| 3337 | uint16_t err_type == 11; |
| 3338 | enum ofp_role_request_failed_code code; |
| 3339 | of_octets_t data; |
| 3340 | }; |
| 3341 | |
| 3342 | /* Meter Mod Failed Error Message */ |
| 3343 | struct of_meter_mod_failed_error_msg : of_error_msg { |
| 3344 | uint8_t version; |
| 3345 | uint8_t type == 1; |
| 3346 | uint16_t length; |
| 3347 | uint32_t xid; |
| 3348 | uint16_t err_type == 12; |
| 3349 | enum ofp_meter_mod_failed_code code; |
| 3350 | of_octets_t data; |
| 3351 | }; |
| 3352 | |
| 3353 | /* Table Features Failed Error Message */ |
| 3354 | struct of_table_features_failed_error_msg : of_error_msg { |
| 3355 | uint8_t version; |
| 3356 | uint8_t type == 1; |
| 3357 | uint16_t length; |
| 3358 | uint32_t xid; |
| 3359 | uint16_t err_type == 13; |
| 3360 | enum ofp_table_features_failed_code code; |
| 3361 | of_octets_t data; |
| 3362 | }; |
| 3363 | |
| 3364 | /* Bad Property Error Message */ |
| 3365 | struct of_bad_property_error_msg : of_error_msg { |
| 3366 | uint8_t version; |
| 3367 | uint8_t type == 1; |
| 3368 | uint16_t length; |
| 3369 | uint32_t xid; |
| 3370 | uint16_t err_type == 14; |
| 3371 | enum ofp_bad_property_code code; |
| 3372 | of_octets_t data; |
| 3373 | }; |
| 3374 | |
| 3375 | /* Async Config Failed Error Message */ |
| 3376 | struct of_async_config_failed_error_msg : of_error_msg { |
| 3377 | uint8_t version; |
| 3378 | uint8_t type == 1; |
| 3379 | uint16_t length; |
| 3380 | uint32_t xid; |
| 3381 | uint16_t err_type == 15; |
| 3382 | enum ofp_async_config_failed_code code; |
| 3383 | of_octets_t data; |
| 3384 | }; |
| 3385 | |
| 3386 | /* Flow Monitor Failed Error Message */ |
| 3387 | struct of_flow_monitor_failed_error_msg : of_error_msg { |
| 3388 | uint8_t version; |
| 3389 | uint8_t type == 1; |
| 3390 | uint16_t length; |
| 3391 | uint32_t xid; |
| 3392 | uint16_t err_type == 16; |
| 3393 | enum ofp_flow_monitor_failed_code code; |
| 3394 | of_octets_t data; |
| 3395 | }; |
| 3396 | |
| 3397 | /* Bundle Failed Error Message */ |
| 3398 | struct of_bundle_failed_error_msg : of_error_msg { |
| 3399 | uint8_t version; |
| 3400 | uint8_t type == 1; |
| 3401 | uint16_t length; |
| 3402 | uint32_t xid; |
| 3403 | uint16_t err_type == 17; |
| 3404 | enum ofp_bundle_failed_code code; |
| 3405 | of_octets_t data; |
| 3406 | }; |
| 3407 | |
| 3408 | /* Experimenter Error Message */ |
| 3409 | struct of_experimenter_error_msg : of_error_msg { |
| 3410 | uint8_t version; |
| 3411 | uint8_t type == 1; |
| 3412 | uint16_t length; |
| 3413 | uint32_t xid; |
| 3414 | uint16_t err_type == 0xffff; |
| 3415 | uint16_t subtype; |
| 3416 | uint32_t experimenter == ?; |
| 3417 | of_octets_t data; |
| 3418 | }; |
| 3419 | |
| 3420 | /* Get Async Request Message */ |
| 3421 | struct of_async_get_request : of_header { |
| 3422 | uint8_t version; |
| 3423 | uint8_t type == 26; |
| 3424 | uint16_t length; |
| 3425 | uint32_t xid; |
| 3426 | list(of_async_config_prop_t) properties; |
| 3427 | }; |
| 3428 | |
| 3429 | /* Get Async Reply Message */ |
| 3430 | struct of_async_get_reply : of_header { |
| 3431 | uint8_t version; |
| 3432 | uint8_t type == 27; |
| 3433 | uint16_t length; |
| 3434 | uint32_t xid; |
| 3435 | list(of_async_config_prop_t) properties; |
| 3436 | }; |
| 3437 | |
| 3438 | /* Set Async Message */ |
| 3439 | struct of_async_set : of_header { |
| 3440 | uint8_t version; |
| 3441 | uint8_t type == 28; |
| 3442 | uint16_t length; |
| 3443 | uint32_t xid; |
| 3444 | list(of_async_config_prop_t) properties; |
| 3445 | }; |
| 3446 | |
| 3447 | /* description statistic request */ |
| 3448 | struct of_desc_stats_request : of_stats_request { |
| 3449 | uint8_t version; |
| 3450 | uint8_t type == 18; |
| 3451 | uint16_t length; |
| 3452 | uint32_t xid; |
| 3453 | uint16_t stats_type == 0; |
| 3454 | enum ofp_stats_request_flags flags; |
| 3455 | pad(4); |
| 3456 | }; |
| 3457 | |
| 3458 | /* description statistic reply (ofp_desc) */ |
| 3459 | struct of_desc_stats_reply : of_stats_reply { |
| 3460 | uint8_t version; |
| 3461 | uint8_t type == 19; |
| 3462 | uint16_t length; |
| 3463 | uint32_t xid; |
| 3464 | uint16_t stats_type == 0; |
| 3465 | enum ofp_stats_reply_flags flags; |
| 3466 | pad(4); |
| 3467 | of_desc_str_t mfr_desc; |
| 3468 | of_desc_str_t hw_desc; |
| 3469 | of_desc_str_t sw_desc; |
| 3470 | of_serial_num_t serial_num; |
| 3471 | of_desc_str_t dp_desc; |
| 3472 | }; |
| 3473 | |
| 3474 | /* controller status statistic request */ |
| 3475 | struct of_controller_status_stats_request : of_stats_request { |
| 3476 | uint8_t version; |
| 3477 | uint8_t type == 18; |
| 3478 | uint16_t length; |
| 3479 | uint32_t xid; |
| 3480 | uint16_t stats_type == 18; |
| 3481 | enum ofp_stats_request_flags flags; |
| 3482 | pad(4); |
| 3483 | }; |
| 3484 | |
| 3485 | /*controller status statistic reply */ |
| 3486 | struct of_controller_status_stats_reply : of_stats_reply { |
| 3487 | uint8_t version; |
| 3488 | uint8_t type == 19; |
| 3489 | uint16_t length; |
| 3490 | uint32_t xid; |
| 3491 | uint16_t stats_type == 18; |
| 3492 | enum ofp_stats_reply_flags flags; |
| 3493 | pad(4); |
| 3494 | list(of_controller_status_entry_t) controller_status; |
| 3495 | }; |
| 3496 | |
| 3497 | /* Bundle features properties header */ |
| 3498 | struct of_bundle_features_prop { |
| 3499 | uint16_t type == ?; |
| 3500 | uint16_t length; |
| 3501 | }; |
| 3502 | |
| 3503 | /* Bundle features statistic request */ |
| 3504 | struct of_bundle_features_stats_request : of_stats_request { |
| 3505 | uint8_t version; |
| 3506 | uint8_t type == 18; |
| 3507 | uint16_t length; |
| 3508 | uint32_t xid; |
| 3509 | uint16_t stats_type == 19; |
| 3510 | enum ofp_stats_request_flags flags; |
| 3511 | pad(4); |
| 3512 | enum ofp_bundle_feature_flags feature_request_flags; |
| 3513 | pad(4); |
| 3514 | list(of_bundle_features_prop_t) properties; |
| 3515 | }; |
| 3516 | |
| 3517 | /*Bundle features statistic reply */ |
| 3518 | struct of_bundle_features_stats_reply : of_stats_reply { |
| 3519 | uint8_t version; |
| 3520 | uint8_t type == 19; |
| 3521 | uint16_t length; |
| 3522 | uint32_t xid; |
| 3523 | uint16_t stats_type == 19; |
| 3524 | enum ofp_stats_reply_flags flags; |
| 3525 | pad(4); |
| 3526 | enum ofp_bundle_feature_flags capabilities; |
| 3527 | pad(6); |
| 3528 | list(of_bundle_features_prop_t) properties; |
| 3529 | }; |
| 3530 | |
| 3531 | /* Bundle time features. */ |
| 3532 | struct of_bundle_features_prop_time : of_bundle_features_prop{ |
| 3533 | uint16_t type == 1; |
| 3534 | uint16_t length; |
| 3535 | pad(4); |
| 3536 | of_time_t sched_accuracy; |
| 3537 | of_time_t sched_max_future; |
| 3538 | of_time_t sched_max_past; |
| 3539 | of_time_t timestamp; |
| 3540 | }; |
| 3541 | |
| 3542 | /* Experimenter stats request */ |
| 3543 | struct of_experimenter_stats_request : of_stats_request { |
| 3544 | uint8_t version; |
| 3545 | uint8_t type == 18; |
| 3546 | uint16_t length; |
| 3547 | uint32_t xid; |
| 3548 | uint16_t stats_type == 0xffff; |
| 3549 | enum ofp_stats_request_flags flags; |
| 3550 | pad(4); |
| 3551 | uint32_t experimenter == ?; |
| 3552 | uint32_t subtype; |
| 3553 | }; |
| 3554 | |
| 3555 | /* Experimenter stats reply */ |
| 3556 | struct of_experimenter_stats_reply : of_stats_reply { |
| 3557 | uint8_t version; |
| 3558 | uint8_t type == 19; |
| 3559 | uint16_t length; |
| 3560 | uint32_t xid; |
| 3561 | uint16_t stats_type == 0xffff; |
| 3562 | enum ofp_stats_reply_flags flags; |
| 3563 | pad(4); |
| 3564 | uint32_t experimenter == ?; |
| 3565 | uint32_t subtype; |
| 3566 | }; |
| 3567 | |
| 3568 | /* ------------------------------------------- 1.3.1 Queue Structure -------------------------------------- */ |
| 3569 | struct of_queue_prop { |
| 3570 | uint16_t type == ?; |
| 3571 | uint16_t len; |
| 3572 | pad(4); |
| 3573 | }; |
| 3574 | |
| 3575 | struct of_queue_prop_min_rate : of_queue_prop { |
| 3576 | uint16_t type == 1; |
| 3577 | uint16_t len; |
| 3578 | pad(4); |
| 3579 | uint16_t rate; |
| 3580 | pad(6); |
| 3581 | }; |
| 3582 | |
| 3583 | struct of_queue_prop_max_rate : of_queue_prop { |
| 3584 | uint16_t type == 2; |
| 3585 | uint16_t len; |
| 3586 | pad(4); |
| 3587 | uint16_t rate; |
| 3588 | pad(6); |
| 3589 | }; |
| 3590 | |
| 3591 | struct of_queue_prop_experimenter : of_queue_prop { |
| 3592 | uint16_t type == 65535; |
| 3593 | uint16_t len; |
| 3594 | pad(4); |
| 3595 | uint32_t experimenter == ?; |
| 3596 | pad(4); |
| 3597 | of_octets_t data; |
| 3598 | }; |
| 3599 | |
| 3600 | struct of_packet_queue { |
| 3601 | uint32_t queue_id; |
| 3602 | of_port_no_t port; |
| 3603 | uint16_t len; |
| 3604 | pad(6); |
| 3605 | list(of_queue_prop_t) properties; |
| 3606 | }; |
| 3607 | |
| 3608 | |
| 3609 | |
| 3610 | |