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-network-instance { prefix netinst; }
8 import openconfig-bgp { prefix openconfig-bgp; }
9 import bgp-rib { prefix rib; revision-date 2018-03-29; }
10 import openconfig-routing-policy { prefix rpol; }
11 import openconfig-bgp-policy { prefix bgppol; }
12 import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
13 import bgp-types { prefix bgp-t; revision-date 2018-03-29; }
15 organization "AT&T Services, Inc.";
16 contact "Claudio D. Gasparini <claudio.gasparini@pantheon.tech>";
19 "This module contains odl bgp policy model
20 to be used under openconfig policy model definitions.
22 Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
24 This program and the accompanying materials are made available
25 under the terms of the Eclipse Public License v1.0 which
26 accompanies this distribution, and is available at
27 http://www.eclipse.org/legal/epl-v10.html";
29 revision "2018-03-29" {
30 description "Add support for add-path for all afi/safi.";
33 revision "2018-01-09" {
35 "ODL BGP policy models";
38 grouping match-role-condition-grouping {
41 path "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set/role-set-name";
42 require-instance true;
44 description "References a defined neighbor roles set";
46 uses rpol:match-set-options-restricted-group;
49 grouping match-role-set-condition-grouping {
50 container match-role-set {
52 "Match a list of referenced role-set according to the logic
53 defined in the match-set-options leaf";
56 uses match-role-condition-grouping;
60 uses match-role-condition-grouping;
65 grouping bgp-neighbor {
68 path "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/rpol:neighbor-set/rpol:neighbor-set-name";
69 require-instance true;
71 description "References a defined neighbor set";
73 uses rpol:match-set-options-restricted-group;
76 grouping match-bgp-neighbor-grouping {
77 container match-bgp-neighbor-set {
79 "The presence of this container indicates that the routes
80 should match the neighbour address of set referenced";
83 "Match a referenced neighbor set according to the logic
84 defined in the match-set-options-leaf";
86 container from-neighbor {
90 container to-neighbor {
96 grouping match-originator-id-set-condition-grouping {
98 "Match a list of referenced originator-id-set according to the logic
99 defined in the match-set-options leaf";
101 container match-originator-id-set-condition {
102 leaf originator-id-set {
104 path "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/originator-id-sets/originator-id-set/originator-id-set-name";
105 require-instance true;
107 description "References a defined Originator Id set";
109 uses rpol:match-set-options-restricted-group;
113 grouping match-cluster-id-set-condition-grouping {
115 "Match a list of referenced cluster-id-set according to the logic
116 defined in the match-set-options leaf";
117 container match-cluster-id-set-condition {
118 leaf cluster-id-set {
120 path "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/cluster-id-sets/cluster-id-set/cluster-id-set-name";
121 require-instance true;
123 description "References a defined cluster Id set";
125 uses rpol:match-set-options-group;
130 description "Data definition for a list of Odl Bgp roles which
131 are matched as part of a policy";
135 description "List of the defined role sets";
140 "name / label of the role set -- this is used to
141 reference the set in match conditions";
147 "List of role expressions that are part of the set";
152 grouping originator-id-set {
153 description "Data definition for a list of Originators Ids which
154 are matched as part of a policy";
156 list originator-id-set {
157 key originator-id-set-name;
158 description "List of the defined Originators Ids sets";
160 leaf originator-id-set-name {
163 "name / label of the set -- this is used to
164 reference the set in match conditions";
167 leaf-list originator-id {
168 type inet:ipv4-address;
170 "List of role expressions that are part of the set";
174 presence "Local originator Id";
175 description "Validates also Local Originator Id";
180 grouping cluster-id-set {
181 description "Data definition for a list of Cluster Ids which
182 are matched as part of a policy";
184 list cluster-id-set {
185 key cluster-id-set-name;
186 description "List of the defined cluster Ids sets";
188 leaf cluster-id-set-name {
191 "name / label of the set -- this is used to
192 reference the set in match conditions";
195 leaf-list cluster-id {
196 type bgp-t:cluster-identifier;
198 "List of role expressions that are part of the set";
202 presence "Local cluster Id";
203 description "Validates also cluster Originator Id";
208 augment /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets {
209 ext:augment-identifier bgp-cluster-id-sets;
210 container cluster-id-sets {
211 description "Enclosing container for defined cluster-id sets for matching";
216 augment /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets {
217 ext:augment-identifier bgp-role-sets;
218 container role-sets {
219 description "Enclosing container for defined role sets for matching";
224 augment /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets {
225 ext:augment-identifier bgp-originator-id-sets;
226 container originator-id-sets {
227 description "Enclosing container for defined role sets for matching";
228 uses originator-id-set;
232 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
233 ext:augment-identifier match-afi-safi-not-in-condition;
234 leaf-list afi-safi-not-in {
236 base "bgp-types:afi-safi-type";
239 "List of address families which the NLRI must not be within";
243 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
244 ext:augment-identifier match-bgp-neighbor-condition;
245 uses match-bgp-neighbor-grouping;
248 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
249 ext:augment-identifier match-role-set-condition;
250 uses match-role-set-condition-grouping;
253 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
254 ext:augment-identifier match-originator-id-set-condition;
255 uses match-originator-id-set-condition-grouping;
258 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
259 ext:augment-identifier match-cluster-id-set-condition;
260 uses match-cluster-id-set-condition-grouping;
263 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
264 ext:augment-identifier vpn-non-member-condition;
265 container vpn-non-member {
266 presence "Match Route Target Attribute with Route Target memberships of destiny peer. Asserts peers is a non member.";
270 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
271 ext:augment-identifier reflect-attributes-actions;
272 container reflect-attributes-actions {
273 presence "Modify attributes so they are updated as per RFC4456 route reflection";
277 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
278 ext:augment-identifier non-transitive-attributes-filter;
279 container non-transitive-attributes-filter {
280 presence "Filters attributes, removing non transitive attributes";
284 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
285 ext:augment-identifier local-as-path-prepend;
286 container local-as-path-prepend {
287 presence "Prepends local AS Path";
291 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
292 ext:augment-identifier set-cluster-id-prepend;
293 container set-cluster-id-prepend {
295 presence "node is present in the config data to use the Cluster Id prepend action";
296 description "action to prepend local Cluster Id to the Cluster Id List";
300 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
301 ext:augment-identifier set-originator-id-prepend;
302 container set-originator-id-prepend {
303 presence "node is present in the config data to use the Originator Id prepend action";
304 description "action to prepend Originator Id if non Originator Id is present. If no Originator Id"
305 + "is defined, local Originator Id is used.";
307 type inet:ipv4-address;
308 description "Originator Id";