1 module opendaylight-match-types {
2 namespace "urn:opendaylight:model:match:types";
5 import ietf-inet-types {prefix inet;}
6 import ietf-yang-types {prefix yang;}
7 import opendaylight-l2-types {prefix l2t;}
9 revision "2013-08-19" {
10 description "Initial revision of flow service";
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.";
71 type uint8; // TODO define IP protocol number
75 description "IP DSCP (6 bits in ToS field).";
76 type inet:dscp; // TODO: Define DSCP type
79 description "IP ECN (2 bits in ToS field).";
80 type uint8; // TODO define ECN
84 grouping "ipv4-match-fields" {
86 description "IPv4 source address.";
87 type inet:ipv4-prefix;
89 leaf ipv4-destination {
90 description "IPv4 destination address.";
91 type inet:ipv4-prefix;
95 grouping "ipv6-match-fields" {
97 description "IPv6 source address.";
98 type inet:ipv6-prefix;
100 leaf ipv6-destination {
101 description "IPv6 destination address.";
102 type inet:ipv6-prefix;
106 grouping "udp-match-fields" {
107 leaf udp-source-port {
108 description "UDP source port.";
109 type inet:port-number;
111 leaf udp-destination-port {
112 description "UDP destination port.";
113 type inet:port-number;
117 grouping "tcp-match-fields" {
118 leaf tcp-source-port {
119 description "TCP source port.";
120 type inet:port-number;
122 leaf tcp-destination-port {
123 description "TCP destination port.";
124 type inet:port-number;
128 grouping "sctp-match-fields" {
129 leaf sctp-source-port {
130 description "SCTP source port.";
131 type inet:port-number;
133 leaf sctp-destination-dst {
134 description "SCTP destination port.";
135 type inet:port-number;
139 grouping "icmpv4-match-fields" {
141 description "ICMP type.";
142 type uint8; // Define ICMP Type
144 description "ICMP code.";
146 type uint8; // Define ICMP Code
150 grouping "arp-match-fields" {
151 leaf arp-source-transport-address {
152 description "ARP source IPv4 address.";
153 type inet:ipv4-prefix;
156 leaf arp-target-transport-address {
157 description "ARP target IPv4 address.";
158 type inet:ipv4-prefix;
160 container arp-source-hardware-address {
161 description "ARP source hardware address.";
162 presence "Match field is active and set";
163 uses mac-address-filter;
165 container arp-target-hardware-address {
166 description "ARP target hardware address.";
167 presence "Match field is active and set";
168 uses mac-address-filter;
175 leaf-list output-node-connector {
180 case controller-action {
188 case set-queue-action {
190 type string; // TODO: define queues
194 case pop-mpls-action {
197 type uint16; // TODO: define ethertype type
202 case set-mpls-ttl-action {
208 case set-nw-ttl-action {
214 case push-pbb-action {
218 case push-mpls-action {
222 case push-vlan-action {
230 container "ethernet-match" {
231 uses "ethernet-match-fields";
233 container "vlan-match" {
234 uses "vlan-match-fields";
236 container "ip-match" {
237 uses "ip-match-fields";
240 choice layer-3-match {
242 uses "ipv4-match-fields";
245 uses "ipv6-match-fields";
248 uses "arp-match-fields";
252 choice layer-4-match {
254 uses "udp-match-fields";
257 uses "tcp-match-fields";
260 uses "sctp-match-fields";
263 container "icmpv4-match" {
264 uses "icmpv4-match-fields";