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 openconfig-bgp-types { prefix oc-bgp-t; }
10 import bgp-rib { prefix rib; revision-date 2018-03-29; }
11 import openconfig-routing-policy { prefix rpol; }
12 import openconfig-bgp-policy { prefix bgppol; }
13 import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
14 import bgp-types { prefix bgp-t; revision-date 2018-03-29; }
16 organization "AT&T Services, Inc.";
17 contact "Claudio D. Gasparini <claudio.gasparini@pantheon.tech>";
20 "This module contains odl bgp policy model
21 to be used under openconfig policy model definitions.
23 Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
25 This program and the accompanying materials are made available
26 under the terms of the Eclipse Public License v1.0 which
27 accompanies this distribution, and is available at
28 http://www.eclipse.org/legal/epl-v10.html";
30 revision "2018-03-29" {
31 description "Add support for add-path for all afi/safi.";
34 revision "2018-01-09" {
36 "ODL BGP policy models";
39 grouping match-role-condition-grouping {
42 path "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set/role-set-name";
43 require-instance true;
45 description "References a defined neighbor roles set";
47 uses rpol:match-set-options-restricted-group;
50 grouping match-role-set-condition-grouping {
51 container match-role-set {
53 "Match a list of referenced role-set according to the logic
54 defined in the match-set-options leaf";
57 uses match-role-condition-grouping;
61 uses match-role-condition-grouping;
66 grouping bgp-neighbor {
69 path "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/rpol:neighbor-set/rpol:neighbor-set-name";
70 require-instance true;
72 description "References a defined neighbor set";
74 uses rpol:match-set-options-restricted-group;
77 grouping match-bgp-neighbor-grouping {
78 container match-bgp-neighbor-set {
80 "The presence of this container indicates that the routes
81 should match the neighbour address of set referenced";
84 "Match a referenced neighbor set according to the logic
85 defined in the match-set-options-leaf";
87 container from-neighbor {
91 container to-neighbor {
97 grouping match-originator-id-set-condition-grouping {
99 "Match a list of referenced originator-id-set according to the logic
100 defined in the match-set-options leaf";
102 container match-originator-id-set-condition {
103 leaf originator-id-set {
105 path "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/originator-id-sets/originator-id-set/originator-id-set-name";
106 require-instance true;
108 description "References a defined Originator Id set";
110 uses rpol:match-set-options-restricted-group;
114 grouping match-cluster-id-set-condition-grouping {
116 "Match a list of referenced cluster-id-set according to the logic
117 defined in the match-set-options leaf";
118 container match-cluster-id-set-condition {
119 leaf cluster-id-set {
121 path "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/cluster-id-sets/cluster-id-set/cluster-id-set-name";
122 require-instance true;
124 description "References a defined cluster Id set";
126 uses rpol:match-set-options-group;
131 description "Data definition for a list of Odl Bgp roles which
132 are matched as part of a policy";
136 description "List of the defined role sets";
141 "name / label of the role set -- this is used to
142 reference the set in match conditions";
148 "List of role expressions that are part of the set";
153 grouping originator-id-set {
154 description "Data definition for a list of Originators Ids which
155 are matched as part of a policy";
157 list originator-id-set {
158 key originator-id-set-name;
159 description "List of the defined Originators Ids sets";
161 leaf originator-id-set-name {
164 "name / label of the set -- this is used to
165 reference the set in match conditions";
168 leaf-list originator-id {
169 type inet:ipv4-address;
171 "List of role expressions that are part of the set";
175 presence "Local originator Id";
176 description "Validates also Local Originator Id";
181 grouping cluster-id-set {
182 description "Data definition for a list of Cluster Ids which
183 are matched as part of a policy";
185 list cluster-id-set {
186 key cluster-id-set-name;
187 description "List of the defined cluster Ids sets";
189 leaf cluster-id-set-name {
192 "name / label of the set -- this is used to
193 reference the set in match conditions";
196 leaf-list cluster-id {
197 type bgp-t:cluster-identifier;
199 "List of role expressions that are part of the set";
203 presence "Local cluster Id";
204 description "Validates also cluster Originator Id";
209 augment /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets {
210 ext:augment-identifier bgp-cluster-id-sets;
211 container cluster-id-sets {
212 description "Enclosing container for defined cluster-id sets for matching";
217 augment /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets {
218 ext:augment-identifier bgp-role-sets;
219 container role-sets {
220 description "Enclosing container for defined role sets for matching";
225 augment /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets {
226 ext:augment-identifier bgp-originator-id-sets;
227 container originator-id-sets {
228 description "Enclosing container for defined role sets for matching";
229 uses originator-id-set;
233 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
234 ext:augment-identifier match-afi-safi-not-in-condition;
235 leaf-list afi-safi-not-in {
237 base "oc-bgp-t:afi-safi-type";
240 "List of address families which the NLRI must not be within";
244 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
245 ext:augment-identifier match-bgp-neighbor-condition;
246 uses match-bgp-neighbor-grouping;
249 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
250 ext:augment-identifier match-role-set-condition;
251 uses match-role-set-condition-grouping;
254 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
255 ext:augment-identifier match-originator-id-set-condition;
256 uses match-originator-id-set-condition-grouping;
259 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
260 ext:augment-identifier match-cluster-id-set-condition;
261 uses match-cluster-id-set-condition-grouping;
264 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
265 ext:augment-identifier vpn-non-member-condition;
266 container vpn-non-member {
267 presence "Match Route Target Attribute with Route Target memberships of destiny peer. Asserts peers is a non member.";
271 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
272 ext:augment-identifier reflect-attributes-actions;
273 container reflect-attributes-actions {
274 presence "Modify attributes so they are updated as per RFC4456 route reflection";
278 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
279 ext:augment-identifier non-transitive-attributes-filter;
280 container non-transitive-attributes-filter {
281 presence "Filters attributes, removing non transitive attributes";
285 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
286 ext:augment-identifier local-as-path-prepend;
287 container local-as-path-prepend {
288 presence "Prepends local AS Path";
292 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
293 ext:augment-identifier set-cluster-id-prepend;
294 container set-cluster-id-prepend {
296 presence "node is present in the config data to use the Cluster Id prepend action";
297 description "action to prepend local Cluster Id to the Cluster Id List";
301 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
302 ext:augment-identifier set-originator-id-prepend;
303 container set-originator-id-prepend {
304 presence "node is present in the config data to use the Originator Id prepend action";
305 description "action to prepend Originator Id if non Originator Id is present. If no Originator Id"
306 + "is defined, local Originator Id is used.";
308 type inet:ipv4-address;
309 description "Originator Id";