Thomas Vachuska | 6655bee | 2017-08-24 16:12:59 -0700 | [diff] [blame] | 1 | module openconfig-bgp-policy { |
| 2 | |
| 3 | yang-version "1"; |
| 4 | |
| 5 | // namespace |
| 6 | namespace "http://openconfig.net/yang/bgp-policy"; |
| 7 | |
| 8 | prefix "oc-bgp-pol"; |
| 9 | |
| 10 | // import some basic types |
| 11 | import openconfig-inet-types { prefix oc-inet; } |
| 12 | import openconfig-routing-policy {prefix oc-rpol; } |
| 13 | import openconfig-policy-types { prefix oc-pol-types; } |
| 14 | import openconfig-bgp-types { prefix oc-bgp-types; } |
| 15 | import openconfig-extensions { prefix oc-ext; } |
| 16 | |
| 17 | |
| 18 | // meta |
| 19 | organization |
| 20 | "OpenConfig working group"; |
| 21 | |
| 22 | contact |
| 23 | "OpenConfig working group |
| 24 | netopenconfig@googlegroups.com"; |
| 25 | |
| 26 | description |
| 27 | "This module contains data definitions for BGP routing policy. |
| 28 | It augments the base routing-policy module with BGP-specific |
| 29 | options for conditions and actions."; |
| 30 | |
| 31 | oc-ext:openconfig-version "4.0.1"; |
| 32 | |
| 33 | revision "2017-07-30" { |
| 34 | description |
| 35 | "Clarification of add-paths send-max leaf"; |
| 36 | reference "4.0.1"; |
| 37 | } |
| 38 | |
| 39 | revision "2017-07-10" { |
| 40 | description |
| 41 | "Add error notifications; moved add-paths config; add AS |
| 42 | prepend policy features; removed unneeded config leaves"; |
| 43 | reference "4.0.0"; |
| 44 | } |
| 45 | |
| 46 | revision "2017-02-02" { |
| 47 | description |
| 48 | "Bugfix to remove remaining global-level policy data"; |
| 49 | reference "3.0.1"; |
| 50 | } |
| 51 | |
| 52 | revision "2017-01-26" { |
| 53 | description |
| 54 | "Add dynamic neighbor support, migrate to OpenConfig types"; |
| 55 | reference "3.0.0"; |
| 56 | } |
| 57 | |
| 58 | revision "2016-06-21" { |
| 59 | description |
| 60 | "OpenConfig BGP refactor"; |
| 61 | reference "2.1.1"; |
| 62 | } |
| 63 | |
| 64 | |
| 65 | // typedef statements |
| 66 | |
| 67 | typedef bgp-set-community-option-type { |
| 68 | type enumeration { |
| 69 | enum ADD { |
| 70 | description |
| 71 | "add the specified communities to the existing |
| 72 | community attribute"; |
| 73 | } |
| 74 | enum REMOVE { |
| 75 | description |
| 76 | "remove the specified communities from the |
| 77 | existing community attribute"; |
| 78 | } |
| 79 | enum REPLACE { |
| 80 | description |
| 81 | "replace the existing community attribute with |
| 82 | the specified communities. If an empty set is |
| 83 | specified, this removes the community attribute |
| 84 | from the route."; |
| 85 | } |
| 86 | } |
| 87 | description |
| 88 | "Type definition for options when setting the community |
| 89 | attribute in a policy action"; |
| 90 | } |
| 91 | |
| 92 | typedef bgp-next-hop-type { |
| 93 | type union { |
| 94 | type oc-inet:ip-address; |
| 95 | type enumeration { |
| 96 | enum SELF { |
| 97 | description "special designation for local router's own |
| 98 | address, i.e., next-hop-self"; |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | description |
| 103 | "type definition for specifying next-hop in policy actions"; |
| 104 | } |
| 105 | |
| 106 | typedef bgp-set-med-type { |
| 107 | type union { |
| 108 | type uint32; |
| 109 | type string { |
| 110 | pattern '^[+-][0-9]+$'; |
| 111 | } |
| 112 | type enumeration { |
| 113 | enum IGP { |
| 114 | description "set the MED value to the IGP cost toward the |
| 115 | next hop for the route"; |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | description |
| 120 | "Type definition for specifying how the BGP MED can |
| 121 | be set in BGP policy actions. The three choices are to set |
| 122 | the MED directly, increment/decrement using +/- notation, |
| 123 | and setting it to the IGP cost (predefined value)."; |
| 124 | } |
| 125 | |
| 126 | // grouping statements |
| 127 | |
| 128 | grouping match-community-config { |
| 129 | description |
| 130 | "Configuration data for match conditions on communities"; |
| 131 | |
| 132 | leaf community-set { |
| 133 | type leafref { |
| 134 | path "/oc-rpol:routing-policy/oc-rpol:defined-sets/" + |
| 135 | "oc-bgp-pol:bgp-defined-sets/oc-bgp-pol:community-sets/" + |
| 136 | "oc-bgp-pol:community-set/oc-bgp-pol:community-set-name"; |
| 137 | } |
| 138 | description |
| 139 | "References a defined community set"; |
| 140 | } |
| 141 | |
| 142 | uses oc-rpol:match-set-options-group; |
| 143 | } |
| 144 | |
| 145 | grouping match-community-state { |
| 146 | description |
| 147 | "Operational state data for match conditions on communities"; |
| 148 | } |
| 149 | |
| 150 | grouping match-community-top { |
| 151 | description |
| 152 | "Top-level grouping for match conditions on communities"; |
| 153 | |
| 154 | container match-community-set { |
| 155 | description |
| 156 | "Top-level container for match conditions on communities. |
| 157 | Match a referenced community-set according to the logic |
| 158 | defined in the match-set-options leaf"; |
| 159 | |
| 160 | container config { |
| 161 | description |
| 162 | "Configuration data for match conditions on communities"; |
| 163 | |
| 164 | uses match-community-config; |
| 165 | } |
| 166 | |
| 167 | container state { |
| 168 | |
| 169 | config false; |
| 170 | |
| 171 | description |
| 172 | "Operational state data "; |
| 173 | |
| 174 | uses match-community-config; |
| 175 | uses match-community-state; |
| 176 | } |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | grouping match-ext-community-config { |
| 181 | description |
| 182 | "Configuration data for match conditions on extended |
| 183 | communities"; |
| 184 | |
| 185 | leaf ext-community-set { |
| 186 | type leafref { |
| 187 | path "/oc-rpol:routing-policy/oc-rpol:defined-sets/" + |
| 188 | "oc-bgp-pol:bgp-defined-sets/oc-bgp-pol:ext-community-sets/" + |
| 189 | "oc-bgp-pol:ext-community-set/" + |
| 190 | "oc-bgp-pol:ext-community-set-name"; |
| 191 | } |
| 192 | description "References a defined extended community set"; |
| 193 | } |
| 194 | |
| 195 | uses oc-rpol:match-set-options-group; |
| 196 | } |
| 197 | |
| 198 | grouping match-ext-community-state { |
| 199 | description |
| 200 | "Operational state data for match conditions on extended |
| 201 | communities"; |
| 202 | } |
| 203 | |
| 204 | grouping match-ext-community-top { |
| 205 | description |
| 206 | "Top-level grouping for match conditions on extended |
| 207 | communities"; |
| 208 | |
| 209 | container match-ext-community-set { |
| 210 | description |
| 211 | "Match a referenced extended community-set according to the |
| 212 | logic defined in the match-set-options leaf"; |
| 213 | |
| 214 | container config { |
| 215 | description |
| 216 | "Configuration data for match conditions on extended |
| 217 | communities"; |
| 218 | |
| 219 | uses match-ext-community-config; |
| 220 | } |
| 221 | |
| 222 | container state { |
| 223 | |
| 224 | config false; |
| 225 | |
| 226 | description |
| 227 | "Operational state data for match conditions on extended |
| 228 | communities"; |
| 229 | |
| 230 | uses match-ext-community-config; |
| 231 | uses match-ext-community-state; |
| 232 | } |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | grouping match-as-path-config { |
| 237 | description |
| 238 | "Configuration data for match conditions on AS path set"; |
| 239 | |
| 240 | leaf as-path-set { |
| 241 | type leafref { |
| 242 | path "/oc-rpol:routing-policy/oc-rpol:defined-sets/" + |
| 243 | "oc-bgp-pol:bgp-defined-sets/oc-bgp-pol:as-path-sets/" + |
| 244 | "oc-bgp-pol:as-path-set/oc-bgp-pol:as-path-set-name"; |
| 245 | } |
| 246 | description "References a defined AS path set"; |
| 247 | } |
| 248 | uses oc-rpol:match-set-options-group; |
| 249 | } |
| 250 | |
| 251 | grouping match-as-path-state { |
| 252 | description |
| 253 | "Operational state data for match conditions on AS path set"; |
| 254 | } |
| 255 | |
| 256 | grouping match-as-path-top { |
| 257 | description |
| 258 | "Top-level grouping for match conditions on AS path set"; |
| 259 | |
| 260 | container match-as-path-set { |
| 261 | description |
| 262 | "Match a referenced as-path set according to the logic |
| 263 | defined in the match-set-options leaf"; |
| 264 | |
| 265 | container config { |
| 266 | description |
| 267 | "Configuration data for match conditions on AS path set"; |
| 268 | |
| 269 | uses match-as-path-config; |
| 270 | } |
| 271 | |
| 272 | container state { |
| 273 | |
| 274 | config false; |
| 275 | |
| 276 | description |
| 277 | "Operational state data for match conditions on AS |
| 278 | path set"; |
| 279 | |
| 280 | uses match-as-path-config; |
| 281 | uses match-as-path-state; |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | grouping bgp-match-set-conditions { |
| 287 | description |
| 288 | "Condition statement definitions for checking membership in a |
| 289 | defined set"; |
| 290 | |
| 291 | uses match-community-top; |
| 292 | uses match-ext-community-top; |
| 293 | uses match-as-path-top; |
| 294 | } |
| 295 | |
| 296 | grouping community-count-config { |
| 297 | description |
| 298 | "Configuration data for community count condition"; |
| 299 | |
| 300 | uses oc-pol-types:attribute-compare-operators; |
| 301 | } |
| 302 | |
| 303 | grouping community-count-state { |
| 304 | description |
| 305 | "Operational state data for community count condition"; |
| 306 | } |
| 307 | |
| 308 | grouping community-count-top { |
| 309 | description |
| 310 | "Top-level grouping for community count condition"; |
| 311 | |
| 312 | container community-count { |
| 313 | description |
| 314 | "Value and comparison operations for conditions based on the |
| 315 | number of communities in the route update"; |
| 316 | |
| 317 | container config { |
| 318 | description |
| 319 | "Configuration data for community count condition"; |
| 320 | |
| 321 | uses community-count-config; |
| 322 | } |
| 323 | |
| 324 | container state { |
| 325 | |
| 326 | config false; |
| 327 | |
| 328 | description |
| 329 | "Operational state data for community count condition"; |
| 330 | |
| 331 | uses community-count-config; |
| 332 | uses community-count-state; |
| 333 | } |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | grouping as-path-length-config { |
| 338 | description |
| 339 | "Configuration data for AS path length condition"; |
| 340 | |
| 341 | uses oc-pol-types:attribute-compare-operators; |
| 342 | } |
| 343 | |
| 344 | grouping as-path-length-state { |
| 345 | description |
| 346 | "Operational state data for AS path length condition"; |
| 347 | } |
| 348 | |
| 349 | grouping as-path-length-top { |
| 350 | description |
| 351 | "Top-level grouping for AS path length condition"; |
| 352 | |
| 353 | container as-path-length { |
| 354 | description |
| 355 | "Value and comparison operations for conditions based on the |
| 356 | length of the AS path in the route update"; |
| 357 | |
| 358 | container config { |
| 359 | description |
| 360 | "Configuration data for AS path length condition"; |
| 361 | |
| 362 | uses as-path-length-config; |
| 363 | } |
| 364 | |
| 365 | container state { |
| 366 | |
| 367 | config false; |
| 368 | |
| 369 | description |
| 370 | "Operational state data for AS path length condition"; |
| 371 | |
| 372 | uses as-path-length-config; |
| 373 | uses as-path-length-state; |
| 374 | } |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | grouping bgp-conditions-config { |
| 379 | description |
| 380 | "Configuration data for BGP-specific policy conditions"; |
| 381 | |
| 382 | leaf med-eq { |
| 383 | type uint32; |
| 384 | description |
| 385 | "Condition to check if the received MED value is equal to |
| 386 | the specified value"; |
| 387 | } |
| 388 | |
| 389 | leaf origin-eq { |
| 390 | type oc-bgp-types:bgp-origin-attr-type; |
| 391 | description |
| 392 | "Condition to check if the route origin is equal to the |
| 393 | specified value"; |
| 394 | } |
| 395 | |
| 396 | leaf-list next-hop-in { |
| 397 | type oc-inet:ip-address; |
| 398 | description |
| 399 | "List of next hop addresses to check for in the route |
| 400 | update"; |
| 401 | } |
| 402 | |
| 403 | leaf-list afi-safi-in { |
| 404 | type identityref { |
| 405 | base oc-bgp-types:AFI_SAFI_TYPE; |
| 406 | } |
| 407 | description |
| 408 | "List of address families which the NLRI may be |
| 409 | within"; |
| 410 | } |
| 411 | |
| 412 | leaf local-pref-eq { |
| 413 | type uint32; |
| 414 | // TODO: add support for other comparisons if needed |
| 415 | description |
| 416 | "Condition to check if the local pref attribute is equal to |
| 417 | the specified value"; |
| 418 | } |
| 419 | |
| 420 | leaf route-type { |
| 421 | // TODO: verify extent of vendor support for this comparison |
| 422 | type enumeration { |
| 423 | enum INTERNAL { |
| 424 | description "route type is internal"; |
| 425 | } |
| 426 | enum EXTERNAL { |
| 427 | description "route type is external"; |
| 428 | } |
| 429 | } |
| 430 | description |
| 431 | "Condition to check the route type in the route update"; |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | grouping bgp-conditions-state { |
| 436 | description |
| 437 | "Operational state data for BGP-specific policy conditions"; |
| 438 | } |
| 439 | |
| 440 | grouping bgp-conditions-top { |
| 441 | description |
| 442 | "Top-level grouping for BGP-specific policy conditions"; |
| 443 | |
| 444 | container bgp-conditions { |
| 445 | description |
| 446 | "Top-level container "; |
| 447 | |
| 448 | container config { |
| 449 | description |
| 450 | "Configuration data for BGP-specific policy conditions"; |
| 451 | |
| 452 | uses bgp-conditions-config; |
| 453 | } |
| 454 | |
| 455 | container state { |
| 456 | |
| 457 | config false; |
| 458 | |
| 459 | description |
| 460 | "Operational state data for BGP-specific policy |
| 461 | conditions"; |
| 462 | |
| 463 | uses bgp-conditions-config; |
| 464 | uses bgp-conditions-state; |
| 465 | } |
| 466 | |
| 467 | uses community-count-top; |
| 468 | uses as-path-length-top; |
| 469 | uses bgp-match-set-conditions; |
| 470 | } |
| 471 | } |
| 472 | |
| 473 | grouping community-set-config { |
| 474 | description |
| 475 | "Configuration data for BGP community sets"; |
| 476 | |
| 477 | leaf community-set-name { |
| 478 | type string; |
| 479 | mandatory true; |
| 480 | description |
| 481 | "name / label of the community set -- this is used to |
| 482 | reference the set in match conditions"; |
| 483 | } |
| 484 | |
| 485 | leaf-list community-member { |
| 486 | type union { |
| 487 | type oc-bgp-types:bgp-std-community-type; |
| 488 | type oc-bgp-types:bgp-community-regexp-type; |
| 489 | type oc-bgp-types:bgp-well-known-community-type; |
| 490 | } |
| 491 | description |
| 492 | "members of the community set"; |
| 493 | } |
| 494 | } |
| 495 | |
| 496 | grouping community-set-state { |
| 497 | description |
| 498 | "Operational state data for BGP community sets"; |
| 499 | } |
| 500 | |
| 501 | grouping community-set-top { |
| 502 | description |
| 503 | "Top-level grouping for BGP community sets"; |
| 504 | |
| 505 | container community-sets { |
| 506 | description |
| 507 | "Enclosing container for list of defined BGP community sets"; |
| 508 | |
| 509 | list community-set { |
| 510 | key "community-set-name"; |
| 511 | description |
| 512 | "List of defined BGP community sets"; |
| 513 | |
| 514 | leaf community-set-name { |
| 515 | type leafref { |
| 516 | path "../config/community-set-name"; |
| 517 | } |
| 518 | description |
| 519 | "Reference to list key"; |
| 520 | } |
| 521 | |
| 522 | container config { |
| 523 | description |
| 524 | "Configuration data for BGP community sets"; |
| 525 | |
| 526 | uses community-set-config; |
| 527 | } |
| 528 | |
| 529 | container state { |
| 530 | |
| 531 | config false; |
| 532 | |
| 533 | description |
| 534 | "Operational state data for BGP community sets"; |
| 535 | |
| 536 | uses community-set-config; |
| 537 | uses community-set-state; |
| 538 | } |
| 539 | } |
| 540 | } |
| 541 | } |
| 542 | |
| 543 | grouping ext-community-set-config { |
| 544 | description |
| 545 | "Configuration data for extended BGP community sets"; |
| 546 | |
| 547 | leaf ext-community-set-name { |
| 548 | type string; |
| 549 | description |
| 550 | "name / label of the extended community set -- this is |
| 551 | used to reference the set in match conditions"; |
| 552 | } |
| 553 | |
| 554 | leaf-list ext-community-member { |
| 555 | type union { |
| 556 | type oc-bgp-types:bgp-ext-community-type; |
| 557 | type oc-bgp-types:bgp-community-regexp-type; |
| 558 | } |
| 559 | description |
| 560 | "members of the extended community set"; |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | grouping ext-community-set-state { |
| 565 | description |
| 566 | "Operational state data for extended BGP community sets"; |
| 567 | } |
| 568 | |
| 569 | grouping ext-community-set-top { |
| 570 | description |
| 571 | "Top-level grouping for extended BGP community sets"; |
| 572 | |
| 573 | container ext-community-sets { |
| 574 | description |
| 575 | "Enclosing container for list of extended BGP community |
| 576 | sets"; |
| 577 | |
| 578 | list ext-community-set { |
| 579 | key "ext-community-set-name"; |
| 580 | description |
| 581 | "List of defined extended BGP community sets"; |
| 582 | |
| 583 | leaf ext-community-set-name { |
| 584 | type leafref { |
| 585 | path "../config/ext-community-set-name"; |
| 586 | } |
| 587 | description |
| 588 | "Reference to list key"; |
| 589 | } |
| 590 | |
| 591 | container config { |
| 592 | description |
| 593 | "Configuration data for extended BGP community sets"; |
| 594 | |
| 595 | uses ext-community-set-config; |
| 596 | } |
| 597 | |
| 598 | container state { |
| 599 | |
| 600 | config false; |
| 601 | |
| 602 | description |
| 603 | "Operational state data for extended BGP community sets"; |
| 604 | |
| 605 | uses ext-community-set-config; |
| 606 | uses ext-community-set-state; |
| 607 | } |
| 608 | } |
| 609 | } |
| 610 | } |
| 611 | |
| 612 | grouping as-path-set-config { |
| 613 | description |
| 614 | "Configuration data for AS path sets"; |
| 615 | |
| 616 | leaf as-path-set-name { |
| 617 | type string; |
| 618 | description |
| 619 | "name of the AS path set -- this is used to reference |
| 620 | the set in match conditions"; |
| 621 | } |
| 622 | |
| 623 | leaf-list as-path-set-member { |
| 624 | // TODO: need to refine typedef for AS path expressions |
| 625 | type string; |
| 626 | description |
| 627 | "AS path expression -- list of ASes in the set"; |
| 628 | } |
| 629 | } |
| 630 | |
| 631 | grouping as-path-set-state { |
| 632 | description |
| 633 | "Operational state data for AS path sets"; |
| 634 | } |
| 635 | |
| 636 | grouping as-path-set-top { |
| 637 | description |
| 638 | "Top-level grouping for AS path sets"; |
| 639 | |
| 640 | container as-path-sets { |
| 641 | description |
| 642 | "Enclosing container for list of define AS path sets"; |
| 643 | |
| 644 | list as-path-set { |
| 645 | key "as-path-set-name"; |
| 646 | description |
| 647 | "List of defined AS path sets"; |
| 648 | |
| 649 | leaf as-path-set-name { |
| 650 | type leafref { |
| 651 | path "../config/as-path-set-name"; |
| 652 | } |
| 653 | description |
| 654 | "Reference to list key"; |
| 655 | } |
| 656 | |
| 657 | container config { |
| 658 | description |
| 659 | "Configuration data for AS path sets"; |
| 660 | |
| 661 | uses as-path-set-config; |
| 662 | } |
| 663 | |
| 664 | container state { |
| 665 | |
| 666 | config false; |
| 667 | |
| 668 | description |
| 669 | "Operational state data for AS path sets"; |
| 670 | |
| 671 | uses as-path-set-config; |
| 672 | uses as-path-set-state; |
| 673 | } |
| 674 | } |
| 675 | } |
| 676 | } |
| 677 | |
| 678 | // augment statements |
| 679 | |
| 680 | augment "/oc-rpol:routing-policy/oc-rpol:defined-sets" { |
| 681 | description "adds BGP defined sets container to routing policy |
| 682 | model"; |
| 683 | |
| 684 | container bgp-defined-sets { |
| 685 | description |
| 686 | "BGP-related set definitions for policy match conditions"; |
| 687 | |
| 688 | uses community-set-top; |
| 689 | uses ext-community-set-top; |
| 690 | uses as-path-set-top; |
| 691 | } |
| 692 | } |
| 693 | |
| 694 | grouping as-path-prepend-config { |
| 695 | description |
| 696 | "Configuration data for the AS path prepend action"; |
| 697 | |
| 698 | leaf repeat-n { |
| 699 | type uint8 { |
| 700 | range 1..max; |
| 701 | } |
| 702 | description |
| 703 | "Number of times to prepend the value specified in the asn |
| 704 | leaf to the AS path. If no value is specified by the asn |
| 705 | leaf, the local AS number of the system is used. The value |
| 706 | should be between 1 and the maximum supported by the |
| 707 | implementation."; |
| 708 | } |
| 709 | |
| 710 | leaf asn { |
| 711 | type oc-inet:as-number; |
| 712 | description |
| 713 | "The AS number to prepend to the AS path. If this leaf is |
| 714 | not specified and repeat-n is set, then the local AS |
| 715 | number will be used for prepending."; |
| 716 | } |
| 717 | } |
| 718 | |
| 719 | grouping as-path-prepend-state { |
| 720 | description |
| 721 | "Operational state data for the AS path prepend action"; |
| 722 | } |
| 723 | |
| 724 | grouping as-path-prepend-top { |
| 725 | description |
| 726 | "Top-level grouping for the AS path prepend action"; |
| 727 | |
| 728 | container set-as-path-prepend { |
| 729 | description |
| 730 | "Action to prepend the specified AS number to the AS-path a |
| 731 | specified number of times"; |
| 732 | |
| 733 | container config { |
| 734 | description |
| 735 | "Configuration data for the AS path prepend action"; |
| 736 | |
| 737 | uses as-path-prepend-config; |
| 738 | } |
| 739 | |
| 740 | container state { |
| 741 | |
| 742 | config false; |
| 743 | |
| 744 | description |
| 745 | "Operational state data for the AS path prepend action"; |
| 746 | |
| 747 | uses as-path-prepend-config; |
| 748 | uses as-path-prepend-state; |
| 749 | } |
| 750 | } |
| 751 | } |
| 752 | |
| 753 | grouping set-community-action-common { |
| 754 | description |
| 755 | "Common leaves for set-community and set-ext-community |
| 756 | actions"; |
| 757 | |
| 758 | leaf method { |
| 759 | type enumeration { |
| 760 | enum INLINE { |
| 761 | description |
| 762 | "The extended communities are specified inline as a |
| 763 | list"; |
| 764 | } |
| 765 | enum REFERENCE { |
| 766 | description |
| 767 | "The extended communities are specified by referencing a |
| 768 | defined ext-community set"; |
| 769 | } |
| 770 | } |
| 771 | description |
| 772 | "Indicates the method used to specify the extended |
| 773 | communities for the set-ext-community action"; |
| 774 | } |
| 775 | |
| 776 | leaf options { |
| 777 | type bgp-set-community-option-type; |
| 778 | description |
| 779 | "Options for modifying the community attribute with |
| 780 | the specified values. These options apply to both |
| 781 | methods of setting the community attribute."; |
| 782 | } |
| 783 | } |
| 784 | |
| 785 | grouping set-community-inline-config { |
| 786 | description |
| 787 | "Configuration data for inline specification of set-community |
| 788 | action"; |
| 789 | |
| 790 | leaf-list communities { |
| 791 | type union { |
| 792 | type oc-bgp-types:bgp-std-community-type; |
| 793 | type oc-bgp-types:bgp-well-known-community-type; |
| 794 | } |
| 795 | description |
| 796 | "Set the community values for the update inline with |
| 797 | a list."; |
| 798 | } |
| 799 | } |
| 800 | |
| 801 | grouping set-community-inline-state { |
| 802 | description |
| 803 | "Operational state data or inline specification of |
| 804 | set-community action"; |
| 805 | } |
| 806 | |
| 807 | grouping set-community-inline-top { |
| 808 | description |
| 809 | "Top-level grouping or inline specification of set-community |
| 810 | action"; |
| 811 | |
| 812 | container inline { |
| 813 | when "../config/method=INLINE" { |
| 814 | description |
| 815 | "Active only when the set-community method is INLINE"; |
| 816 | } |
| 817 | description |
| 818 | "Set the community values for the action inline with |
| 819 | a list."; |
| 820 | |
| 821 | container config { |
| 822 | description |
| 823 | "Configuration data or inline specification of set-community |
| 824 | action"; |
| 825 | |
| 826 | uses set-community-inline-config; |
| 827 | } |
| 828 | |
| 829 | container state { |
| 830 | |
| 831 | config false; |
| 832 | |
| 833 | description |
| 834 | "Operational state data or inline specification of |
| 835 | set-community action"; |
| 836 | |
| 837 | uses set-community-inline-config; |
| 838 | uses set-community-inline-state; |
| 839 | } |
| 840 | } |
| 841 | } |
| 842 | |
| 843 | grouping set-community-reference-config { |
| 844 | description |
| 845 | "Configuration data for referening a community-set in the |
| 846 | set-community action"; |
| 847 | |
| 848 | leaf community-set-ref { |
| 849 | type leafref { |
| 850 | path "/oc-rpol:routing-policy/oc-rpol:defined-sets/" + |
| 851 | "oc-bgp-pol:bgp-defined-sets/" + |
| 852 | "oc-bgp-pol:community-sets/oc-bgp-pol:community-set/" + |
| 853 | "oc-bgp-pol:community-set-name"; |
| 854 | } |
| 855 | description |
| 856 | "References a defined community set by name"; |
| 857 | } |
| 858 | } |
| 859 | |
| 860 | grouping set-community-reference-state { |
| 861 | description |
| 862 | "Operational state data for referening a community-set in the |
| 863 | set-community action"; |
| 864 | } |
| 865 | |
| 866 | grouping set-community-reference-top { |
| 867 | description |
| 868 | "Top-level grouping for referening a community-set in the |
| 869 | set-community action"; |
| 870 | |
| 871 | container reference { |
| 872 | when "../config/method=REFERENCE" { |
| 873 | description |
| 874 | "Active only when the set-community method is REFERENCE"; |
| 875 | } |
| 876 | description |
| 877 | "Provide a reference to a defined community set for the |
| 878 | set-community action"; |
| 879 | |
| 880 | container config { |
| 881 | description |
| 882 | "Configuration data for referening a community-set in the |
| 883 | set-community action"; |
| 884 | |
| 885 | uses set-community-reference-config; |
| 886 | } |
| 887 | |
| 888 | container state { |
| 889 | |
| 890 | config false; |
| 891 | |
| 892 | description |
| 893 | "Operational state data for referening a community-set |
| 894 | in the set-community action"; |
| 895 | |
| 896 | uses set-community-reference-config; |
| 897 | uses set-community-reference-state; |
| 898 | } |
| 899 | } |
| 900 | } |
| 901 | |
| 902 | grouping set-community-action-config { |
| 903 | description |
| 904 | "Configuration data for the set-community action"; |
| 905 | |
| 906 | uses set-community-action-common; |
| 907 | } |
| 908 | |
| 909 | grouping set-community-action-state { |
| 910 | description |
| 911 | "Operational state data for the set-community action"; |
| 912 | } |
| 913 | |
| 914 | grouping set-community-action-top { |
| 915 | description |
| 916 | "Top-level grouping for the set-community action"; |
| 917 | |
| 918 | container set-community { |
| 919 | description |
| 920 | "Action to set the community attributes of the route, along |
| 921 | with options to modify how the community is modified. |
| 922 | Communities may be set using an inline list OR |
| 923 | reference to an existing defined set (not both)."; |
| 924 | |
| 925 | container config { |
| 926 | description |
| 927 | "Configuration data for the set-community action"; |
| 928 | |
| 929 | uses set-community-action-config; |
| 930 | } |
| 931 | |
| 932 | container state { |
| 933 | |
| 934 | config false; |
| 935 | |
| 936 | description |
| 937 | "Operational state data for the set-community action"; |
| 938 | |
| 939 | uses set-community-action-config; |
| 940 | uses set-community-action-state; |
| 941 | } |
| 942 | |
| 943 | uses set-community-inline-top; |
| 944 | uses set-community-reference-top; |
| 945 | } |
| 946 | } |
| 947 | |
| 948 | grouping set-ext-community-inline-config { |
| 949 | description |
| 950 | "Configuration data for inline specification of |
| 951 | set-ext-community action"; |
| 952 | |
| 953 | leaf-list communities { |
| 954 | type union { |
| 955 | type oc-bgp-types:bgp-ext-community-type; |
| 956 | type oc-bgp-types:bgp-well-known-community-type; |
| 957 | } |
| 958 | description |
| 959 | "Set the extended community values for the update inline |
| 960 | with a list."; |
| 961 | } |
| 962 | } |
| 963 | |
| 964 | grouping set-ext-community-inline-state { |
| 965 | description |
| 966 | "Operational state data or inline specification of |
| 967 | set-ext-community action"; |
| 968 | } |
| 969 | |
| 970 | grouping set-ext-community-inline-top { |
| 971 | description |
| 972 | "Top-level grouping or inline specification of set-ext-community |
| 973 | action"; |
| 974 | |
| 975 | container inline { |
| 976 | when "../config/method=INLINE" { |
| 977 | description |
| 978 | "Active only when the set-community method is INLINE"; |
| 979 | } |
| 980 | description |
| 981 | "Set the extended community values for the action inline with |
| 982 | a list."; |
| 983 | |
| 984 | container config { |
| 985 | description |
| 986 | "Configuration data or inline specification of |
| 987 | set-ext-community action"; |
| 988 | |
| 989 | uses set-ext-community-inline-config; |
| 990 | } |
| 991 | |
| 992 | container state { |
| 993 | |
| 994 | config false; |
| 995 | |
| 996 | description |
| 997 | "Operational state data or inline specification of |
| 998 | set-ext-community action"; |
| 999 | |
| 1000 | uses set-ext-community-inline-config; |
| 1001 | uses set-ext-community-inline-state; |
| 1002 | } |
| 1003 | } |
| 1004 | } |
| 1005 | |
| 1006 | grouping set-ext-community-reference-config { |
| 1007 | description |
| 1008 | "Configuration data for referening a extended community-set |
| 1009 | in the set-ext-community action"; |
| 1010 | |
| 1011 | leaf ext-community-set-ref { |
| 1012 | type leafref { |
| 1013 | path "/oc-rpol:routing-policy/oc-rpol:defined-sets/" + |
| 1014 | "oc-bgp-pol:bgp-defined-sets/" + |
| 1015 | "oc-bgp-pol:ext-community-sets/" + |
| 1016 | "oc-bgp-pol:ext-community-set/" + |
| 1017 | "oc-bgp-pol:ext-community-set-name"; |
| 1018 | } |
| 1019 | description |
| 1020 | "References a defined extended community set by |
| 1021 | name"; |
| 1022 | } |
| 1023 | } |
| 1024 | |
| 1025 | grouping set-ext-community-reference-state { |
| 1026 | description |
| 1027 | "Operational state data for referening an extended |
| 1028 | community-set in the set-ext-community action"; |
| 1029 | } |
| 1030 | |
| 1031 | grouping set-ext-community-reference-top { |
| 1032 | description |
| 1033 | "Top-level grouping for referening an extended community-set |
| 1034 | in the set-community action"; |
| 1035 | |
| 1036 | container reference { |
| 1037 | when "../config/method=REFERENCE" { |
| 1038 | description |
| 1039 | "Active only when the set-community method is REFERENCE"; |
| 1040 | } |
| 1041 | description |
| 1042 | "Provide a reference to an extended community set for the |
| 1043 | set-ext-community action"; |
| 1044 | |
| 1045 | container config { |
| 1046 | description |
| 1047 | "Configuration data for referening an extended |
| 1048 | community-set in the set-ext-community action"; |
| 1049 | |
| 1050 | uses set-ext-community-reference-config; |
| 1051 | } |
| 1052 | |
| 1053 | container state { |
| 1054 | |
| 1055 | config false; |
| 1056 | |
| 1057 | description |
| 1058 | "Operational state data for referening an extended |
| 1059 | community-set in the set-ext-community action"; |
| 1060 | |
| 1061 | uses set-ext-community-reference-config; |
| 1062 | uses set-ext-community-reference-state; |
| 1063 | } |
| 1064 | } |
| 1065 | } |
| 1066 | |
| 1067 | grouping set-ext-community-action-config { |
| 1068 | description |
| 1069 | "Configuration data for the set-ext-community action"; |
| 1070 | |
| 1071 | uses set-community-action-common; |
| 1072 | } |
| 1073 | |
| 1074 | grouping set-ext-community-action-state { |
| 1075 | description |
| 1076 | "Operational state data for the set-ext-community action"; |
| 1077 | } |
| 1078 | |
| 1079 | grouping set-ext-community-action-top { |
| 1080 | description |
| 1081 | "Top-level grouping for the set-ext-community action"; |
| 1082 | |
| 1083 | container set-ext-community { |
| 1084 | description |
| 1085 | "Action to set the extended community attributes of the |
| 1086 | route, along with options to modify how the community is |
| 1087 | modified. Extended communities may be set using an inline |
| 1088 | list OR a reference to an existing defined set (but not |
| 1089 | both)."; |
| 1090 | |
| 1091 | container config { |
| 1092 | description |
| 1093 | "Configuration data for the set-ext-community action"; |
| 1094 | |
| 1095 | uses set-ext-community-action-config; |
| 1096 | } |
| 1097 | |
| 1098 | container state { |
| 1099 | |
| 1100 | config false; |
| 1101 | |
| 1102 | description |
| 1103 | "Operational state data for the set-ext-community action"; |
| 1104 | |
| 1105 | uses set-ext-community-action-config; |
| 1106 | uses set-ext-community-action-state; |
| 1107 | } |
| 1108 | uses set-ext-community-inline-top; |
| 1109 | uses set-ext-community-reference-top; |
| 1110 | } |
| 1111 | } |
| 1112 | |
| 1113 | grouping bgp-actions-config { |
| 1114 | description |
| 1115 | "Configuration data for BGP-specific actions"; |
| 1116 | |
| 1117 | leaf set-route-origin { |
| 1118 | type oc-bgp-types:bgp-origin-attr-type; |
| 1119 | description "set the origin attribute to the specified |
| 1120 | value"; |
| 1121 | } |
| 1122 | |
| 1123 | leaf set-local-pref { |
| 1124 | type uint32; |
| 1125 | description "set the local pref attribute on the route |
| 1126 | update"; |
| 1127 | } |
| 1128 | |
| 1129 | leaf set-next-hop { |
| 1130 | type bgp-next-hop-type; |
| 1131 | description "set the next-hop attribute in the route update"; |
| 1132 | } |
| 1133 | |
| 1134 | leaf set-med { |
| 1135 | type bgp-set-med-type; |
| 1136 | description "set the med metric attribute in the route |
| 1137 | update"; |
| 1138 | } |
| 1139 | } |
| 1140 | |
| 1141 | grouping bgp-actions-state { |
| 1142 | description |
| 1143 | "Operational state data for BGP-specific actions"; |
| 1144 | } |
| 1145 | |
| 1146 | grouping bgp-actions-top { |
| 1147 | description |
| 1148 | "Top-level grouping for BGP-specific actions"; |
| 1149 | |
| 1150 | container bgp-actions { |
| 1151 | description |
| 1152 | "Top-level container for BGP-specific actions"; |
| 1153 | |
| 1154 | container config { |
| 1155 | description |
| 1156 | "Configuration data for BGP-specific actions"; |
| 1157 | |
| 1158 | uses bgp-actions-config; |
| 1159 | } |
| 1160 | |
| 1161 | container state { |
| 1162 | |
| 1163 | config false; |
| 1164 | |
| 1165 | description |
| 1166 | "Operational state data for BGP-specific actions"; |
| 1167 | |
| 1168 | uses bgp-actions-config; |
| 1169 | uses bgp-actions-state; |
| 1170 | } |
| 1171 | uses as-path-prepend-top; |
| 1172 | uses set-community-action-top; |
| 1173 | uses set-ext-community-action-top; |
| 1174 | } |
| 1175 | } |
| 1176 | |
| 1177 | augment "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + |
| 1178 | "oc-rpol:policy-definition/oc-rpol:statements/oc-rpol:statement/" + |
| 1179 | "oc-rpol:conditions" { |
| 1180 | description |
| 1181 | "BGP policy conditions added to routing policy module"; |
| 1182 | |
| 1183 | uses bgp-conditions-top; |
| 1184 | } |
| 1185 | |
| 1186 | augment "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + |
| 1187 | "oc-rpol:policy-definition/oc-rpol:statements/oc-rpol:statement/" + |
| 1188 | "oc-rpol:actions" { |
| 1189 | description "BGP policy actions added to routing policy |
| 1190 | module"; |
| 1191 | |
| 1192 | uses bgp-actions-top; |
| 1193 | } |
| 1194 | |
| 1195 | // rpc statements |
| 1196 | |
| 1197 | // notification statements |
| 1198 | } |