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";}
8 import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
10 revision "2013-10-26" {
11 description "Initial revision of match types";
14 grouping "mac-address-filter" {
17 type yang:mac-address;
20 type yang:mac-address;
24 grouping "of-metadata" {
34 /** Match Groupings **/
35 grouping "ethernet-match-fields" {
36 container ethernet-source {
37 description "Ethernet source address.";
38 presence "Match field is active and set";
39 uses mac-address-filter;
41 container ethernet-destination {
42 description "Ethernet destination address.";
43 presence "Match field is active and set";
44 uses mac-address-filter;
46 container ethernet-type {
47 description "Ethernet frame type.";
48 presence "Match field is active and set";
52 type l2t:ether-type; // Needs to define that as general model
57 grouping "vlan-match-fields" {
59 description "VLAN id.";
60 presence "Match field is active and set";
62 leaf vlan-id-present {
71 description "VLAN priority.";
76 grouping "ip-match-fields" {
78 description "IP protocol.";
83 description "IP DSCP (6 bits in ToS field).";
88 description "IP ECN (2 bits in ToS field).";
93 description "IP Proto (IPv4 or IPv6 Protocol Number).";
98 grouping "ipv4-match-fields" {
100 description "IPv4 source address.";
101 type inet:ipv4-prefix;
104 leaf ipv4-destination {
105 description "IPv4 destination address.";
106 type inet:ipv4-prefix;
111 grouping "ipv6-match-fields" {
113 description "IPv6 source address.";
114 type inet:ipv6-prefix;
117 leaf ipv6-destination {
118 description "IPv6 destination address.";
119 type inet:ipv6-prefix;
122 leaf ipv6-nd-target {
123 description "IPv6 target address for neighbour discovery message";
124 type inet:ipv6-address;
127 container "ipv6-label" {
129 type inet:ipv6-flow-label;
133 type inet:ipv6-flow-label;
138 description "Link layer source address for neighbour discovery message";
139 type yang:mac-address;
143 description "Link layer target address for neighbour discovery message";
144 type yang:mac-address;
147 container "ipv6-ext-header" {
149 description "IPv6 Extension Header field";
153 leaf ipv6-exthdr-mask {
161 grouping "udp-match-fields" {
162 leaf udp-source-port {
163 description "UDP source port.";
164 type inet:port-number;
166 leaf udp-destination-port {
167 description "UDP destination port.";
168 type inet:port-number;
172 grouping "protocol-match-fields" {
174 description "Label in the first MPLS shim header";
179 description "TC in the first MPLS shim header";
184 description "BoS bit in the first MPLS shim header";
190 description "I-SID in the first PBB service instance tag";
202 grouping "tcp-match-fields" {
203 leaf tcp-source-port {
204 description "TCP source port.";
205 type inet:port-number;
207 leaf tcp-destination-port {
208 description "TCP destination port.";
209 type inet:port-number;
213 grouping "sctp-match-fields" {
214 leaf sctp-source-port {
215 description "SCTP source port.";
216 type inet:port-number;
218 leaf sctp-destination-port {
219 description "SCTP destination port.";
220 type inet:port-number;
224 grouping "icmpv4-match-fields" {
226 description "ICMP type.";
227 type uint8; // Define ICMP Type
229 description "ICMP code.";
231 type uint8; // Define ICMP Code
235 grouping "icmpv6-match-fields" {
237 description "ICMP type.";
238 type uint8; // Define ICMP Type
240 description "ICMP code.";
242 type uint8; // Define ICMP Code
246 grouping "arp-match-fields" {
251 leaf arp-source-transport-address {
252 description "ARP source IPv4 address.";
253 type inet:ipv4-prefix;
256 leaf arp-target-transport-address {
257 description "ARP target IPv4 address.";
258 type inet:ipv4-prefix;
260 container arp-source-hardware-address {
261 description "ARP source hardware address.";
262 presence "Match field is active and set";
263 uses mac-address-filter;
265 container arp-target-hardware-address {
266 description "ARP target hardware address.";
267 presence "Match field is active and set";
268 uses mac-address-filter;
274 type inv:node-connector-id;
278 type inv:node-connector-id;
281 container "metadata" {
287 description "Metadata associated in the logical port";
296 container "ethernet-match" {
297 uses "ethernet-match-fields";
300 container "vlan-match" {
301 uses "vlan-match-fields";
304 container "ip-match" {
305 uses "ip-match-fields";
308 choice layer-3-match {
310 uses "ipv4-match-fields";
313 uses "ipv6-match-fields";
316 uses "arp-match-fields";
320 choice layer-4-match {
322 uses "udp-match-fields";
325 uses "tcp-match-fields";
328 uses "sctp-match-fields";
332 container "icmpv4-match" {
333 uses "icmpv4-match-fields";
336 container "icmpv6-match" {
337 uses "icmpv6-match-fields";
340 container "protocol-match-fields" {
341 uses "protocol-match-fields";