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