Route Constrain policies
[bgpcep.git] / bgp / openconfig-rp-statement / src / test / resources / initial / routing-policy-config.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   ~ Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
4   ~
5   ~ This program and the accompanying materials are made available under the
6   ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
7   ~ and is available at http://www.eclipse.org/legal/epl-v10.html
8 -->
9 <!-- vi: set et smarttab sw=4 tabstop=4: -->
10 <routing-policy xmlns="http://openconfig.net/yang/routing-policy">
11     <policy-definitions>
12         <policy-definition>
13             <name>default-odl-import-policy</name>
14             <statements>
15                 <statement>
16                     <name>from-external</name>
17                     <conditions>
18                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
19                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
20                                 <from-role>
21                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
22                                 </from-role>
23                             </match-role-set>
24                         </bgp-conditions>
25                     </conditions>
26                     <actions>
27                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
28                             <non-transitive-attributes-filter xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
29                             <local-as-path-prepend xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
30                         </bgp-actions>
31                     </actions>
32                 </statement>
33                 <statement>
34                     <name>from-non-external</name>
35                     <conditions>
36                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
37                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
38                                 <from-role>
39                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
40                                     <match-set-options>INVERT</match-set-options>
41                                 </from-role>
42                             </match-role-set>
43                             <!--https://tools.ietf.org/html/rfc4456#section-8-->
44                             <match-originator-id-set-condition xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
45                                 <originator-id-set>
46                                     /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/originator-id-sets/originator-id-set[originator-set-name="local-originator-id"]
47                                 </originator-id-set>
48                                 <match-set-options>INVERT</match-set-options>
49                             </match-originator-id-set-condition>
50                             <match-cluster-id-set-condition xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
51                                 <cluster-id-set>
52                                     /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/cluster-id-sets/cluster-id-set[cluster-set-name="local-cluster-id"]
53                                 </cluster-id-set>
54                                 <match-set-options>INVERT</match-set-options>
55                             </match-cluster-id-set-condition>
56                         </bgp-conditions>
57                     </conditions>
58                     <actions>
59                         <accept-route/>
60                     </actions>
61                 </statement>
62             </statements>
63         </policy-definition>
64         <policy-definition>
65             <name>default-odl-export-policy</name>
66             <statements>
67                 <statement>
68                     <name>to-odl-internal</name>
69                     <conditions>
70                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
71                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
72                                 <to-role>
73                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-internal"]</role-set>
74                                 </to-role>
75                             </match-role-set>
76                         </bgp-conditions>
77                     </conditions>
78                     <actions>
79                         <reject-route/>
80                     </actions>
81                 </statement>
82                 <statement>
83                     <name>to-external</name>
84                     <conditions>
85                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
86                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
87                                 <from-role>
88                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
89                                 </from-role>
90                                 <to-role>
91                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
92                                 </to-role>
93                             </match-role-set>
94                         </bgp-conditions>
95                     </conditions>
96                     <actions>
97                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
98                             <non-transitive-attributes-filter xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
99                             <local-as-path-prepend xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
100                             <set-as-path-prepend/>
101                         </bgp-actions>
102                     </actions>
103                 </statement>
104                 <statement>
105                     <name>from-internal-to-internal</name>
106                     <conditions>
107                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
108                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
109                                 <from-role>
110                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
111                                 </from-role>
112                                 <to-role>
113                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
114                                 </to-role>
115                             </match-role-set>
116                         </bgp-conditions>
117                     </conditions>
118                     <actions>
119                         <reject-route/>
120                     </actions>
121                 </statement>
122                 <statement>
123                     <name>from-external-to-internal</name>
124                     <conditions>
125                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
126                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
127                                 <from-role>
128                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
129                                 </from-role>
130                                 <to-role>
131                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
132                                 </to-role>
133                             </match-role-set>
134                         </bgp-conditions>
135                     </conditions>
136                     <actions>
137                         <accept-route/>
138                     </actions>
139                 </statement>
140                 <statement>
141                     <name>from-odl-internal-to-internal-or-rr-client</name>
142                     <conditions>
143                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
144                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
145                                 <from-role>
146                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-internal"]</role-set>
147                                 </from-role>
148                                 <to-role>
149                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="ibgp-rr-client"]</role-set>
150                                 </to-role>
151                             </match-role-set>
152                         </bgp-conditions>
153                     </conditions>
154                     <actions>
155                         <accept-route/>
156                     </actions>
157                 </statement>
158                 <statement>
159                     <name>from-rr-client-to-internal</name>
160                     <conditions>
161                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
162                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
163                                 <from-role>
164                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-rr-client"]</role-set>
165                                 </from-role>
166                                 <to-role>
167                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
168                                 </to-role>
169                             </match-role-set>
170                         </bgp-conditions>
171                     </conditions>
172                     <actions>
173                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
174                             <set-cluster-id-prepend xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
175                             <set-originator-id-prepend xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
176                         </bgp-actions>
177                     </actions>
178                 </statement>
179                 <statement>
180                     <name>from-external-to-route-reflector</name>
181                     <conditions>
182                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
183                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
184                                 <from-role>
185                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
186                                 </from-role>
187                                 <to-role>
188                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-rr-client"]</role-set>
189                                 </to-role>
190                             </match-role-set>
191                         </bgp-conditions>
192                     </conditions>
193                     <actions>
194                         <accept-route/>
195                     </actions>
196                 </statement>
197                 <statement>
198                     <name>from-internal-or-rr-client-to-route-reflector</name>
199                     <conditions>
200                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
201                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
202                                 <from-role>
203                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="ibgp-rr-client"]</role-set>
204                                 </from-role>
205                                 <to-role>
206                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-rr-client"]</role-set>
207                                 </to-role>
208                             </match-role-set>
209                         </bgp-conditions>
210                     </conditions>
211                     <actions>
212                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
213                             <set-cluster-id-prepend xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
214                             <set-originator-id-prepend xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
215                         </bgp-actions>
216                     </actions>
217                 </statement>
218             </statements>
219         </policy-definition>
220         <policy-definition>
221             <name>ext-community-statements-test</name>
222             <statements>
223                 <statement>
224                     <name>ext-community-any-test</name>
225                     <conditions>
226                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
227                             <match-ext-community-set>
228                                 <ext-community-set>
229                                     /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"]
230                                 </ext-community-set>
231                                 <match-set-options>ANY</match-set-options>
232                             </match-ext-community-set>
233                         </bgp-conditions>
234                     </conditions>
235                     <actions>
236                         <reject-route/>
237                     </actions>
238                 </statement>
239                 <statement>
240                     <name>ext-community-all-test</name>
241                     <conditions>
242                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
243                             <match-ext-community-set>
244                                 <ext-community-set>
245                                     /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"]
246                                 </ext-community-set>
247                                 <match-set-options>ALL</match-set-options>
248                             </match-ext-community-set>
249                         </bgp-conditions>
250                     </conditions>
251                     <actions>
252                         <reject-route/>
253                     </actions>
254                 </statement>
255                 <statement>
256                     <name>ext-community-invert-test</name>
257                     <conditions>
258                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
259                             <match-ext-community-set>
260                                 <ext-community-set>
261                                     /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"]
262                                 </ext-community-set>
263                                 <match-set-options>INVERT</match-set-options>
264                             </match-ext-community-set>
265                         </bgp-conditions>
266                     </conditions>
267                     <actions>
268                         <reject-route/>
269                     </actions>
270                 </statement>
271             </statements>
272         </policy-definition>
273         <policy-definition>
274             <name>basic-statements-test</name>
275             <statements>
276                 <statement>
277                     <name>reject-prefix-test</name>
278                     <conditions>
279                         <match-prefix-set>
280                             <prefix-set>
281                                 /rpol:routing-policy/rpol:defined-sets/rpol:prefix-sets/prefix-set[prefix-set-name="test-prefix-set"]
282                             </prefix-set>
283                         </match-prefix-set>
284                     </conditions>
285                     <actions>
286                         <reject-route/>
287                     </actions>
288                 </statement>
289                 <statement>
290                     <name>reject-prefix-inverse-test</name>
291                     <conditions>
292                         <match-prefix-set>
293                             <prefix-set>
294                                 /rpol:routing-policy/rpol:defined-sets/rpol:prefix-sets/prefix-set[prefix-set-name="test-prefix-set"]
295                             </prefix-set>
296                             <match-set-options>INVERT</match-set-options>
297                         </match-prefix-set>
298                     </conditions>
299                     <actions>
300                         <reject-route/>
301                     </actions>
302                 </statement>
303                 <statement>
304                     <name>as-path-eq-length-test</name>
305                     <conditions>
306                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
307                             <as-path-length>
308                                 <operator xmlns:x="http://openconfig.net/yang/policy-types">x:attribute-eq</operator>
309                                 <value>2</value>
310                             </as-path-length>
311                         </bgp-conditions>
312                     </conditions>
313                     <actions>
314                         <reject-route/>
315                     </actions>
316                 </statement>
317             </statements>
318         </policy-definition>
319         <policy-definition>
320             <name>match-as-path-set-test</name>
321             <statements>
322                 <statement>
323                     <name>reject-match-as-path-any-set</name>
324                     <conditions>
325                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
326                             <match-as-path-set>
327                                 <as-path-set>
328                                     /rpol:routing-policy/rpol:defined-sets/bgp-pol:bgp-defined-sets/bgp-pol:as-path-sets/bgp-pol:as-path-set/[as-path-set-name="test-as-path-set"]
329                                 </as-path-set>
330                                 <match-set-options>ANY</match-set-options>
331                             </match-as-path-set>
332                         </bgp-conditions>
333                     </conditions>
334                     <actions>
335                         <reject-route/>
336                     </actions>
337                 </statement>
338                 <statement>
339                     <name>reject-match-as-path-all-set</name>
340                     <conditions>
341                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
342                             <match-as-path-set>
343                                 <as-path-set>
344                                     /rpol:routing-policy/rpol:defined-sets/bgp-pol:bgp-defined-sets/bgp-pol:as-path-sets/bgp-pol:as-path-set/[as-path-set-name="test-as-path-set"]
345                                 </as-path-set>
346                                 <match-set-options>ALL</match-set-options>
347                             </match-as-path-set>
348                         </bgp-conditions>
349                     </conditions>
350                     <actions>
351                         <reject-route/>
352                     </actions>
353                 </statement>
354                 <statement>
355                     <name>reject-match-as-path-inverse-set</name>
356                     <conditions>
357                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
358                             <match-as-path-set>
359                                 <as-path-set>
360                                     /rpol:routing-policy/rpol:defined-sets/bgp-pol:bgp-defined-sets/bgp-pol:as-path-sets/bgp-pol:as-path-set/[as-path-set-name="test-as-path-set"
361                                 </as-path-set>
362                                 <match-set-options>INVERT</match-set-options>
363                             </match-as-path-set>
364                         </bgp-conditions>
365                     </conditions>
366                     <actions>
367                         <reject-route/>
368                     </actions>
369                 </statement>
370             </statements>
371         </policy-definition>
372         <policy-definition>
373             <name>community-statements-test</name>
374             <statements>
375                 <statement>
376                     <name>community-any-test</name>
377                     <conditions>
378                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
379                             <match-community-set>
380                                 <community-set>
381                                     /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"]
382                                 </community-set>
383                                 <match-set-options>ANY</match-set-options>
384                             </match-community-set>
385                         </bgp-conditions>
386                     </conditions>
387                     <actions>
388                         <reject-route/>
389                     </actions>
390                 </statement>
391                 <statement>
392                     <name>community-all-test</name>
393                     <conditions>
394                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
395                             <match-community-set>
396                                 <community-set>
397                                     /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"]
398                                 </community-set>
399                                 <match-set-options>ALL</match-set-options>
400                             </match-community-set>
401                         </bgp-conditions>
402                     </conditions>
403                     <actions>
404                         <reject-route/>
405                     </actions>
406                 </statement>
407                 <statement>
408                     <name>community-invert-test</name>
409                     <conditions>
410                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
411                             <match-community-set>
412                                 <community-set>
413                                     /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"]
414                                 </community-set>
415                                 <match-set-options>INVERT</match-set-options>
416                             </match-community-set>
417                         </bgp-conditions>
418                     </conditions>
419                     <actions>
420                         <reject-route/>
421                     </actions>
422                 </statement>
423             </statements>
424         </policy-definition>
425         <policy-definition>
426             <name>set-community-statements-test</name>
427             <statements>
428                 <statement>
429                     <name>set-community-inline-add-test</name>
430                     <conditions>
431                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
432                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
433                                 <from-role>
434                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
435                                 </from-role>
436                             </match-role-set>
437                         </bgp-conditions>
438                     </conditions>
439                     <actions>
440                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
441                             <set-community>
442                                 <communities>
443                                     <as-number>65</as-number>
444                                     <semantics>10</semantics>
445                                 </communities>
446                                 <communities>
447                                     <as-number>66</as-number>
448                                     <semantics>11</semantics>
449                                 </communities>
450                                 <options>ADD</options>
451                             </set-community>
452                         </bgp-actions>
453                     </actions>
454                 </statement>
455                 <statement>
456                     <name>set-community-inline-replace-test</name>
457                     <conditions>
458                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
459                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
460                                 <from-role>
461                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
462                                 </from-role>
463                             </match-role-set>
464                         </bgp-conditions>
465                     </conditions>
466                     <actions>
467                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
468                             <set-community>
469                                 <communities>
470                                     <as-number>65</as-number>
471                                     <semantics>10</semantics>
472                                 </communities>
473                                 <communities>
474                                     <as-number>66</as-number>
475                                     <semantics>11</semantics>
476                                 </communities>
477                                 <options>REPLACE</options>
478                             </set-community>
479                         </bgp-actions>
480                     </actions>
481                 </statement>
482                 <statement>
483                     <name>set-community-inline-remove-test</name>
484                     <conditions>
485                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
486                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
487                                 <from-role>
488                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
489                                 </from-role>
490                             </match-role-set>
491                         </bgp-conditions>
492                     </conditions>
493                     <actions>
494                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
495                             <set-community>
496                                 <communities>
497                                     <as-number>65</as-number>
498                                     <semantics>10</semantics>
499                                 </communities>
500                                 <communities>
501                                     <as-number>66</as-number>
502                                     <semantics>11</semantics>
503                                 </communities>
504                                 <options>REMOVE</options>
505                             </set-community>
506                         </bgp-actions>
507                     </actions>
508                 </statement>
509                 <statement>
510                     <name>set-community-reference-add-test</name>
511                     <conditions>
512                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
513                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
514                                 <from-role>
515                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
516                                 </from-role>
517                             </match-role-set>
518                         </bgp-conditions>
519                     </conditions>
520                     <actions>
521                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
522                             <set-community>
523                                 <community-set-ref>
524                                     /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"]
525                                 </community-set-ref>
526                                 <options>ADD</options>
527                             </set-community>
528                         </bgp-actions>
529                     </actions>
530                 </statement>
531                 <statement>
532                     <name>set-community-reference-replace-test</name>
533                     <conditions>
534                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
535                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
536                                 <from-role>
537                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
538                                 </from-role>
539                             </match-role-set>
540                         </bgp-conditions>
541                     </conditions>
542                     <actions>
543                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
544                             <set-community>
545                                 <community-set-ref>
546                                     /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"]
547                                 </community-set-ref>
548                                 <options>REPLACE</options>
549                             </set-community>
550                         </bgp-actions>
551                     </actions>
552                 </statement>
553                 <statement>
554                     <name>set-community-reference-remove-test</name>
555                     <conditions>
556                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
557                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
558                                 <from-role>
559                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
560                                 </from-role>
561                             </match-role-set>
562                         </bgp-conditions>
563                     </conditions>
564                     <actions>
565                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
566                             <set-community>
567                                 <community-set-ref>
568                                     /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"]
569                                 </community-set-ref>
570                                 <options>REMOVE</options>
571                             </set-community>
572                         </bgp-actions>
573                     </actions>
574                 </statement>
575             </statements>
576         </policy-definition>
577         <policy-definition>
578             <name>set-ext-community-statements-test</name>
579             <statements>
580                 <statement>
581                     <name>set-ext-community-inline-add-test</name>
582                     <conditions>
583                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
584                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
585                                 <from-role>
586                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
587                                 </from-role>
588                             </match-role-set>
589                         </bgp-conditions>
590                     </conditions>
591                     <actions>
592                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
593                             <set-ext-community>
594                                 <ext-community-member>
595                                     <encapsulation-extended-community>
596                                         <tunnel-type>vxlan</tunnel-type>
597                                     </encapsulation-extended-community>
598                                 </ext-community-member>
599                                 <ext-community-member>
600                                     <as-4-route-origin-extended-community>
601                                         <as-4-specific-common>
602                                             <as-number>65000</as-number>
603                                             <local-administrator>123</local-administrator>
604                                         </as-4-specific-common>
605                                     </as-4-route-origin-extended-community>
606                                 </ext-community-member>
607                                 <options>ADD</options>
608                             </set-ext-community>
609                         </bgp-actions>
610                     </actions>
611                 </statement>
612                 <statement>
613                     <name>set-ext-community-inline-replace-test</name>
614                     <conditions>
615                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
616                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
617                                 <from-role>
618                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
619                                 </from-role>
620                             </match-role-set>
621                         </bgp-conditions>
622                     </conditions>
623                     <actions>
624                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
625                             <set-ext-community>
626                                 <ext-community-member>
627                                     <encapsulation-extended-community>
628                                         <tunnel-type>vxlan</tunnel-type>
629                                     </encapsulation-extended-community>
630                                 </ext-community-member>
631                                 <ext-community-member>
632                                     <as-4-route-origin-extended-community>
633                                         <as-4-specific-common>
634                                             <as-number>65000</as-number>
635                                             <local-administrator>123</local-administrator>
636                                         </as-4-specific-common>
637                                     </as-4-route-origin-extended-community>
638                                 </ext-community-member>
639                                 <options>REPLACE</options>
640                             </set-ext-community>
641                         </bgp-actions>
642                     </actions>
643                 </statement>
644                 <statement>
645                     <name>set-ext-community-inline-remove-test</name>
646                     <conditions>
647                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
648                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
649                                 <from-role>
650                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
651                                 </from-role>
652                             </match-role-set>
653                         </bgp-conditions>
654                     </conditions>
655                     <actions>
656                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
657                             <set-ext-community>
658                                 <ext-community-member>
659                                     <encapsulation-extended-community>
660                                         <tunnel-type>vxlan</tunnel-type>
661                                     </encapsulation-extended-community>
662                                 </ext-community-member>
663                                 <ext-community-member>
664                                     <as-4-route-origin-extended-community>
665                                         <as-4-specific-common>
666                                             <as-number>65000</as-number>
667                                             <local-administrator>123</local-administrator>
668                                         </as-4-specific-common>
669                                     </as-4-route-origin-extended-community>
670                                 </ext-community-member>
671                                 <options>REMOVE</options>
672                             </set-ext-community>
673                         </bgp-actions>
674                     </actions>
675                 </statement>
676                 <statement>
677                     <name>set-ext-community-reference-add-test</name>
678                     <conditions>
679                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
680                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
681                                 <from-role>
682                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
683                                 </from-role>
684                             </match-role-set>
685                         </bgp-conditions>
686                     </conditions>
687                     <actions>
688                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
689                             <set-ext-community>
690                                 <ext-community-set-ref>
691                                     /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"]
692                                 </ext-community-set-ref>
693                                 <options>ADD</options>
694                             </set-ext-community>
695                         </bgp-actions>
696                     </actions>
697                 </statement>
698                 <statement>
699                     <name>set-ext-community-reference-replace-test</name>
700                     <conditions>
701                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
702                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
703                                 <from-role>
704                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"</role-set>
705                                 </from-role>
706                             </match-role-set>
707                         </bgp-conditions>
708                     </conditions>
709                     <actions>
710                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
711                             <set-ext-community>
712                                 <ext-community-set-ref>
713                                     /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"]
714                                 </ext-community-set-ref>
715                                 <options>REPLACE</options>
716                             </set-ext-community>
717                         </bgp-actions>
718                     </actions>
719                 </statement>
720                 <statement>
721                     <name>set-ext-community-reference-remove-test</name>
722                     <conditions>
723                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
724                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
725                                 <from-role>
726                                     <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
727                                 </from-role>
728                             </match-role-set>
729                         </bgp-conditions>
730                     </conditions>
731                     <actions>
732                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
733                             <set-ext-community>
734                                 <ext-community-set-ref>
735                                     /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"
736                                 </ext-community-set-ref>
737                                 <options>REMOVE</options>
738                             </set-ext-community>
739                         </bgp-actions>
740                     </actions>
741                 </statement>
742             </statements>
743         </policy-definition>
744         <policy-definition>
745             <name>bgp-neighbor-statements-test</name>
746             <statements>
747                 <statement>
748                     <name>reject-from-neighbor-test</name>
749                     <conditions>
750                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
751                             <match-bgp-neighbor-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
752                                 <from-neighbor>
753                                     <neighbor-set>
754                                         /rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="test-bgp-neighbor-set"]
755                                     </neighbor-set>
756                                 </from-neighbor>
757                             </match-bgp-neighbor-set>
758                         </bgp-conditions>
759                     </conditions>
760                     <actions>
761                         <reject-route/>
762                     </actions>
763                 </statement>
764                 <statement>
765                     <name>reject-from-neighbor-invert-test</name>
766                     <conditions>
767                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
768                             <match-bgp-neighbor-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
769                                 <from-neighbor>
770                                     <neighbor-set>
771                                         /rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="test-bgp-neighbor-set"]
772                                     </neighbor-set>
773                                     <match-set-options>INVERT</match-set-options>
774                                 </from-neighbor>
775                             </match-bgp-neighbor-set>
776                         </bgp-conditions>
777                     </conditions>
778                     <actions>
779                         <reject-route/>
780                     </actions>
781                 </statement>
782                 <statement>
783                     <name>reject-to-neighbor-test</name>
784                     <conditions>
785                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
786                             <match-bgp-neighbor-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
787                                 <to-neighbor>
788                                     <neighbor-set>
789                                         /rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="test-bgp-neighbor-set"]
790                                     </neighbor-set>
791                                 </to-neighbor>
792                             </match-bgp-neighbor-set>
793                         </bgp-conditions>
794                     </conditions>
795                     <actions>
796                         <reject-route/>
797                     </actions>
798                 </statement>
799                 <statement>
800                     <name>reject-to-neighbor-invert-test</name>
801                     <conditions>
802                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
803                             <match-bgp-neighbor-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
804                                 <to-neighbor>
805                                     <neighbor-set>
806                                         /rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="test-bgp-neighbor-set"]
807                                     </neighbor-set>
808                                     <match-set-options>INVERT</match-set-options>
809                                 </to-neighbor>
810                             </match-bgp-neighbor-set>
811                         </bgp-conditions>
812                     </conditions>
813                     <actions>
814                         <reject-route/>
815                     </actions>
816                 </statement>
817             </statements>
818         </policy-definition>
819         <policy-definition>
820             <name>match-afi-safi-not-in-test</name>
821             <statements>
822                 <statement>
823                     <name>match-afi-safi-not-in-test</name>
824                     <conditions>
825                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
826                             <afi-safi-not-in xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"
827                                              xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-not-in>
828                         </bgp-conditions>
829                     </conditions>
830                     <actions>
831                         <reject-route/>
832                     </actions>
833                 </statement>
834             </statements>
835         </policy-definition>
836         <policy-definition>
837             <name>set-originator-id-to-advertizer-router-id</name>
838             <statements>
839                 <statement>
840                     <name>set-originator-id-to-advertizer-router-id</name>
841                     <conditions>
842                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
843                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
844                                 <from-role>
845                                     <role-set>
846                                         /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]
847                                     </role-set>
848                                 </from-role>
849                             </match-role-set>
850                         </bgp-conditions>
851                     </conditions>
852                     <actions>
853                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
854                             <set-originator-id-to-advertizer-router-id xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
855                         </bgp-actions>
856                     </actions>
857                 </statement>
858             </statements>
859         </policy-definition>
860         <policy-definition>
861             <name>set-local-address-as-next-hop</name>
862             <statements>
863                 <statement>
864                     <name>set-local-address-as-next-hop</name>
865                     <conditions>
866                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
867                             <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
868                                 <from-role>
869                                     <role-set>
870                                         /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]
871                                     </role-set>
872                                 </from-role>
873                             </match-role-set>
874                         </bgp-conditions>
875                     </conditions>
876                     <actions>
877                         <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
878                             <set-local-address-as-next-hop xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
879                         </bgp-actions>
880                     </actions>
881                 </statement>
882             </statements>
883         </policy-definition>
884         <policy-definition>
885             <name>vpn-non-member-test</name>
886             <statements>
887                 <statement>
888                     <name>vpn-non-member-test</name>
889                     <conditions>
890                         <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
891                             <vpn-non-member xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
892                         </bgp-conditions>
893                     </conditions>
894                     <actions>
895                         <reject-route/>
896                     </actions>
897                 </statement>
898             </statements>
899         </policy-definition>
900     </policy-definitions>
901     <defined-sets>
902         <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
903             <role-sets xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
904                 <role-set>
905                     <role-set-name>only-ibgp</role-set-name>
906                     <role>ibgp</role>
907                 </role-set>
908                 <role-set>
909                     <role-set-name>only-rr-client</role-set-name>
910                     <role>rr-client</role>
911                 </role-set>
912                 <role-set>
913                     <role-set-name>only-ebgp</role-set-name>
914                     <role>ebgp</role>
915                 </role-set>
916                 <role-set>
917                     <role-set-name>only-internal</role-set-name>
918                     <role>internal</role>
919                 </role-set>
920                 <role-set>
921                     <role-set-name>ibgp-rr-client</role-set-name>
922                     <role>ibgp</role>
923                     <role>rr-client</role>
924                 </role-set>
925                 <role-set>
926                     <role-set-name>all</role-set-name>
927                     <role>ebgp</role>
928                     <role>ibgp</role>
929                     <role>rr-client</role>
930                     <role>internal</role>
931                 </role-set>
932             </role-sets>
933             <originator-id-sets xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
934                 <originator-id-set>
935                     <originator-id-set-name>local-originator-id</originator-id-set-name>
936                     <local/>
937                 </originator-id-set>
938             </originator-id-sets>
939             <cluster-id-sets xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
940                 <cluster-id-set>
941                     <cluster-id-set-name>local-cluster-id</cluster-id-set-name>
942                     <local/>
943                 </cluster-id-set>
944             </cluster-id-sets>
945             <as-path-sets>
946                 <as-path-set>
947                     <as-path-set-name>test-as-path-set</as-path-set-name>
948                     <as-path-set-member>65</as-path-set-member>
949                     <as-path-set-member>64</as-path-set-member>
950                     <as-path-set-member>63</as-path-set-member>
951                 </as-path-set>
952             </as-path-sets>
953             <ext-community-sets>
954                 <ext-community-set>
955                     <ext-community-set-name>ext-community-set-name-test</ext-community-set-name>
956                     <ext-community-member>
957                         <encapsulation-extended-community>
958                             <tunnel-type>vxlan</tunnel-type>
959                         </encapsulation-extended-community>
960                     </ext-community-member>
961                     <ext-community-member>
962                         <as-4-route-origin-extended-community>
963                             <as-4-specific-common>
964                                 <as-number>65000</as-number>
965                                 <local-administrator>123</local-administrator>
966                             </as-4-specific-common>
967                         </as-4-route-origin-extended-community>
968                     </ext-community-member>
969                 </ext-community-set>
970             </ext-community-sets>
971             <community-sets>
972                 <community-set>
973                     <community-set-name>community-set-name-test</community-set-name>
974                     <communities>
975                         <as-number>65</as-number>
976                         <semantics>10</semantics>
977                     </communities>
978                     <communities>
979                         <as-number>66</as-number>
980                         <semantics>11</semantics>
981                     </communities>
982                 </community-set>
983             </community-sets>
984         </bgp-defined-sets>
985         <prefix-sets>
986             <prefix-set>
987                 <prefix-set-name>test-prefix-set</prefix-set-name>
988                 <prefix>
989                     <ip-prefix>10.3.192.0/21</ip-prefix>
990                     <masklength-range>exact</masklength-range>
991                 </prefix>
992                 <prefix>
993                     <ip-prefix>10.3.191.0/21</ip-prefix>
994                     <masklength-range>21..24</masklength-range>
995                 </prefix>
996             </prefix-set>
997         </prefix-sets>
998         <neighbor-sets>
999             <neighbor-set>
1000                 <neighbor-set-name>test-bgp-neighbor-set</neighbor-set-name>
1001                 <neighbor>
1002                     <address>127.0.0.1</address>
1003                 </neighbor>
1004                 <neighbor>
1005                     <address>127.0.0.2</address>
1006                 </neighbor>
1007             </neighbor-set>
1008         </neighbor-sets>
1009     </defined-sets>
1010 </routing-policy>