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