e74b5483428fc1765e8bf29b763fb840c688fd25
[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         
192     grouping set-field-match {
193         list set-field-match {
194             key "match-type";
195             leaf match-type {
196                 type identityref {
197                     base match-field;
198                 }
199             }
200             leaf has-mask {
201                 type boolean;
202             } 
203         }
204     }
205       
206     grouping table-feature-prop-type {
207         choice table-feature-prop-type {
208             case instructions { 
209                 container instructions {
210                     uses flow:instruction-list;
211                 } 
212             }
213             
214             case instructions-miss {   
215                 container instructions-miss {
216                     uses flow:instruction-list;
217                 } 
218             }
219
220             case next-table {   
221                 container tables {
222                     leaf-list table-ids {
223                         type uint8;
224                     }
225                 } 
226             }
227             
228             case next-table-miss {   
229                 container tables-miss {
230                     leaf-list table-ids {
231                         type uint8;
232                     }
233                 } 
234             }
235             
236             case write-actions {   
237                 container write-actions {
238                     uses action:action-list;
239                 } 
240             }
241             
242             case write-actions-miss {   
243                 container write-actions-miss {
244                     uses action:action-list;
245                 } 
246             }
247             
248             case apply-actions {   
249                 container apply-actions {
250                     uses action:action-list;
251                 } 
252             }
253             
254             case apply-actions-miss {   
255                 container apply-actions-miss {
256                     uses action:action-list;
257                 } 
258             }
259             
260             case match {
261                         container match-setfield {
262                     uses set-field-match; 
263                         }
264             }
265             
266             case wildcards {   
267                         container wildcard-setfield {
268                     uses set-field-match;
269                 }
270             }
271             
272             case write-setfield {   
273                         container write-setfield {
274                     uses set-field-match;
275                 }
276             }
277             
278             case write-setfield-miss {   
279                 container write-setfield-miss {
280                     uses set-field-match;
281                 }
282             }
283             
284             case apply-setfield {   
285                 container apply-setfield {
286                     uses set-field-match; 
287                 }
288             }
289             
290             case apply-setfield-miss {   
291                 container apply-setfield-miss {
292                     uses set-field-match; 
293                 }
294             }
295         }
296     } 
297     
298     grouping table-features {
299         list table-features {
300             key "table-id";
301             
302             leaf table-id {
303                 type uint8;
304             }      
305             
306             leaf name {
307                 description "Name of the table";
308                 type string;               
309             }
310             
311             leaf metadata-match {
312                 description "Bits of metadata table can match";
313                 type uint64;                
314             }
315             
316             leaf metadata-write {
317                 description "Bits of metadata table can write";
318                 type uint64;                
319             }
320             
321             leaf max-entries {
322                 description "Max number of entries supported";
323                 type uint32;                
324             }
325             
326             leaf config {
327                 description "Bitmap of OFPTC_ values";
328                 type table-config;
329             }
330             
331             container table-properties {
332                 list table-feature-properties {
333                      key "order";
334                      leaf order {
335                          type int32;
336                      }
337                      uses table-feature-prop-type;
338                 }
339             }
340         }
341     }    
342 }