1 module opendaylight-flow {
2 namespace "urn:opendaylight:flow:service";
5 import yang-ext {prefix ext;}
6 import ietf-inet-types {prefix inet;}
7 import ietf-yang-types {prefix yang;}
8 import opendaylight-inventory {prefix inv;}
10 revision "2013-08-19" {
11 description "Initial revision of flow service";
14 /** Base structure **/
22 leaf input-node-connector {
23 type inv:node-connector-id; //
39 augment "/flows/flow/match" {
40 ext:augment-identifier "ethernet-match";
41 container ethernet-source {
42 description "Ethernet source address.";
44 type yang:mac-address;
50 container ethernet-destination {
51 description "Ethernet destination address.";
53 type yang:mac-address;
56 container ethernet-type {
57 description "Ethernet frame type.";
59 type uint16; // Needs to define that as general model
67 augment "/flows/flow/match" {
68 ext:augment-identifier "vlan-match";
71 description "VLAN id.";
73 type uint16; // TODO: Define proper vlan id type.
80 description "VLAN priority.";
81 type uint8; // TODO: Define PCP type
87 augment "/flows/flow/match" {
88 ext:augment-identifier "ip-match";
91 description "IP protocol.";
92 type uint8; // TODO define IP protocol number
96 description "IP DSCP (6 bits in ToS field).";
97 type inet:dscp; // TODO: Define DSCP type
100 description "IP ECN (2 bits in ToS field).";
101 type uint8; // TODO define ECN
105 augment "/flows/flow/match" {
106 ext:augment-identifier "ipv4-match";
108 description "IPv4 source address.";
109 type inet:ipv4-prefix;
111 leaf ipv4-destination {
112 description "IPv4 destination address.";
113 type inet:ipv4-prefix;
117 augment "/flows/flow/match" {
118 ext:augment-identifier "ipv6-match";
120 description "IPv6 source address.";
121 type inet:ipv6-prefix;
123 leaf ipv6-destination {
124 description "IPv6 destination address.";
125 type inet:ipv6-prefix;
130 augment "/flows/flow/match" {
131 ext:augment-identifier "udp-match";
133 leaf udp-source-port {
134 description "UDP source port.";
135 type inet:port-number;
137 leaf udp-destination-port {
138 description "UDP destination port.";
139 type inet:port-number;
143 augment "/flows/flow/match" {
144 ext:augment-identifier "tcp-match";
145 leaf tcp-source-port {
146 description "TCP source port.";
147 type inet:port-number;
149 leaf tcp-destination-port {
150 description "TCP destination port.";
151 type inet:port-number;
155 augment "/flows/flow/match" {
156 ext:augment-identifier "sctp-match";
157 leaf sctp-source-port {
158 description "SCTP source port.";
159 type inet:port-number;
161 leaf sctp-destination-dst {
162 description "SCTP destination port.";
163 type inet:port-number;
167 augment "/flows/flow/match" {
168 ext:augment-identifier "icmpv4-match";
170 description "ICMP type.";
171 type uint8; // Define ICMP Type
173 description "ICMP code.";
175 type uint8; // Define ICMP Code
179 augment "/flows/flow/match" {
180 ext:augment-identifier "arp-match";
182 leaf arp-source-transport-address {
183 description "ARP source IPv4 address.";
184 type inet:ipv4-prefix;
187 leaf arp-target-transport-address {
188 description "ARP target IPv4 address.";
189 type inet:ipv4-prefix;
191 container arp-source-hardware-address {
192 description "ARP source hardware address.";
194 type yang:mac-address;
200 container arp-target-hardware-address {
201 description "ARP target hardware address.";
203 type yang:mac-address;
212 augment "/flows/flow/action/action" {
214 leaf output-node-connector {
219 case controller-action {
227 case set-queue-action {
229 type string; // TODO: define queues
233 case pop-mpls-action {
236 type uint16; // TODO: define ethertype type
241 case set-mpls-ttl-action {
247 case set-nw-ttl-action {
253 case push-pbb-action {
257 case push-mpls-action {
261 case push-vlan-action {