BUG-9223:Remove hardcoded value of lldp interval
[openflowplugin.git] / 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 "2013-07-15";}
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             uses action:ordered;
62             uses instruction;
63         }
64     }
65
66      grouping instruction {
67          choice instruction {
68             case go-to-table-case {
69                 container go-to-table {
70                  leaf table_id {
71                      type uint8;
72                  }
73              }
74             }
75              
76             case write-metadata-case {
77                 container write-metadata {
78                  leaf metadata {
79                      type uint64;
80                  }
81                  
82                  leaf metadata-mask {
83                      type uint64;
84                  }
85              }
86             }
87              
88             case write-actions-case {
89                 container write-actions {
90                  uses action:action-list;
91              }
92             }
93              
94             case apply-actions-case {
95                 container apply-actions {
96                  uses action:action-list;
97              }
98             }
99              
100             case clear-actions-case {
101                 container clear-actions {
102                  uses action:action-list;
103              }
104             }
105              
106             case meter-case {
107                 container meter {
108                      leaf meter-id {
109                         type meter:meter-id;
110                      } 
111                  }
112              }
113          }
114     }
115     
116     typedef flow-mod-flags {
117         type bits {
118             bit CHECK_OVERLAP;
119             bit RESET_COUNTS;
120             bit NO_PKT_COUNTS;
121             bit NO_BYT_COUNTS;
122             bit SEND_FLOW_REM;
123         }
124     }
125      typedef removed-flow-reason {
126             type enumeration {
127                 enum OFPRR_IDLE_TIMEOUT{
128                     value 0;
129                     description "Flow idle time exceeded idle_timeout.";
130                 }
131                 enum OFPRR_HARD_TIMEOUT {
132                     value 1;
133                     description "Time exceeded hard_timeout.";
134                 }
135                 enum OFPRR_DELETE {
136                     value 2;
137                     description "Evicted by a DELETE flow mod.";
138                 }
139                 enum OFPRR_GROUP_DELETE {
140                     value 3;
141                     description "Group was removed.";
142                 }
143
144             }
145      }
146     
147     grouping generic_flow_attributes {
148         leaf priority {
149             type uint16;
150         }
151         
152         leaf idle-timeout {
153             type uint16;
154         }
155         
156         leaf hard-timeout {
157             type uint16;
158         }
159         
160         leaf cookie {
161             type flow-cookie;
162         }
163         
164         leaf table_id {
165             type uint8;
166         }
167     }
168     
169     grouping flow {
170         container match {
171             uses match:match;
172         }
173         
174         container instructions {
175             uses instruction-list;
176         }          
177          
178         uses generic_flow_attributes;
179         
180         leaf container-name {
181             type string; 
182         }
183         
184         leaf cookie_mask {
185             type flow-cookie;
186         }
187         
188         leaf buffer_id {
189             type uint32;
190         }
191         
192         leaf out_port {
193             type uint64;
194         }
195         
196         leaf out_group {
197             type uint32;
198         }
199         
200         leaf flags {
201             type flow-mod-flags;
202         }
203         
204         leaf flow-name {
205             type string;
206         }
207         
208         leaf installHw {
209             type boolean;
210         }
211
212         leaf barrier {
213             type boolean;
214         }
215
216         leaf strict {
217             type boolean;
218             default "false";
219         }
220
221     }
222
223     grouping flow-statistics {
224         leaf packet-count {
225             type yang:counter64;
226         }
227
228         leaf byte-count {
229             type yang:counter64;
230         }
231
232         container duration {
233             leaf second {
234                 type yang:counter64;
235             }
236             leaf nanosecond {
237                 type yang:counter64;
238             }
239         }
240     }
241
242     grouping flow-table-statistics {
243         leaf active {
244             type yang:counter64;
245         } 
246
247         leaf lookup {
248             type yang:counter64;
249         }
250
251         leaf matched {
252             type yang:counter64;   
253         }
254     }
255     
256     grouping flow-mod-removed {
257         uses generic_flow_attributes;
258         
259         leaf removed_reason {
260             type removed-flow-reason;
261         }
262
263         leaf duration_nsec {
264             type uint32;
265         }
266         
267         leaf duration_sec {
268             type uint32;
269         }
270
271         leaf packet_count {
272             type uint64;
273         }
274
275         leaf byte_count {
276             type uint64;
277         }
278                 
279         container match {
280             uses match:match;
281         }
282     }
283 }