Thomas Vachuska | 6655bee | 2017-08-24 16:12:59 -0700 | [diff] [blame] | 1 | submodule openconfig-rib-bgp-tables { |
| 2 | |
| 3 | belongs-to openconfig-rib-bgp { |
| 4 | prefix "oc-rib-bgp"; |
| 5 | } |
| 6 | |
| 7 | |
| 8 | // import some basic types |
| 9 | import ietf-inet-types { prefix inet; } |
| 10 | import openconfig-extensions { prefix oc-ext; } |
| 11 | import openconfig-policy-types { prefix oc-pol-types; } |
| 12 | |
| 13 | include openconfig-rib-bgp-attributes; |
| 14 | include openconfig-rib-bgp-shared-attributes; |
| 15 | include openconfig-rib-bgp-table-attributes; |
| 16 | |
| 17 | // meta |
| 18 | organization "OpenConfig working group"; |
| 19 | |
| 20 | contact |
| 21 | "OpenConfig working group |
| 22 | www.openconfig.net"; |
| 23 | |
| 24 | description |
| 25 | "This submodule contains structural data definitions for |
| 26 | BGP routing tables."; |
| 27 | |
| 28 | |
| 29 | oc-ext:openconfig-version "0.3.0"; |
| 30 | |
| 31 | revision "2016-10-17" { |
| 32 | description |
| 33 | "OpenConfig BGP RIB refactor"; |
| 34 | reference "0.3.0"; |
| 35 | } |
| 36 | |
| 37 | |
| 38 | grouping bgp-adj-rib-common-attr-refs { |
| 39 | description |
| 40 | "Definitions of common references to attribute sets for |
| 41 | multiple AFI-SAFIs for Adj-RIB tables"; |
| 42 | |
| 43 | leaf attr-index { |
| 44 | type leafref { |
| 45 | path "../../../../../../../../../../attr-sets/attr-set/" + |
| 46 | "state/index"; |
| 47 | } |
| 48 | description |
| 49 | "Reference to the common attribute group for the |
| 50 | route"; |
| 51 | } |
| 52 | |
| 53 | leaf community-index { |
| 54 | type leafref { |
| 55 | path "../../../../../../../../../../communities/community/" + |
| 56 | "state/index"; |
| 57 | } |
| 58 | description |
| 59 | "Reference to the community attribute for the route"; |
| 60 | } |
| 61 | |
| 62 | leaf ext-community-index { |
| 63 | type leafref { |
| 64 | path "../../../../../../../../../../ext-communities/" + |
| 65 | "ext-community/state/index"; |
| 66 | } |
| 67 | description |
| 68 | "Reference to the extended community attribute for the |
| 69 | route"; |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | grouping bgp-loc-rib-common-attr-refs { |
| 74 | description |
| 75 | "Definitions of common references to attribute sets for |
| 76 | multiple AFI-SAFIs for LOC-RIB tables"; |
| 77 | |
| 78 | leaf attr-index { |
| 79 | type leafref { |
| 80 | path "../../../../../../../../attr-sets/attr-set/" + |
| 81 | "state/index"; |
| 82 | } |
| 83 | description |
| 84 | "Reference to the common attribute group for the |
| 85 | route"; |
| 86 | } |
| 87 | |
| 88 | leaf community-index { |
| 89 | type leafref { |
| 90 | path "../../../../../../../../communities/community/" + |
| 91 | "state/index"; |
| 92 | } |
| 93 | description |
| 94 | "Reference to the community attribute for the route"; |
| 95 | } |
| 96 | |
| 97 | leaf ext-community-index { |
| 98 | type leafref { |
| 99 | path "../../../../../../../../ext-communities/" + |
| 100 | "ext-community/state/index"; |
| 101 | } |
| 102 | description |
| 103 | "Reference to the extended community attribute for the |
| 104 | route"; |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | grouping bgp-loc-rib-common-keys { |
| 109 | description |
| 110 | "Common references used in keys for IPv4 and IPv6 |
| 111 | LOC-RIB entries"; |
| 112 | |
| 113 | leaf origin { |
| 114 | type union { |
| 115 | type inet:ip-address-no-zone; |
| 116 | type identityref { |
| 117 | base oc-pol-types:INSTALL_PROTOCOL_TYPE; |
| 118 | } |
| 119 | } |
| 120 | description |
| 121 | "Indicates the origin of the route. If the route is learned |
| 122 | from a neighbor, this value is the neighbor address. If |
| 123 | the route was injected or redistributed from another |
| 124 | protocol, the origin indicates the source protocol for the |
| 125 | route."; |
| 126 | } |
| 127 | |
| 128 | leaf path-id { |
| 129 | type uint32; |
| 130 | default 0; |
| 131 | description |
| 132 | "If the route is learned from a neighbor, the path-id |
| 133 | corresponds to the path-id for the route in the |
| 134 | corresponding adj-rib-in-post table. If the route is |
| 135 | injected from another protocol, or the neighbor does not |
| 136 | support BGP add-paths, the path-id should be set |
| 137 | to zero, also the default value."; |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | grouping bgp-loc-rib-key-refs { |
| 142 | description |
| 143 | "Key references to support operational state structure for |
| 144 | the BGP LOC-RIB table"; |
| 145 | |
| 146 | leaf prefix { |
| 147 | type leafref { |
| 148 | path "../state/prefix"; |
| 149 | } |
| 150 | description |
| 151 | "Reference to the prefix list key"; |
| 152 | } |
| 153 | |
| 154 | leaf origin { |
| 155 | type leafref { |
| 156 | path "../state/origin"; |
| 157 | } |
| 158 | description |
| 159 | "Reference to the origin list key"; |
| 160 | } |
| 161 | |
| 162 | leaf path-id { |
| 163 | type leafref { |
| 164 | path "../state/path-id"; |
| 165 | } |
| 166 | description |
| 167 | "Reference to the path-id list key"; |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | grouping ipv4-loc-rib-top { |
| 172 | description |
| 173 | "Top-level grouping for IPv4 routing tables"; |
| 174 | |
| 175 | container loc-rib { |
| 176 | config false; |
| 177 | description |
| 178 | "Container for the IPv4 BGP LOC-RIB data"; |
| 179 | |
| 180 | uses bgp-common-table-attrs-top; |
| 181 | |
| 182 | container routes { |
| 183 | description |
| 184 | "Enclosing container for list of routes in the routing |
| 185 | table."; |
| 186 | |
| 187 | list route { |
| 188 | key "prefix origin path-id"; |
| 189 | |
| 190 | description |
| 191 | "List of routes in the table, keyed by the route |
| 192 | prefix, the route origin, and path-id. The route |
| 193 | origin can be either the neighbor address from which |
| 194 | the route was learned, or the source protocol that |
| 195 | injected the route. The path-id distinguishes routes |
| 196 | for the same prefix received from a neighbor (e.g., |
| 197 | if add-paths is eanbled)."; |
| 198 | |
| 199 | uses bgp-loc-rib-key-refs; |
| 200 | |
| 201 | container state { |
| 202 | description |
| 203 | "Operational state data for route entries in the |
| 204 | BGP LOC-RIB"; |
| 205 | |
| 206 | leaf prefix { |
| 207 | type inet:ipv4-prefix; |
| 208 | description |
| 209 | "The IPv4 prefix corresponding to the route"; |
| 210 | } |
| 211 | |
| 212 | uses bgp-loc-rib-common-keys; |
| 213 | |
| 214 | uses bgp-loc-rib-common-attr-refs; |
| 215 | |
| 216 | uses bgp-loc-rib-attr-state; |
| 217 | |
| 218 | uses bgp-common-route-annotations-state; |
| 219 | uses bgp-loc-rib-route-annotations-state; |
| 220 | |
| 221 | } |
| 222 | |
| 223 | uses bgp-unknown-attr-top; |
| 224 | |
| 225 | } |
| 226 | } |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | |
| 231 | grouping ipv6-loc-rib-top { |
| 232 | description |
| 233 | "Top-level grouping for IPv6 routing tables"; |
| 234 | |
| 235 | container loc-rib { |
| 236 | config false; |
| 237 | description |
| 238 | "Container for the IPv6 BGP LOC-RIB data"; |
| 239 | |
| 240 | uses bgp-common-table-attrs-top; |
| 241 | |
| 242 | |
| 243 | container routes { |
| 244 | description |
| 245 | "Enclosing container for list of routes in the routing |
| 246 | table."; |
| 247 | |
| 248 | list route { |
| 249 | key "prefix origin path-id"; |
| 250 | |
| 251 | description |
| 252 | "List of routes in the table, keyed by the route |
| 253 | prefix, the route origin, and path-id. The route |
| 254 | origin can be either the neighbor address from which |
| 255 | the route was learned, or the source protocol that |
| 256 | injected the route. The path-id distinguishes routes |
| 257 | for the same prefix received from a neighbor (e.g., |
| 258 | if add-paths is eanbled)."; |
| 259 | |
| 260 | uses bgp-loc-rib-key-refs; |
| 261 | |
| 262 | container state { |
| 263 | description |
| 264 | "Operational state data for route entries in the |
| 265 | BGP LOC-RIB"; |
| 266 | |
| 267 | leaf prefix { |
| 268 | type inet:ipv6-prefix; |
| 269 | description |
| 270 | "The IPv6 prefix corresponding to the route"; |
| 271 | } |
| 272 | |
| 273 | uses bgp-loc-rib-common-keys; |
| 274 | |
| 275 | uses bgp-loc-rib-common-attr-refs; |
| 276 | |
| 277 | uses bgp-loc-rib-attr-state; |
| 278 | |
| 279 | uses bgp-common-route-annotations-state; |
| 280 | uses bgp-loc-rib-route-annotations-state; |
| 281 | |
| 282 | } |
| 283 | |
| 284 | uses bgp-unknown-attr-top; |
| 285 | } |
| 286 | } |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | grouping bgp-adj-rib-key-refs { |
| 291 | description |
| 292 | "Key references to support operational state structure for |
| 293 | the BGP Adj-RIB tables"; |
| 294 | |
| 295 | leaf prefix { |
| 296 | type leafref { |
| 297 | path "../state/prefix"; |
| 298 | } |
| 299 | description |
| 300 | "Reference to the prefix list key"; |
| 301 | } |
| 302 | |
| 303 | leaf path-id { |
| 304 | type leafref { |
| 305 | path "../state/path-id"; |
| 306 | } |
| 307 | description |
| 308 | "Reference to the path-id list key"; |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | grouping ipv4-adj-rib-common { |
| 313 | description |
| 314 | "Common structural grouping for each IPv4 adj-RIB table"; |
| 315 | |
| 316 | uses bgp-common-table-attrs-top; |
| 317 | |
| 318 | container routes { |
| 319 | config false; |
| 320 | description |
| 321 | "Enclosing container for list of routes in the routing |
| 322 | table."; |
| 323 | |
| 324 | list route { |
| 325 | key "prefix path-id"; |
| 326 | |
| 327 | description |
| 328 | "List of routes in the table, keyed by a combination of |
| 329 | the route prefix and path-id to distinguish multiple |
| 330 | routes received from a neighbor for the same prefix, |
| 331 | e.g., when BGP add-paths is enabled."; |
| 332 | |
| 333 | uses bgp-adj-rib-key-refs; |
| 334 | |
| 335 | container state { |
| 336 | description |
| 337 | "Operational state data for BGP Adj-RIB entries"; |
| 338 | |
| 339 | leaf prefix { |
| 340 | type inet:ipv4-prefix; |
| 341 | description |
| 342 | "Prefix for the route"; |
| 343 | } |
| 344 | |
| 345 | uses bgp-adj-rib-attr-state; |
| 346 | |
| 347 | uses bgp-adj-rib-common-attr-refs; |
| 348 | |
| 349 | uses bgp-common-route-annotations-state; |
| 350 | } |
| 351 | |
| 352 | uses bgp-unknown-attr-top; |
| 353 | |
| 354 | } |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | grouping ipv4-adj-rib-in-post { |
| 359 | description |
| 360 | "Common structural grouping for the IPv4 adj-rib-in |
| 361 | post-policy table"; |
| 362 | |
| 363 | uses bgp-common-table-attrs-top; |
| 364 | |
| 365 | container routes { |
| 366 | config false; |
| 367 | description |
| 368 | "Enclosing container for list of routes in the routing |
| 369 | table."; |
| 370 | |
| 371 | list route { |
| 372 | key "prefix path-id"; |
| 373 | |
| 374 | description |
| 375 | "List of routes in the table, keyed by a combination of |
| 376 | the route prefix and path-id to distinguish multiple |
| 377 | routes received from a neighbor for the same prefix, |
| 378 | e.g., when BGP add-paths is enabled."; |
| 379 | |
| 380 | uses bgp-adj-rib-key-refs; |
| 381 | |
| 382 | container state { |
| 383 | description |
| 384 | "Operational state data for BGP Adj-RIB entries"; |
| 385 | |
| 386 | leaf prefix { |
| 387 | type inet:ipv4-prefix; |
| 388 | description |
| 389 | "Prefix for the route"; |
| 390 | } |
| 391 | |
| 392 | uses bgp-adj-rib-attr-state; |
| 393 | |
| 394 | uses bgp-adj-rib-common-attr-refs; |
| 395 | |
| 396 | uses bgp-common-route-annotations-state; |
| 397 | |
| 398 | uses bgp-adj-rib-in-post-route-annotations-state; |
| 399 | } |
| 400 | |
| 401 | uses bgp-unknown-attr-top; |
| 402 | } |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | |
| 407 | grouping ipv4-adj-rib-top { |
| 408 | description |
| 409 | "Top-level grouping for Adj-RIB table"; |
| 410 | |
| 411 | container neighbors { |
| 412 | config false; |
| 413 | description |
| 414 | "Enclosing container for neighbor list"; |
| 415 | |
| 416 | list neighbor { |
| 417 | key "neighbor-address"; |
| 418 | description |
| 419 | "List of neighbors (peers) of the local BGP speaker"; |
| 420 | |
| 421 | leaf neighbor-address { |
| 422 | type leafref { |
| 423 | path "../state/neighbor-address"; |
| 424 | } |
| 425 | description |
| 426 | "Reference to the list key"; |
| 427 | } |
| 428 | |
| 429 | container state { |
| 430 | description |
| 431 | "Operational state for each neighbor BGP Adj-RIB"; |
| 432 | |
| 433 | leaf neighbor-address { |
| 434 | type inet:ip-address-no-zone; |
| 435 | description |
| 436 | "IP address of the BGP neighbor or peer"; |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | container adj-rib-in-pre { |
| 441 | description |
| 442 | "Per-neighbor table containing the NLRI updates |
| 443 | received from the neighbor before any local input |
| 444 | policy rules or filters have been applied. This can |
| 445 | be considered the 'raw' updates from the neighbor."; |
| 446 | |
| 447 | uses ipv4-adj-rib-common; |
| 448 | |
| 449 | } |
| 450 | |
| 451 | container adj-rib-in-post { |
| 452 | description |
| 453 | "Per-neighbor table containing the paths received from |
| 454 | the neighbor that are eligible for best-path selection |
| 455 | after local input policy rules have been applied."; |
| 456 | |
| 457 | uses ipv4-adj-rib-in-post; |
| 458 | } |
| 459 | |
| 460 | container adj-rib-out-pre { |
| 461 | description |
| 462 | "Per-neighbor table containing paths eligble for |
| 463 | sending (advertising) to the neighbor before output |
| 464 | policy rules have been applied"; |
| 465 | |
| 466 | uses ipv4-adj-rib-common; |
| 467 | |
| 468 | } |
| 469 | |
| 470 | container adj-rib-out-post { |
| 471 | description |
| 472 | "Per-neighbor table containing paths eligble for |
| 473 | sending (advertising) to the neighbor after output |
| 474 | policy rules have been applied"; |
| 475 | |
| 476 | uses ipv4-adj-rib-common; |
| 477 | |
| 478 | } |
| 479 | } |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | grouping ipv6-adj-rib-common { |
| 484 | description |
| 485 | "Common structural grouping for each IPv6 adj-RIB table"; |
| 486 | |
| 487 | uses bgp-common-table-attrs-state; |
| 488 | |
| 489 | container routes { |
| 490 | config false; |
| 491 | description |
| 492 | "Enclosing container for list of routes in the routing |
| 493 | table."; |
| 494 | |
| 495 | list route { |
| 496 | key "prefix path-id"; |
| 497 | |
| 498 | description |
| 499 | "List of routes in the table"; |
| 500 | |
| 501 | uses bgp-adj-rib-key-refs; |
| 502 | |
| 503 | container state { |
| 504 | description |
| 505 | "Operational state data for BGP Adj-RIB entries"; |
| 506 | |
| 507 | leaf prefix { |
| 508 | type inet:ipv6-prefix; |
| 509 | description |
| 510 | "Prefix for the route"; |
| 511 | } |
| 512 | |
| 513 | uses bgp-adj-rib-attr-state; |
| 514 | |
| 515 | uses bgp-adj-rib-common-attr-refs; |
| 516 | |
| 517 | uses bgp-common-route-annotations-state; |
| 518 | } |
| 519 | |
| 520 | uses bgp-unknown-attr-top; |
| 521 | } |
| 522 | } |
| 523 | } |
| 524 | |
| 525 | grouping ipv6-adj-rib-in-post { |
| 526 | description |
| 527 | "Common structural grouping for the IPv6 adj-rib-in |
| 528 | post-policy table"; |
| 529 | |
| 530 | uses bgp-common-table-attrs-state; |
| 531 | |
| 532 | container routes { |
| 533 | config false; |
| 534 | description |
| 535 | "Enclosing container for list of routes in the routing |
| 536 | table."; |
| 537 | |
| 538 | list route { |
| 539 | key "prefix path-id"; |
| 540 | |
| 541 | description |
| 542 | "List of routes in the table"; |
| 543 | |
| 544 | uses bgp-adj-rib-key-refs; |
| 545 | |
| 546 | container state { |
| 547 | description |
| 548 | "Operational state data for BGP Adj-RIB entries"; |
| 549 | |
| 550 | leaf prefix { |
| 551 | type inet:ipv6-prefix; |
| 552 | description |
| 553 | "Prefix for the route"; |
| 554 | } |
| 555 | |
| 556 | uses bgp-adj-rib-attr-state; |
| 557 | |
| 558 | uses bgp-adj-rib-common-attr-refs; |
| 559 | |
| 560 | uses bgp-common-route-annotations-state; |
| 561 | |
| 562 | uses bgp-adj-rib-in-post-route-annotations-state; |
| 563 | } |
| 564 | |
| 565 | uses bgp-unknown-attr-top; |
| 566 | } |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | grouping ipv6-adj-rib-top { |
| 571 | description |
| 572 | "Top-level grouping for Adj-RIB table"; |
| 573 | |
| 574 | container neighbors { |
| 575 | config false; |
| 576 | description |
| 577 | "Enclosing container for neighbor list"; |
| 578 | |
| 579 | list neighbor { |
| 580 | key "neighbor-address"; |
| 581 | description |
| 582 | "List of neighbors (peers) of the local BGP speaker"; |
| 583 | |
| 584 | leaf neighbor-address { |
| 585 | type leafref { |
| 586 | path "../state/neighbor-address"; |
| 587 | } |
| 588 | description |
| 589 | "Reference to the list key"; |
| 590 | } |
| 591 | |
| 592 | container state { |
| 593 | description |
| 594 | "Operational state for each neighbor BGP Adj-RIB"; |
| 595 | |
| 596 | leaf neighbor-address { |
| 597 | type inet:ip-address-no-zone; |
| 598 | description |
| 599 | "IP address of the BGP neighbor or peer"; |
| 600 | } |
| 601 | } |
| 602 | |
| 603 | container adj-rib-in-pre { |
| 604 | description |
| 605 | "Per-neighbor table containing the NLRI updates |
| 606 | received from the neighbor before any local input |
| 607 | policy rules or filters have been applied. This can |
| 608 | be considered the 'raw' updates from the neighbor."; |
| 609 | |
| 610 | uses ipv6-adj-rib-common; |
| 611 | |
| 612 | } |
| 613 | |
| 614 | container adj-rib-in-post { |
| 615 | description |
| 616 | "Per-neighbor table containing the paths received from |
| 617 | the neighbor that are eligible for best-path selection |
| 618 | after local input policy rules have been applied."; |
| 619 | |
| 620 | uses ipv6-adj-rib-in-post; |
| 621 | } |
| 622 | |
| 623 | container adj-rib-out-pre { |
| 624 | description |
| 625 | "Per-neighbor table containing paths eligble for |
| 626 | sending (advertising) to the neighbor before output |
| 627 | policy rules have been applied"; |
| 628 | |
| 629 | uses ipv6-adj-rib-common; |
| 630 | |
| 631 | } |
| 632 | |
| 633 | container adj-rib-out-post { |
| 634 | description |
| 635 | "Per-neighbor table containing paths eligble for |
| 636 | sending (advertising) to the neighbor after output |
| 637 | policy rules have been applied"; |
| 638 | |
| 639 | uses ipv6-adj-rib-common; |
| 640 | |
| 641 | } |
| 642 | } |
| 643 | } |
| 644 | } |
| 645 | |
| 646 | } |