Quickfix - TableMod message (now correct config)
[openflowjava.git] / openflow-protocol-api / src / main / yang / openflow-extensible-match.yang
1 module openflow-extensible-match {
2     namespace "urn:opendaylight:openflow:oxm";
3     prefix "oxm";
4
5     import ietf-yang-types {prefix yang;}
6     import ietf-inet-types {prefix inet;}
7     import openflow-types {prefix oft;}
8
9     revision "2013-07-31" {
10         description "OpenFlow 1.3 - match model";
11     }
12
13     identity oxm-match-type {
14         description 
15            "The OpenFlow Extensible Match type must be supported by all OpenFlow
16             switches.";
17         base oft:match-type-base;
18     }
19     
20     // oxm classes
21         identity clazz {
22             description "Base identity for OXM classes";
23         }
24
25         identity nxm-0-class {
26             description "Backward compatibility with NXM";
27             base clazz;
28         }
29         identity nxm-1-class {
30             description "Backward compatibility with NXM";
31             base clazz;
32         }
33         identity openflow-basic-class {
34             description "Basic class for OpenFlow";
35             base clazz;
36         }
37         identity experimenter-class {
38             description 
39                 "Marks Experimenter match type class.
40                 All experimenter match classes MUST use this class as a base.";
41             base clazz;
42         }
43
44     // field types
45         identity match-field {
46             description "Base identity for OXM Fields";
47         }
48
49         identity in_port {
50             base match-field;
51             description "Match for Switch input port.";
52         }
53         identity in_phy_port {
54             base match-field;
55             description "Match for Switch physical input port.";
56         }
57         identity metadata {
58             base match-field;
59             description "Match for Metadata passed between tables.";
60         }
61         identity eth_dst {
62             base match-field;
63             description "Match for Ethernet destination address.";
64         }
65         identity eth_src {
66             base match-field;
67             description "Match for Ethernet source address.";
68         }
69         identity eth_type {
70             base match-field;
71             description "Match for Ethernet frame type.";
72         }
73         identity vlan_vid {
74             base match-field;
75             description "Match for VLAN id.";
76         }
77         identity vlan_pcp {
78             base match-field;
79             description "Match for VLAN priority.";
80         }
81         identity ip_dscp {
82             base match-field;
83             description "Match for IP DSCP (6 bits in ToS field).";
84         }
85         identity ip_ecn {
86             base match-field;
87             description "Match for IP ECN (2 bits in ToS field).";
88         }
89         identity ip_proto {
90             base match-field;
91             description "Match for IP protocol.";
92         }
93         identity ipv4_src {
94             base match-field;
95             description "Match for IPv4 source address.";
96         }
97         identity ipv4_dst {
98             base match-field;
99             description "Match for IPv4 destination address.";
100         }
101         identity tcp_src {
102             base match-field;
103             description "Match for TCP source port.";
104         }
105         identity tcp_dst {
106             base match-field;
107             description "Match for TCP destination port.";
108         }
109         identity udp_src {
110             base match-field;
111             description "Match for UDP source port.";
112         }
113         identity udp_dst {
114             base match-field;
115             description "Match for UDP destination port.";
116         }
117         identity sctp_src {
118             base match-field;
119             description "Match for SCTP source port.";
120         }
121         identity sctp_dst {
122             base match-field;
123             description "Match for SCTP destination port.";
124         }
125         identity icmpv4_type {
126             base match-field;
127             description "Match for ICMP type.";
128         }
129         identity icmpv4_code {
130             base match-field;
131             description "Match for ICMP code.";
132         }
133         identity arp_op {
134             base match-field;
135             description "Match for ARP opcode.";
136         }
137         identity arp_spa {
138             base match-field;
139             description "Match for ARP source IPv4 address.";
140         }
141         identity arp_tpa {
142             base match-field;
143             description "Match for ARP target IPv4 address.";
144         }
145         identity arp_sha {
146             base match-field;
147             description "Match for ARP source hardware address.";
148         }
149         identity arp_tha {
150             base match-field;
151             description "Match for ARP target hardware address.";
152         }
153         identity ipv6_src {
154             base match-field;
155             description "Match for IPv6 source address.";
156         }
157         identity ipv6_dst {
158             base match-field;
159             description "Match for IPv6 destination address.";
160         }
161         identity ipv6_flabel {
162             base match-field;
163             description "Match for IPv6 Flow Label";
164         }
165         identity icmpv6_type {
166             base match-field;
167             description "Match for ICMPv6 type.";
168         }
169         identity icmpv6_code {
170             base match-field;
171             description "Match for ICMPv6 code.";
172         }
173         identity ipv6_nd_target {
174             base match-field;
175             description "Match for Target address for ND.";
176         }
177         identity ipv6_nd_sll {
178             base match-field;
179             description "Match for Source link-layer for ND.";
180         }
181         identity ipv6_nd_tll {
182             base match-field;
183             description "Match for Target link-layer for ND.";
184         }
185         identity mpls_label {
186             base match-field;
187             description "Match for MPLS label.";
188         }
189         identity mpls_tc {
190             base match-field;
191             description "Match for MPLS TC.";
192         }
193         identity mpls_bos {
194             base match-field;
195             description "Match for MPLS BoS bit.";
196         }
197         identity pbb_isid {
198             base match-field;
199             description "Match for PBB I-SID.";
200         }
201         identity tunnel_id {
202             base match-field;
203             description "Match for Logical Port Metadata";
204         }
205         identity ipv6_exthdr {
206             base match-field;
207             description "Match for IPv6 Extension Header pseudo-field";
208         }
209
210         container oxm-container {
211             uses oxm-fields;
212         }
213         
214         grouping oxm-fields {
215             list match-entries {
216                 leaf oxm-class {
217                     type identityref {
218                         base clazz;
219                     }
220                 }
221                 leaf oxm-match-field {
222                     type identityref {
223                         base match-field;
224                     }
225                 }
226                 leaf has-mask {
227                     type boolean;
228                 } 
229             }
230         }
231         
232         // OF1.0 structures
233         grouping match-v10-grouping {
234             container match-v10 {
235                 leaf wildcards {
236                     type uint32;
237                 }
238                 leaf in-port {
239                     type uint16;
240                 }
241                 leaf dl-src {
242                     type yang:mac-address;
243                 }
244                 leaf dl-dst {
245                     type yang:mac-address;
246                 }
247                 leaf dl-vlan {
248                     type uint16;
249                 }
250                 leaf dl-vlan-pcp {
251                     type uint8;
252                 }
253                 leaf dl-type {
254                     type uint16;
255                 }
256                 leaf nw-tos {
257                     type uint8;
258                 }
259                 leaf nw-proto {
260                     type uint8;
261                 }
262                 leaf nw-src {
263                     type inet:ipv4-address;
264                 }
265                 leaf nw-dst {
266                     type inet:ipv4-address;
267                 }
268                 leaf tp-src {
269                     type uint16;
270                 }
271                 leaf tp-dst {
272                     type uint16;
273                 }
274             }
275         }
276         
277 }