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 grouping "ipv4-match-fields" {
98 description "IPv4 source address.";
99 type inet:ipv4-prefix;
102 leaf ipv4-destination {
103 description "IPv4 destination address.";
104 type inet:ipv4-prefix;
109 grouping "ipv6-match-fields" {
111 description "IPv6 source address.";
112 type inet:ipv6-prefix;
115 leaf ipv6-destination {
116 description "IPv6 destination address.";
117 type inet:ipv6-prefix;
120 leaf ipv6-nd-target {
121 description "IPv6 target address for neighbour discovery message";
122 type inet:ipv6-address;
125 container "ipv6-label" {
127 type inet:ipv6-flow-label;
136 description "Link layer source address for neighbour discovery message";
137 type yang:mac-address;
141 description "Link layer target address for neighbour discovery message";
142 type yang:mac-address;
145 container "ipv6-ext-header" {
147 description "IPv6 Extension Header field";
151 leaf ipv6-exthdr-mask {
157 grouping "udp-match-fields" {
158 leaf udp-source-port {
159 description "UDP source port.";
160 type inet:port-number;
162 leaf udp-destination-port {
163 description "UDP destination port.";
164 type inet:port-number;
168 grouping "protocol-match-fields" {
170 description "Label in the first MPLS shim header";
175 description "TC in the first MPLS shim header";
180 description "BoS bit in the first MPLS shim header";
186 description "I-SID in the first PBB service instance tag";
196 grouping "tcp-match-fields" {
197 leaf tcp-source-port {
198 description "TCP source port.";
199 type inet:port-number;
201 leaf tcp-destination-port {
202 description "TCP destination port.";
203 type inet:port-number;
207 grouping "sctp-match-fields" {
208 leaf sctp-source-port {
209 description "SCTP source port.";
210 type inet:port-number;
212 leaf sctp-destination-port {
213 description "SCTP destination port.";
214 type inet:port-number;
218 grouping "icmpv4-match-fields" {
220 description "ICMP type.";
221 type uint8; // Define ICMP Type
223 description "ICMP code.";
225 type uint8; // Define ICMP Code
229 grouping "icmpv6-match-fields" {
231 description "ICMP type.";
232 type uint8; // Define ICMP Type
234 description "ICMP code.";
236 type uint8; // Define ICMP Code
240 grouping "arp-match-fields" {
245 leaf arp-source-transport-address {
246 description "ARP source IPv4 address.";
247 type inet:ipv4-prefix;
250 leaf arp-target-transport-address {
251 description "ARP target IPv4 address.";
252 type inet:ipv4-prefix;
254 container arp-source-hardware-address {
255 description "ARP source hardware address.";
256 presence "Match field is active and set";
257 uses mac-address-filter;
259 container arp-target-hardware-address {
260 description "ARP target hardware address.";
261 presence "Match field is active and set";
262 uses mac-address-filter;
275 container "metadata" {
281 description "Metadata associated in the logical port";
290 container "ethernet-match" {
291 uses "ethernet-match-fields";
294 container "vlan-match" {
295 uses "vlan-match-fields";
298 container "ip-match" {
299 uses "ip-match-fields";
302 choice layer-3-match {
304 uses "ipv4-match-fields";
307 uses "ipv6-match-fields";
310 uses "arp-match-fields";
314 choice layer-4-match {
316 uses "udp-match-fields";
319 uses "tcp-match-fields";
322 uses "sctp-match-fields";
326 container "icmpv4-match" {
327 uses "icmpv4-match-fields";
330 container "icmpv6-match" {
331 uses "icmpv6-match-fields";
334 container "protocol-match-fields" {
335 uses "protocol-match-fields";