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