Fix for port-state Bug 262.
[controller.git] / opendaylight / md-sal / model / model-flow-base / src / main / yang / port-types.yang
index 8338d185cc36abbbbc34613fe1e3df84d805550a..2554fffadb7a047d0e8bb525688a20ba1423ba13 100644 (file)
@@ -4,11 +4,19 @@ module opendaylight-port-types {
 
     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
     import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
+    import opendaylight-queue-types {prefix queue-types; revision-date "2013-09-25";}
     
     revision "2013-09-25" {
         description "Initial revision of Port Inventory model";
     }
-
+    
+    typedef port-reason {
+        type enumeration {
+            enum add;
+            enum delete;
+            enum update;
+        }
+    }
     
     typedef port-config {
         type bits {
@@ -19,14 +27,17 @@ module opendaylight-port-types {
         }
     }
     
-    typedef port-state {
-        type enumeration {
-            enum link-down;
-            enum blocked;
-            enum live;
+    grouping port-state {
+        leaf link-down {
+            type boolean;
+        }
+        leaf blocked {
+            type boolean;
+        }   
+        leaf live {
+            type boolean;
         }
     }
-
     
     typedef port-features {
         type bits {
@@ -72,6 +83,21 @@ module opendaylight-port-types {
         }
     }
     
+    grouping flow-port-status {
+        leaf reason {
+            type port-reason;
+        }
+        
+        uses flow-capable-port;
+    }
+    
+    grouping queues {
+       list queue {
+               key "queue-id";
+               uses queue-types:queue-packet;
+       }
+    }
+    
     grouping flow-capable-port {    
                 
         uses common-port;
@@ -81,9 +107,9 @@ module opendaylight-port-types {
             description "Human readable name of the port";                    
         }
         
-        leaf state {
-            type port-state;
-            description "Bit map of OFPPS-* flags";            
+        container state {
+            uses port-state;
+            description "Description of state of port";            
         }
         
         leaf current-feature {
@@ -112,9 +138,11 @@ module opendaylight-port-types {
             units "kbps";
             description "Max port bit rate in kbps";            
         }
+        
+        uses queues;
     }    
     
-    grouping ofp-port-mod {
+    grouping port-mod {
         container port {
             list port {
                 key "port-mod-order";