Bug 2756 - Action model update
[openflowjava.git] / openflow-protocol-api / src / main / yang / openflow-action.yang
index 0f579fa0bbb984dc3d0f8de39034e14560e2ac02..4655d15a76a03efc81eff00b8ec699d3db2ce9bf 100644 (file)
     namespace "urn:opendaylight:openflow:common:action";
     prefix "ofaction";
 
+    import ietf-inet-types {prefix inet;}
+    import ietf-yang-types {prefix yang;}
+
     import openflow-types { prefix oft; }
+    import openflow-extensible-match { prefix oxm;}
 
-    revision "2013-07-31" {
+    revision "2015-02-03" {
         description "OpenFlow 1.3 - action model";
     }
 
-    identity output {
-        description " Output to switch port. (both OF v1.0 and v1.3)";
-        base oft:action-base;
-    }
-    identity copy_ttl_out {
-        description " Copy TTL \"outwards\" -- from next-to-outermost to outermost ";
-        base oft:action-base;
-    }
-    identity copy_ttl_in {
-        description " Copy TTL \"inwards\" -- from outermost to next-to-outermost ";
-        base oft:action-base;
-    }
-    identity set_mpls_ttl {
-        description " MPLS TTL ";
-        base oft:action-base;
-    }
-    identity dec_mpls_ttl {
-        description " Decrement MPLS TTL ";
-        base oft:action-base;
-    }
-    identity push_vlan {
-        description " Push a new VLAN tag ";
-        base oft:action-base;
-    }
-    identity pop_vlan {
-        description " Pop the outer VLAN tag ";
-        base oft:action-base;
-    }
-    identity push_mpls {
-        description " Push a new MPLS tag ";
-        base oft:action-base;
-    }
-    identity pop_mpls {
-        description " Pop the outer MPLS tag ";
-        base oft:action-base;
-    }
-    identity set_queue {
-        description " Set queue id when outputting to a port ";
-        base oft:action-base;
-    }
-    identity group {
-        description " Apply group. ";
-        base oft:action-base;
-    }
-    identity set_nw_ttl {
-        description " IP TTL. ";
-        base oft:action-base;
-    }
-    identity dec_nw_ttl {
-        description " Decrement IP TTL. ";
-        base oft:action-base;
-    }
-    identity set_field {
-        description " Set a header field using OXM TLV format. ";
-        base oft:action-base;
-    }
-    identity push_pbb {
-        description " Push a new PBB service tag (I-TAG) ";
-        base oft:action-base;
-    }
-    identity pop_pbb {
-        description " Pop the outer PBB service tag (I-TAG) ";
-        base oft:action-base;
-    }
-    identity experimenter {
-        description "";
-        base oft:action-base;
-    }
-
     identity experimenter-action-sub-type {
         description "The base identity for vendor's actions.";
     }
 
-    container actions-container {
-        uses actions-grouping;
+    container action-container {
+        uses action-grouping;
     }
 
     grouping actions-grouping {
         list action {
-            config false;
-            leaf type {
-                type identityref {
-                    base oft:action-base;
-                }
-            }
+            uses action-grouping;
         }
     }
 
-    // OF1.0 structures
-    identity set_vlan_vid {
-        description "Set the 802.1q VLAN id (OF v1.0).";
-        base oft:action-base;
-    }
-    identity set_vlan_pcp {
-        description "Set the 802.1q priority (OF v1.0).";
-        base oft:action-base;
-    }
-    identity strip_vlan {
-        description "Strip the 802.1q header (OF v1.0).";
-        base oft:action-base;
-    }
-    identity set_dl_src {
-        description "Ethernet source address (OF v1.0).";
-        base oft:action-base;
-    }
-    identity set_dl_dst {
-        description "Ethernet destination address (OF v1.0).";
-        base oft:action-base;
-    }
-    identity set_nw_src {
-        description "IP source address (OF v1.0).";
-        base oft:action-base;
-    }
-    identity set_nw_dst {
-        description "IP destination address (OF v1.0).";
-        base oft:action-base;
-    }
-    identity set_nw_tos {
-        description "IP ToS (DSCP field, 6 bits) (OF v1.0).";
-        base oft:action-base;
-    }
-    identity set_tp_src {
-        description "TCP/UDP source port (OF v1.0).";
-        base oft:action-base;
-    }
-    identity set_tp_dst {
-        description "TCP/UDP destination port (OF v1.0).";
-        base oft:action-base;
-    }
-    identity enqueue {
-        description "Output to queue (OF v1.0).";
-        base oft:action-base;
+    grouping action-grouping {
+        choice action-choice {
+            case output-action-case {
+                container output-action {
+                    leaf port {
+                        type oft:port-number;
+                    }
+                    leaf max-length {
+                        type uint16;
+                    }
+                }
+            }
+            case copy-ttl-out-case {
+                // empty action
+            }
+            case copy-ttl-in-case {
+                // empty action
+            }
+            case set-mpls-ttl-case {
+                container set-mpls-ttl-action {
+                    leaf mpls-ttl {
+                        type uint8;
+                    }
+                }
+            }
+            case dec-mpls-ttl-case {
+                // empty action
+            }
+            case push-vlan-case {
+                container push-vlan-action {
+                    leaf ethertype {
+                        type oft:ether-type;
+                    }
+                }
+            }
+            case pop-vlan-case {
+                // empty action
+            }
+            case push-mpls-case {
+                container push-mpls-action {
+                    leaf ethertype {
+                        type oft:ether-type;
+                    }
+                }
+            }
+            case pop-mpls-case {
+                container pop-mpls-action {
+                    leaf ethertype {
+                        type oft:ether-type;
+                    }
+                }
+            }
+            case set-queue-case {
+                container set-queue-action {
+                    leaf queue-id {
+                        type uint32;
+                    }
+                }
+            }
+            case group-case {
+                container group-action {
+                    leaf group-id {
+                        type uint32;
+                    }
+                }
+            }
+            case set-nw-ttl-case {
+                container set-nw-ttl-action {
+                    leaf nw-ttl {
+                        type uint8;
+                    }
+                }
+            }
+            case dec-nw-ttl-case {
+                // empty action
+            }
+            case set-field-case {
+                container set-field-action {
+                    uses oxm:match-entries-grouping;
+                }
+            }
+            case push-pbb-case {
+                container push-pbb-action {
+                    leaf ethertype {
+                        type oft:ether-type;
+                    }
+                }
+            }
+            case pop-pbb-case {
+                // empty action
+            }
+        // OF1.0 structures
+            case set-vlan-vid-case {
+                container set-vlan-vid-action {
+                    leaf vlan-vid {
+                        type uint16;
+                    }
+                }
+            }
+            case set-vlan-pcp-case {
+                container set-vlan-pcp-action {
+                    leaf vlan-pcp {
+                        type uint8;
+                    }
+                }
+            }
+            case strip-vlan-case {
+                // empty action
+            }
+            case set-dl-src-case {
+                container set-dl-src-action {
+                    leaf dl-src-address {
+                        type yang:mac-address;
+                    }
+                }
+            }
+            case set-dl-dst-case {
+                container set-dl-dst-action {
+                    leaf dl-dst-address {
+                        type yang:mac-address;
+                    }
+                }
+            }
+            case set-nw-src-case {
+                container set-nw-src-action {
+                    leaf ip-address {
+                        type inet:ipv4-address;
+                    }
+                }
+            }
+            case set-nw-dst-case {
+                container set-nw-dst-action {
+                    leaf ip-address {
+                        type inet:ipv4-address;
+                    }
+                }
+            }
+            case set-nw-tos-case {
+                container set-nw-tos-action {
+                    leaf nw-tos {
+                        type uint8;
+                    }
+                }
+            }
+            case set-tp-src-case {
+                container set-tp-src-action {
+                    leaf port {
+                        type oft:port-number;
+                    }
+                }
+            }
+            case set-tp-dst-case {
+                container set-tp-dst-action {
+                    leaf port {
+                        type oft:port-number;
+                    }
+                }
+            }
+            case enqueue-case {
+                container enqueue-action {
+                    leaf port {
+                        type oft:port-number;
+                    }
+                    leaf queue-id {
+                        type oft:queue-id;
+                    }
+                }
+            }
+        }
     }
 
 }