Adding learn action - Bug 6445
[openflowplugin.git] / extension / openflowjava-extension-nicira / src / main / yang / nicira-action.yang
index 7352c01ef5ec9960e721c677007ee7859299de49..387f04271f3f070bcf40e4ecb37949283f74eefc 100644 (file)
@@ -4,17 +4,17 @@ module nicira-action {
     namespace "urn:opendaylight:openflowjava:nx:action";
     prefix "nicira-action";
 
-    import openflow-action {prefix ofaction;}
+    import openflow-action {prefix ofaction; revision-date "2015-02-03";}
     import openflow-types {prefix oft;}
     import yang-ext {prefix ext; revision-date "2013-07-09";}
 
-    description 
+    description
         "Nicira openflow extensions of action.";
 
     revision "2014-04-21" {
         description "Initial revision";
     }
-    
+
     identity nxm-nx-reg-load {
         base ofaction:experimenter-action-sub-type;
     }
@@ -30,9 +30,21 @@ module nicira-action {
     identity nxm-nx-multipath {
         base ofaction:experimenter-action-sub-type;
     }
+    identity nxm-nx-push-nsh {
+        base ofaction:experimenter-action-sub-type;
+    }
+    identity nxm-nx-pop-nsh {
+        base ofaction:experimenter-action-sub-type;
+    }
+    identity nxm-nx-conntrack {
+        base ofaction:experimenter-action-sub-type;
+    }
+    identity nxm-nx-learn {
+        base ofaction:experimenter-action-sub-type;
+    }
 
     grouping ofj-nx-action-reg-load-grouping {
-        container action-reg-load {
+        container nx-action-reg-load {
             leaf ofs_nbits {
                 type uint16;
             }
@@ -42,29 +54,35 @@ module nicira-action {
             leaf value {
                 type uint64;
             }
+            leaf experimenter-id {
+                type oft:experimenter-id;
+            }
         }
     }
     grouping ofj-nx-action-reg-move-grouping {
-        container action-reg-move {
-            leaf n_bits {
-                type uint16;
-            }
-            leaf src_ofs {
-                type uint16;
-            }
-            leaf dst_ofs {
-                type uint16;
-            }
-            leaf src {
-                type uint32;
-            }
-            leaf dst {
-                type uint32;
-            }
+        container nx-action-reg-move {
+                leaf n_bits {
+                    type uint16;
+                }
+                leaf src_ofs {
+                    type uint16;
+                }
+                leaf dst_ofs {
+                    type uint16;
+                }
+                leaf src {
+                    type uint32;
+                }
+                leaf dst {
+                    type uint32;
+                }
+                leaf experimenter-id {
+                    type oft:experimenter-id;
+                }
         }
     }
     grouping ofj-nx-action-output-reg-grouping {
-        container action-output-reg {
+        container nx-action-output-reg {
             leaf n_bits {
                 type uint16;
             }
@@ -74,11 +92,14 @@ module nicira-action {
             leaf max_len {
                 type uint16;
             }
+            leaf experimenter-id {
+                type oft:experimenter-id;
+            }
         }
     }
 
     grouping ofj-nx-action-resubmit-grouping {
-        container action-resubmit {
+        container nx-action-resubmit {
             leaf in-port {
                 type uint16;
                 default 0xfff8; // OFPP_INPORT
@@ -89,6 +110,9 @@ module nicira-action {
                 }
                 default 255; // Current Table
             }
+            leaf experimenter-id {
+                type oft:experimenter-id;
+            }
         }
     }
 
@@ -123,7 +147,7 @@ module nicira-action {
     }
 
     grouping ofj-nx-action-multipath-grouping {
-        container action-multipath {
+        container nx-action-multipath {
             leaf fields {
                 type ofj-nx-hash-fields;
             }
@@ -146,15 +170,237 @@ module nicira-action {
             leaf dst {
                 type uint32;
             }
+            leaf experimenter-id {
+                type oft:experimenter-id;
+            }
+        }
+    }
+
+    grouping ofj-nx-action-push-nsh-grouping {
+        container nx-action-push-nsh {
+            leaf experimenter-id {
+                type oft:experimenter-id;
+            }
+        }
+    }
+    grouping ofj-nx-action-pop-nsh-grouping {
+        container nx-action-pop-nsh {
+            leaf experimenter-id {
+                type oft:experimenter-id;
+            }
+        }
+    }
+
+    grouping ofj-nx-action-conntrack-grouping {
+        container nx-action-conntrack {
+            leaf flags {
+                type uint16;
+            }
+            leaf zone-src {
+                type uint32;
+            }
+            leaf conntrack-zone {
+                type uint16;
+            }
+            leaf recirc-table {
+                type uint8;
+            }
+            leaf experimenter-id {
+                type oft:experimenter-id;
+            }
+        }
+    }
+
+    grouping flow-mod-spec {
+        description
+           "flow mod spec indicates the actions that should be performed to create a new flow which was learned from learn action.";
+        choice flow-mod-spec{
+            case flow-mod-add-match-from-field-case{
+                container flow-mod-add-match-from-field{
+                        leaf flow-mod-num-bits{
+                        type uint16;
+                    }
+
+                    leaf src-field{
+                        type uint32;
+                    }
+
+                    leaf src-ofs{
+                        type uint16;
+                    }
+
+                    leaf dst-field{
+                        type uint32;
+                    }
+
+                    leaf dst-ofs{
+                        type uint16;
+                    }
+                }
+            }
+            case flow-mod-add-match-from-field-case{
+                container flow-mod-add-match-from-field{
+                        leaf flow-mod-num-bits{
+                        type uint16;
+                    }
+
+                    leaf src-field{
+                        type uint32;
+                    }
+
+                    leaf src-ofs{
+                        type uint16;
+                    }
+
+                    leaf dst-field{
+                        type uint32;
+                    }
+
+                    leaf dst-ofs{
+                        type uint16;
+                    }
+                }
+            }
+            case flow-mod-add-match-from-value-case{
+                container flow-mod-add-match-from-value{
+                        leaf flow-mod-num-bits{
+                        type uint16;
+                    }
+
+                    leaf value{
+                        type uint16;
+                    }
+
+                    leaf src-field{
+                        type uint32;
+                    }
+
+                    leaf src-ofs{
+                        type uint16;
+                    }
+                }
+            }
+            case flow-mod-copy-field-into-field-case{
+                container flow-mod-copy-field-into-field{
+                        leaf flow-mod-num-bits{
+                        type uint16;
+                    }
+
+                    leaf src-field{
+                        type uint32;
+                    }
+
+                    leaf src-ofs{
+                        type uint16;
+                    }
+
+                    leaf dst-field{
+                        type uint32;
+                    }
+
+                    leaf dst-ofs{
+                        type uint16;
+                    }
+                }
+            }
+            case flow-mod-copy-value-into-field-case{
+                container flow-mod-copy-value-into-field{
+                        leaf flow-mod-num-bits{
+                        type uint16;
+                    }
+
+                    leaf value{
+                        type uint16;
+                    }
+
+                    leaf dst-field{
+                        type uint32;
+                    }
+
+                    leaf dst-ofs{
+                        type uint16;
+                    }
+                }
+            }
+            case flow-mod-output-to-port-case{
+                container flow-mod-output-to-port{
+                        leaf flow-mod-num-bits{
+                        type uint16;
+                    }
+
+                    leaf src-field{
+                        type uint32;
+                    }
+
+                    leaf src-ofs{
+                        type uint16;
+                    }
+                }
+            }
         }
     }
 
-    augment "/ofaction:actions-container/ofaction:action" {
+    grouping ofj-nx-action-learn-grouping {
+        container nx-action-learn {
+            leaf idle-timeout {
+                type uint16;
+            }
+            leaf hard-timeout {
+                type uint16;
+            }
+            leaf priority {
+                type uint16;
+            }
+            leaf cookie {
+                type uint64;
+            }
+            leaf flags {
+                type uint16;
+            }
+            leaf table-id {
+                type uint8;
+            }
+            leaf fin-idle-timeout {
+                type uint16;
+            }
+            leaf fin-hard-timeout {
+                type uint16;
+            }
+
+            list flow-mods{
+                uses flow-mod-spec;
+            }
+        }
+    }
+
+    augment "/ofaction:action-container/ofaction:action-choice" {
         ext:augment-identifier "ofj-aug-nx-action";
-        uses ofj-nx-action-reg-load-grouping;
-        uses ofj-nx-action-reg-move-grouping;
-        uses ofj-nx-action-output-reg-grouping;
-        uses ofj-nx-action-resubmit-grouping;
-        uses ofj-nx-action-multipath-grouping;
+        case action-reg-load {
+            uses ofj-nx-action-reg-load-grouping;
+        }
+        case action-reg-move {
+            uses ofj-nx-action-reg-move-grouping;
+        }
+        case action-output-reg {
+            uses ofj-nx-action-output-reg-grouping;
+        }
+        case action-resubmit {
+            uses ofj-nx-action-resubmit-grouping;
+        }
+        case action-multipath {
+            uses ofj-nx-action-multipath-grouping;
+        }
+        case action-push-nsh {
+            uses ofj-nx-action-push-nsh-grouping;
+        }
+        case action-pop-nsh {
+            uses ofj-nx-action-pop-nsh-grouping;
+        }
+        case action-conntrack {
+            uses ofj-nx-action-conntrack-grouping;
+        }
+        case action-learn {
+            uses ofj-nx-action-learn-grouping;
+        }
     }
 }