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 group-mod-command {
390 /* ofp_group_mod_command */
394 description "New group.";
398 description "Modify all matching groups.";
402 description "Delete all matching groups.";
414 description "All (multicast/broadcast) group.";
418 description "Select group.";
420 enum OFPGT_INDIRECT {
422 description "Indirect group.";
426 description "Fast failover group.";
431 typedef multipart-request-flags {
433 "enum ofp_multipart_request_flags ";
435 bit OFPMPF_REQ_MORE {
436 //description "More requests to follow.";
442 typedef multipart-type {
443 /* ofp_multipart_type */
447 description "All (multicast/broadcast) group.";
452 description "Description of this OpenFlow switch.
453 The request body is empty.
454 The reply body is struct ofp_desc.";
458 description "Individual flow statistics.
459 The request body is struct ofp_flow_stats_request.
460 The reply body is an array of struct ofp_flow_stats.";
462 enum OFPMP_AGGREGATE {
464 description "Aggregate flow statistics.
465 The request body is struct ofp_aggregate_stats_request.
466 The reply body is struct ofp_aggregate_stats_reply.";
470 description "Flow table statistics.
471 The request body is empty.
472 The reply body is an array of struct ofp_table_stats.";
474 enum OFPMP_PORT_STATS {
476 description "Port statistics.
477 The request body is struct ofp_port_stats_request.
478 The reply body is an array of struct ofp_port_stats.";
482 description "Queue statistics for a port
483 The request body is struct ofp_queue_stats_request.
484 The reply body is an array of struct ofp_queue_stats";
488 description "Group counter statistics.
489 The request body is struct ofp_group_stats_request.
490 The reply is an array of struct ofp_group_stats.";
492 enum OFPMP_GROUP_DESC {
494 description "Group description.
495 The request body is empty.
496 The reply body is an array of struct ofp_group_desc.";
498 enum OFPMP_GROUP_FEATURES {
500 description "Group features.
501 The request body is empty.
502 The reply body is struct ofp_group_features.";
506 description "Meter statistics.
507 The request body is struct ofp_meter_multipart_requests.
508 The reply body is an array of struct ofp_meter_stats.";
510 enum OFPMP_METER_CONFIG {
512 description "Meter configuration.
513 The request body is struct ofp_meter_multipart_requests.
514 The reply body is an array of struct ofp_meter_config.";
516 enum OFPMP_METER_FEATURES {
518 description "Meter features.
519 The request body is empty.
520 The reply body is struct ofp_meter_features.";
522 enum OFPMP_TABLE_FEATURES {
524 description "Table features.
525 The request body is either empty or contains an array of
526 struct ofp_table_features containing the controller’s
527 desired view of the switch. If the switch is unable to
528 set the specified view an error is returned.
529 The reply body is an array of struct ofp_table_features.";
531 enum OFPMP_PORT_DESC {
533 description "Port description.
534 The request body is empty.
535 The reply body is an array of struct ofp_port.";
537 enum OFPMP_EXPERIMENTER {
538 value 65535; //0xffff
539 description "Experimenter extension.
540 The request and reply bodies begin with
541 struct ofp_experimenter_multipart_header.
542 The request and reply bodies are otherwise experimenter-defined.";
547 typedef queue-property {
548 /* ofp_queue_properties */
552 description "All (multicast/broadcast) group.";
554 enum OFPQT_MIN_RATE {
556 description "Minimum datarate guaranteed.";
558 enum OFPQT_MAX_RATE {
560 description "Maximum datarate.";
562 enum OFPQT_EXPERIMENTER {
563 value 65535; // 0xffff
564 description "Experimenter defined property.";
569 typedef controller-role {
570 /* ofp_controller_role */
572 enum OFPCR_ROLE_NOCHANGE {
574 description "Don’t change current role.";
576 enum OFPCR_ROLE_EQUAL {
578 description "Default role, full access.";
580 enum OFPCR_ROLE_MASTER {
582 description "Full access, at most one master.";
584 enum OFPCR_ROLE_SLAVE {
586 description "Read-only access.";
591 typedef packet-in-reason {
592 /* ofp_packet_in_reason */
596 description "No matching flow (table-miss flow entry). ";
600 description "Action explicitly output to controller. ";
602 enum OFPR_INVALID_TTL {
604 description "Packet has invalid TTL ";
609 typedef meter-mod-command {
610 /* ofp_meter_mod_command */
613 description "New meter. ";
616 description "Modify specified meter. ";
619 description "Delete specified meter. ";
625 typedef meter-flags {
626 /* ofp_meter_flags */
630 /* Rate value in kb/s (kilo-bit per second). */
634 /* Rate value in packet/sec. */
642 /* Collect statistics. */
647 typedef meter-band-type {
648 /* ofp_meter_band_type */
652 description "Drop packet. ";
654 enum OFPMBT_DSCP_REMARK {
656 description "Remark DSCP in the IP header. ";
658 enum OFPMBT_EXPERIMENTER {
659 value 65535; //0xFFFF
660 description "Experimenter meter band. ";
666 typedef table-config {
667 /* ofp_table_config */
669 bit OFPTC_DEPRECATED_MASK {
670 /* Deprecated bits */
676 typedef group-types {
680 /* All (multicast/broadcast) group. */
688 /* Indirect group. */
692 /* Fast failover group. */
698 typedef group-capabilities {
699 /* ofp_group_capabilities */
701 bit OFPGFC_SELECT_WEIGHT {
702 /* Support weight for select groups */
705 bit OFPGFC_SELECT_LIVENESS {
706 /* Support liveness for select groups */
709 bit OFPGFC_CHAINING {
710 /* Support chaining groups */
713 bit OFPGFC_CHAINING_CHECKS {
714 /* Check chaining for loops and delete */