3 namespace "urn:opendaylight:params:xml:ns:yang:bgp-flowspec";
6 import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
7 import bgp-message { prefix bgp-msg; revision-date 2013-09-19; }
8 import bgp-multiprotocol { prefix bgp-mp; revision-date 2013-09-19; }
9 import bgp-rib { prefix bgp-rib; revision-date 2013-09-25; }
10 import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
11 import network-concepts { prefix netc; revision-date 2013-11-25; }
13 organization "Cisco Systems, Inc.";
14 contact "Dana Kutenicsova <dkutenic@cisco.com>";
17 "This module contains the base data model of a BGP flow specification.
18 It rolls up the definitions contained in RFC5575.
20 Copyright (c)2015 Cisco Systems, Inc. All rights reserved.
22 This program and the accompanying materials are made available
23 under the terms of the Eclipse Public License v1.0 which
24 accompanies this distribution, and is available at
25 http://www.eclipse.org/legal/epl-v10.html";
27 revision "2015-01-14" {
30 reference "http://tools.ietf.org/html/rfc5575";
33 identity flowspec-subsequent-address-family {
34 reference "http://tools.ietf.org/html/rfc5575#section-11";
36 base bgp-t:subsequent-address-family;
39 typedef component-type {
40 reference "http://tools.ietf.org/html/rfc5575#section-4";
42 enum destination-prefix {
54 enum destination-port {
82 reference "http://tools.ietf.org/html/rfc5575#section-4";
100 reference "https://tools.ietf.org/html/rfc2474#section-3";
106 typedef numeric-operand {
107 reference "http://tools.ietf.org/html/rfc5575#section-4";
127 typedef bitmask-operand {
128 reference "http://tools.ietf.org/html/rfc5575#section-4";
145 grouping numeric-two-byte-value {
146 reference "http://tools.ietf.org/html/rfc5575#section-4";
148 type numeric-operand;
155 grouping numeric-one-byte-value {
156 reference "http://tools.ietf.org/html/rfc5575#section-4";
158 type numeric-operand;
165 grouping bitmask-two-byte-value {
166 reference "http://tools.ietf.org/html/rfc5575#section-4";
168 type bitmask-operand;
175 grouping dscp-value {
176 reference "http://tools.ietf.org/html/rfc5575#section-4";
178 type numeric-operand;
185 grouping fragment-value {
186 reference "http://tools.ietf.org/html/rfc5575#section-4";
188 type bitmask-operand;
195 grouping flowspec-destination {
196 reference "http://tools.ietf.org/html/rfc5575#section-4";
198 leaf component-type {
201 choice flowspec-type {
202 case destination-prefix-case {
203 when "../component-type = destination-prefix";
204 leaf destination-prefix {
205 type inet:ipv4-prefix;
208 case source-prefix-case {
209 when "../component-type = source-prefix";
211 type inet:ipv4-prefix;
214 case protocol-ip-case {
215 when "../component-type = protocol-ip";
217 uses numeric-two-byte-value;
221 when "../component-type = port";
223 uses numeric-two-byte-value;
226 case destination-port-case {
227 when "../component-type = destination-port";
228 list destination-ports {
229 uses numeric-two-byte-value;
232 case source-port-case {
233 when "../component-type = source-port";
235 uses numeric-two-byte-value;
238 case icmp-type-case {
239 when "../component-type = icmp-type";
241 uses numeric-one-byte-value;
244 case icmp-code-case {
245 when "../component-type = icmp-code";
247 uses numeric-one-byte-value;
250 case tcp-flags-case {
251 when "../component-type = tcp-flags";
253 uses bitmask-two-byte-value;
256 case packet-length-case {
257 when "../component-type = packet-length";
258 list packet-lengths {
259 uses numeric-two-byte-value;
263 when "../component-type = dscp";
269 when "../component-type = fragment";
278 augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-reach-nlri/bgp-mp:advertized-routes/bgp-mp:destination-type" {
279 case destination-flowspec-case {
280 container destination-flowspec {
281 uses flowspec-destination;
286 augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-unreach-nlri/bgp-mp:withdrawn-routes/bgp-mp:destination-type" {
287 case destination-flowspec-case {
288 container destination-flowspec {
289 uses flowspec-destination;
294 grouping flowspec-routes {
295 container flowspec-routes {
296 list flowspec-route {
299 "The sole function of this leaf
300 to act as the key in the list.
301 Its format does not form the
302 API contract of this model.";
307 augment bgp-msg:attributes {
308 uses flowspec-destination;
315 augment "/bgp-msg:update/bgp-msg:attributes/bgp-msg:extended-communities/bgp-msg:extended-community" {
316 reference "https://tools.ietf.org/html/rfc5575#section-7";
317 case traffic-rate-extended-community-case {
318 container traffic-rate-extended-community {
319 when "../comm-type = 128 and ../comm-sub-type = 6";
320 leaf informative-as {
321 type bgp-t:short-as-number;
323 leaf local-administrator {
328 case traffic-action-extended-community-case {
329 container traffic-action-extended-community {
330 when "../comm-type = 128 and ../comm-sub-type = 7";
335 leaf terminal-action {
341 case redirect-extended-community-case {
342 container redirect-extended-community {
343 when "../comm-type = 128 and ../comm-sub-type = 8";
344 leaf global-administrator {
345 type bgp-t:short-as-number;
347 leaf local-administrator {
354 case traffic-marking-extended-community-case {
355 container traffic-marking-extended-community {
356 when "../comm-type = 128 and ../comm-sub-type = 9";
357 leaf global-administrator {
364 augment "/bgp-rib:application-rib/bgp-rib:tables/bgp-rib:routes" {
365 case flowspec-routes-case {
366 uses flowspec-routes;
370 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:loc-rib/bgp-rib:tables/bgp-rib:routes" {
371 case flowspec-routes-case {
372 uses flowspec-routes;