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