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