Updated models, modeling existing SAL and its functionality 39/1139/2
authorTony Tkacik <ttkacik@cisco.com>
Mon, 9 Sep 2013 23:18:28 +0000 (16:18 -0700)
committerTony Tkacik <ttkacik@cisco.com>
Mon, 9 Sep 2013 23:48:11 +0000 (16:48 -0700)
model-flow-base
  - match-types.yang - Match types categorized by protocol / layer
  - flow-types.yang - Base flow types / actions
model-flow-service
  - flow-service.yang - Model of Flow Programming service
model-flow-statistics
  - flow-statistics.yang - Flow Statistics service
model-inventory
  - model-inventory.yang - Device inventory

Change-Id: I14e9fe3c7a85e49131e102cf4c840bb1bdb0afbc
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
opendaylight/sal/yang-prototype/sal/model/model-flow-base/pom.xml
opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/flow-types.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/match-types.yang [moved from opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/opendaylight-flow-base.yang with 75% similarity]
opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/flow-service.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/opendaylight-flow-config.yang [deleted file]
opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/opendaylight-flow-service.yang [deleted file]
opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/packet-processing.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/flow-statistics.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/statistics-types.yang [moved from opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang with 54% similarity]
opendaylight/sal/yang-prototype/sal/model/model-inventory/src/main/yang/inventory.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/sal/model/model-inventory/src/main/yang/opendaylight-inventory.yang [deleted file]

index 6eaaebada598c3fada00c18528adffc9468d309a..6c050735bb4ea78fff5ea946bb8623b9a99758e0 100644 (file)
@@ -14,7 +14,7 @@
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>model-flow-base</artifactId>
-
+    
     <dependencies>
         <dependency>
             <groupId>${project.groupId}</groupId>
diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/flow-types.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/flow-types.yang
new file mode 100644 (file)
index 0000000..ed92bf4
--- /dev/null
@@ -0,0 +1,113 @@
+module opendaylight-flow-types {
+    namespace "urn:opendaylight:flow:types";
+    prefix flow;
+
+    import ietf-inet-types {prefix inet;}
+    import opendaylight-match-types {prefix match;}
+    import ietf-yang-types {prefix yang;}
+
+
+    revision "2013-08-19" {
+        description "Initial revision of flow service";
+    }
+
+    grouping action {
+        choice action {
+            case output-action {
+                leaf-list output-node-connector {
+                    type inet:uri;
+                }
+            }
+
+            case controller-action {
+                leaf max-length {
+                    type uint16 {
+                        range "0..65294";
+                    }
+                }
+            }
+
+            case set-queue-action {
+                leaf queue {
+                    type string; // TODO: define queues
+                }
+            }
+
+            case pop-mpls-action {
+                leaf ethernet-type {
+                        type uint16; // TODO: define ethertype type
+                }
+            }
+
+            case set-mpls-ttl-action {
+                leaf mpls-ttl {
+                    type uint8;
+                }
+            }
+
+            case set-nw-ttl-action {
+                leaf nw-ttl {
+                    type uint8;
+                }
+            }
+
+            case push-pbb-action {
+
+            }
+
+            case push-mpls-action {
+
+            }
+
+            case push-vlan-action {
+
+            }
+        }
+    }
+
+    grouping flow {
+        container match {
+            uses match:match;
+        }
+        list action {
+            key "order";
+            leaf order {
+                type int32;
+            }
+            uses action;
+        }
+    }
+
+    grouping flow-statistics {
+        leaf packet-count {
+            type yang:counter64;
+        } 
+
+        leaf byte-count {
+            type yang:counter64;
+        }
+
+        container duration {
+            leaf second {
+                type yang:counter64;
+            }
+            leaf nanosecond {
+                type yang:counter64;
+            }
+        }
+    }
+
+    grouping flow-table-statistics {
+        leaf active {
+            type yang:counter64;
+        } 
+
+        leaf lookup {
+            type yang:counter64;
+        }
+
+        leaf matched {
+            type yang:counter64;   
+        }
+    }
+}
\ No newline at end of file
similarity index 75%
rename from opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/opendaylight-flow-base.yang
rename to opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/match-types.yang
index 443d82f2e42bd13083ace2889b25574d46246fd1..54b46d5587af0e0c65841d03546d80aa7f58d5bb 100644 (file)
@@ -1,37 +1,36 @@
-module opendaylight-flow-base {
-    namespace "urn:opendaylight:flow:base";
-    prefix "flowbase";
+module opendaylight-match-types {
+    namespace "urn:opendaylight:model:match:types";
+    prefix "match";
 
-    import yang-ext {prefix ext;}
     import ietf-inet-types {prefix inet;}
     import ietf-yang-types {prefix yang;}
-    import opendaylight-inventory {prefix inv;}
     import opendaylight-l2-types {prefix l2t;}
 
     revision "2013-08-19" {
         description "Initial revision of flow service";
     }
 
+    grouping "mac-address-filter" {
+        leaf address {
+            mandatory true;
+            type yang:mac-address;
+        }
+        leaf mask {
+            type binary;
+        }
+    }
+
      /** Match Groupings **/
     grouping "ethernet-match-fields" {
         container ethernet-source {
-            //description "Ethernet source address.";
-            //presence "Match field is active and set";
-            leaf address {
-                mandatory true;
-                type yang:mac-address;
-            }
-            leaf mask {
-                type binary;
-            }
+            description "Ethernet source address.";
+            presence "Match field is active and set";
+            uses mac-address-filter;
         }
         container ethernet-destination {
             description "Ethernet destination address.";
             presence "Match field is active and set";
-            leaf address {
-                mandatory true;
-                type yang:mac-address;
-            }
+            uses mac-address-filter;
         }
         container ethernet-type {
             description "Ethernet frame type.";
@@ -64,8 +63,6 @@ module opendaylight-flow-base {
             description "VLAN priority.";
             type l2t:vlan-pcp;
         }
-        
-
     }
 
     grouping "ip-match-fields" {
@@ -106,7 +103,6 @@ module opendaylight-flow-base {
         }
     }
 
-
     grouping "udp-match-fields" {
         leaf udp-source-port {
             description "UDP source port.";
@@ -151,7 +147,7 @@ module opendaylight-flow-base {
         }
     }
 
-    grouping "arp-match-fields" {     
+    grouping "arp-match-fields" {
         leaf arp-source-transport-address {
             description "ARP source IPv4 address.";
             type inet:ipv4-prefix;
@@ -164,31 +160,19 @@ module opendaylight-flow-base {
         container arp-source-hardware-address {
             description "ARP source hardware address.";
             presence "Match field is active and set";
-            leaf address {
-                mandatory true;
-                type yang:mac-address;
-            }
-            leaf mask {
-                type binary;
-            }
+        uses mac-address-filter;
         }
         container arp-target-hardware-address {
             description "ARP target hardware address.";
             presence "Match field is active and set";
-            leaf address {
-                mandatory true;
-                type yang:mac-address;
-            }
-            leaf mask {
-                type binary;
-            }
+        uses mac-address-filter;
         }
     }
 
     grouping action {
         choice action {
             case output-action {
-                leaf output-node-connector {
+                leaf-list output-node-connector {
                     type string;
                 }
             }
@@ -241,48 +225,43 @@ module opendaylight-flow-base {
         }
     }
 
-    grouping flow {
-        leaf node {
-            type inv:node-id;
+
+    grouping match {
+        container "ethernet-match" {
+            uses "ethernet-match-fields";
         }
-        container match {
-            container "ethernet-match" {
-                uses "ethernet-match-fields";
-            }
-            container "vlan-match" {
-                uses "vlan-match-fields";
-            }
-            container "ip-match" {
-                uses "ip-match-fields";
-            }
-            container "ipv4-match" {
+        container "vlan-match" {
+            uses "vlan-match-fields";
+        }
+        container "ip-match" {
+            uses "ip-match-fields";
+        }
+        
+        choice layer-3-match {
+            case "ipv4-match" {
                 uses "ipv4-match-fields";
             }
-            container "ipv6-match" {
+            case "ipv6-match" {
                 uses "ipv6-match-fields";
             }
-            container "udp-match" {
+            case "arp-match" {
+                uses "arp-match-fields";
+            }
+        }
+        
+        choice layer-4-match {
+            case "udp-match" {
                 uses "udp-match-fields";
             }
-            container "tcp-match" {
+            case "tcp-match" {
                 uses "tcp-match-fields";
             }
-            container "sctp-match" {
+            case "sctp-match" {
                 uses "sctp-match-fields";
             }
-            container "icmpv4-match" {
-                uses "icmpv4-match-fields";
-            }
-            container "arp-match" {
-                uses "arp-match-fields";
-            }
         }
-        list action {
-            key "order";
-            leaf order {
-                type int32;
-            }
-            uses action;
+        container "icmpv4-match" {
+            uses "icmpv4-match-fields";
         }
     }
 }
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/flow-service.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/flow-service.yang
new file mode 100644 (file)
index 0000000..113cb12
--- /dev/null
@@ -0,0 +1,81 @@
+module sal-flow {
+    namespace "urn:opendaylight:flow:service";
+    prefix flow;
+
+    import yang-ext {prefix ext;}
+    import opendaylight-inventory {prefix inv;}
+    import ietf-inet-types {prefix inet;}
+    import opendaylight-flow-types {prefix types;}
+
+
+    revision "2013-08-19" {
+        description "Initial revision of flow service";
+    }
+
+
+    typedef flow-table-ref {
+        type instance-identifier;
+    }
+    
+    grouping node-flow {
+        leaf node {
+            type inv:node-ref;
+        }
+        leaf flow-table {
+            type flow-table-ref;
+        }
+        uses types:flow;
+    }
+
+    /** Base configuration structure **/
+    grouping flow-update {
+        container original-flow {
+            uses types:flow;
+        }
+        container updated-flow {
+            uses types:flow;
+        }
+    }
+
+    rpc add-flow {
+        input {
+            uses node-flow;
+        }
+    }
+
+    rpc remove-flow {
+        input {
+            uses node-flow;
+        }
+    }
+
+    rpc update-flow {
+        input {
+            uses node-flow;
+        }
+    }
+
+    notification flow-added {
+        uses node-flow;
+    }
+
+    notification flow-updated {
+        uses node-flow;
+    }
+
+    notification flow-removed {
+        uses node-flow;
+    }
+
+    augment "/inv:nodes/inv:node" {
+        ext:augment-identifier "flow-capable-node";
+        container flow-tables {
+            list table {
+                key "id";
+                leaf "id" {
+                    type inet:uri;
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/opendaylight-flow-config.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/opendaylight-flow-config.yang
deleted file mode 100644 (file)
index a4ecf73..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-module opendaylight-flow-config {
-    namespace "urn:opendaylight:flow:config";
-    prefix flow;
-
-    import yang-ext {prefix ext;}
-    import opendaylight-inventory {prefix inv;}
-    import opendaylight-flow-base {prefix flowbase;}
-
-    revision "2013-08-19" {
-        description "Initial revision of flow service";
-    }
-
-    /** Base configuration structure 
-    container flows {
-        list flow {
-            uses flowbase:flow;
-        }
-    }
-
-    **/
-}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/opendaylight-flow-service.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/opendaylight-flow-service.yang
deleted file mode 100644 (file)
index 0f01de5..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-module opendaylight-flow-service {
-    namespace "urn:opendaylight:flow:service";
-    prefix flow;
-
-    import yang-ext {prefix ext;}
-    import opendaylight-inventory {prefix inv;}
-    import opendaylight-flow-base {prefix flowbase;}
-
-    revision "2013-08-19" {
-        description "Initial revision of flow service";
-    }
-
-    /** Base configuration structure **/
-    
-
-    grouping flow-update {
-        container original-flow {
-            uses flowbase:flow;
-        }
-        container updated-flow {
-            uses flowbase:flow;
-        }
-    }
-
-    rpc add-flow {
-        input {
-            uses flowbase:flow;
-        }
-    }
-
-    rpc remove-flow {
-        input {
-            uses flowbase:flow;
-        }
-    }
-
-    rpc update-flow {
-        input {
-            uses flow-update;
-        }
-    }
-
-    notification flow-added {
-        uses flowbase:flow;
-    }
-
-    notification flow-updated {
-        input {
-            uses flow-update;
-        }
-    }
-
-    notification flow-removed {
-        uses flowbase:flow;
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/packet-processing.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/packet-processing.yang
new file mode 100644 (file)
index 0000000..260de5f
--- /dev/null
@@ -0,0 +1,46 @@
+module packet-processing {
+    namespace "urn:opendaylight:packet:service";
+    prefix flow;
+
+    import opendaylight-inventory {prefix inv;}
+    import ietf-inet-types {prefix inet;}
+    import ietf-yang-types {prefix yang;} 
+    import opendaylight-l2-types {prefix types;}
+    
+    revision "2013-07-09" {
+        description "";
+    }
+
+    grouping raw-packet {
+       leaf ingress {
+               type inv:node-connector-ref;
+       }
+       leaf payload {
+               type binary;
+       }
+    }
+
+    grouping ethernet-packet {
+       leaf source {
+               type yang:mac-address;
+       }
+
+       leaf destination {
+               type yang:mac-address;
+       }
+    }
+
+
+    notification packet-received {
+       uses raw-packet;
+    }
+
+    rpc transmit-packet {
+       input {
+               leaf egress {
+                       type inv:node-connector-ref;
+               }
+               uses raw-packet;
+       }
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/flow-statistics.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/flow-statistics.yang
new file mode 100644 (file)
index 0000000..7e00a36
--- /dev/null
@@ -0,0 +1,70 @@
+module opendaylight-flow-statistics {
+    namespace "urn:opendaylight:flow:statistics";
+    prefix flowstat;
+
+    import yang-ext {prefix ext;}
+    import opendaylight-inventory {prefix inv;}
+    import opendaylight-flow-types {prefix flow-types;}
+    import sal-flow {prefix flow;}
+    import opendaylight-statistics-types {prefix stat-types;}
+
+    revision "2013-08-19" {
+        description "Initial revision of flow service";
+    }
+
+    rpc get-node-connector-statistics {
+        input {
+            leaf node {
+                ext:context-reference "node-context";
+                type inv:node-ref;
+            }
+            leaf node-connector {
+                type inv:node-connector-ref;
+            }
+        }
+        output {
+            uses stat-types:node-connector-statistics;
+        }
+    }
+
+    notification node-connector-statistics-updated {
+        uses stat-types:node-connector-statistics;
+    }
+
+    rpc get-flow-statistics {
+        input {
+            leaf node {
+                ext:context-reference "node-context";
+                type inv:node-ref;
+            }
+            uses flow-types:flow;
+        }
+        output {
+            uses flow-types:flow-statistics;
+        }
+    }
+
+    notification flow-statistics-updated {
+        uses flow-types:flow-statistics;
+    }
+
+    rpc get-flow-table-statistics {
+        input {
+            leaf node {
+                ext:context-reference "node-context";
+                type inv:node-ref;
+            }
+        }
+        output {
+            uses flow-types:flow-table-statistics;
+        }
+    }
+
+    notification flow-table-statistics-updated {
+        leaf flow-table {
+            type flow:flow-table-ref;
+        }
+        uses flow-types:flow-table-statistics;
+    }
+
+}
\ No newline at end of file
similarity index 54%
rename from opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang
rename to opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/statistics-types.yang
index 3c1bb70e6886a5b27d16e915f45288abf5267099..47c4c9369e2ded77a471de29928e58e1fbef82df 100644 (file)
@@ -1,44 +1,18 @@
-module opendaylight-flow-statistics {
-    namespace "urn:opendaylight:flow:statistics";
-    prefix flowstat;
+module opendaylight-statistics-types {
+    namespace "urn:opendaylight:model:statistics:types";
+    prefix stat-types;
 
-    import yang-ext {prefix ext;}
-    import ietf-inet-types {prefix inet;}
-    import ietf-yang-types {prefix yang;}
-    import opendaylight-flow-base {prefix flow;}
     import opendaylight-inventory {prefix inv;}
 
+    
     revision "2013-08-19" {
         description "Initial revision of flow service";
     }
 
-    /*
-    augment "/flow:flows/flow:flow" {
-        ext:augment-identifier "flow-statistics";
+    
 
-        leaf packet-count {
-            type uint64;
-        } 
-
-        leaf byte-count {
-            type uint64;
-        }
-
-        container duration {
-            leaf second {
-                type uint64;
-            }
-            leaf nanosecond {
-                type uint64;
-            }
-        }
-    }
-    */
-
-    augment "/inv:nodes/inv:node/inv:node-connector" {
-        ext:augment-identifier "node-connector-statistics";
-
-        container packets {
+    grouping node-connector-statistics {
+       container packets {
             leaf received {
                 type uint64;
             }
@@ -78,7 +52,5 @@ module opendaylight-flow-statistics {
         leaf collision-count {
             type uint64;
         }
-
     }
-
 }
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/sal/model/model-inventory/src/main/yang/inventory.yang b/opendaylight/sal/yang-prototype/sal/model/model-inventory/src/main/yang/inventory.yang
new file mode 100644 (file)
index 0000000..a114c62
--- /dev/null
@@ -0,0 +1,69 @@
+module opendaylight-inventory {
+    namespace "urn:opendaylight:inventory";
+    prefix inv;
+
+    import yang-ext {prefix ext;}
+    import ietf-inet-types {prefix inet;}
+    import ietf-yang-types {prefix yang;}
+
+
+    revision "2013-08-19" {
+        description "Initial revision of Inventory model";
+    }
+
+    typedef node-id {
+        type inet:uri;
+    }
+
+    typedef node-connector-id {
+        type inet:uri;
+    }
+
+    typedef node-ref {
+        type instance-identifier;
+    }
+
+    typedef node-connector-ref {
+        type instance-identifier;
+    }
+
+    identity node-context {
+        description "Identity used to mark node context";
+    }
+
+    identity node-connector-context {
+
+    }
+
+       grouping node {
+               leaf id {
+            type node-id;
+        }
+       }
+
+       grouping node-connector {
+               leaf id {
+            type node-connector-id;
+               }
+       }
+
+
+
+
+    /** Base structure **/
+    container nodes {
+        list node {
+            key "id";
+            ext:context-instance "node-context";
+
+                       uses node;
+
+            list "node-connector" {
+                key "id";
+                ext:context-instance "node-connector-context";
+                
+                use node-connector;
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/sal/model/model-inventory/src/main/yang/opendaylight-inventory.yang b/opendaylight/sal/yang-prototype/sal/model/model-inventory/src/main/yang/opendaylight-inventory.yang
deleted file mode 100644 (file)
index fa9de4a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-module opendaylight-inventory {
-    namespace "urn:opendaylight:inventory";
-    prefix flow;
-
-    import yang-ext {prefix ext;}
-    import ietf-inet-types {prefix inet;}
-    import ietf-yang-types {prefix yang;}
-
-
-    revision "2013-08-19" {
-        description "Initial revision of Inventory model";
-    }
-
-    typedef node-id {
-        type inet:uri;
-    }
-
-    typedef node-connector-id {
-        type inet:uri;
-    }
-
-    /** Base structure **/
-    container nodes {
-        list node {
-            key id;
-            leaf id {
-                type node-id;
-            }
-            list node-connector {
-                key "id";
-                leaf id {
-                    type node-connector-id;
-                }
-            }
-        }
-    }
-}
\ No newline at end of file