Port and statistics models updated.
[controller.git] / opendaylight / md-sal / model / model-inventory / src / main / yang / OFPort.yang
diff --git a/opendaylight/md-sal/model/model-inventory/src/main/yang/OFPort.yang b/opendaylight/md-sal/model/model-inventory/src/main/yang/OFPort.yang
new file mode 100644 (file)
index 0000000..a16926e
--- /dev/null
@@ -0,0 +1,142 @@
+module opendaylight-port-inventory {
+    namespace "urn:opendaylight:port:inventory";
+    prefix portInv;
+
+    import yang-ext {prefix ext;}
+    import ietf-inet-types {prefix inet;}
+    import ietf-yang-types {prefix yang;}
+    import opendaylight-inventory {prefix inv;}
+
+    revision "2013-09-25" {
+        description "Initial revision of Port Inventory model";
+    }
+
+    typedef node-connector-Id {
+        type instance-identifier;
+    }
+    
+    grouping ofp-port-config {
+        leaf port-config {
+            type enumeration {
+                enum OFPPC_PORT_DOWN;
+                enum OFFPC_NO_RECV;
+                enum OFFPC_NO_FWD;
+                enum OFPPC_NO_PACKET_IN;
+            }
+        }
+    }
+    
+    grouping ofp-port-state {
+        leaf port-state {
+            type enumeration {
+                enum OFPPS_LINK_DOWN;
+                enum OFPPS_BLOCKED;
+                enum OFFPS_LIVE;
+            }
+        }
+    }
+    
+    grouping ofp-port-features {
+        leaf port-features {
+            type enumeration {
+                enum OFPPF_10MB_HD;
+                enum OFPPF_10MB_FD;
+                enum OFPPF_100MB_HD;
+                enum OFPPF_100MB_FD;
+                enum OFPPF_1GB_HD;
+                enum OFPPF_1GB_FD;
+                enum OFPPF_10GB_FD;
+                enum OFPPF_40GB_FD;
+                enum OFPPF_100GB_FD;
+                enum OFPPF_1TB_FD;
+                enum OFPPF_OTHER;
+                enum OFPPF_COPPER;
+                enum OFPPF_FIBER;
+                enum OFPPF_AUTOENG;
+                enum OFPPF_PAUSE;
+                enum OFPPF_PAUSE_ASYM;
+            }
+        }
+    }
+    
+    grouping common-port {
+        leaf port_no {
+            type node-connector-Id;
+        }
+        
+        leaf-list hw_addr {
+            type uint8;
+            description "MAC Address of the port";
+            max-elements 6;
+        }
+        
+        leaf config {
+            type uint32;
+            description "Bit map of OFPPC_* flags"            
+        }
+        
+        leaf advertised {
+            type uint32;
+            description "Features being advertised by the port"            
+        }
+    }
+    
+    grouping ofp-port {
+        key "port-order";
+        leaf port-order {
+            type uint32;
+        }      
+        
+        uses common-port;
+        
+        leaf name {
+            type string;
+            description "Human readable name of the port";
+            length 16;
+        }
+        
+        leaf state {
+            type uint32;
+            description "Bit map of OFPPS_* flags"            
+        }
+        
+        leaf curr {
+            type uint32;
+            description "Bit map of OFPPF_* flags"            
+        }       
+        
+        leaf supported {
+            type uint32;
+            description "Features supported by the port"            
+        }
+        
+        leaf peer {
+            type uint32;
+            description "Features advertised by peer"            
+        }
+        
+        leaf curr_speed {
+            type uint32;
+            description "Current port bit rate in kbps"            
+        }
+        
+        leaf max_speed {
+            type uint32;
+            description "Max port bit rate in kbps"            
+        }
+    }    
+    
+    grouping ofp-port-mod {
+        key "port-mod-order";
+        leaf port-mod-order {
+            type uint32;
+        }    
+        
+        uses group-port;
+        
+        leaf mask {
+            type uint32;
+            description "Bitmap of OFPPC_* flags to be changed"
+        }        
+    }
+}
\ No newline at end of file