1 module odl-bgp-policy {
3 namespace "urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy";
4 prefix "odl-bgp-policy";
6 import yang-ext { prefix ext; revision-date 2013-07-09; }
7 import openconfig-bgp-types { prefix oc-bgp-t; }
8 import bgp-rib { prefix rib; revision-date 2018-03-29; }
9 import openconfig-routing-policy { prefix rpol; }
10 import openconfig-bgp-policy { prefix bgppol; }
11 import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
12 import bgp-types { prefix bgp-t; revision-date 2018-03-29; }
14 organization "AT&T Services, Inc.";
15 contact "Claudio D. Gasparini <claudio.gasparini@pantheon.tech>";
18 "This module contains odl bgp policy model
19 to be used under openconfig policy model definitions.
21 Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
23 This program and the accompanying materials are made available
24 under the terms of the Eclipse Public License v1.0 which
25 accompanies this distribution, and is available at
26 http://www.eclipse.org/legal/epl-v10.html";
28 revision "2018-03-29" {
29 description "Add support for add-path for all afi/safi.";
32 revision "2018-01-09" {
34 "ODL BGP policy models";
37 grouping match-role-condition-grouping {
40 path "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set/role-set-name";
41 require-instance true;
43 description "References a defined neighbor roles set";
45 uses rpol:match-set-options-restricted-group;
48 grouping match-role-set-condition-grouping {
49 container match-role-set {
51 "Match a list of referenced role-set according to the logic
52 defined in the match-set-options leaf";
55 uses match-role-condition-grouping;
59 uses match-role-condition-grouping;
64 grouping bgp-neighbor {
67 path "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/rpol:neighbor-set/rpol:neighbor-set-name";
68 require-instance true;
70 description "References a defined neighbor set";
72 uses rpol:match-set-options-restricted-group;
75 grouping match-bgp-neighbor-grouping {
76 container match-bgp-neighbor-set {
78 "The presence of this container indicates that the routes
79 should match the neighbour address of set referenced";
82 "Match a referenced neighbor set according to the logic
83 defined in the match-set-options-leaf";
85 container from-neighbor {
89 container to-neighbor {
95 grouping match-originator-id-set-condition-grouping {
97 "Match a list of referenced originator-id-set according to the logic
98 defined in the match-set-options leaf";
100 container match-originator-id-set-condition {
101 leaf originator-id-set {
103 path "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/originator-id-sets/originator-id-set/originator-id-set-name";
104 require-instance true;
106 description "References a defined Originator Id set";
108 uses rpol:match-set-options-restricted-group;
112 grouping match-cluster-id-set-condition-grouping {
114 "Match a list of referenced cluster-id-set according to the logic
115 defined in the match-set-options leaf";
116 container match-cluster-id-set-condition {
117 leaf cluster-id-set {
119 path "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/cluster-id-sets/cluster-id-set/cluster-id-set-name";
120 require-instance true;
122 description "References a defined cluster Id set";
124 uses rpol:match-set-options-group;
129 description "Data definition for a list of Odl Bgp roles which
130 are matched as part of a policy";
134 description "List of the defined role sets";
139 "name / label of the role set -- this is used to
140 reference the set in match conditions";
146 "List of role expressions that are part of the set";
151 grouping originator-id-set {
152 description "Data definition for a list of Originators Ids which
153 are matched as part of a policy";
155 list originator-id-set {
156 key originator-id-set-name;
157 description "List of the defined Originators Ids sets";
159 leaf originator-id-set-name {
162 "name / label of the set -- this is used to
163 reference the set in match conditions";
166 leaf-list originator-id {
167 type inet:ipv4-address-no-zone;
169 "List of role expressions that are part of the set";
173 presence "Local originator Id";
174 description "Validates also Local Originator Id";
179 grouping cluster-id-set {
180 description "Data definition for a list of Cluster Ids which
181 are matched as part of a policy";
183 list cluster-id-set {
184 key cluster-id-set-name;
185 description "List of the defined cluster Ids sets";
187 leaf cluster-id-set-name {
190 "name / label of the set -- this is used to
191 reference the set in match conditions";
194 leaf-list cluster-id {
195 type bgp-t:cluster-identifier;
197 "List of role expressions that are part of the set";
201 presence "Local cluster Id";
202 description "Validates also cluster Originator Id";
207 augment /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets {
208 ext:augment-identifier bgp-cluster-id-sets;
209 container cluster-id-sets {
210 description "Enclosing container for defined cluster-id sets for matching";
215 augment /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets {
216 ext:augment-identifier bgp-role-sets;
217 container role-sets {
218 description "Enclosing container for defined role sets for matching";
223 augment /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets {
224 ext:augment-identifier bgp-originator-id-sets;
225 container originator-id-sets {
226 description "Enclosing container for defined role sets for matching";
227 uses originator-id-set;
231 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
232 ext:augment-identifier match-afi-safi-not-in-condition;
233 leaf-list afi-safi-not-in {
235 base "oc-bgp-t:afi-safi-type";
238 "List of address families which the NLRI must not be within";
242 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
243 ext:augment-identifier match-bgp-neighbor-condition;
244 uses match-bgp-neighbor-grouping;
247 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
248 ext:augment-identifier match-role-set-condition;
249 uses match-role-set-condition-grouping;
252 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
253 ext:augment-identifier match-originator-id-set-condition;
254 uses match-originator-id-set-condition-grouping;
257 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
258 ext:augment-identifier match-cluster-id-set-condition;
259 uses match-cluster-id-set-condition-grouping;
262 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
263 ext:augment-identifier vpn-non-member-condition;
264 container vpn-non-member {
265 presence "Match Route Target Attribute with Route Target memberships of destiny peer. Asserts peers is a non member.";
269 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
270 ext:augment-identifier reflect-attributes-actions;
271 container reflect-attributes-actions {
272 presence "Modify attributes so they are updated as per RFC4456 route reflection";
276 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
277 ext:augment-identifier non-transitive-attributes-filter;
278 container non-transitive-attributes-filter {
279 presence "Filters attributes, removing non transitive attributes";
283 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
284 ext:augment-identifier local-as-path-prepend;
285 container local-as-path-prepend {
286 presence "Prepends local AS Path";
290 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
291 ext:augment-identifier set-cluster-id-prepend;
292 container set-cluster-id-prepend {
294 presence "node is present in the config data to use the Cluster Id prepend action";
295 description "action to prepend local Cluster Id to the Cluster Id List";
299 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
300 ext:augment-identifier set-originator-id-prepend;
301 container set-originator-id-prepend {
302 presence "node is present in the config data to use the Originator Id prepend action";
303 description "action to prepend Originator Id if non Originator Id is present. If no Originator Id"
304 + "is defined, local Originator Id is used.";
306 type inet:ipv4-address-no-zone;
307 description "Originator Id";