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