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 /** Match Groupings **/
24 grouping "ethernet-match-fields" {
25 container ethernet-source {
26 description "Ethernet source address.";
27 presence "Match field is active and set";
28 uses mac-address-filter;
30 container ethernet-destination {
31 description "Ethernet destination address.";
32 presence "Match field is active and set";
33 uses mac-address-filter;
35 container ethernet-type {
36 description "Ethernet frame type.";
37 presence "Match field is active and set";
41 type l2t:ether-type; // Needs to define that as general model
49 grouping "vlan-match-fields" {
51 description "VLAN id.";
52 presence "Match field is active and set";
63 description "VLAN priority.";
68 grouping "ip-match-fields" {
70 description "IP protocol.";
75 description "IP DSCP (6 bits in ToS field).";
80 description "IP ECN (2 bits in ToS field).";
85 description "IP Proto (IPv4 or IPv6 Protocol Number).";
90 grouping "ipv4-match-fields" {
92 description "IPv4 source address.";
93 type inet:ipv4-prefix;
95 leaf ipv4-destination {
96 description "IPv4 destination address.";
97 type inet:ipv4-prefix;
101 grouping "ipv6-match-fields" {
103 description "IPv6 source address.";
104 type inet:ipv6-prefix;
107 leaf ipv6-destination {
108 description "IPv6 destination address.";
109 type inet:ipv6-prefix;
112 leaf ipv6-nd-target {
113 description "IPv6 target address for neighbour discovery message";
114 type inet:ipv6-prefix;
118 type inet:ipv6-flow-label;
122 description "Link layer source address for neighbour discovery message";
123 type yang:mac-address;
127 description "Link layer target address for neighbour discovery message";
128 type yang:mac-address;
132 description "IPv6 Extension Header field";
137 grouping "udp-match-fields" {
138 leaf udp-source-port {
139 description "UDP source port.";
140 type inet:port-number;
142 leaf udp-destination-port {
143 description "UDP destination port.";
144 type inet:port-number;
148 grouping "protocol-match-fields" {
150 description "Label in the first MPLS shim header";
155 description "TC in the first MPLS shim header";
160 description "BoS bit in the first MPLS shim header";
165 description "I-SID in the first PBB service instance tag";
171 grouping "tcp-match-fields" {
172 leaf tcp-source-port {
173 description "TCP source port.";
174 type inet:port-number;
176 leaf tcp-destination-port {
177 description "TCP destination port.";
178 type inet:port-number;
182 grouping "sctp-match-fields" {
183 leaf sctp-source-port {
184 description "SCTP source port.";
185 type inet:port-number;
187 leaf sctp-destination-port {
188 description "SCTP destination port.";
189 type inet:port-number;
193 grouping "icmpv4-match-fields" {
195 description "ICMP type.";
196 type uint8; // Define ICMP Type
198 description "ICMP code.";
200 type uint8; // Define ICMP Code
204 grouping "icmpv6-match-fields" {
206 description "ICMP type.";
207 type uint8; // Define ICMP Type
209 description "ICMP code.";
211 type uint8; // Define ICMP Code
215 grouping "arp-match-fields" {
220 leaf arp-source-transport-address {
221 description "ARP source IPv4 address.";
222 type inet:ipv4-prefix;
225 leaf arp-target-transport-address {
226 description "ARP target IPv4 address.";
227 type inet:ipv4-prefix;
229 container arp-source-hardware-address {
230 description "ARP source hardware address.";
231 presence "Match field is active and set";
232 uses mac-address-filter;
234 container arp-target-hardware-address {
235 description "ARP target hardware address.";
236 presence "Match field is active and set";
237 uses mac-address-filter;
255 description "Metadata associated in the logical port";
259 container "ethernet-match" {
260 uses "ethernet-match-fields";
263 container "vlan-match" {
264 uses "vlan-match-fields";
267 container "ip-match" {
268 uses "ip-match-fields";
271 choice layer-3-match {
273 uses "ipv4-match-fields";
276 uses "ipv6-match-fields";
279 uses "arp-match-fields";
283 choice layer-4-match {
285 uses "udp-match-fields";
288 uses "tcp-match-fields";
291 uses "sctp-match-fields";
295 container "icmpv4-match" {
296 uses "icmpv4-match-fields";
299 container "icmpv6-match" {
300 uses "icmpv6-match-fields";
303 container "protocol-match-fields" {
304 uses "protocol-match-fields";