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