1 module openflow-types {
2 namespace "urn:opendaylight:openflow:common:types";
5 revision "2013-07-31" {
6 //description "Initial model";
11 range "0..4294967040"; // 0xffffff00 See for actual value
15 typedef special-port-number {
19 //description "Send the packet out the input port. This virtual port must be explicitly used in order to send back out of the input port."
22 //value "4294967289"; // 0xfffffff9;
23 //description "Perform actions in flow table. NB: This can only be the destination port for packet-out messages."
26 //value "4294967290"; // 0xfffffffa;
27 //description "Process with normal L2/L3 switching."
30 //value "4294967291"; // 0xfffffffb;
31 //description "All physical ports except input port and those disabled by STP."
34 //value "4294967292"; // 0xfffffffc;
35 //description "All physical ports except input port."
38 //value "4294967293"; // 0xfffffffd;
39 //description "Send to controller."
42 //value "4294967294"; // 0xfffffffe;
43 //description "Local openflow port."
46 //value "4294967295"; // 0xffffffff;
47 //description "not associated with a physical port."
52 typedef any-port-number {
55 type special-port-number;
60 typedef port-features {
61 ////description "Features of ports available in datapath.";
62 //reference "ofp_port_features";
66 //description "10 Mb half-duplex rate support.";
70 //description "10 Mb full-duplex rate support.";
74 //description "100 Mb half-duplex rate support.";
78 //description "100 Mb full-duplex rate support.";
82 //description "1 Gb half-duplex rate support.";
86 //description "1 Gb full-duplex rate support.";
90 //description "10 Gb full-duplex rate support.";
94 //description "40 Gb full-duplex rate support.";
98 //description "100 Gb full-duplex rate support.";
102 //description "1 Tb full-duplex rate support.";
106 //description "Other rate, not in the list.";
110 //description "Copper medium.";
114 //description "Fiber medium.";
118 //description "Auto-negotiation.";
122 //description "Pause.";
126 //description "Asymmetric pause.";
131 typedef port-config {
133 "Flags to indicate behavior of the physical port. These flags are
134 describe the current configuration and used port_mod message
135 to configure the port's behavior.";
138 //description " Port is administratively down.";
142 //description " Drop all packets received by port.";
146 //description " Drop packets forwarded to port.";
150 //description "Do not send packet-in msgs for port.";
158 "Current state of the physical port. These are not configurable from
162 //description "No physical link present.";
166 //description "Port is blocked";
170 //description "Live for Fast Failover Group.";
176 identity match-type-base {
178 "The match type indicates the match structure (set of fields that compose the
179 match) in use. The match type is placed in the type field at the beginning
180 of all match structures.Extensions that define match types may be
181 published on the ONF wiki. Support for extensions is optional.";
184 identity standard-match-type {
186 base oft:match-type-base;
191 // base oft:match-type-base;
194 //TODO: use identityref, when generating available
198 identity instruction {
232 description "Hello Protocol failed.";
236 description "Request was not understood.";
240 description "Error in action description.";
242 enum BAD_INSTRUCTION {
244 description "Error in instruction list.";
248 description "Error in match.";
250 enum FLOW_MOD_FAILED {
252 description "Problem modifying flow entry.";
254 enum GROUP_MOD_FAILED {
256 description "Problem modifying group entry.";
258 enum PORT_MOD_FAILED {
260 description "Port mod request failed.";
262 enum TABLE_MOD_FAILED {
264 description "Table mod request failed.";
266 enum QUEUE_OP_FAILED {
268 description "Queue operation failed.";
270 enum SWITCH_CONFIG_FAILED {
272 description "Switch config request failed.";
274 enum ROLE_REQUEST_FAILED {
276 description "Controller Role request failed.";
278 enum METER_MOD_FAILED {
280 description "Error in meter.";
282 enum TABLE_FEATURES_FAILED {
284 description "Setting table features failed.";
287 value 65535; //0xffff
288 description "Experimenter error messages.";
293 typedef hello-element-type {
297 description "Bitmap of version supported.";
302 typedef switch-config-flag {
303 /* Handling of IP fragments. */
307 description "No special handling for fragments.";
309 enum OFPC_FRAG_DROP {
311 description "Drop fragments.";
313 enum OFPC_FRAG_REASM {
315 description "Reassemble (only if OFPC_IP_REASM set).";
317 enum OFPC_FRAG_MASK {
323 typedef flow-removed-reason {
326 enum OFPRR_IDLE_TIMEOUT {
328 description "Flow idle time exceeded idle_timeout.";
330 enum OFPRR_HARD_TIMEOUT {
332 description "Time exceeded hard_timeout.";
336 description "Evicted by a DELETE flow mod.";
338 enum OFPRR_GROUP_DELETE {
340 description "Group was removed.";
345 typedef port-reason {
350 description "The port was added.";
354 description "he port was removed.";
358 description "Some attribute of the port has changed.";
363 typedef flow-mod-command {
364 /* ofp_flow_mod_command */
368 description "New flow.";
372 description "Modify all matching flows.";
374 enum OFPFC_MODIFY_STRICT {
376 description "Modify entry strictly matching wildcards and priority.";
380 description "Delete all matching flows.";
382 enum OFPFC_DELETE_STRICT {
384 description "Delete entry strictly matching wildcards and priority.";
389 typedef flow-mod-flags {
390 /* ofp_flow_mod_flags */
392 bit OFPFF_SEND_FLOW_REM {
394 /* Send flow removed message when flow expires or is deleted. */
396 bit OFPFF_CHECK_OVERLAP {
398 /* Check for overlapping entries first. */
400 bit OFPFF_RESET_COUNTS {
402 /* Reset flow packet and byte counts. */
404 bit OFPFF_NO_PKT_COUNTS {
406 /* Don't keep track of packet count. */
408 bit OFPFF_NO_BYT_COUNTS {
410 /* Don't keep track of byte count. */
415 typedef group-mod-command {
416 /* ofp_group_mod_command */
420 description "New group.";
424 description "Modify all matching groups.";
428 description "Delete all matching groups.";
440 description "All (multicast/broadcast) group.";
444 description "Select group.";
446 enum OFPGT_INDIRECT {
448 description "Indirect group.";
452 description "Fast failover group.";
457 typedef multipart-request-flags {
459 "enum ofp_multipart_request_flags ";
461 bit OFPMPF_REQ_MORE {
462 //description "More requests to follow.";
468 typedef multipart-type {
469 /* ofp_multipart_type */
473 description "All (multicast/broadcast) group.";
478 description "Description of this OpenFlow switch.
479 The request body is empty.
480 The reply body is struct ofp_desc.";
484 description "Individual flow statistics.
485 The request body is struct ofp_flow_stats_request.
486 The reply body is an array of struct ofp_flow_stats.";
488 enum OFPMP_AGGREGATE {
490 description "Aggregate flow statistics.
491 The request body is struct ofp_aggregate_stats_request.
492 The reply body is struct ofp_aggregate_stats_reply.";
496 description "Flow table statistics.
497 The request body is empty.
498 The reply body is an array of struct ofp_table_stats.";
500 enum OFPMP_PORT_STATS {
502 description "Port statistics.
503 The request body is struct ofp_port_stats_request.
504 The reply body is an array of struct ofp_port_stats.";
508 description "Queue statistics for a port
509 The request body is struct ofp_queue_stats_request.
510 The reply body is an array of struct ofp_queue_stats";
514 description "Group counter statistics.
515 The request body is struct ofp_group_stats_request.
516 The reply is an array of struct ofp_group_stats.";
518 enum OFPMP_GROUP_DESC {
520 description "Group description.
521 The request body is empty.
522 The reply body is an array of struct ofp_group_desc.";
524 enum OFPMP_GROUP_FEATURES {
526 description "Group features.
527 The request body is empty.
528 The reply body is struct ofp_group_features.";
532 description "Meter statistics.
533 The request body is struct ofp_meter_multipart_requests.
534 The reply body is an array of struct ofp_meter_stats.";
536 enum OFPMP_METER_CONFIG {
538 description "Meter configuration.
539 The request body is struct ofp_meter_multipart_requests.
540 The reply body is an array of struct ofp_meter_config.";
542 enum OFPMP_METER_FEATURES {
544 description "Meter features.
545 The request body is empty.
546 The reply body is struct ofp_meter_features.";
548 enum OFPMP_TABLE_FEATURES {
550 description "Table features.
551 The request body is either empty or contains an array of
552 struct ofp_table_features containing the controller’s
553 desired view of the switch. If the switch is unable to
554 set the specified view an error is returned.
555 The reply body is an array of struct ofp_table_features.";
557 enum OFPMP_PORT_DESC {
559 description "Port description.
560 The request body is empty.
561 The reply body is an array of struct ofp_port.";
563 enum OFPMP_EXPERIMENTER {
564 value 65535; //0xffff
565 description "Experimenter extension.
566 The request and reply bodies begin with
567 struct ofp_experimenter_multipart_header.
568 The request and reply bodies are otherwise experimenter-defined.";
573 typedef queue-property {
574 /* ofp_queue_properties */
578 description "All (multicast/broadcast) group.";
580 enum OFPQT_MIN_RATE {
582 description "Minimum datarate guaranteed.";
584 enum OFPQT_MAX_RATE {
586 description "Maximum datarate.";
588 enum OFPQT_EXPERIMENTER {
589 value 65535; // 0xffff
590 description "Experimenter defined property.";
595 typedef controller-role {
596 /* ofp_controller_role */
598 enum OFPCR_ROLE_NOCHANGE {
600 description "Don’t change current role.";
602 enum OFPCR_ROLE_EQUAL {
604 description "Default role, full access.";
606 enum OFPCR_ROLE_MASTER {
608 description "Full access, at most one master.";
610 enum OFPCR_ROLE_SLAVE {
612 description "Read-only access.";
617 typedef packet-in-reason {
618 /* ofp_packet_in_reason */
622 description "No matching flow (table-miss flow entry). ";
626 description "Action explicitly output to controller. ";
628 enum OFPR_INVALID_TTL {
630 description "Packet has invalid TTL ";
635 typedef meter-mod-command {
636 /* ofp_meter_mod_command */
639 description "New meter. ";
642 description "Modify specified meter. ";
645 description "Delete specified meter. ";
651 typedef meter-flags {
652 /* ofp_meter_flags */
656 /* Rate value in kb/s (kilo-bit per second). */
660 /* Rate value in packet/sec. */
668 /* Collect statistics. */
673 typedef meter-band-type {
674 /* ofp_meter_band_type */
678 description "Drop packet. ";
680 enum OFPMBT_DSCP_REMARK {
682 description "Remark DSCP in the IP header. ";
684 enum OFPMBT_EXPERIMENTER {
685 value 65535; //0xFFFF
686 description "Experimenter meter band. ";
692 typedef table-config {
693 /* ofp_table_config */
695 bit OFPTC_DEPRECATED_MASK {
696 /* Deprecated bits */
702 typedef group-types {
706 /* All (multicast/broadcast) group. */
714 /* Indirect group. */
718 /* Fast failover group. */
724 typedef group-capabilities {
725 /* ofp_group_capabilities */
727 bit OFPGFC_SELECT_WEIGHT {
728 /* Support weight for select groups */
731 bit OFPGFC_SELECT_LIVENESS {
732 /* Support liveness for select groups */
735 bit OFPGFC_CHAINING {
736 /* Support chaining groups */
739 bit OFPGFC_CHAINING_CHECKS {
740 /* Check chaining for loops and delete */