Eliminate blueprint for southbound-cli commands
[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                         ordered-by user;
238                     }
239                 }
240             }
241
242             case next-table-miss {
243                 container tables-miss {
244                     leaf-list table-ids {
245                         type uint8;
246                         ordered-by user;
247                     }
248                 }
249             }
250
251             case write-actions {
252                 container write-actions {
253                     uses action:action-list;
254                 }
255             }
256
257             case write-actions-miss {
258                 container write-actions-miss {
259                     uses action:action-list;
260                 }
261             }
262
263             case apply-actions {
264                 container apply-actions {
265                     uses action:action-list;
266                 }
267             }
268
269             case apply-actions-miss {
270                 container apply-actions-miss {
271                     uses action:action-list;
272                 }
273             }
274
275             case match {
276                 container match-setfield {
277                     uses set-field-match;
278                 }
279             }
280
281             case wildcards {
282                 container wildcard-setfield {
283                     uses set-field-match;
284                 }
285             }
286
287             case write-setfield {
288                 container write-setfield {
289                     uses set-field-match;
290                 }
291             }
292
293             case write-setfield-miss {
294                 container write-setfield-miss {
295                     uses set-field-match;
296                 }
297             }
298
299             case apply-setfield {
300                 container apply-setfield {
301                     uses set-field-match;
302                 }
303             }
304
305             case apply-setfield-miss {
306                 container apply-setfield-miss {
307                     uses set-field-match;
308                 }
309             }
310         }
311     }
312
313     grouping table-features {
314         list table-features {
315             key "table-id";
316
317             leaf table-id {
318                 type uint8;
319             }
320
321             leaf name {
322                 description "Name of the table";
323                 type string;
324             }
325
326             leaf metadata-match {
327                 description "Bits of metadata table can match";
328                 type uint64;
329             }
330
331             leaf metadata-write {
332                 description "Bits of metadata table can write";
333                 type uint64;
334             }
335
336             leaf max-entries {
337                 description "Max number of entries supported";
338                 type uint32;
339             }
340
341             leaf config {
342                 description "Bitmap of OFPTC_ values";
343                 type table-config;
344             }
345
346             container table-properties {
347                 list table-feature-properties {
348                      key "order";
349                      uses action:ordered;
350                      uses table-feature-prop-type;
351                 }
352             }
353         }
354     }
355
356     augment "/multipart:multipart-reply/multipart:multipart-reply-body" {
357         case multipart-reply-table-features {
358             uses table-features;
359         }
360     }
361
362     augment "/multipart:multipart-request/multipart:multipart-request-body" {
363         case multipart-request-table-features {
364             uses table-features;
365         }
366     }
367 }