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";}
11 revision "2013-10-26" {
12 description "Initial revision of match types";
15 grouping "mac-address-filter" {
18 type yang:mac-address;
21 type yang:mac-address;
25 grouping "of-metadata" {
35 /** Match Groupings **/
36 grouping "ethernet-match-fields" {
37 container ethernet-source {
38 description "Ethernet source address.";
39 presence "Match field is active and set";
40 uses mac-address-filter;
42 container ethernet-destination {
43 description "Ethernet destination address.";
44 presence "Match field is active and set";
45 uses mac-address-filter;
47 container ethernet-type {
48 description "Ethernet frame type.";
49 presence "Match field is active and set";
53 type l2t:ether-type; // Needs to define that as general model
58 grouping "vlan-match-fields" {
60 description "VLAN id.";
61 presence "Match field is active and set";
63 leaf vlan-id-present {
72 description "VLAN priority.";
77 grouping "ip-match-fields" {
79 description "IP protocol.";
84 description "IP DSCP (6 bits in ToS field).";
89 description "IP ECN (2 bits in ToS field).";
94 description "IP Proto (IPv4 or IPv6 Protocol Number).";
99 grouping "ipv4-match-fields" {
101 description "IPv4 source address.";
102 type inet:ipv4-prefix;
105 leaf ipv4-destination {
106 description "IPv4 destination address.";
107 type inet:ipv4-prefix;
112 grouping "ipv6-match-fields" {
114 description "IPv6 source address.";
115 type inet:ipv6-prefix;
118 leaf ipv6-destination {
119 description "IPv6 destination address.";
120 type inet:ipv6-prefix;
123 leaf ipv6-nd-target {
124 description "IPv6 target address for neighbour discovery message";
125 type inet:ipv6-address;
128 container "ipv6-label" {
130 type inet:ipv6-flow-label;
134 type inet:ipv6-flow-label;
139 description "Link layer source address for neighbour discovery message";
140 type yang:mac-address;
144 description "Link layer target address for neighbour discovery message";
145 type yang:mac-address;
148 container "ipv6-ext-header" {
150 description "IPv6 Extension Header field";
154 leaf ipv6-exthdr-mask {
162 grouping "udp-match-fields" {
163 leaf udp-source-port {
164 description "UDP source port.";
165 type inet:port-number;
167 leaf udp-destination-port {
168 description "UDP destination port.";
169 type inet:port-number;
173 grouping "protocol-match-fields" {
175 description "Label in the first MPLS shim header";
180 description "TC in the first MPLS shim header";
185 description "BoS bit in the first MPLS shim header";
191 description "I-SID in the first PBB service instance tag";
203 grouping "tcp-match-fields" {
204 leaf tcp-source-port {
205 description "TCP source port.";
206 type inet:port-number;
208 leaf tcp-destination-port {
209 description "TCP destination port.";
210 type inet:port-number;
214 grouping "sctp-match-fields" {
215 leaf sctp-source-port {
216 description "SCTP source port.";
217 type inet:port-number;
219 leaf sctp-destination-port {
220 description "SCTP destination port.";
221 type inet:port-number;
225 grouping "icmpv4-match-fields" {
227 description "ICMP type.";
228 type uint8; // Define ICMP Type
230 description "ICMP code.";
232 type uint8; // Define ICMP Code
236 grouping "icmpv6-match-fields" {
238 description "ICMP type.";
239 type uint8; // Define ICMP Type
241 description "ICMP code.";
243 type uint8; // Define ICMP Code
247 grouping "arp-match-fields" {
252 leaf arp-source-transport-address {
253 description "ARP source IPv4 address.";
254 type inet:ipv4-prefix;
257 leaf arp-target-transport-address {
258 description "ARP target IPv4 address.";
259 type inet:ipv4-prefix;
261 container arp-source-hardware-address {
262 description "ARP source hardware address.";
263 presence "Match field is active and set";
264 uses mac-address-filter;
266 container arp-target-hardware-address {
267 description "ARP target hardware address.";
268 presence "Match field is active and set";
269 uses mac-address-filter;
273 grouping "tcp-flag-match-fields" {
279 grouping "tunnel-ipv4-match-fields" {
280 leaf tunnel-ipv4-source {
281 description "IPv4 source tunnel endpoint address.";
282 type inet:ipv4-prefix;
284 leaf tunnel-ipv4-destination {
285 description "IPv4 destination tunnel endpoint address.";
286 type inet:ipv4-prefix;
292 type inv:node-connector-id;
296 type inv:node-connector-id;
299 container "metadata" {
305 description "Metadata associated in the logical port";
314 container "ethernet-match" {
315 uses "ethernet-match-fields";
318 container "vlan-match" {
319 uses "vlan-match-fields";
322 container "ip-match" {
323 uses "ip-match-fields";
326 choice layer-3-match {
328 uses "ipv4-match-fields";
330 case "ipv4-match-arbitrary-bit-mask"{
331 uses "mask:ipv4-match-arbitrary-bitmask-fields";
334 uses "ipv6-match-fields";
337 uses "arp-match-fields";
339 case "tunnel-ipv4-match" {
340 uses "tunnel-ipv4-match-fields";
344 choice layer-4-match {
346 uses "udp-match-fields";
349 uses "tcp-match-fields";
352 uses "sctp-match-fields";
356 container "icmpv4-match" {
357 uses "icmpv4-match-fields";
360 container "icmpv6-match" {
361 uses "icmpv6-match-fields";
364 container "protocol-match-fields" {
365 uses "protocol-match-fields";
368 container tcp-flag-match {
369 uses "tcp-flag-match-fields";