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 /** Match Groupings **/
37 grouping "ethernet-match-fields" {
38 container ethernet-source {
39 description "Ethernet source address.";
40 presence "Match field is active and set";
41 uses mac-address-filter;
43 container ethernet-destination {
44 description "Ethernet destination address.";
45 presence "Match field is active and set";
46 uses mac-address-filter;
48 container ethernet-type {
49 description "Ethernet frame type.";
50 presence "Match field is active and set";
54 type l2t:ether-type; // Needs to define that as general model
59 grouping "vlan-match-fields" {
61 description "VLAN id.";
62 presence "Match field is active and set";
64 leaf vlan-id-present {
73 description "VLAN priority.";
78 grouping "ip-match-fields" {
80 description "IP protocol.";
85 description "IP DSCP (6 bits in ToS field).";
90 description "IP ECN (2 bits in ToS field).";
95 description "IP Proto (IPv4 or IPv6 Protocol Number).";
100 grouping "ipv4-match-fields" {
102 description "IPv4 source address.";
103 type inet:ipv4-prefix;
106 leaf ipv4-destination {
107 description "IPv4 destination address.";
108 type inet:ipv4-prefix;
113 grouping "ipv6-match-fields" {
115 description "IPv6 source address.";
116 type inet:ipv6-prefix;
119 leaf ipv6-destination {
120 description "IPv6 destination address.";
121 type inet:ipv6-prefix;
124 leaf ipv6-nd-target {
125 description "IPv6 target address for neighbour discovery message";
126 type inet:ipv6-address;
129 container "ipv6-label" {
131 type inet:ipv6-flow-label;
135 type inet:ipv6-flow-label;
140 description "Link layer source address for neighbour discovery message";
141 type yang:mac-address;
145 description "Link layer target address for neighbour discovery message";
146 type yang:mac-address;
149 container "ipv6-ext-header" {
151 description "IPv6 Extension Header field";
155 leaf ipv6-exthdr-mask {
163 grouping "udp-match-fields" {
164 leaf udp-source-port {
165 description "UDP source port.";
166 type inet:port-number;
168 leaf udp-destination-port {
169 description "UDP destination port.";
170 type inet:port-number;
174 grouping "protocol-match-fields" {
176 description "Label in the first MPLS shim header";
181 description "TC in the first MPLS shim header";
186 description "BoS bit in the first MPLS shim header";
192 description "I-SID in the first PBB service instance tag";
204 grouping "tcp-match-fields" {
205 leaf tcp-source-port {
206 description "TCP source port.";
207 type inet:port-number;
209 leaf tcp-destination-port {
210 description "TCP destination port.";
211 type inet:port-number;
215 grouping "sctp-match-fields" {
216 leaf sctp-source-port {
217 description "SCTP source port.";
218 type inet:port-number;
220 leaf sctp-destination-port {
221 description "SCTP destination port.";
222 type inet:port-number;
226 grouping "icmpv4-match-fields" {
228 description "ICMP type.";
229 type uint8; // Define ICMP Type
231 description "ICMP code.";
233 type uint8; // Define ICMP Code
237 grouping "icmpv6-match-fields" {
239 description "ICMP type.";
240 type uint8; // Define ICMP Type
242 description "ICMP code.";
244 type uint8; // Define ICMP Code
248 grouping "arp-match-fields" {
253 leaf arp-source-transport-address {
254 description "ARP source IPv4 address.";
255 type inet:ipv4-prefix;
258 leaf arp-target-transport-address {
259 description "ARP target IPv4 address.";
260 type inet:ipv4-prefix;
262 container arp-source-hardware-address {
263 description "ARP source hardware address.";
264 presence "Match field is active and set";
265 uses mac-address-filter;
267 container arp-target-hardware-address {
268 description "ARP target hardware address.";
269 presence "Match field is active and set";
270 uses mac-address-filter;
274 grouping "tcp-flag-match-fields" {
280 grouping "tunnel-ipv4-match-fields" {
281 leaf tunnel-ipv4-source {
282 description "IPv4 source tunnel endpoint address.";
283 type inet:ipv4-prefix;
285 leaf tunnel-ipv4-destination {
286 description "IPv4 destination tunnel endpoint address.";
287 type inet:ipv4-prefix;
293 type inv:node-connector-id;
297 type inv:node-connector-id;
300 container "metadata" {
306 description "Metadata associated in the logical port";
315 container "ethernet-match" {
316 uses "ethernet-match-fields";
319 container "vlan-match" {
320 uses "vlan-match-fields";
323 container "ip-match" {
324 uses "ip-match-fields";
327 choice layer-3-match {
329 uses "ipv4-match-fields";
331 case "ipv4-match-arbitrary-bit-mask"{
332 uses "mask:ipv4-match-arbitrary-bitmask-fields";
335 uses "ipv6-match-fields";
337 case "ipv6-match-arbitrary-bit-mask"{
338 uses ipv6-arbitrary-mask:ipv6-match-arbitrary-bitmask-fields;
341 uses "arp-match-fields";
343 case "tunnel-ipv4-match" {
344 uses "tunnel-ipv4-match-fields";
348 choice layer-4-match {
350 uses "udp-match-fields";
353 uses "tcp-match-fields";
356 uses "sctp-match-fields";
360 container "icmpv4-match" {
361 uses "icmpv4-match-fields";
364 container "icmpv6-match" {
365 uses "icmpv6-match-fields";
368 container "protocol-match-fields" {
369 uses "protocol-match-fields";
372 container tcp-flag-match {
373 uses "tcp-flag-match-fields";