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;
151 description "IPv6 Extension Header field";
156 grouping "udp-match-fields" {
157 leaf udp-source-port {
158 description "UDP source port.";
159 type inet:port-number;
161 leaf udp-destination-port {
162 description "UDP destination port.";
163 type inet:port-number;
167 grouping "protocol-match-fields" {
169 description "Label in the first MPLS shim header";
174 description "TC in the first MPLS shim header";
179 description "BoS bit in the first MPLS shim header";
185 description "I-SID in the first PBB service instance tag";
195 grouping "tcp-match-fields" {
196 leaf tcp-source-port {
197 description "TCP source port.";
198 type inet:port-number;
200 leaf tcp-destination-port {
201 description "TCP destination port.";
202 type inet:port-number;
206 grouping "sctp-match-fields" {
207 leaf sctp-source-port {
208 description "SCTP source port.";
209 type inet:port-number;
211 leaf sctp-destination-port {
212 description "SCTP destination port.";
213 type inet:port-number;
217 grouping "icmpv4-match-fields" {
219 description "ICMP type.";
220 type uint8; // Define ICMP Type
222 description "ICMP code.";
224 type uint8; // Define ICMP Code
228 grouping "icmpv6-match-fields" {
230 description "ICMP type.";
231 type uint8; // Define ICMP Type
233 description "ICMP code.";
235 type uint8; // Define ICMP Code
239 grouping "arp-match-fields" {
244 leaf arp-source-transport-address {
245 description "ARP source IPv4 address.";
246 type inet:ipv4-prefix;
249 leaf arp-target-transport-address {
250 description "ARP target IPv4 address.";
251 type inet:ipv4-prefix;
253 container arp-source-hardware-address {
254 description "ARP source hardware address.";
255 presence "Match field is active and set";
256 uses mac-address-filter;
258 container arp-target-hardware-address {
259 description "ARP target hardware address.";
260 presence "Match field is active and set";
261 uses mac-address-filter;
274 container "metadata" {
280 description "Metadata associated in the logical port";
289 container "ethernet-match" {
290 uses "ethernet-match-fields";
293 container "vlan-match" {
294 uses "vlan-match-fields";
297 container "ip-match" {
298 uses "ip-match-fields";
301 choice layer-3-match {
303 uses "ipv4-match-fields";
306 uses "ipv6-match-fields";
309 uses "arp-match-fields";
313 choice layer-4-match {
315 uses "udp-match-fields";
318 uses "tcp-match-fields";
321 uses "sctp-match-fields";
325 container "icmpv4-match" {
326 uses "icmpv4-match-fields";
329 container "icmpv6-match" {
330 uses "icmpv6-match-fields";
333 container "protocol-match-fields" {
334 uses "protocol-match-fields";