Rework OpenFlowPluginProviderImpl connection provider tracking
[openflowplugin.git] / model / model-flow-base / src / main / yang / opendaylight-port-types.yang
index 9e880987524c3cee54d7f0486f7dce5df272ae17..fa6e1fcdfd7acded5d2ab949f4d27a123ca5c1a9 100644 (file)
@@ -2,13 +2,15 @@ module opendaylight-port-types {
     namespace "urn:opendaylight:flow:types:port";
     prefix port-types;
 
-    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
+    import ietf-yang-types {prefix yang; revision-date "2013-07-15";}
     import opendaylight-queue-types {prefix queue-types; revision-date "2013-09-25";}
-    
+    import openflow-protocol { prefix ofproto; revision-date "2013-07-31"; }
+    import opendaylight-multipart-types { prefix multipart; revision-date "2017-01-12"; }
+
     revision "2013-09-25" {
         description "Initial revision of Port Inventory model";
     }
-    
+
     typedef port-reason {
         type enumeration {
             enum add;
@@ -16,7 +18,7 @@ module opendaylight-port-types {
             enum update;
         }
     }
-    
+
     typedef port-config {
         type bits {
             bit PORT-DOWN;
@@ -25,19 +27,19 @@ module opendaylight-port-types {
             bit NO-PACKET-IN;
         }
     }
-    
+
     grouping port-state {
         leaf link-down {
             type boolean;
         }
         leaf blocked {
             type boolean;
-        }   
+        }
         leaf live {
             type boolean;
         }
     }
-    
+
     typedef port-features {
         type bits {
             bit ten-mb-hd;
@@ -58,119 +60,148 @@ module opendaylight-port-types {
             bit pause-asym;
         }
     }
-    
+
+    typedef port-number-uni {
+        description "Union port number: 4B number / string (reserved port name)";
+        type union {
+            type uint32;
+            type string;
+        }
+    }
+
     grouping common-port {
 
         leaf port-number {
-            type union {
-                type uint32;
-                type string;
-            }
+            type port-number-uni;
         }
-        
+
         leaf hardware-address {
             type yang:mac-address;
             description "MAC Address of the port";
-            
+
         }
-        
+
         leaf configuration {
             type port-config;
-            description "Bit map of OFPPC-* flags";          
+            description "Bit map of OFPPC-* flags";
         }
-        
+
         leaf advertised-features {
             type port-features;
-            description "Features being advertised by the port";            
+            description "Features being advertised by the port";
+        }
+    }
+
+    grouping  common-port-with-mask {
+        uses common-port;
+
+        leaf mask {
+            type port-config;
+            description "Bitmap of OFPPC-* flags to be changed";
         }
     }
-    
+
     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 {    
-                
+
+    grouping flow-capable-port {
+
         uses common-port;
-        
+
         leaf name {
             type string;
-            description "Human readable name of the port";                    
+            description "Human readable name of the port";
         }
-        
+
         container state {
             uses port-state;
-            description "Description of state of port";            
+            description "Description of state of port";
         }
-        
+
         leaf current-feature {
             type port-features;
-            description "Bit map of OFPPF-* flags";            
-        }       
-        
+            description "Bit map of OFPPF-* flags";
+        }
+
         leaf supported {
             type port-features;
-            description "Features supported by the port";           
+            description "Features supported by the port";
         }
-        
+
         leaf peer-features {
             type port-features;
-            description "Features advertised by peer";            
+            description "Features advertised by peer";
         }
-        
+
         leaf current-speed {
             type uint32;
             units "kbps";
-            description "Current port bit rate in kbps";            
+            description "Current port bit rate in kbps";
         }
-        
+
         leaf maximum-speed {
             type uint32;
             units "kbps";
-            description "Max port bit rate in kbps";            
+            description "Max port bit rate in kbps";
         }
-        
+
         uses queues;
-    }    
-    
+    }
+
     grouping port-mod {
         container port {
             list port {
                 key "port-mod-order";
                 leaf port-mod-order {
                     type uint32;
-                }    
-                
-                uses common-port;
-                
-                leaf mask {
-                    type port-config;
-                    description "Bitmap of OFPPC-* flags to be changed";
-                }      
-                
+                }
+
+                uses common-port-with-mask;
+
                 leaf container-name {
-                    type string; 
+                    type string;
                 }
-            
+
                 leaf port-name {
-                    type string; 
-                } 
+                    type string;
+                }
 
                 leaf barrier {
-                    type boolean; 
-                } 
-            }            
-        }    
+                    type boolean;
+                }
+            }
+        }
+    }
+
+    container port-message {
+        uses common-port-with-mask;
+        uses ofproto:ofHeader;
+    }
+
+    augment "/multipart:multipart-reply/multipart:multipart-reply-body" {
+        case multipart-reply-port-desc {
+            list ports {
+                uses flow-capable-port;
+            }
+        }
+    }
+
+
+    augment "/multipart:multipart-request/multipart:multipart-request-body" {
+        case multipart-request-port-desc {
+            // Empty case
+        }
     }
 }