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