Updated flow capable node models. 98/1798/2
authorTony Tkacik <ttkacik@cisco.com>
Thu, 10 Oct 2013 11:46:06 +0000 (13:46 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 10 Oct 2013 19:09:53 +0000 (19:09 +0000)
Change-Id: I8308148e5e081bed135917e4f57b1611906cca74
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
opendaylight/md-sal/model/model-flow-base/src/main/yang/meter-types.yang
opendaylight/md-sal/model/model-flow-base/src/main/yang/port-types.yang [new file with mode: 0644]
opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-node-inventory.yang
opendaylight/md-sal/model/model-inventory/src/main/yang/node-inventory.yang

index cf309f1..971a893 100644 (file)
@@ -16,21 +16,21 @@ module opendaylight-meter-types {
     
     grouping meter-flags {
         leaf flags {
-            type enumeration {
-                enum meter-kbps;
-                enum meter_pktps;
-                enum meter_burst;
-                enum meter_stats;
+            type bits {
+                bit meter-kbps;
+                bit meter_pktps;
+                bit meter_burst;
+                bit meter_stats;
             }
         }
     }
     
     grouping meter-band-type {
         leaf flags {
-            type enumeration {
-                enum ofpmbt-drop;
-                enum ofpmbt-dscp-remark;
-                enum ofpmbt-experimenter;               
+            type bits {
+                bit ofpmbt-drop;
+                bit ofpmbt-dscp-remark;
+                bit ofpmbt-experimenter;               
             }
         }
     }
diff --git a/opendaylight/md-sal/model/model-flow-base/src/main/yang/port-types.yang b/opendaylight/md-sal/model/model-flow-base/src/main/yang/port-types.yang
new file mode 100644 (file)
index 0000000..af7c4df
--- /dev/null
@@ -0,0 +1,135 @@
+module opendaylight-port-types {
+    namespace "urn:opendaylight:flow:types:port";
+    prefix port-types;
+
+    import yang-ext {prefix ext;}
+    import ietf-inet-types {prefix inet;}
+    import ietf-yang-types {prefix yang;}
+    
+    revision "2013-09-25" {
+        description "Initial revision of Port Inventory model";
+    }
+
+    
+    typedef port-config {
+        type bits {
+            bit PORT-DOWN;
+            bit NO-RECV;
+            bit NO-FWD;
+            bit NO-PACKET-IN;
+        }
+    }
+    
+    typedef port-state {
+            type enumeration {
+                enum LINK-DOWN;
+                enum BLOCKED;
+                enum LIVE;
+        }
+    }
+
+    
+    typedef port-features {
+        type bits {
+            bit 10mb-hd;
+            bit 10mb-fd;
+            bit 100mb-hd;
+            bit 100mb-fd;
+            bit 1gb-hd;
+            bit 1gb-fd;
+            bit 10gb-fd;
+            bit 40gb-fd;
+            bit 100gb-fd;
+            bit 1tb-fd;
+            bit other;
+            bit copper;
+            bit fiber;
+            bit autoeng;
+            bit pause;
+            bit pause-asym;
+        }
+    }
+    
+    grouping common-port {
+
+        leaf port-number {
+            type uint32;
+        }
+        
+        leaf hardware-address {
+            type yang:mac-address;
+            description "MAC Address of the port";
+            
+        }
+        
+        leaf configuration {
+            type port-config;
+            description "Bit map of OFPPC-* flags";          
+        }
+        
+        leaf advertised-features {
+            type port-features;
+            description "Features being advertised by the port";            
+        }
+    }
+    
+    grouping flow-capable-port {    
+                
+        uses common-port;
+        
+        leaf name {
+            type string;
+            description "Human readable name of the port";                    
+        }
+        
+        leaf state {
+            type port-state;
+            description "Bit map of OFPPS-* flags";            
+        }
+        
+        leaf current-feature {
+            type port-features;
+            description "Bit map of OFPPF-* flags";            
+        }       
+        
+        leaf supported {
+            type port-features;
+            description "Features supported by the port";           
+        }
+        
+        leaf peer-features {
+            type port-features;
+            description "Features advertised by peer";            
+        }
+        
+        leaf current-speed {
+            type uint32;
+            units "kbps";
+            description "Current port bit rate in kbps";            
+        }
+        
+        leaf maximum-speed {
+            type uint32;
+            units "kbps";
+            description "Max port bit rate in kbps";            
+        }
+    }    
+    
+    grouping ofp-port-mod {
+        container port {
+            list port {
+                key "port-mod-order";
+                leaf port-mod-order {
+                    type uint32;
+                }    
+                
+                uses common-port;
+                
+                leaf mask {
+                    type uint32;
+                    description "Bitmap of OFPPC-* flags to be changed";
+                }       
+            }
+        }    
+    }
+}
\ No newline at end of file
index 80a4ccf..118d1cd 100644 (file)
@@ -5,6 +5,7 @@ module flow-node-inventory {
     import yang-ext {prefix ext;}
     import ietf-inet-types {prefix inet;}
     import ietf-yang-types {prefix yang;}
+    import opendaylight-port-types {prefix port;}
     import opendaylight-inventory {prefix inv;}
     
     revision "2013-08-19" {
@@ -12,6 +13,12 @@ module flow-node-inventory {
     }
     
     
+    grouping feature {
+        leaf support-state {
+            type inv:support-type;
+        }
+    }
+
     grouping queue {
          leaf queue-id {
             type uint32;
@@ -28,68 +35,80 @@ module flow-node-inventory {
         }
     }
 
-    grouping flow-capable-node-capabilities {
+    grouping table {
+
+
+    }
+
+    grouping flow-node {
         container tables {
-            leaf support-state {
-                type inv:support-type;
+            uses feature;
+            list table {
+                uses table;
             }
-            
         }
         
         container group-tables {
-        
+            uses feature;
         }
         
         container supported-match-types {
             list match-type {
+                uses feature;
                 leaf match {
                     type string; // FIXME: Add identity
                 }
-                leaf support-state {
-                    type inv:support-type;
-                }
+                
             }
         }
         
         container supported-instructions {
             list instruction-type {
+                uses feature;
                 leaf instruction {
                     type string; // FIXME: Add identity
                 }
-                
-                leaf support-state {
-                    type inv:support-type;
-                }
             }
         }
 
         container supported-actions {
             list action-type {
+                uses feature;
+
                 leaf action {
                     type string; // FIXME: Add identity
                 }
-                
-                leaf support-state {
-                    type inv:support-type;
-                }
             }
         }
     }
     
-    grouping flow-capable-node-connector {
-        
+    grouping flow-node-connector {
+
+        uses port:flow-capable-port;
     }
 
-    notification node-capabilities-updated {
-        uses flow-capable-node-capabilities;
+    augment "/inv:nodes/inv:node" {
+        ext:augment-identifier "flow-capable-node";
+        uses flow-node;
     }
 
-    notification node-connector-capabilities-updated {
-        uses flow-capable-node-connector;
+    augment "/inv:nodes/inv:node/inv:node-connector" {
+        ext:augment-identifier "flow-capable-node-connector";
+        uses flow-node-connector;
     }
 
-    augment "/inv:nodes/inv:node" {
-        augment-identifier "flow-capable-node";
-        uses flow-capable-node-capabilities;
+    augment "/inv:node-updated" {
+        ext:augment-identifier "flow-capable-node-updated";
+        uses flow-node;
+    }
+
+    augment "/inv:node-updated/inv:node-connector" {
+        //ext:identical-augment "flow-capable-node-connector";
+        ext:augment-identifier "flow-capable-node-connector-update-fields";
+        uses flow-node-connector;
+    }
+
+    augment "/inv:node-connector-updated" {
+        ext:augment-identifier "flow-capable-node-connector-updated";   
     }
 }
\ No newline at end of file
index 6ef5b63..d27f260 100644 (file)
@@ -41,13 +41,21 @@ module opendaylight-inventory {
     }
 
     identity node-connector-context {
-        
+
     }
 
     grouping node {
-    leaf id {
+        leaf id {
             type node-id;
         }
+
+        list "node-connector" {
+            key "id";
+            ext:context-instance "node-connector-context";
+
+            use node-connector;
+        }
+
     }
 
     grouping node-connector {
@@ -63,13 +71,35 @@ module opendaylight-inventory {
             ext:context-instance "node-context";
 
             uses node;
+        }
+    }
+
+    notification node-updated {
+        leaf node-ref {
+            ext:context-reference "node-context";
+            type node-ref;
+        }
+        uses node;
+    }
 
-            list "node-connector" {
-                key "id";
-                ext:context-instance "node-connector-context";
+    notification node-connector-updated {
+        /*leaf node-ref {
+            type node-ref;
+        }*/
+        uses node-connector;
+    }
+
+    notification node-removed {
+        leaf node-ref {
+            ext:context-reference "node-context";
+            type node-ref;
+        }
+    }
 
-                use node-connector;
-            }
+    notification node-connector-removed {
+        leaf node-connector-ref {
+            ext:context-reference "node-connector-context";
+            type node-ref;
         }
     }
 }
\ No newline at end of file