Merge "Add test for generated code checking list of dependencies."
[controller.git] / opendaylight / md-sal / model / model-flow-base / src / main / yang / opendaylight-flow-types.yang
1 module opendaylight-flow-types {
2     namespace "urn:opendaylight:flow:types";
3     prefix flow;
4
5     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
6     import ietf-yang-types {prefix yang; revision-date "2010-09-24";}    
7     import opendaylight-match-types {prefix match; revision-date "2013-10-26";}
8     import opendaylight-action-types {prefix action;}
9     import opendaylight-meter-types {prefix meter; revision-date "2013-09-18";}
10
11     revision "2013-10-26" {
12         description "Initial revision of flow service";
13     }
14     
15     typedef flow-ref {
16         type instance-identifier;
17     }
18     
19     typedef output-port-values {
20         type enumeration {
21             enum MAX {
22                 value 1;
23             }
24             enum IN_PORT {
25                 value 2;
26             }
27             enum TABLE {
28                 value 3;
29             }
30             enum NORMAL {
31                 value 4;
32             }
33             enum FLOOD {
34                 value 5;
35             }
36             enum ALL {
37                 value 6;
38             }
39             enum CONTROLLER {
40                 value 7;
41             }
42             enum LOCAL {
43                 value 8;
44             }
45             enum ANY {
46                 value 9;
47             }
48              enum NONE {
49                 value 10;
50             }
51
52         }
53     }
54     grouping instruction-list {
55         list instruction {
56             key "order";
57             leaf order {
58                 type int32;
59             }
60             uses instruction;
61         }
62     }
63
64      grouping instruction {
65          choice instruction {
66             case go-to-table-case {
67                 container go-to-table {
68                  leaf table_id {
69                      type uint8;
70                  }
71              }
72             }
73              
74             case write-metadata-case {
75                 container write-metadata {
76                  leaf metadata {
77                      type uint64;
78                  }
79                  
80                  leaf metadata-mask {
81                      type uint64;
82                  }
83              }
84             }
85              
86             case write-actions-case {
87                 container write-actions {
88                  uses action:action-list;
89              }
90             }
91              
92             case apply-actions-case {
93                 container apply-actions {
94                  uses action:action-list;
95              }
96             }
97              
98             case clear-actions-case {
99                 container clear-actions {
100                  uses action:action-list;
101              }
102             }
103              
104             case meter-case {
105                 container meter {
106                      leaf meter-id {
107                         type meter:meter-id;
108                      } 
109                  }
110              }
111          }
112     }
113     
114     typedef flow-mod-flags {
115         type bits {
116             bit CHECK_OVERLAP;
117             bit RESET_COUNTS;
118             bit NO_PKT_COUNTS;
119             bit NO_BYT_COUNTS;
120             bit SEND_FLOW_REM;
121         }
122     }
123
124     typedef removed_reason_flags {
125         type bits {
126             bit IDLE_TIMEOUT;
127             bit HARD_TIMEOUT;
128             bit DELETE;
129             bit GROUP_DELETE;
130         }
131     }
132     
133     grouping generic_flow_attributes {
134         leaf priority {
135             type uint16;
136         }
137         
138         leaf idle-timeout {
139             type uint16;
140         }
141         
142         leaf hard-timeout {
143             type uint16;
144         }
145         
146         leaf cookie {
147             type uint64;
148         }
149         
150         leaf table_id {
151             type uint8;
152         }
153     }
154     
155     grouping flow {
156         container match {
157             uses match:match;
158         }
159         
160         container instructions {
161             uses instruction-list;
162         }          
163          
164         uses generic_flow_attributes;
165         
166         leaf container-name {
167             type string; 
168         }
169         
170         leaf cookie_mask {
171             type uint64;
172         }
173         
174         leaf buffer_id {
175             type uint32;
176         }
177         
178         leaf out_port {
179             type uint64;
180         }
181         
182         leaf out_group {
183             type uint32;
184         }
185         
186         leaf flags {
187             type flow-mod-flags;
188         }
189         
190         leaf flow-name {
191             type string;
192         }
193         
194         leaf installHw {
195             type boolean;
196         }
197
198         leaf barrier {
199             type boolean;
200         }
201
202         leaf strict {
203             type boolean;
204             default "false";
205         }
206
207     }
208
209     grouping flow-statistics {
210         leaf packet-count {
211             type yang:counter64;
212         }
213
214         leaf byte-count {
215             type yang:counter64;
216         }
217
218         container duration {
219             leaf second {
220                 type yang:counter64;
221             }
222             leaf nanosecond {
223                 type yang:counter64;
224             }
225         }
226     }
227
228     grouping flow-table-statistics {
229         leaf active {
230             type yang:counter64;
231         } 
232
233         leaf lookup {
234             type yang:counter64;
235         }
236
237         leaf matched {
238             type yang:counter64;   
239         }
240     }
241     
242     grouping flow-mod-removed {
243         uses generic_flow_attributes;
244         
245         leaf removed_reason {
246             type removed_reason_flags;
247         }
248
249         leaf duration_nsec {
250             type uint32;
251         }
252         
253         leaf duration_sec {
254             type uint32;
255         }
256
257         leaf packet_count {
258             type uint64;
259         }
260
261         leaf byte_count {
262             type uint64;
263         }
264                 
265         container match {
266             uses match:match;
267         }
268     }
269 }