Fix opendaylight-flow-types.yang cases
[openflowplugin.git] / model / model-flow-base / src / main / yang / opendaylight-table-types.yang
1 module opendaylight-table-types {
2     namespace "urn:opendaylight:table:types";
3     prefix table;
4
5     import opendaylight-flow-types {prefix flow;revision-date "2013-10-26";}
6     import opendaylight-action-types {prefix action;}
7     import opendaylight-multipart-types { prefix multipart; revision-date "2017-01-12"; }
8
9     revision "2013-10-26" {
10         description "Initial revision of table service";
11     }
12
13     typedef table-id {
14         type uint8;
15     }
16
17     typedef table-ref {
18         type instance-identifier;
19     }
20
21     typedef table-config {
22         type bits {
23             bit DEPRECATED-MASK;
24         }
25     }
26
27     // field types
28     identity match-field {
29         description "Base identity for match Fields";
30     }
31
32     identity in_port {
33         base match-field;
34         description "Match for Switch input port.";
35     }
36     identity in_phy_port {
37         base match-field;
38         description "Match for Switch physical input port.";
39     }
40     identity metadata {
41         base match-field;
42         description "Match for Metadata passed between tables.";
43     }
44     identity eth_dst {
45         base match-field;
46         description "Match for Ethernet destination address.";
47     }
48     identity eth_src {
49         base match-field;
50         description "Match for Ethernet source address.";
51     }
52     identity eth_type {
53         base match-field;
54         description "Match for Ethernet frame type.";
55     }
56     identity vlan_vid {
57         base match-field;
58         description "Match for VLAN id.";
59     }
60     identity vlan_pcp {
61         base match-field;
62         description "Match for VLAN priority.";
63     }
64     identity ip_dscp {
65         base match-field;
66         description "Match for IP DSCP (6 bits in ToS field).";
67     }
68     identity ip_ecn {
69         base match-field;
70         description "Match for IP ECN (2 bits in ToS field).";
71     }
72     identity ip_proto {
73         base match-field;
74         description "Match for IP protocol.";
75     }
76     identity ipv4_src {
77         base match-field;
78         description "Match for IPv4 source address.";
79     }
80     identity ipv4_dst {
81         base match-field;
82         description "Match for IPv4 destination address.";
83     }
84     identity tcp_src {
85         base match-field;
86         description "Match for TCP source port.";
87     }
88     identity tcp_dst {
89         base match-field;
90         description "Match for TCP destination port.";
91     }
92     identity udp_src {
93         base match-field;
94         description "Match for UDP source port.";
95     }
96     identity udp_dst {
97         base match-field;
98         description "Match for UDP destination port.";
99     }
100     identity sctp_src {
101         base match-field;
102         description "Match for SCTP source port.";
103     }
104     identity sctp_dst {
105         base match-field;
106         description "Match for SCTP destination port.";
107     }
108     identity icmpv4_type {
109         base match-field;
110         description "Match for ICMP type.";
111     }
112     identity icmpv4_code {
113         base match-field;
114         description "Match for ICMP code.";
115     }
116     identity arp_op {
117         base match-field;
118         description "Match for ARP opcode.";
119     }
120     identity arp_spa {
121         base match-field;
122         description "Match for ARP source IPv4 address.";
123     }
124     identity arp_tpa {
125         base match-field;
126         description "Match for ARP target IPv4 address.";
127     }
128     identity arp_sha {
129         base match-field;
130         description "Match for ARP source hardware address.";
131     }
132     identity arp_tha {
133         base match-field;
134         description "Match for ARP target hardware address.";
135     }
136     identity ipv6_src {
137         base match-field;
138         description "Match for IPv6 source address.";
139     }
140     identity ipv6_dst {
141         base match-field;
142         description "Match for IPv6 destination address.";
143     }
144     identity ipv6_flabel {
145         base match-field;
146         description "Match for IPv6 Flow Label";
147     }
148     identity icmpv6_type {
149         base match-field;
150         description "Match for ICMPv6 type.";
151     }
152     identity icmpv6_code {
153         base match-field;
154         description "Match for ICMPv6 code.";
155     }
156     identity ipv6_nd_target {
157         base match-field;
158         description "Match for Target address for ND.";
159     }
160     identity ipv6_nd_sll {
161         base match-field;
162         description "Match for Source link-layer for ND.";
163     }
164     identity ipv6_nd_tll {
165         base match-field;
166         description "Match for Target link-layer for ND.";
167     }
168     identity mpls_label {
169         base match-field;
170         description "Match for MPLS label.";
171     }
172     identity mpls_tc {
173         base match-field;
174         description "Match for MPLS TC.";
175     }
176     identity mpls_bos {
177         base match-field;
178         description "Match for MPLS BoS bit.";
179     }
180     identity pbb_isid {
181         base match-field;
182         description "Match for PBB I-SID.";
183     }
184     identity tunnel_id {
185         base match-field;
186         description "Match for Logical Port Metadata";
187     }
188     identity ipv6_exthdr {
189         base match-field;
190         description "Match for IPv6 Extension Header pseudo-field";
191     }
192     identity tcp_flags {
193         base match-field;
194         description "TCP Flags Match";
195     }
196     identity tunnel_ipv4_dst {
197         base match-field;
198         description "IPv4 destination tunnel endpoint address.";
199     }
200     identity tunnel_ipv4_src {
201         base match-field;
202         description "IPv4 source tunnel endpoint address.";
203     }
204
205     grouping set-field-match {
206         list set-field-match {
207             key "match-type";
208             leaf match-type {
209                 type identityref {
210                     base match-field;
211                 }
212             }
213             leaf has-mask {
214                 type boolean;
215             }
216         }
217     }
218
219     grouping table-feature-prop-type {
220         choice table-feature-prop-type {
221             case instructions {
222                 container instructions {
223                     uses flow:instruction-list;
224                 }
225             }
226
227             case instructions-miss {
228                 container instructions-miss {
229                     uses flow:instruction-list;
230                 }
231             }
232
233             case next-table {
234                 container tables {
235                     leaf-list table-ids {
236                         type uint8;
237                     }
238                 }
239             }
240
241             case next-table-miss {
242                 container tables-miss {
243                     leaf-list table-ids {
244                         type uint8;
245                     }
246                 }
247             }
248
249             case write-actions {
250                 container write-actions {
251                     uses action:action-list;
252                 }
253             }
254
255             case write-actions-miss {
256                 container write-actions-miss {
257                     uses action:action-list;
258                 }
259             }
260
261             case apply-actions {
262                 container apply-actions {
263                     uses action:action-list;
264                 }
265             }
266
267             case apply-actions-miss {
268                 container apply-actions-miss {
269                     uses action:action-list;
270                 }
271             }
272
273             case match {
274                         container match-setfield {
275                     uses set-field-match;
276                         }
277             }
278
279             case wildcards {
280                         container wildcard-setfield {
281                     uses set-field-match;
282                 }
283             }
284
285             case write-setfield {
286                         container write-setfield {
287                     uses set-field-match;
288                 }
289             }
290
291             case write-setfield-miss {
292                 container write-setfield-miss {
293                     uses set-field-match;
294                 }
295             }
296
297             case apply-setfield {
298                 container apply-setfield {
299                     uses set-field-match;
300                 }
301             }
302
303             case apply-setfield-miss {
304                 container apply-setfield-miss {
305                     uses set-field-match;
306                 }
307             }
308         }
309     }
310
311     grouping table-features {
312         list table-features {
313             key "table-id";
314
315             leaf table-id {
316                 type uint8;
317             }
318
319             leaf name {
320                 description "Name of the table";
321                 type string;
322             }
323
324             leaf metadata-match {
325                 description "Bits of metadata table can match";
326                 type uint64;
327             }
328
329             leaf metadata-write {
330                 description "Bits of metadata table can write";
331                 type uint64;
332             }
333
334             leaf max-entries {
335                 description "Max number of entries supported";
336                 type uint32;
337             }
338
339             leaf config {
340                 description "Bitmap of OFPTC_ values";
341                 type table-config;
342             }
343
344             container table-properties {
345                 list table-feature-properties {
346                      key "order";
347                      uses action:ordered;
348                      uses table-feature-prop-type;
349                 }
350             }
351         }
352     }
353
354     augment "/multipart:multipart-reply/multipart:multipart-reply-body" {
355         case multipart-reply-table-features {
356             uses table-features;
357         }
358     }
359
360     augment "/multipart:multipart-request/multipart:multipart-request-body" {
361         case multipart-request-table-features {
362             uses table-features;
363         }
364     }
365 }