29ea8ddf1889bc8d3cfec6e37d070896fc0bd3ae
[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                 leaf meter-id {
60                     type uint32;
61                 }
62             }   
63         }
64     }
65     
66     typedef flow-mod-flags {
67         type bits {
68             bit CHECK_OVERLAP;
69             bit RESET_COUNTS;
70             bit NO_PKT_COUNTS;
71             bit NO_BYT_COUNTS;
72             bit SEND_FLOW_REM;
73         }
74     }
75
76     typedef removed_reason_flags {
77         type bits {
78             bit IDLE_TIMEOUT;
79             bit HARD_TIMEOUT;
80             bit DELETE;
81             bit GROUP_DELETE;
82         }
83     }
84     
85     grouping generic_flow_attributes {
86         leaf priority {
87             type uint16;
88         }
89         
90         leaf idle-timeout {
91             type uint16;
92         }
93         
94         leaf hard-timeout {
95             type uint16;
96         }
97         
98         leaf cookie {
99             type uint64;
100         }
101         
102         leaf table_id {
103             type uint8;
104         }
105     }
106     
107     grouping flow {
108         container match {
109             uses match:match;
110         }
111         
112         container instructions {
113             uses instruction-list;
114         }          
115          
116         uses generic_flow_attributes;
117         
118         leaf container-name {
119             type string; 
120         }
121         
122         leaf cookie_mask {
123             type uint64;
124         }
125         
126         leaf buffer_id {
127             type uint32;
128         }
129         
130         leaf out_port {
131             type uint64;
132         }
133         
134         leaf out_group {
135             type uint32;
136         }
137         
138         leaf flags {
139             type flow-mod-flags;
140         }
141         
142         leaf flow-name {
143             type string;
144         }
145         
146         leaf installHw {
147             type boolean;
148         }
149
150         leaf barrier {
151             type boolean;
152         }
153
154         leaf strict {
155             type boolean;
156             default "false";
157         }
158
159     }
160
161     grouping flow-statistics {
162         leaf packet-count {
163             type yang:counter64;
164         } 
165
166         leaf byte-count {
167             type yang:counter64;
168         }
169
170         container duration {
171             leaf second {
172                 type yang:counter64;
173             }
174             leaf nanosecond {
175                 type yang:counter64;
176             }
177         }
178     }
179
180     grouping flow-table-statistics {
181         leaf active {
182             type yang:counter64;
183         } 
184
185         leaf lookup {
186             type yang:counter64;
187         }
188
189         leaf matched {
190             type yang:counter64;   
191         }
192     }
193     
194     grouping flow-mod-removed {
195         uses generic_flow_attributes;
196         
197         leaf removed_reason {
198             type removed_reason_flags;
199         }
200
201         leaf duration_nsec {
202             type uint32;
203         }
204         
205         leaf duration_sec {
206             type uint32;
207         }
208
209         leaf packet_count {
210             type uint64;
211         }
212
213         leaf byte_count {
214             type uint64;
215         }
216                 
217         container match {
218             uses match:match;
219         }
220     }
221 }