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