1 module opendaylight-match-types {
2 namespace "urn:opendaylight:model:match:types";
5 import ietf-inet-types {prefix inet; revision-date "2013-07-15";}
6 import ietf-yang-types {prefix yang; revision-date "2013-07-15";}
7 import opendaylight-l2-types {prefix l2t;revision-date "2013-08-27";}
8 import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
9 import opendaylight-arbitrary-bitmask-fields {prefix mask; revision-date "2016-01-30";}
10 import opendaylight-ipv6-arbitrary-bitmask-fields {prefix ipv6-arbitrary-mask; revision-date "2016-02-24";}
12 revision "2013-10-26" {
13 description "Initial revision of match types";
16 grouping "mac-address-filter" {
19 type yang:mac-address;
22 type yang:mac-address;
26 grouping "of-metadata" {
36 grouping packet-type-fields {
39 "Outermost header type of a packet. It's a 4 byte
40 value, the 2 most significant bytes are the
41 namespace and the next 2 bytes are the type.";
46 /** Match Groupings **/
47 grouping "ethernet-match-fields" {
48 container ethernet-source {
49 description "Ethernet source address.";
50 presence "Match field is active and set";
51 uses mac-address-filter;
53 container ethernet-destination {
54 description "Ethernet destination address.";
55 presence "Match field is active and set";
56 uses mac-address-filter;
58 container ethernet-type {
59 description "Ethernet frame type.";
60 presence "Match field is active and set";
64 type l2t:ether-type; // Needs to define that as general model
69 grouping "vlan-match-fields" {
71 description "VLAN id.";
72 presence "Match field is active and set";
74 leaf vlan-id-present {
83 description "VLAN priority.";
88 grouping "ip-match-fields" {
90 description "IP protocol.";
95 description "IP DSCP (6 bits in ToS field).";
100 description "IP ECN (2 bits in ToS field).";
105 description "IP Proto (IPv4 or IPv6 Protocol Number).";
106 type inet:ip-version;
110 grouping "ipv4-match-fields" {
112 description "IPv4 source address.";
113 type inet:ipv4-prefix;
116 leaf ipv4-destination {
117 description "IPv4 destination address.";
118 type inet:ipv4-prefix;
123 grouping "ipv6-match-fields" {
125 description "IPv6 source address.";
126 type inet:ipv6-prefix;
129 leaf ipv6-destination {
130 description "IPv6 destination address.";
131 type inet:ipv6-prefix;
134 leaf ipv6-nd-target {
135 description "IPv6 target address for neighbour discovery message";
136 type inet:ipv6-address;
139 container "ipv6-label" {
141 type inet:ipv6-flow-label;
145 type inet:ipv6-flow-label;
150 description "Link layer source address for neighbour discovery message";
151 type yang:mac-address;
155 description "Link layer target address for neighbour discovery message";
156 type yang:mac-address;
159 container "ipv6-ext-header" {
161 description "IPv6 Extension Header field";
165 leaf ipv6-exthdr-mask {
173 grouping "udp-match-fields" {
174 leaf udp-source-port {
175 description "UDP source port.";
176 type inet:port-number;
178 leaf udp-source-port-mask {
179 description "UDP source port mask.";
180 type inet:port-number;
182 leaf udp-destination-port {
183 description "UDP destination port.";
184 type inet:port-number;
186 leaf udp-destination-port-mask {
187 description "UDP destination port mask.";
188 type inet:port-number;
192 grouping "protocol-match-fields" {
194 description "Label in the first MPLS shim header";
199 description "TC in the first MPLS shim header";
204 description "BoS bit in the first MPLS shim header";
210 description "I-SID in the first PBB service instance tag";
222 grouping "tcp-match-fields" {
223 leaf tcp-source-port {
224 description "TCP source port.";
225 type inet:port-number;
227 leaf tcp-source-port-mask {
228 description "TCP source port mask.";
229 type inet:port-number;
231 leaf tcp-destination-port {
232 description "TCP destination port.";
233 type inet:port-number;
235 leaf tcp-destination-port-mask {
236 description "TCP destination port mask.";
237 type inet:port-number;
241 grouping "sctp-match-fields" {
242 leaf sctp-source-port {
243 description "SCTP source port.";
244 type inet:port-number;
246 leaf sctp-destination-port {
247 description "SCTP destination port.";
248 type inet:port-number;
252 grouping "icmpv4-match-fields" {
254 description "ICMP type.";
255 type uint8; // Define ICMP Type
257 description "ICMP code.";
259 type uint8; // Define ICMP Code
263 grouping "icmpv6-match-fields" {
265 description "ICMP type.";
266 type uint8; // Define ICMP Type
268 description "ICMP code.";
270 type uint8; // Define ICMP Code
274 grouping "arp-match-fields" {
279 leaf arp-source-transport-address {
280 description "ARP source IPv4 address.";
281 type inet:ipv4-prefix;
284 leaf arp-target-transport-address {
285 description "ARP target IPv4 address.";
286 type inet:ipv4-prefix;
288 container arp-source-hardware-address {
289 description "ARP source hardware address.";
290 presence "Match field is active and set";
291 uses mac-address-filter;
293 container arp-target-hardware-address {
294 description "ARP target hardware address.";
295 presence "Match field is active and set";
296 uses mac-address-filter;
300 grouping "tcp-flags-match-fields" {
302 description "Tcp flags for match";
305 leaf tcp-flags-mask {
306 description "Mask for tcp flags";
311 grouping "tunnel-ipv4-match-fields" {
312 leaf tunnel-ipv4-source {
313 description "IPv4 source tunnel endpoint address.";
314 type inet:ipv4-prefix;
316 leaf tunnel-ipv4-destination {
317 description "IPv4 destination tunnel endpoint address.";
318 type inet:ipv4-prefix;
324 type inv:node-connector-id;
328 type inv:node-connector-id;
331 container packet-type-match {
332 uses packet-type-fields;
335 container "metadata" {
341 description "Metadata associated in the logical port";
350 container "ethernet-match" {
351 uses "ethernet-match-fields";
354 container "vlan-match" {
355 uses "vlan-match-fields";
358 container "ip-match" {
359 uses "ip-match-fields";
362 choice layer-3-match {
364 uses "ipv4-match-fields";
366 case "ipv4-match-arbitrary-bit-mask"{
367 uses "mask:ipv4-match-arbitrary-bitmask-fields";
370 uses "ipv6-match-fields";
372 case "ipv6-match-arbitrary-bit-mask"{
373 uses ipv6-arbitrary-mask:ipv6-match-arbitrary-bitmask-fields;
376 uses "arp-match-fields";
378 case "tunnel-ipv4-match" {
379 uses "tunnel-ipv4-match-fields";
383 choice layer-4-match {
385 uses "udp-match-fields";
388 uses "tcp-match-fields";
391 uses "sctp-match-fields";
395 container "icmpv4-match" {
396 uses "icmpv4-match-fields";
399 container "icmpv6-match" {
400 uses "icmpv6-match-fields";
403 container "protocol-match-fields" {
404 uses "protocol-match-fields";
407 container tcp-flags-match {
408 uses "tcp-flags-match-fields";