Fixed quote issue in flow-types.yang and table-types.yang
[controller.git] / opendaylight / md-sal / model / model-flow-base / src / main / yang / flow-types.yang
index 8e8c82293505795d7a53e5ada9275320a05ad617..29ea8ddf1889bc8d3cfec6e37d070896fc0bd3ae 100644 (file)
@@ -3,55 +3,23 @@ module opendaylight-flow-types {
     prefix flow;
 
     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
-    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
-    import opendaylight-l2-types {prefix l2t; revision-date "2013-08-27";}
-    import opendaylight-match-types {prefix match; revision-date 2013-10-26";}
-    
+    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}    
+    import opendaylight-match-types {prefix match; revision-date "2013-10-26";}
+    import opendaylight-action-types {prefix action;}
 
     revision "2013-10-26" {
         description "Initial revision of flow service";
     }
     
-    
-    typedef vlan-cfi {
-           type int32;    
-    }
-    
-    
-    grouping action-list {
-        list action {
+    grouping instruction-list {
+        list instruction {
             key "order";
             leaf order {
                 type int32;
             }
-            uses action;
+            uses instruction;
         }
     }
-    
-    grouping address {
-        choice address {
-            case ipv4 {
-                leaf ipv4-address {
-                    type inet:ipv4-prefix;
-                }
-            }
-            case ipv6 {
-                leaf ipv6-address {
-                    type inet:ipv6-prefix;
-                }
-            }
-        }
-    }    
-
-    grouping instruction-list {
-            list instruction {
-                key "order";
-                leaf order {
-                    type int32;
-                }
-                uses instruction;
-            }
-    }
 
     grouping instruction {
         choice instruction {
@@ -72,228 +40,49 @@ module opendaylight-flow-types {
             }
             
             case write-actions {
-                uses action-list;
+                uses action:action-list;
             }
             
             case apply-actions {
-                uses action-list;
+                uses action:action-list;
             }
             
             case clear-actions {
-                uses action-list;
+                uses action:action-list;
             }
             
             case meter {
                 leaf meter {
                     type string;
                 }
-            }   
-        }
-    }
-    
-    grouping action {
-        choice action {
-            case output-action {
-                leaf-list output-node-connector {
-                    type inet:uri;
-                }
                 
-                leaf max-length {
-                    type uint16 {
-                        range "0..65294";
-                    }
-                }                
-            }
-
-            case controller-action {
-                leaf max-length {
-                    type uint16 {
-                        range "0..65294";
-                    }
-                }
-            }
-
-            case set-queue-action {
-                leaf queue {
-                    type string; 
+                leaf meter-id {
+                    type uint32;
                 }
-            }
-
-            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 {
-                leaf ethernet-type {
-                    type uint16; // TODO: define ethertype type
-                }
-            }
-
-            case pop-pbb-action {
-                
-            }
-            
-            case push-mpls-action {
-                leaf ethernet-type {
-                    type uint16; // TODO: define ethertype type
-                }
-            }
-            
-            case dec-mpls-ttl {
-            }
-            
-            case dec-nw-ttl {
-            }
-            
-            case drop-action {
-            }
-            
-            case flood-action {
-            }
-            
-            case flood-all-action {
-            }
-            
-            case hw-path-action {
-            }
-            
-            case loopback-action {
-            }
-            
-            case pop-vlan-action {
-            }
-            
-            case push-vlan-action {
-                leaf tag {               // TPID - 16 bits
-                    type int32;
-                } 
-                leaf pcp {               // PCP - 3 bits
-                    type int32;
-                }
-                leaf cfi {               // CFI - 1 bit (drop eligible)
-                    type vlan-cfi;
-                }
-                leaf vlan-id {           // VID - 12 bits
-                    type l2t:vlan-id;
-                }
-//                leaf tci {               //TCI = [PCP + CFI + VID]
-//                }
-//                leaf header {            //header = [TPID + TCI] 
-//                }
-            }
-            
-            case copy-ttl-out {
-            }
-            
-            case copy-ttl-in {
-            }
-            
-            case set-dl-dst-action {
-                leaf address {
-                    type yang:mac-address;
-                }
-            }
-            
-            case set-dl-src-action {
-                leaf address {
-                    type yang:mac-address;
-                }
-            }
-            case group-action {
-                leaf group {
-                    type string;
-                }
-            }
-            
-            case set-dl-type-action {
-                leaf dl-type {
-                    type l2t:ether-type;
-                }
-            }
-            
-            case set-next-hop-action {
-                uses address;
-            }
-            
-            case set-nw-dst-action {
-                uses address;            
-            }
-            
-            case set-nw-src-action{
-                uses address;            
-            }
-            
-            case set-nw-tos-action {
-                leaf tos {
-                    type int32;
-                }
-            }
-            
-            case set-tp-dst-action {
-                leaf port {
-                    type inet:port-number;
-                }                
-            }
-            case set-tp-src-action {
-                leaf port {
-                    type inet:port-number;
-                }                
-            }
-            case set-vlan-cfi-action {
-                leaf vlan-cfi {
-                    type vlan-cfi;
-                }
-            }
-            
-            case set-vlan-id-action {
-                leaf vlan-id {
-                    type l2t:vlan-id;
-                } 
-            }
-            
-            case set-vlan-pcp-action {
-                leaf vlan-pcp {
-                    type l2t:vlan-pcp;
-                }            
-            }
-            
-            case sw-path-action {            
-            }  
+            }   
         }
     }
-
+    
     typedef flow-mod-flags {
         type bits {
             bit CHECK_OVERLAP;
             bit RESET_COUNTS;
             bit NO_PKT_COUNTS;
             bit NO_BYT_COUNTS;
+            bit SEND_FLOW_REM;
         }
     }
-    
-    grouping flow {
-        container match {
-            uses match:match;
-        }
-        
-        container instructions {
-            uses instruction-list;
+
+    typedef removed_reason_flags {
+        type bits {
+            bit IDLE_TIMEOUT;
+            bit HARD_TIMEOUT;
+            bit DELETE;
+            bit GROUP_DELETE;
         }
-                
+    }
+    
+    grouping generic_flow_attributes {
         leaf priority {
             type uint16;
         }
@@ -310,16 +99,28 @@ module opendaylight-flow-types {
             type uint64;
         }
         
+        leaf table_id {
+            type uint8;
+        }
+    }
+    
+    grouping flow {
+        container match {
+            uses match:match;
+        }
+        
+        container instructions {
+            uses instruction-list;
+        }          
+         
+        uses generic_flow_attributes;
+        
         leaf container-name {
             type string; 
         }
         
         leaf cookie_mask {
-            type uint8;
-        }
-        
-        leaf table_id {
-            type uint8;
+            type uint64;
         }
         
         leaf buffer_id {
@@ -334,13 +135,27 @@ module opendaylight-flow-types {
             type uint32;
         }
         
-        leaf flags{
+        leaf flags {
             type flow-mod-flags;
         }
         
-        leaf flow-name{
+        leaf flow-name {
             type string;
         }
+        
+        leaf installHw {
+            type boolean;
+        }
+
+        leaf barrier {
+            type boolean;
+        }
+
+        leaf strict {
+            type boolean;
+            default "false";
+        }
+
     }
 
     grouping flow-statistics {
@@ -375,4 +190,32 @@ module opendaylight-flow-types {
             type yang:counter64;   
         }
     }
+    
+    grouping flow-mod-removed {
+        uses generic_flow_attributes;
+        
+        leaf removed_reason {
+            type removed_reason_flags;
+        }
+
+        leaf duration_nsec {
+            type uint32;
+        }
+        
+        leaf duration_sec {
+            type uint32;
+        }
+
+        leaf packet_count {
+            type uint64;
+        }
+
+        leaf byte_count {
+            type uint64;
+        }
+               
+        container match {
+            uses match:match;
+        }
+    }
 }
\ No newline at end of file