Added container and flow name details as in AD-SAL
[controller.git] / opendaylight / md-sal / model / model-flow-base / src / main / yang / 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;}
6     import opendaylight-match-types {prefix match;}
7     import ietf-yang-types {prefix yang;}
8     import opendaylight-l2-types {prefix l2t;}
9
10     revision "2013-08-19" {
11         description "Initial revision of flow service";
12     }
13     
14     
15     typedef vlan-cfi {
16            type int32;    
17     }
18     
19     grouping address {
20         choice address {
21             case ipv4 {
22                 leaf ipv4-address {
23                     type inet:ipv4-prefix;
24                 }
25             }
26             case ipv6 {
27                 leaf ipv6-address {
28                     type inet:ipv6-prefix;
29                 }
30             }
31         }
32     }    
33
34     grouping action {
35         choice action {
36             case output-action {
37                 leaf-list output-node-connector {
38                     type inet:uri;
39                 }
40             }
41
42             case controller-action {
43                 leaf max-length {
44                     type uint16 {
45                         range "0..65294";
46                     }
47                 }
48             }
49
50             case set-queue-action {
51                 leaf queue {
52                     type string; // TODO: define queues
53                 }
54             }
55
56             case pop-mpls-action {
57                 leaf ethernet-type {
58                         type uint16; // TODO: define ethertype type
59                 }
60             }
61
62             case set-mpls-ttl-action {
63                 leaf mpls-ttl {
64                     type uint8;
65                 }
66             }
67
68             case set-nw-ttl-action {
69                 leaf nw-ttl {
70                     type uint8;
71                 }
72             }
73
74             case push-pbb-action {
75
76             }
77
78             case push-mpls-action {
79
80             }
81
82             case drop-action {
83             }
84             
85             case flood-action {
86             }
87             
88             case flood-all-action {
89             }
90             
91             case hw-path-action {
92             }
93             
94             case loopback-action {
95             }
96             
97             case pop-vlan-action {
98             }
99             
100             case push-vlan-action {
101                 leaf tag {               // TPID - 16 bits
102                     type int32;
103                 } 
104                 leaf pcp {               // PCP - 3 bits
105                     type int32;
106                 }
107                 leaf cfi {               // CFI - 1 bit (drop eligible)
108                     type vlan-cfi;
109                 }
110                 leaf vlan-id {           // VID - 12 bits
111                     type l2t:vlan-id;
112                 }
113 //                leaf tci {               //TCI = [PCP + CFI + VID]
114 //                }
115 //                leaf header {            //header = [TPID + TCI] 
116 //                }
117             }
118             case set-dl-dst-action {
119                 leaf address {
120                     type yang:mac-address;
121                 }
122             }
123             
124             case set-dl-src-action {
125                 leaf address {
126                     type yang:mac-address;
127                 }
128             }
129             case set-dl-type-action {
130                 leaf dl-type {
131                     type l2t:ether-type;
132                 }
133             }
134             case set-next-hop-action {
135                 uses address;
136             }
137             case set-nw-dst-action {
138                 uses address;            
139             }
140             case set-nw-src-action{
141                 uses address;            
142             }
143             case set-nw-tos-action {
144                 leaf tos {
145                     type int32;
146                 }
147             }
148             
149             case set-tp-dst-action {
150                 leaf port {
151                     type inet:port-number;
152                 }                
153             }
154             case set-tp-src-action {
155                 leaf port {
156                     type inet:port-number;
157                 }                
158             }
159             case set-vlan-cfi-action {
160                 leaf vlan-cfi {
161                     type vlan-cfi;
162                 }
163             }
164             case set-vlan-id-action {
165                 leaf vlan-id {
166                     type l2t:vlan-id;
167                 } 
168             }
169             case set-vlan-pcp-action {
170                 leaf vlan-pcp {
171                     type l2t:vlan-pcp;
172                 }            
173             }
174             case sw-path-action {            
175             }
176             
177             
178         }
179     }
180
181     typedef flow-mod-flags {
182         type bits {
183             bit CHECK_OVERLAP;
184             bit RESET_COUNTS;
185             bit NO_PKT_COUNTS;
186             bit NO_BYT_COUNTS;
187         }
188     }
189     
190     grouping flow {
191         container match {
192             uses match:match;
193         }
194         list action {
195             key "order";
196             leaf order {
197                 type int32;
198             }
199             uses action;
200         }
201         leaf priority {
202             type uint16;
203         }
204         
205         leaf idle-timeout {
206             type uint16;
207         }
208         
209         leaf hard-timeout {
210             type uint16;
211         }
212         
213         leaf cookie {
214             type uint64;
215         }
216         
217         leaf container-name {
218             type string; 
219         }
220         
221         leaf cookie_mask {
222             type uint8;
223         }
224         
225         leaf table_id {
226             type uint64;
227         }
228         
229         leaf buffer_id {
230             type uint32;
231         }
232         
233         leaf out_port {
234             type uint64;
235         }
236         
237         leaf out_group {
238             type uint32;
239         }
240         
241         leaf flags{
242             type flow-mod-flags;
243         }
244         
245         leaf flow-name{
246             type string;
247         }
248     }
249
250     grouping flow-statistics {
251         leaf packet-count {
252             type yang:counter64;
253         } 
254
255         leaf byte-count {
256             type yang:counter64;
257         }
258
259         container duration {
260             leaf second {
261                 type yang:counter64;
262             }
263             leaf nanosecond {
264                 type yang:counter64;
265             }
266         }
267     }
268
269     grouping flow-table-statistics {
270         leaf active {
271             type yang:counter64;
272         } 
273
274         leaf lookup {
275             type yang:counter64;
276         }
277
278         leaf matched {
279             type yang:counter64;   
280         }
281     }
282 }