1 module opendaylight-match-types {
2 namespace "urn:opendaylight:model:match:types";
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-l2-types {prefix l2t;revision-date "2013-08-27";}
9 revision "2013-10-26" {
10 description "Initial revision of macth types";
13 grouping "mac-address-filter" {
16 type yang:mac-address;
23 grouping "of-metadata" {
33 /** Match Groupings **/
34 grouping "ethernet-match-fields" {
35 container ethernet-source {
36 description "Ethernet source address.";
37 presence "Match field is active and set";
38 uses mac-address-filter;
40 container ethernet-destination {
41 description "Ethernet destination address.";
42 presence "Match field is active and set";
43 uses mac-address-filter;
45 container ethernet-type {
46 description "Ethernet frame type.";
47 presence "Match field is active and set";
51 type l2t:ether-type; // Needs to define that as general model
60 grouping "vlan-match-fields" {
62 description "VLAN id.";
63 presence "Match field is active and set";
74 description "VLAN priority.";
79 grouping "ip-match-fields" {
81 description "IP protocol.";
86 description "IP DSCP (6 bits in ToS field).";
91 description "IP ECN (2 bits in ToS field).";
96 description "IP Proto (IPv4 or IPv6 Protocol Number).";
101 grouping "ipv4-match-fields" {
103 description "IPv4 source address.";
104 type inet:ipv4-prefix;
107 leaf ipv4-destination {
108 description "IPv4 destination address.";
109 type inet:ipv4-prefix;
114 grouping "ipv6-match-fields" {
116 description "IPv6 source address.";
117 type inet:ipv6-prefix;
120 leaf ipv6-destination {
121 description "IPv6 destination address.";
122 type inet:ipv6-prefix;
125 leaf ipv6-nd-target {
126 description "IPv6 target address for neighbour discovery message";
127 type inet:ipv6-address;
130 container "ipv6-label" {
132 type inet:ipv6-flow-label;
141 description "Link layer source address for neighbour discovery message";
142 type yang:mac-address;
146 description "Link layer target address for neighbour discovery message";
147 type yang:mac-address;
150 container "ipv6-ext-header" {
152 description "IPv6 Extension Header field";
156 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";
201 grouping "tcp-match-fields" {
202 leaf tcp-source-port {
203 description "TCP source port.";
204 type inet:port-number;
206 leaf tcp-destination-port {
207 description "TCP destination port.";
208 type inet:port-number;
212 grouping "sctp-match-fields" {
213 leaf sctp-source-port {
214 description "SCTP source port.";
215 type inet:port-number;
217 leaf sctp-destination-port {
218 description "SCTP destination port.";
219 type inet:port-number;
223 grouping "icmpv4-match-fields" {
225 description "ICMP type.";
226 type uint8; // Define ICMP Type
228 description "ICMP code.";
230 type uint8; // Define ICMP Code
234 grouping "icmpv6-match-fields" {
236 description "ICMP type.";
237 type uint8; // Define ICMP Type
239 description "ICMP code.";
241 type uint8; // Define ICMP Code
245 grouping "arp-match-fields" {
250 leaf arp-source-transport-address {
251 description "ARP source IPv4 address.";
252 type inet:ipv4-prefix;
255 leaf arp-target-transport-address {
256 description "ARP target IPv4 address.";
257 type inet:ipv4-prefix;
259 container arp-source-hardware-address {
260 description "ARP source hardware address.";
261 presence "Match field is active and set";
262 uses mac-address-filter;
264 container arp-target-hardware-address {
265 description "ARP target hardware address.";
266 presence "Match field is active and set";
267 uses mac-address-filter;
280 container "metadata" {
286 description "Metadata associated in the logical port";
295 container "ethernet-match" {
296 uses "ethernet-match-fields";
299 container "vlan-match" {
300 uses "vlan-match-fields";
303 container "ip-match" {
304 uses "ip-match-fields";
307 choice layer-3-match {
309 uses "ipv4-match-fields";
312 uses "ipv6-match-fields";
315 uses "arp-match-fields";
319 choice layer-4-match {
321 uses "udp-match-fields";
324 uses "tcp-match-fields";
327 uses "sctp-match-fields";
331 container "icmpv4-match" {
332 uses "icmpv4-match-fields";
335 container "icmpv6-match" {
336 uses "icmpv6-match-fields";
339 container "protocol-match-fields" {
340 uses "protocol-match-fields";