github.com/osrg/gobgp@v2.0.0+incompatible/tools/pyang_plugins/gobgp.yang (about) 1 module gobgp { 2 3 yang-version "1"; 4 5 // namespace 6 namespace "https://github.com/osrg/gobgp"; 7 8 prefix "gobgp"; 9 10 // import some basic types 11 import openconfig-bgp { prefix bgp; } 12 import openconfig-bgp-types { prefix bgp-types; } 13 import openconfig-bgp-multiprotocol { prefix bgp-mp; } 14 import openconfig-routing-policy {prefix rpol; } 15 import openconfig-policy-types {prefix ptypes; } 16 import openconfig-bgp-policy {prefix bgp-pol; } 17 import ietf-inet-types { prefix inet; } 18 import ietf-yang-types { prefix yang; } 19 20 // meta 21 organization 22 "GoBGP"; 23 24 contact 25 "GoBGP http://osrg.github.io/gobgp/"; 26 27 description 28 "This module contains definitions for GoBGP-specific configuration. 29 It augments bgp modules with GoBGP-specific options."; 30 31 revision "2015-08-10" { 32 description 33 "Updated model to augment base bgp modules"; 34 reference "TBD"; 35 } 36 37 typedef bmp-route-monitoring-policy-type { 38 type enumeration { 39 enum PRE-POLICY { 40 value 0; 41 description "send pre-policy routes"; 42 } 43 enum POST-POLICY { 44 value 1; 45 description "send post-policy routes"; 46 } 47 enum BOTH { 48 value 2; 49 description "!OBSOLETED! send both pre and post-policy routes"; 50 } 51 enum LOCAL-RIB { 52 value 3; 53 description "send local rib routes"; 54 } 55 enum ALL { 56 value 4; 57 description "send pre-policy, post-policy, and local rib routes"; 58 } 59 } 60 } 61 62 identity eq { 63 base ptypes:attribute-comparison; 64 } 65 66 identity ge { 67 base ptypes:attribute-comparison; 68 } 69 70 identity le { 71 base ptypes:attribute-comparison; 72 } 73 74 identity IPV4-MULTICAST { 75 base bgp-types:afi-safi-type; 76 description 77 "IPv4 multicast (AFI,SAFI = 1,2)"; 78 reference "RFC4760"; 79 } 80 81 identity IPV6-MULTICAST { 82 base bgp-types:afi-safi-type; 83 description 84 "IPv4 multicast (AFI,SAFI = 1,2)"; 85 reference "RFC4760"; 86 } 87 88 identity RTC { 89 base bgp-types:afi-safi-type; 90 description 91 "Route target membership (AFI,SAFI = 1,132)"; 92 reference "RFC4684"; 93 } 94 95 identity IPV4-ENCAP { 96 base bgp-types:afi-safi-type; 97 description 98 "Encapsulation (AFI,SAFI = 1,7)"; 99 reference "RFC5512"; 100 } 101 102 identity IPV6-ENCAP { 103 base bgp-types:afi-safi-type; 104 description 105 "Encapsulation (AFI,SAFI = 2,7)"; 106 reference "RFC5512"; 107 } 108 109 identity IPV4-FLOWSPEC { 110 base bgp-types:afi-safi-type; 111 description 112 "IPv4 flowspec (AFI,SAFI = 1,133)"; 113 reference "RFC5575"; 114 } 115 116 identity L3VPN-IPV4-FLOWSPEC { 117 base bgp-types:afi-safi-type; 118 description 119 "L3VPN IPv4 flowspec (AFI,SAFI = 1,134)"; 120 reference "RFC5575"; 121 } 122 123 identity IPV6-FLOWSPEC { 124 base bgp-types:afi-safi-type; 125 description 126 "IPv6 flowspec (AFI,SAFI = 1,133)"; 127 reference "RFC5575"; 128 } 129 130 identity L3VPN-IPV6-FLOWSPEC { 131 base bgp-types:afi-safi-type; 132 description 133 "L3VPN IPv6 flowspec (AFI,SAFI = 1,134)"; 134 reference "RFC5575"; 135 } 136 137 identity L2VPN-FLOWSPEC { 138 base bgp-types:afi-safi-type; 139 description 140 "L2VPN flowspec (AFI,SAFI = 25,134)"; 141 reference "draft-ietf-idr-flowspec-l2vpn-03"; 142 } 143 144 identity OPAQUE { 145 base bgp-types:afi-safi-type; 146 description 147 "Opaque (AFI,SAFI = 16397,241)"; 148 reference "https://tools.ietf.org/html/draft-lapukhov-bgp-opaque-signaling-01"; 149 } 150 151 grouping gobgp-message-counter { 152 description 153 "Counters for all BGPMessage types"; 154 155 leaf OPEN { 156 type uint64; 157 description 158 "Number of BGP open messages announcing, withdrawing 159 or modifying paths exchanged."; 160 } 161 162 leaf REFRESH { 163 type uint64; 164 description 165 "Number of BGP Route-Refresh messages indicating an 166 error condition has occurred exchanged."; 167 } 168 169 leaf KEEPALIVE { 170 type uint64; 171 description 172 "Number of BGP Keepalive messages indicating an 173 error condition has occurred exchanged."; 174 } 175 176 leaf DYNAMIC-CAP { 177 type uint64; 178 description 179 "Number of BGP dynamic-cap messages indicating an 180 error condition has occurred exchanged."; 181 } 182 183 leaf WITHDRAW-UPDATE { 184 type uint32; 185 description 186 "Number of updates subjected to treat-as-withdraw treatment."; 187 } 188 189 leaf WITHDRAW-PREFIX { 190 type uint32; 191 description 192 "Number of prefixes subjected to treat-as-withdraw treatment."; 193 } 194 195 leaf DISCARDED { 196 type uint64; 197 description 198 "Number of discarded messages indicating an 199 error condition has occurred exchanged."; 200 } 201 202 leaf TOTAL { 203 type uint64; 204 description 205 "Number of total messages indicating an 206 error condition has occurred exchanged."; 207 } 208 } 209 210 grouping gobgp-adjacent-table { 211 container adj-table { 212 leaf ADVERTISED { 213 type uint32; 214 } 215 216 leaf FILTERED { 217 type uint32; 218 } 219 220 leaf RECEIVED { 221 type uint32; 222 } 223 224 leaf ACCEPTED { 225 type uint32; 226 } 227 } 228 } 229 230 231 grouping gobgp-timer { 232 description "additional timer"; 233 234 leaf idle-hold-time-after-reset { 235 type decimal64 { 236 fraction-digits 2; 237 } 238 default 30; 239 description 240 "Time interval in seconds that a BGP session will be 241 in idle state after neighbor reset operation."; 242 } 243 } 244 245 246 grouping gobgp-neighbor-timer { 247 description "additional timer"; 248 249 leaf downtime { 250 type yang:timeticks; 251 description 252 "This timer determines the amount of time since the 253 BGP last transitioned out of the Established state"; 254 } 255 256 leaf update-recv-time { 257 type int64; 258 description 259 "The number of seconds elasped since January 1, 1970 UTC 260 last time the BGP session received an UPDATE message"; 261 } 262 } 263 264 265 grouping gobgp-in-policy { 266 description 267 "additional policy"; 268 269 leaf-list in-policy { 270 type leafref { 271 path "/rpol:routing-policy/rpol:policy-definitions/" + 272 "rpol:policy-definition/rpol:name"; 273 //require-instance true; 274 } 275 description 276 "list of policy names in sequence to be applied on 277 sending a routing update in the current context, e.g., 278 for the current other route server clients."; 279 } 280 281 leaf default-in-policy { 282 type rpol:default-policy-type; 283 default REJECT-ROUTE; 284 description 285 "explicitly set a default policy if no policy definition 286 in the in-policy chain is satisfied."; 287 } 288 } 289 290 grouping gobgp-route-server-config { 291 description 292 "Configuration parameter specifying whether 293 the neighbor is route server client or not."; 294 295 leaf route-server-client { 296 type boolean; 297 default "false"; 298 description 299 "Configure the neighbor as a route server client."; 300 } 301 } 302 303 grouping gobgp-route-server-config-set { 304 description 305 "set of configurations for route server client."; 306 307 container route-server { 308 description 309 "Configure the local router as a route server"; 310 311 container config { 312 description 313 "Configuration parameters relating to route server 314 client(s) used for the BGP neighbor"; 315 uses gobgp-route-server-config; 316 } 317 container state { 318 config false; 319 description 320 "State information relating to route server 321 client(s) used for the BGP neighbor"; 322 uses gobgp-route-server-config; 323 } 324 } 325 } 326 327 typedef rpki-validation-result-type { 328 type enumeration { 329 enum NONE { 330 description "RPKI disabled"; 331 } 332 enum NOT-FOUND { 333 description "If the origin AS, prefix, maximum prefix length 334 does not exist in the range of ROA"; 335 } 336 enum VALID { 337 description "If the origin AS, prefix, maximum prefix length is 338 exist in the range of ROA"; 339 } 340 enum INVALID { 341 description "if the origin AS is different when prefix, 342 maximum prefix length is exist in the range of ROA"; 343 } 344 } 345 description 346 "indicate the validation result of RPKI based on ROA"; 347 } 348 349 grouping gobgp-rpki-validation-result { 350 description "additional rpki"; 351 352 leaf rpki-validation-result { 353 type rpki-validation-result-type; 354 default NOT-FOUND; 355 description 356 "specify the validation result of RPKI based on ROA as conditions"; 357 } 358 } 359 360 grouping gobgp-rpki-server-messages-sent { 361 description "additional RPKI sent messages"; 362 363 leaf serial-query { 364 type int64; 365 description 366 "Number of serial query message sent to RPKI server"; 367 } 368 leaf reset-query { 369 type int64; 370 description 371 "Number of reset query message sent to RPKI server"; 372 } 373 leaf error { 374 type int64; 375 description 376 "Number of error message sent to RPKI server"; 377 } 378 } 379 380 grouping gobgp-rpki-server-messages-received { 381 description "additional RPKI receive messages"; 382 383 leaf serial-notify { 384 type int64; 385 description 386 "Number of serial notify message received from RPKI server"; 387 } 388 leaf cache-reset { 389 type int64; 390 description 391 "Number of cache reset message received from RPKI server"; 392 } 393 leaf cache-response { 394 type int64; 395 description 396 "Number of cache response message received from RPKI server"; 397 } 398 leaf ipv4-prefix { 399 type int64; 400 description 401 "Number of ipv4 prefix message received from RPKI server"; 402 } 403 leaf ipv6-prefix { 404 type int64; 405 description 406 "Number of ipv6 prefix message received from RPKI server"; 407 } 408 leaf end-of-data { 409 type int64; 410 description 411 "Number of end of data message received from RPKI server"; 412 } 413 leaf error { 414 type int64; 415 description 416 "Number of error message received from RPKI server"; 417 } 418 } 419 420 grouping gobgp-rpki-server-messages { 421 description "additional RPKI messages"; 422 423 container rpki-sent { 424 description 425 "Counters for transmission RPKI Message types"; 426 uses gobgp-rpki-server-messages-sent; 427 } 428 container rpki-received { 429 description 430 "Counters for reception RPKI Message types"; 431 uses gobgp-rpki-server-messages-received; 432 } 433 } 434 435 grouping gobgp-rpki-server-state { 436 description "additional RPKI state"; 437 438 leaf up { 439 type boolean; 440 } 441 leaf serial-number { 442 type uint32; 443 } 444 leaf records-v4 { 445 type uint32; 446 } 447 leaf records-v6 { 448 type uint32; 449 } 450 leaf prefixes-v4 { 451 type uint32; 452 } 453 leaf prefixes-v6 { 454 type uint32; 455 } 456 leaf uptime { 457 type int64; 458 description 459 "This timer determines the amount of time since the 460 RPKI last transitioned in of the Established state"; 461 } 462 leaf downtime { 463 type int64; 464 description 465 "This timer determines the amount of time since the 466 RPKI last transitioned out of the Established state"; 467 } 468 leaf last-pdu-recv-time { 469 type int64; 470 description 471 "last time the received an pdu message from RPKI server"; 472 } 473 container rpki-messages { 474 description 475 "Counters for transmission and reception RPKI Message types"; 476 uses gobgp-rpki-server-messages; 477 } 478 } 479 480 grouping gobgp-rpki-server-config { 481 description "additional RPKI config"; 482 483 leaf address { 484 type inet:ip-address; 485 description 486 "Reference to the address of the RPKI server used as 487 a key in the RPKI server list"; 488 } 489 leaf port { 490 type uint32; 491 description 492 "Reference to the port of the RPKI server"; 493 } 494 leaf refresh-time { 495 type int64; 496 description 497 "Check interval for a configured RPKI server."; 498 } 499 leaf hold-time { 500 type int64; 501 description 502 "Specify the length of time in seconds that the session between 503 the router and RPKI server is to be considered operational 504 without any activity"; 505 } 506 leaf record-lifetime { 507 type int64; 508 description 509 "Indicate the expiration date of the route validation recode 510 received from RPKI server"; 511 } 512 leaf preference { 513 type uint8; 514 description 515 "RPKI server has a static preference. 516 Higher the preference values indicates a higher priority RPKI server"; 517 } 518 } 519 520 grouping gobgp-rpki-server-set { 521 description "additional RPKI configuration and state"; 522 523 container config { 524 description 525 "Configuration parameters relating to RPKI server"; 526 uses gobgp-rpki-server-config; 527 } 528 container state { 529 description 530 "State information relating to RPKI server"; 531 uses gobgp-rpki-server-state; 532 } 533 } 534 535 grouping gobgp-rpki-servers { 536 description "additional RPKI structure"; 537 538 container rpki-servers { 539 list rpki-server { 540 key "address"; 541 description 542 "List of RPKI servers configured on the local system"; 543 leaf address { 544 type leafref { 545 path "../config/address"; 546 } 547 } 548 uses gobgp-rpki-server-set; 549 } 550 } 551 } 552 553 grouping gobgp-bmp-server-config { 554 description "additional BMP config"; 555 556 leaf address { 557 type inet:ip-address; 558 description 559 "Reference to the address of the BMP server used as 560 a key in the BMP server list"; 561 } 562 563 leaf port { 564 type uint32; 565 description 566 "Reference to the port of the BMP server"; 567 } 568 569 leaf route-monitoring-policy { 570 type bmp-route-monitoring-policy-type; 571 default PRE-POLICY; 572 } 573 574 leaf statistics-timeout { 575 type uint16; 576 description 577 "Interval seconds of statistics messages sent to BMP server"; 578 } 579 580 leaf route-mirroring-enabled { 581 type boolean; 582 description 583 "Enable feature for mirroring of received BGP messages 584 mainly for debugging purpose"; 585 } 586 } 587 588 grouping gobgp-bmp-server-set { 589 description "additional BMP configuration and state"; 590 591 container config { 592 description 593 "Configuration parameters relating to BMP server"; 594 uses gobgp-bmp-server-config; 595 } 596 597 container state { 598 description 599 "Configuration parameters relating to BMP server"; 600 uses gobgp-bmp-server-config; 601 } 602 } 603 604 grouping gobgp-bmp-servers { 605 description "BGP Monitoring Protocol servers"; 606 607 container bmp-servers { 608 list bmp-server { 609 key "address"; 610 description 611 "List of BMP servers configured on the local system"; 612 leaf address { 613 type leafref { 614 path "../config/address"; 615 } 616 } 617 uses gobgp-bmp-server-set; 618 } 619 } 620 } 621 grouping gobgp-vrf-common { 622 description 623 "Common parameters for VRF configuration and state."; 624 625 leaf name { 626 description 627 "Unique name among all VRF instances."; 628 type string; 629 } 630 631 leaf id { 632 description 633 "Unique identifier among all VRF instances."; 634 type uint32; 635 } 636 637 leaf rd { 638 description 639 "Route Distinguisher for this VRF."; 640 type string; 641 } 642 643 leaf-list import-rt { 644 description 645 "List of import Route Targets for this VRF."; 646 type string; 647 } 648 649 leaf-list export-rt { 650 description 651 "List of export Route Targets for this VRF."; 652 type string; 653 } 654 } 655 656 grouping gobgp-vrf-config { 657 description 658 "Configuration parameters for VRF."; 659 660 leaf-list both-rt { 661 description 662 "List of both import and export Route Targets for this VRF. Each 663 configuration for import and export Route Targets will be preferred."; 664 type string; 665 } 666 } 667 668 grouping gobgp-vrf-set { 669 description "Set of VRF instance configuration and state"; 670 671 container config { 672 description 673 "Configuration parameters for VRF."; 674 uses gobgp-vrf-common; 675 uses gobgp-vrf-config; 676 } 677 678 container state { 679 description 680 "Configured states of VRF."; 681 uses gobgp-vrf-common; 682 } 683 } 684 685 grouping gobgp-vrfs { 686 description 687 "Virtual Routing and Forwarding (VRF) instances."; 688 689 container vrfs { 690 list vrf { 691 description 692 "VRF instance configurations on the local system."; 693 694 key "name"; 695 leaf name { 696 type leafref { 697 path "../config/name"; 698 } 699 } 700 701 uses gobgp-vrf-set; 702 } 703 } 704 } 705 706 grouping long-lived-graceful-restart { 707 container long-lived-graceful-restart { 708 container config { 709 leaf enabled { 710 type boolean; 711 } 712 leaf restart-time { 713 type uint32; 714 } 715 } 716 container state { 717 leaf enabled { 718 type boolean; 719 } 720 leaf received { 721 type boolean; 722 } 723 leaf advertised { 724 type boolean; 725 } 726 leaf peer-restart-time { 727 type uint32; 728 } 729 leaf peer-restart-timer-expired { 730 type boolean; 731 } 732 } 733 } 734 } 735 736 grouping gobgp-ttl-security-config { 737 description 738 "Configuration parameters for TTL Security"; 739 740 leaf enabled { 741 type boolean; 742 default "false"; 743 description 744 "Enable features for TTL Security"; 745 } 746 747 leaf ttl-min { 748 type uint8; 749 description 750 "Reference to the port of the BMP server"; 751 } 752 } 753 754 grouping gobgp-ttl-security-config-set { 755 description 756 "set of configurations for Generalized TTL Security Mechanism (GTSM)"; 757 758 container ttl-security { 759 description 760 "Configure TTL Security feature"; 761 762 container config { 763 description 764 "Configuration parameters for TTL Security"; 765 uses gobgp-ttl-security-config; 766 } 767 768 container state { 769 config false; 770 description 771 "State information for TTL Security"; 772 uses gobgp-ttl-security-config; 773 } 774 } 775 } 776 777 // augment statements 778 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:state/bgp:messages/bgp:sent" { 779 description "additional counters"; 780 uses gobgp-message-counter; 781 } 782 783 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:state/bgp:messages/bgp:received" { 784 description "additional counters"; 785 uses gobgp-message-counter; 786 } 787 788 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:state" { 789 description "additional counters"; 790 uses gobgp-adjacent-table; 791 } 792 793 typedef bgp-capability { 794 type uint8; 795 } 796 797 typedef bgp-open-message { 798 type uint8; 799 } 800 801 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:state" { 802 leaf-list remote-capability { 803 type bgp-capability; 804 } 805 leaf-list local-capability { 806 type bgp-capability; 807 } 808 809 leaf received-open-message { 810 type bgp-open-message; 811 } 812 } 813 814 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:config" { 815 description "additional state elements"; 816 817 leaf admin-down { 818 type boolean; 819 description 820 "The config of administrative operation. If state, indicates the neighbor is disabled by the administrator"; 821 } 822 } 823 824 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:state" { 825 description "additional state elements"; 826 827 leaf admin-down { 828 type boolean; 829 description 830 "The state of administrative operation. If the state is true, it indicates the neighbor is disabled by the administrator"; 831 } 832 833 leaf admin-state { 834 type enumeration { 835 enum UP { 836 description "admin state is up"; 837 } 838 enum DOWN { 839 description "admin state is down"; 840 } 841 enum PFX_CT { 842 description "prefix counter over limit"; 843 } 844 } 845 } 846 847 leaf established-count { 848 type uint32; 849 description 850 "The number of how many the peer became established state"; 851 } 852 853 leaf flops { 854 type uint32; 855 description 856 "The number of flip-flops"; 857 } 858 859 860 } 861 862 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:config" { 863 leaf neighbor-interface { 864 type string; 865 } 866 leaf vrf { 867 type string; 868 } 869 } 870 871 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:state" { 872 leaf neighbor-interface { 873 type string; 874 } 875 leaf vrf { 876 type string; 877 } 878 } 879 880 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:state" { 881 leaf remote-router-id { 882 type string; 883 } 884 } 885 886 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:transport/bgp:config" { 887 leaf remote-port { 888 type inet:port-number; 889 } 890 891 leaf ttl { 892 description "TTL value for BGP packets"; 893 type uint8; 894 } 895 } 896 897 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:timers/bgp:config" { 898 description "additional timer"; 899 uses gobgp-timer; 900 } 901 902 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:timers/bgp:state" { 903 description "additional timers"; 904 uses gobgp-timer; 905 uses gobgp-neighbor-timer; 906 } 907 908 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:afi-safis/bgp:afi-safi/bgp:graceful-restart/bgp:state" { 909 description "additional graceful-restart status"; 910 leaf end-of-rib-received { 911 type boolean; 912 } 913 leaf end-of-rib-sent { 914 type boolean; 915 } 916 } 917 918 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:graceful-restart/bgp:config" { 919 description "additional graceful-restart status"; 920 leaf deferral-time { 921 type uint16; 922 } 923 leaf notification-enabled { 924 type boolean; 925 } 926 leaf long-lived-enabled { 927 type boolean; 928 } 929 } 930 931 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:graceful-restart/bgp:state" { 932 description "additional graceful-restart status"; 933 leaf deferral-time { 934 type uint16; 935 } 936 leaf notification-enabled { 937 type boolean; 938 } 939 leaf long-lived-enabled { 940 type boolean; 941 } 942 } 943 944 augment "/bgp:bgp/bgp:peer-groups/bgp:peer-group" { 945 description "route server configuration for peer-group"; 946 uses gobgp-route-server-config-set; 947 } 948 949 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor" { 950 description "route server configuration for neighbor"; 951 uses gobgp-route-server-config-set; 952 } 953 954 augment "/bgp:bgp/bgp:peer-groups/bgp:peer-group" { 955 description "TTL Security configuration for peer-group"; 956 uses gobgp-ttl-security-config-set; 957 } 958 959 augment "/bgp:bgp/bgp:neighbors/bgp:neighbor" { 960 description "TTL Security configuration for neighbor"; 961 uses gobgp-ttl-security-config-set; 962 } 963 964 augment "/bgp:bgp/bgp:global/bgp:apply-policy/bgp:config" { 965 description "addtional policy"; 966 uses gobgp-in-policy; 967 968 } 969 970 augment "/bgp:bgp/bgp:global/bgp:apply-policy/bgp:state" { 971 description "additional policy"; 972 uses gobgp-in-policy; 973 974 } 975 976 augment "/rpol:routing-policy/rpol:policy-definitions/" + 977 "rpol:policy-definition/rpol:statements/rpol:statement/" + 978 "rpol:actions/bgp-pol:bgp-actions/bgp-pol:set-as-path-prepend" { 979 description "as number used for aspath prepend"; 980 981 leaf as { 982 type union { 983 type inet:as-number; 984 type string { 985 pattern "last-as"; 986 } 987 } 988 description 989 "autonomous system number or 'last-as' which means 990 the leftmost as number in the AS-path to be prepended"; 991 } 992 } 993 994 augment "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/rpol:neighbor-set" { 995 description "alternative for the existing neighbor element"; 996 997 leaf-list neighbor-info { 998 description 999 "neighbor ip address or prefix"; 1000 type inet:ip-address; 1001 } 1002 } 1003 1004 augment "/rpol:routing-policy/rpol:defined-sets/" + 1005 "bgp-pol:bgp-defined-sets/bgp-pol:community-sets/bgp-pol:community-set" { 1006 description "alternative for the existing community-member"; 1007 1008 leaf-list community { 1009 description 1010 "community set member"; 1011 type string; 1012 } 1013 } 1014 1015 augment "/rpol:routing-policy/rpol:defined-sets/" + 1016 "bgp-pol:bgp-defined-sets/bgp-pol:ext-community-sets/bgp-pol:ext-community-set" { 1017 description "alternative for the existing ext-community-member"; 1018 1019 leaf-list ext-community { 1020 type string; 1021 description 1022 "extended community set member"; 1023 } 1024 } 1025 1026 augment "/rpol:routing-policy/rpol:defined-sets/" + 1027 "bgp-pol:bgp-defined-sets" { 1028 container large-community-sets { 1029 list large-community-set { 1030 key "large-community-set-name"; 1031 1032 leaf large-community-set-name { 1033 type string; 1034 } 1035 leaf-list large-community { 1036 type string; 1037 description 1038 "extended community set member"; 1039 } 1040 } 1041 } 1042 } 1043 1044 augment "/rpol:routing-policy/rpol:defined-sets/" + 1045 "bgp-pol:bgp-defined-sets/bgp-pol:as-path-sets/bgp-pol:as-path-set" { 1046 description "alternative for the existing as-path-set-member"; 1047 1048 leaf-list as-path { 1049 type string; 1050 description 1051 "AS path expression"; 1052 } 1053 } 1054 1055 augment "/rpol:routing-policy/rpol:policy-definitions/" + 1056 "rpol:policy-definition/rpol:statements/rpol:statement/" + 1057 "rpol:conditions/bgp-pol:bgp-conditions" { 1058 description "additional rpki condition"; 1059 uses gobgp-rpki-validation-result; 1060 } 1061 1062 deviation "/rpol:routing-policy/rpol:policy-definitions/" + 1063 "rpol:policy-definition/rpol:statements/rpol:statement/" + 1064 "rpol:conditions/bgp-pol:bgp-conditions/bgp-pol:route-type" { 1065 description "alternative route-type condition"; 1066 deviate replace { 1067 type enumeration { 1068 enum NONE { 1069 description "route type is none"; 1070 } 1071 enum INTERNAL { 1072 description "route type is internal"; 1073 } 1074 enum EXTERNAL { 1075 description "route type is external"; 1076 } 1077 enum LOCAL { 1078 description "route type is local"; 1079 } 1080 } 1081 1082 } 1083 } 1084 1085 augment "/rpol:routing-policy/rpol:policy-definitions/" + 1086 "rpol:policy-definition/rpol:statements/rpol:statement/" + 1087 "rpol:conditions/bgp-pol:bgp-conditions" { 1088 container match-large-community-set { 1089 leaf large-community-set { 1090 type string; 1091 } 1092 uses rpol:match-set-options-group; 1093 } 1094 } 1095 1096 augment "/rpol:routing-policy/rpol:policy-definitions/" + 1097 "rpol:policy-definition/rpol:statements/rpol:statement/" + 1098 "rpol:actions/bgp-pol:bgp-actions" { 1099 container set-large-community { 1100 container set-large-community-method { 1101 leaf-list communities { 1102 type string; 1103 } 1104 } 1105 leaf options { 1106 type bgp-pol:bgp-set-community-option-type; 1107 } 1108 } 1109 } 1110 1111 augment "/bgp:bgp" { 1112 description "Additional RPKI configuration and state"; 1113 uses gobgp-rpki-servers; 1114 } 1115 1116 augment "/bgp:bgp" { 1117 description "Additional BMP configuration and state"; 1118 uses gobgp-bmp-servers; 1119 } 1120 1121 augment "/bgp:bgp" { 1122 description "Additional VRF configuration and state"; 1123 uses gobgp-vrfs; 1124 } 1125 1126 typedef mrt-type { 1127 type enumeration { 1128 enum UPDATES { 1129 description "RPKI disabled"; 1130 } 1131 enum TABLE { 1132 description "If the origin AS, prefix, maximum prefix length is 1133 exist in the range of ROA"; 1134 } 1135 } 1136 } 1137 1138 grouping gobgp-mrt-set { 1139 container config { 1140 leaf dump-type { 1141 type mrt-type; 1142 } 1143 leaf file-name { 1144 type string; 1145 description 1146 "Configures a file name to be written"; 1147 } 1148 leaf table-name { 1149 type string; 1150 description 1151 "specify the table name with route server setup"; 1152 } 1153 leaf dump-interval { 1154 type uint64; 1155 } 1156 leaf rotation-interval { 1157 type uint64; 1158 } 1159 } 1160 } 1161 1162 grouping gobgp-mrt { 1163 description "additional mrt configuration"; 1164 container mrt-dump { 1165 list mrt { 1166 key "file-name"; 1167 leaf file-name { 1168 type leafref { 1169 path "../config/file-name"; 1170 } 1171 } 1172 uses gobgp-mrt-set; 1173 } 1174 } 1175 } 1176 1177 augment "/bgp:bgp" { 1178 description "additional mrt configuration"; 1179 uses gobgp-mrt; 1180 } 1181 1182 grouping zebra-config { 1183 leaf enabled { 1184 type boolean; 1185 description 1186 "Configure enabling to connect to zebra."; 1187 } 1188 leaf url { 1189 type string; 1190 description 1191 "Configure url for zebra."; 1192 } 1193 leaf-list redistribute-route-type { 1194 type string; 1195 } 1196 leaf version { 1197 type uint8; 1198 description 1199 "Configure version of zebra protocol. Default is 2. Supported up to 3."; 1200 } 1201 leaf nexthop-trigger-enable { 1202 type boolean; 1203 } 1204 leaf nexthop-trigger-delay { 1205 type uint8; 1206 } 1207 } 1208 1209 grouping zebra-set { 1210 container zebra { 1211 container config { 1212 uses zebra-config; 1213 } 1214 container state { 1215 uses zebra-config; 1216 } 1217 } 1218 } 1219 1220 augment "/bgp:bgp" { 1221 uses zebra-set; 1222 } 1223 1224 grouping collector-config { 1225 leaf url { 1226 type string; 1227 } 1228 leaf db-name { 1229 type string; 1230 } 1231 leaf table-dump-interval { 1232 type uint64; 1233 } 1234 } 1235 1236 grouping collector-set { 1237 container collector { 1238 container config { 1239 uses collector-config; 1240 } 1241 container state { 1242 uses collector-config; 1243 } 1244 } 1245 } 1246 1247 augment "/bgp:bgp" { 1248 uses collector-set; 1249 } 1250 1251 grouping listen-config { 1252 leaf port { 1253 type int32; 1254 } 1255 leaf-list local-address { 1256 type string; 1257 } 1258 } 1259 1260 augment "/bgp:bgp/bgp:global/bgp:config" { 1261 uses listen-config; 1262 } 1263 1264 augment "/bgp:bgp/bgp:global/bgp:state" { 1265 uses listen-config; 1266 } 1267 1268 grouping dynamic-neighbors { 1269 container dynamic-neighbors { 1270 list dynamic-neighbor { 1271 key "prefix"; 1272 1273 leaf prefix { 1274 type leafref { 1275 path "../config/prefix"; 1276 } 1277 } 1278 1279 container config { 1280 uses bgp-global-dynamic-neighbor-config; 1281 } 1282 1283 container state { 1284 config false; 1285 uses bgp-global-dynamic-neighbor-config; 1286 } 1287 } 1288 } 1289 } 1290 1291 grouping bgp-global-dynamic-neighbor-config { 1292 description "A dynamic neighbor belongs to a peer group. 1293 This configuration structure was taken from the latest openconfig."; 1294 1295 leaf prefix { 1296 type string; 1297 } 1298 leaf peer-group { 1299 type string; 1300 } 1301 } 1302 1303 augment "/bgp:bgp" { 1304 uses dynamic-neighbors; 1305 } 1306 1307 grouping disable-best-path-selection-config { 1308 leaf disable-best-path-selection { 1309 type boolean; 1310 description 1311 "Disables best path selection process."; 1312 } 1313 } 1314 1315 augment "/bgp:bgp/bgp:global/bgp:route-selection-options/bgp:config" { 1316 uses disable-best-path-selection-config; 1317 } 1318 1319 augment "/bgp:bgp/bgp:global/bgp:route-selection-options/bgp:state" { 1320 uses disable-best-path-selection-config; 1321 } 1322 1323 augment "/bgp:bgp/bgp:global/bgp:afi-safis/bgp:afi-safi" { 1324 uses bgp-mp:all-afi-safi-common; 1325 } 1326 1327 grouping route-target-membership-config { 1328 leaf deferral-time { 1329 type uint16; 1330 } 1331 } 1332 1333 grouping afi-safi-state { 1334 leaf family { 1335 description 1336 "Address family value of AFI-SAFI pair translated from afi-safi-name."; 1337 type route-family; 1338 } 1339 } 1340 1341 augment "/bgp:bgp/bgp:global/bgp:afi-safis/bgp:afi-safi/bgp:state" { 1342 uses afi-safi-state; 1343 } 1344 1345 augment "/bgp:bgp/bgp:global/bgp:afi-safis/bgp:afi-safi" { 1346 container route-target-membership { 1347 container config { 1348 uses route-target-membership-config; 1349 } 1350 container state { 1351 uses route-target-membership-config; 1352 } 1353 } 1354 1355 uses long-lived-graceful-restart; 1356 } 1357 1358 augment "/bgp:bgp/bgp:global/bgp:afi-safis/bgp:afi-safi" { 1359 container add-paths { 1360 description 1361 "add-paths configuration options related to a particular AFI-SAFI."; 1362 container config { 1363 uses bgp:bgp-neighbor-add-paths_config; 1364 } 1365 container state { 1366 uses bgp:bgp-neighbor-add-paths_config; 1367 } 1368 } 1369 } 1370 }