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