github.com/osrg/gobgp@v2.0.0+incompatible/api/gobgp.proto (about) 1 // Copyright (C) 2015-2017 Nippon Telegraph and Telephone Corporation. 2 // 3 // Permission is hereby granted, free of charge, to any person 4 // obtaining a copy of this software and associated documentation files 5 // (the "Software"), to deal in the Software without restriction, 6 // including without limitation the rights to use, copy, modify, merge, 7 // publish, distribute, sublicense, and/or sell copies of the Software, 8 // and to permit persons to whom the Software is furnished to do so, 9 // subject to the following conditions: 10 // 11 // The above copyright notice and this permission notice shall be 12 // included in all copies or substantial portions of the Software. 13 14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 22 syntax = "proto3"; 23 24 import "google/protobuf/any.proto"; 25 import "google/protobuf/empty.proto"; 26 import "google/protobuf/timestamp.proto"; 27 28 package gobgpapi; 29 30 // Interface exported by the server. 31 32 service GobgpApi { 33 rpc StartBgp(StartBgpRequest) returns (google.protobuf.Empty); 34 rpc StopBgp(StopBgpRequest) returns (google.protobuf.Empty); 35 rpc GetBgp(GetBgpRequest) returns (GetBgpResponse); 36 37 rpc AddPeer(AddPeerRequest) returns (google.protobuf.Empty); 38 rpc DeletePeer(DeletePeerRequest) returns (google.protobuf.Empty); 39 rpc ListPeer(ListPeerRequest) returns (stream ListPeerResponse); 40 rpc UpdatePeer(UpdatePeerRequest) returns (UpdatePeerResponse); 41 rpc ResetPeer(ResetPeerRequest) returns (google.protobuf.Empty); 42 rpc ShutdownPeer(ShutdownPeerRequest) returns (google.protobuf.Empty); 43 rpc EnablePeer(EnablePeerRequest) returns (google.protobuf.Empty); 44 rpc DisablePeer(DisablePeerRequest) returns (google.protobuf.Empty); 45 rpc MonitorPeer(MonitorPeerRequest) returns (stream MonitorPeerResponse); 46 47 rpc AddPeerGroup(AddPeerGroupRequest) returns (google.protobuf.Empty); 48 rpc DeletePeerGroup(DeletePeerGroupRequest) returns (google.protobuf.Empty); 49 rpc UpdatePeerGroup(UpdatePeerGroupRequest) returns (UpdatePeerGroupResponse); 50 51 rpc AddDynamicNeighbor(AddDynamicNeighborRequest) returns (google.protobuf.Empty); 52 53 rpc AddPath(AddPathRequest) returns (AddPathResponse); 54 rpc DeletePath(DeletePathRequest) returns (google.protobuf.Empty); 55 rpc ListPath(ListPathRequest) returns (stream ListPathResponse); 56 rpc AddPathStream(stream AddPathStreamRequest) returns (google.protobuf.Empty); 57 58 rpc GetTable(GetTableRequest) returns (GetTableResponse); 59 rpc MonitorTable(MonitorTableRequest) returns (stream MonitorTableResponse); 60 61 rpc AddVrf(AddVrfRequest) returns (google.protobuf.Empty); 62 rpc DeleteVrf(DeleteVrfRequest) returns (google.protobuf.Empty); 63 rpc ListVrf(ListVrfRequest) returns (stream ListVrfResponse); 64 65 rpc AddPolicy(AddPolicyRequest) returns (google.protobuf.Empty); 66 rpc DeletePolicy(DeletePolicyRequest) returns (google.protobuf.Empty); 67 rpc ListPolicy(ListPolicyRequest) returns (stream ListPolicyResponse); 68 rpc SetPolicies(SetPoliciesRequest) returns (google.protobuf.Empty); 69 70 rpc AddDefinedSet(AddDefinedSetRequest) returns (google.protobuf.Empty); 71 rpc DeleteDefinedSet(DeleteDefinedSetRequest) returns (google.protobuf.Empty); 72 rpc ListDefinedSet(ListDefinedSetRequest) returns (stream ListDefinedSetResponse); 73 74 rpc AddStatement(AddStatementRequest) returns (google.protobuf.Empty); 75 rpc DeleteStatement(DeleteStatementRequest) returns (google.protobuf.Empty); 76 rpc ListStatement(ListStatementRequest) returns (stream ListStatementResponse); 77 78 rpc AddPolicyAssignment(AddPolicyAssignmentRequest) returns (google.protobuf.Empty); 79 rpc DeletePolicyAssignment(DeletePolicyAssignmentRequest) returns (google.protobuf.Empty); 80 rpc ListPolicyAssignment(ListPolicyAssignmentRequest) returns (stream ListPolicyAssignmentResponse); 81 rpc SetPolicyAssignment(SetPolicyAssignmentRequest) returns (google.protobuf.Empty); 82 83 rpc AddRpki(AddRpkiRequest) returns (google.protobuf.Empty); 84 rpc DeleteRpki(DeleteRpkiRequest) returns (google.protobuf.Empty); 85 rpc ListRpki(ListRpkiRequest) returns (stream ListRpkiResponse); 86 rpc EnableRpki(EnableRpkiRequest) returns (google.protobuf.Empty); 87 rpc DisableRpki(DisableRpkiRequest) returns (google.protobuf.Empty); 88 rpc ResetRpki(ResetRpkiRequest) returns (google.protobuf.Empty); 89 rpc ListRpkiTable(ListRpkiTableRequest) returns (stream ListRpkiTableResponse); 90 91 rpc EnableZebra(EnableZebraRequest) returns (google.protobuf.Empty); 92 93 rpc EnableMrt(EnableMrtRequest) returns (google.protobuf.Empty); 94 rpc DisableMrt(DisableMrtRequest) returns (google.protobuf.Empty); 95 96 rpc AddBmp(AddBmpRequest) returns (google.protobuf.Empty); 97 rpc DeleteBmp(DeleteBmpRequest) returns (google.protobuf.Empty); 98 } 99 100 message StartBgpRequest { 101 Global global = 1; 102 } 103 104 message StopBgpRequest { 105 } 106 107 message GetBgpRequest { 108 } 109 110 message GetBgpResponse { 111 Global global = 1; 112 } 113 114 message AddPeerRequest { 115 Peer peer = 1; 116 } 117 118 message DeletePeerRequest { 119 string address = 1; 120 string interface = 2; 121 } 122 123 message ListPeerRequest { 124 string address = 1; 125 bool enableAdvertised = 2; 126 } 127 128 message ListPeerResponse { 129 Peer peer = 1; 130 } 131 132 message UpdatePeerRequest { 133 Peer peer = 1; 134 // Calls SoftResetIn after updating the peer configuration if needed. 135 bool do_soft_reset_in = 2; 136 } 137 138 message UpdatePeerResponse { 139 // Indicates whether calling SoftResetIn is required due to this update. If 140 // "true" is set, the client should call SoftResetIn manually. If 141 // "do_soft_reset_in = true" is set in the request, always returned with 142 // "false". 143 bool needs_soft_reset_in = 1; 144 } 145 146 message ResetPeerRequest { 147 string address = 1; 148 string communication = 2; 149 bool soft = 3; 150 enum SoftResetDirection { 151 IN = 0; 152 OUT = 1; 153 BOTH = 2; 154 } 155 SoftResetDirection direction = 4; 156 } 157 158 message ShutdownPeerRequest { 159 string address = 1; 160 string communication = 2; 161 } 162 163 message EnablePeerRequest { 164 string address = 1; 165 } 166 167 message DisablePeerRequest { 168 string address = 1; 169 string communication = 2; 170 } 171 172 message MonitorPeerRequest { 173 string address = 1; 174 bool current = 2; 175 } 176 177 message MonitorPeerResponse { 178 Peer peer = 1; 179 } 180 181 message AddPeerGroupRequest { 182 PeerGroup peer_group = 1; 183 } 184 185 message DeletePeerGroupRequest { 186 string name = 1; 187 } 188 189 message UpdatePeerGroupRequest { 190 PeerGroup peer_group = 1; 191 bool do_soft_reset_in = 2; 192 } 193 194 message UpdatePeerGroupResponse { 195 bool needs_soft_reset_in = 1; 196 } 197 198 message AddDynamicNeighborRequest { 199 DynamicNeighbor dynamic_neighbor = 1; 200 } 201 202 message AddPathRequest { 203 TableType table_type = 1; 204 string vrf_id = 2; 205 Path path = 3; 206 } 207 208 message AddPathResponse { 209 bytes uuid = 1; 210 } 211 212 message DeletePathRequest { 213 TableType table_type = 1; 214 string vrf_id = 2; 215 Family family = 3; 216 Path path = 4; 217 bytes uuid = 5; 218 } 219 220 message ListPathRequest { 221 TableType table_type = 1; 222 string name = 2; 223 Family family = 3; 224 repeated TableLookupPrefix prefixes = 4; 225 enum SortType { 226 NONE = 0; 227 PREFIX = 1; 228 } 229 SortType sort_type = 5; 230 } 231 232 message ListPathResponse { 233 Destination destination = 1; 234 } 235 236 message AddPathStreamRequest { 237 TableType table_type = 1; 238 string vrf_id = 2; 239 repeated Path paths = 3; 240 } 241 242 message GetTableRequest { 243 TableType table_type = 1; 244 Family family = 2; 245 string name = 3; 246 } 247 248 message GetTableResponse { 249 uint64 num_destination = 1; 250 uint64 num_path = 2; 251 uint64 num_accepted = 3; // only meaningful when type == ADJ_IN 252 } 253 254 message MonitorTableRequest { 255 TableType table_type = 1; 256 string name = 2; 257 Family family = 3; 258 bool current = 4; 259 bool post_policy = 5; 260 } 261 262 message MonitorTableResponse { 263 Path path = 1; 264 } 265 266 message AddVrfRequest { 267 Vrf vrf = 1; 268 } 269 270 message DeleteVrfRequest { 271 string name = 1; 272 } 273 274 message ListVrfRequest { 275 string name = 1; 276 } 277 278 message ListVrfResponse { 279 Vrf vrf = 1; 280 } 281 282 message AddPolicyRequest { 283 Policy policy = 1; 284 // if this flag is set, gobgpd won't define new statements 285 // but refer existing statements using statement's names in this arguments. 286 bool refer_existing_statements = 2; 287 } 288 289 message DeletePolicyRequest { 290 Policy policy = 1; 291 // if this flag is set, gobgpd won't delete any statements 292 // even if some statements get not used by any policy by this operation. 293 bool preserve_statements = 2; 294 bool all = 3; 295 } 296 297 message ListPolicyRequest { 298 string name = 1; 299 } 300 301 message ListPolicyResponse { 302 Policy policy = 1; 303 } 304 305 message SetPoliciesRequest { 306 repeated DefinedSet defined_sets = 1; 307 repeated Policy policies = 2; 308 repeated PolicyAssignment assignments = 3; 309 } 310 311 message AddDefinedSetRequest { 312 DefinedSet defined_set = 1; 313 } 314 315 message DeleteDefinedSetRequest { 316 DefinedSet defined_set = 1; 317 bool all = 2; 318 } 319 320 message ListDefinedSetRequest { 321 DefinedType defined_type = 1; 322 string name = 2; 323 } 324 325 message ListDefinedSetResponse { 326 DefinedSet defined_set = 1; 327 } 328 329 message AddStatementRequest { 330 Statement statement = 1; 331 } 332 333 message DeleteStatementRequest { 334 Statement statement = 1; 335 bool all = 2; 336 } 337 338 message ListStatementRequest { 339 string name = 1; 340 } 341 342 message ListStatementResponse { 343 Statement statement = 1; 344 } 345 346 message AddPolicyAssignmentRequest { 347 PolicyAssignment assignment = 1; 348 } 349 350 message DeletePolicyAssignmentRequest { 351 PolicyAssignment assignment = 1; 352 bool all = 2; 353 } 354 355 message ListPolicyAssignmentRequest { 356 string name = 1; 357 PolicyDirection direction = 2; 358 } 359 360 message ListPolicyAssignmentResponse { 361 PolicyAssignment assignment = 1; 362 } 363 364 message SetPolicyAssignmentRequest { 365 PolicyAssignment assignment = 1; 366 } 367 368 message AddRpkiRequest { 369 string address = 1; 370 uint32 port = 2; 371 int64 lifetime = 3; 372 } 373 374 message DeleteRpkiRequest { 375 string address = 1; 376 uint32 port = 2; 377 } 378 379 message ListRpkiRequest { 380 Family family = 1; 381 } 382 383 message ListRpkiResponse { 384 Rpki server = 1; 385 } 386 387 message EnableRpkiRequest { 388 string address = 1; 389 uint32 port = 2; 390 } 391 392 message DisableRpkiRequest { 393 string address = 1; 394 uint32 port = 2; 395 } 396 397 message ResetRpkiRequest { 398 string address = 1; 399 uint32 port = 2; 400 bool soft = 3; 401 } 402 403 message ListRpkiTableRequest { 404 Family family = 1; 405 } 406 407 message ListRpkiTableResponse { 408 Roa roa = 1; 409 } 410 411 message EnableZebraRequest { 412 string url = 1; 413 repeated string route_types = 2; 414 uint32 version = 3; 415 bool nexthop_trigger_enable = 4; 416 uint32 nexthop_trigger_delay = 5; 417 } 418 419 message EnableMrtRequest { 420 int32 dump_type = 1; 421 string filename = 2; 422 uint64 dump_interval = 3; 423 uint64 rotation_interval = 4; 424 } 425 426 message DisableMrtRequest { 427 } 428 429 message AddBmpRequest { 430 string address = 1; 431 uint32 port = 2; 432 enum MonitoringPolicy { 433 PRE = 0; 434 POST = 1; 435 BOTH = 2; 436 LOCAL = 3; 437 ALL = 4; 438 } 439 MonitoringPolicy policy = 3; 440 int32 StatisticsTimeout = 4; 441 } 442 443 message DeleteBmpRequest { 444 string address = 1; 445 uint32 port = 2; 446 } 447 448 message Family { 449 enum Afi { 450 AFI_UNKNOWN = 0; 451 AFI_IP = 1; 452 AFI_IP6 = 2; 453 AFI_L2VPN = 25; 454 AFI_OPAQUE = 16397; 455 } 456 457 enum Safi { 458 SAFI_UNKNOWN = 0; 459 SAFI_UNICAST = 1; 460 SAFI_MULTICAST = 2; 461 SAFI_MPLS_LABEL = 4; 462 SAFI_ENCAPSULATION = 7; 463 SAFI_VPLS = 65; 464 SAFI_EVPN = 70; 465 SAFI_MPLS_VPN = 128; 466 SAFI_MPLS_VPN_MULTICAST = 129; 467 SAFI_ROUTE_TARGET_CONSTRAINTS = 132; 468 SAFI_FLOW_SPEC_UNICAST = 133; 469 SAFI_FLOW_SPEC_VPN = 134; 470 SAFI_KEY_VALUE = 241; 471 } 472 473 Afi afi = 1; 474 Safi safi = 2; 475 } 476 477 enum TableType { 478 GLOBAL = 0; 479 LOCAL = 1; 480 ADJ_IN = 2; 481 ADJ_OUT = 3; 482 VRF = 4; 483 } 484 485 message Validation { 486 enum State { 487 STATE_NONE = 0; 488 STATE_NOT_FOUND = 1; 489 STATE_VALID = 2; 490 STATE_INVALID = 3; 491 } 492 493 enum Reason { 494 REASOT_NONE = 0; 495 REASON_AS = 1; 496 REASON_LENGTH = 2; 497 } 498 499 State state = 1; 500 Reason reason = 2; 501 repeated Roa matched = 3; 502 repeated Roa unmatched_as = 4; 503 repeated Roa unmatched_length = 5; 504 } 505 506 message Path { 507 // One of the following defined in "api/attribute.proto": 508 // - IPAddressPrefix 509 // - LabeledIPAddressPrefix 510 // - EncapsulationNLRI 511 // - EVPNEthernetAutoDiscoveryRoute 512 // - EVPNMACIPAdvertisementRoute 513 // - EVPNInclusiveMulticastEthernetTagRoute 514 // - EVPNEthernetSegmentRoute 515 // - EVPNIPPrefixRoute 516 // - LabeledVPNIPAddressPrefix 517 // - RouteTargetMembershipNLRI 518 // - FlowSpecNLRI 519 // - VPNFlowSpecNLRI 520 // - OpaqueNLRI 521 google.protobuf.Any nlri = 1; 522 // Each attribute must be one of *Attribute defined in 523 // "api/attribute.proto". 524 repeated google.protobuf.Any pattrs = 2; 525 google.protobuf.Timestamp age = 3; 526 bool best = 4; 527 bool is_withdraw = 5; 528 Validation validation = 7; 529 bool no_implicit_withdraw = 8; 530 Family family = 9; 531 uint32 source_asn = 10; 532 string source_id = 11; 533 bool filtered = 12; 534 bool stale = 13; 535 bool is_from_external = 14; 536 string neighbor_ip = 15; 537 bytes uuid = 16; // only paths installed by AddPath API have this 538 bool is_nexthop_invalid = 17; 539 uint32 identifier = 18; 540 uint32 local_identifier = 19; 541 bytes nlri_binary = 20; 542 repeated bytes pattrs_binary = 21; 543 } 544 545 message Destination { 546 string prefix = 1; 547 repeated Path paths = 2; 548 } 549 550 // API representation of table.LookupOption 551 enum TableLookupOption { 552 LOOKUP_EXACT = 0; 553 LOOKUP_LONGER = 1; 554 LOOKUP_SHORTER = 2; 555 } 556 557 // API representation of table.LookupPrefix 558 message TableLookupPrefix { 559 string prefix = 1; 560 TableLookupOption lookup_option = 2; 561 } 562 563 message Peer { 564 ApplyPolicy apply_policy = 1; 565 PeerConf conf = 2; 566 EbgpMultihop ebgp_multihop = 3; 567 RouteReflector route_reflector = 4; 568 PeerState state = 5; 569 Timers timers = 6; 570 Transport transport = 7; 571 RouteServer route_server = 8; 572 GracefulRestart graceful_restart = 9; 573 repeated AfiSafi afi_safis = 10; 574 } 575 576 message PeerGroup { 577 ApplyPolicy apply_policy = 1; 578 PeerGroupConf conf = 2; 579 EbgpMultihop ebgp_multihop = 3; 580 RouteReflector route_reflector = 4; 581 PeerGroupState info = 5; 582 Timers timers = 6; 583 Transport transport = 7; 584 RouteServer route_server = 8; 585 GracefulRestart graceful_restart = 9; 586 repeated AfiSafi afi_safis = 10; 587 } 588 589 message DynamicNeighbor { 590 string prefix = 1; 591 string peer_group = 2; 592 } 593 594 message ApplyPolicy { 595 PolicyAssignment in_policy = 1; 596 PolicyAssignment export_policy = 2; 597 PolicyAssignment import_policy = 3; 598 } 599 600 message PrefixLimit { 601 Family family = 1; 602 uint32 max_prefixes = 2; 603 uint32 shutdown_threshold_pct = 3; 604 } 605 606 message PeerConf { 607 string auth_password = 1; 608 string description = 2; 609 uint32 local_as = 3; 610 string neighbor_address = 4; 611 uint32 peer_as = 5; 612 string peer_group = 6; 613 uint32 peer_type = 7; 614 enum RemovePrivateAs { 615 NONE = 0; 616 ALL = 1; 617 REPLACE = 2; 618 } 619 RemovePrivateAs remove_private_as = 8; 620 bool route_flap_damping = 9; 621 uint32 send_community = 10; 622 string neighbor_interface = 11; 623 string vrf = 12; 624 uint32 allow_own_as = 13; 625 bool replace_peer_as = 14; 626 bool admin_down = 15; 627 } 628 629 message PeerGroupConf { 630 string auth_password = 1; 631 string description = 2; 632 uint32 local_as = 3; 633 uint32 peer_as = 4; 634 string peer_group_name = 5; 635 uint32 peer_type = 6; 636 enum RemovePrivateAs { 637 NONE = 0; 638 ALL = 1; 639 REPLACE = 2; 640 } 641 RemovePrivateAs remove_private_as = 7; 642 bool route_flap_damping = 8; 643 uint32 send_community = 9; 644 } 645 646 message PeerGroupState { 647 string auth_password = 1; 648 string description = 2; 649 uint32 local_as = 3; 650 uint32 peer_as = 4; 651 string peer_group_name = 5; 652 uint32 peer_type = 6; 653 enum RemovePrivateAs { 654 NONE = 0; 655 ALL = 1; 656 REPLACE = 2; 657 } 658 RemovePrivateAs remove_private_as = 7; 659 bool route_flap_damping = 8; 660 uint32 send_community = 9; 661 uint32 total_paths = 10; 662 uint32 total_prefixes = 11; 663 } 664 665 message EbgpMultihop { 666 bool enabled = 1; 667 uint32 multihop_ttl = 2; 668 } 669 670 message RouteReflector { 671 bool route_reflector_client = 1; 672 string route_reflector_cluster_id = 2; 673 } 674 675 message PeerState { 676 string auth_password = 1; 677 string description = 2; 678 uint32 local_as = 3; 679 Messages messages = 4; 680 string neighbor_address = 5; 681 uint32 peer_as = 6; 682 string peer_group = 7; 683 uint32 peer_type = 8; 684 Queues queues = 9; 685 uint32 remove_private_as = 10; 686 bool route_flap_damping = 11; 687 uint32 send_community = 12; 688 enum SessionState { 689 UNKNOWN = 0; 690 IDLE = 1; 691 CONNECT = 2; 692 ACTIVE = 3; 693 OPENSENT = 4; 694 OPENCONFIRM = 5; 695 ESTABLISHED = 6; 696 } 697 SessionState session_state = 13; 698 enum AdminState { 699 UP = 0; 700 DOWN = 1; 701 PFX_CT = 2; // prefix counter over limit 702 } 703 AdminState admin_state = 15; 704 uint32 out_q = 16; 705 uint32 flops = 17; 706 // Each attribute must be one of *Capability defined in 707 // "api/capability.proto". 708 repeated google.protobuf.Any remote_cap = 18; 709 repeated google.protobuf.Any local_cap = 19; 710 string router_id = 20; 711 } 712 713 message Messages { 714 Message received = 1; 715 Message sent = 2; 716 } 717 718 message Message { 719 uint64 notification = 1; 720 uint64 update = 2; 721 uint64 open = 3; 722 uint64 keepalive = 4; 723 uint64 refresh = 5; 724 uint64 discarded = 6; 725 uint64 total = 7; 726 uint64 withdraw_update = 8; 727 uint64 withdraw_prefix = 9; 728 } 729 730 message Queues { 731 uint32 input = 1; 732 uint32 output = 2; 733 } 734 735 message Timers { 736 TimersConfig config =1; 737 TimersState state = 2; 738 } 739 740 message TimersConfig{ 741 uint64 connect_retry = 1; 742 uint64 hold_time = 2; 743 uint64 keepalive_interval = 3; 744 uint64 minimum_advertisement_interval = 4; 745 } 746 747 message TimersState{ 748 uint64 connect_retry = 1; 749 uint64 hold_time = 2; 750 uint64 keepalive_interval = 3; 751 uint64 minimum_advertisement_interval = 4; 752 uint64 negotiated_hold_time = 5; 753 google.protobuf.Timestamp uptime = 6; 754 google.protobuf.Timestamp downtime = 7; 755 } 756 757 message Transport { 758 string local_address = 1; 759 uint32 local_port = 2; 760 bool mtu_discovery = 3; 761 bool passive_mode = 4; 762 string remote_address = 5; 763 uint32 remote_port = 6; 764 uint32 tcp_mss = 7; 765 } 766 767 message RouteServer { 768 bool route_server_client = 1; 769 } 770 771 message GracefulRestart { 772 bool enabled = 1; 773 uint32 restart_time = 2; 774 bool helper_only = 3; 775 uint32 deferral_time = 4; 776 bool notification_enabled = 5; 777 bool longlived_enabled = 6; 778 uint32 stale_routes_time = 7; 779 uint32 peer_restart_time = 8; 780 bool peer_restarting = 9; 781 bool local_restarting = 10; 782 string mode = 11; 783 } 784 785 message MpGracefulRestartConfig { 786 bool enabled = 1; 787 } 788 789 message MpGracefulRestartState { 790 bool enabled = 1; 791 bool received = 2; 792 bool advertised = 3; 793 bool end_of_rib_received = 4; 794 bool end_of_rib_sent = 5; 795 } 796 message MpGracefulRestart { 797 MpGracefulRestartConfig config = 1; 798 MpGracefulRestartState state = 2; 799 } 800 801 message AfiSafiConfig { 802 Family family = 1; 803 bool enabled = 2; 804 } 805 806 message AfiSafiState { 807 Family family = 1; 808 bool enabled = 2; 809 uint64 received = 3; 810 uint64 accepted = 4; 811 uint64 advertised = 5; 812 } 813 814 message RouteSelectionOptionsConfig { 815 bool always_compare_med = 1; 816 bool ignore_as_path_length = 2; 817 bool external_compare_router_id = 3; 818 bool advertise_inactive_routes = 4; 819 bool enable_aigp = 5; 820 bool ignore_next_hop_igp_metric = 6; 821 bool disable_best_path_selection = 7; 822 } 823 824 message RouteSelectionOptionsState { 825 bool always_compare_med = 1; 826 bool ignore_as_path_length = 2; 827 bool external_compare_router_id = 3; 828 bool advertise_inactive_routes = 4; 829 bool enable_aigp = 5; 830 bool ignore_next_hop_igp_metric = 6; 831 bool disable_best_path_selection = 7; 832 } 833 834 message RouteSelectionOptions { 835 RouteSelectionOptionsConfig config = 1; 836 RouteSelectionOptionsState state = 2; 837 } 838 839 message UseMultiplePathsConfig { 840 bool enabled = 1; 841 } 842 843 message UseMultiplePathsState { 844 bool enabled = 1; 845 } 846 847 message EbgpConfig { 848 bool allow_multiple_as = 1; 849 uint32 maximum_paths = 2; 850 } 851 852 message EbgpState { 853 bool allow_multiple_as = 1; 854 uint32 maximum_paths = 2; 855 } 856 857 message Ebgp { 858 EbgpConfig config = 1; 859 EbgpState state = 2; 860 } 861 862 message IbgpConfig { 863 uint32 maximum_paths = 1; 864 } 865 866 message IbgpState { 867 uint32 maximum_paths = 1; 868 } 869 870 message Ibgp { 871 IbgpConfig config = 1; 872 IbgpState state = 2; 873 } 874 875 message UseMultiplePaths { 876 UseMultiplePathsConfig config = 1; 877 UseMultiplePathsState state = 2; 878 Ebgp ebgp = 3; 879 Ibgp ibgp = 4; 880 } 881 882 message RouteTargetMembershipConfig { 883 uint32 deferral_time = 1; 884 } 885 886 message RouteTargetMembershipState { 887 uint32 deferral_time = 1; 888 } 889 890 message RouteTargetMembership { 891 RouteTargetMembershipConfig config = 1; 892 RouteTargetMembershipState state = 2; 893 } 894 895 message LongLivedGracefulRestartConfig { 896 bool enabled = 1; 897 uint32 restart_time = 2; 898 } 899 900 message LongLivedGracefulRestartState { 901 bool enabled = 1; 902 bool received = 2; 903 bool advertised = 3; 904 uint32 peer_restart_time = 4; 905 bool peer_restart_timer_expired = 5; 906 } 907 908 message LongLivedGracefulRestart { 909 LongLivedGracefulRestartConfig config = 1; 910 LongLivedGracefulRestartState state = 2; 911 } 912 913 message AfiSafi { 914 MpGracefulRestart mp_graceful_restart = 1; 915 AfiSafiConfig config = 2; 916 AfiSafiState state = 3; 917 ApplyPolicy apply_policy = 4; 918 // TODO: 919 // Support the following structures: 920 // - Ipv4Unicast 921 // - Ipv6Unicast 922 // - Ipv4LabelledUnicast 923 // - Ipv6LabelledUnicast 924 // - L3vpnIpv4Unicast 925 // - L3vpnIpv6Unicast 926 // - L3vpnIpv4Multicast 927 // - L3vpnIpv6Multicast 928 // - L2vpnVpls 929 // - L2vpnEvpn 930 RouteSelectionOptions route_selection_options = 5; 931 UseMultiplePaths use_multiple_paths = 6; 932 PrefixLimit prefix_limits = 7; 933 RouteTargetMembership route_target_membership = 8; 934 LongLivedGracefulRestart long_lived_graceful_restart = 9; 935 AddPaths add_paths = 10; 936 } 937 938 message AddPathsConfig { 939 bool receive = 1; 940 uint32 send_max = 2; 941 } 942 943 message AddPathsState { 944 bool receive = 1; 945 uint32 send_max = 2; 946 } 947 948 message AddPaths { 949 AddPathsConfig config = 1; 950 AddPathsState state = 2; 951 } 952 953 message Prefix { 954 string ip_prefix = 1; 955 uint32 mask_length_min = 2; 956 uint32 mask_length_max = 3; 957 } 958 959 enum DefinedType { 960 PREFIX = 0; 961 NEIGHBOR = 1; 962 TAG = 2; 963 AS_PATH = 3; 964 COMMUNITY = 4; 965 EXT_COMMUNITY = 5; 966 LARGE_COMMUNITY = 6; 967 NEXT_HOP = 7; 968 } 969 970 message DefinedSet { 971 DefinedType defined_type = 1; 972 string name = 2; 973 repeated string list = 3; 974 repeated Prefix prefixes = 4; 975 } 976 977 enum MatchType { 978 ANY = 0; 979 ALL = 1; 980 INVERT = 2; 981 } 982 983 message MatchSet { 984 MatchType match_type = 1; 985 string name = 2; 986 } 987 988 enum AsPathLengthType { 989 EQ = 0; 990 GE = 1; 991 LE = 2; 992 } 993 994 message AsPathLength { 995 AsPathLengthType length_type = 1; 996 uint32 length = 2; 997 } 998 999 message Conditions { 1000 MatchSet prefix_set = 1; 1001 MatchSet neighbor_set = 2; 1002 AsPathLength as_path_length = 3; 1003 MatchSet as_path_set = 4; 1004 MatchSet community_set = 5; 1005 MatchSet ext_community_set = 6; 1006 int32 rpki_result = 7; 1007 enum RouteType { 1008 ROUTE_TYPE_NONE = 0; 1009 ROUTE_TYPE_INTERNAL = 1; 1010 ROUTE_TYPE_EXTERNAL = 2; 1011 ROUTE_TYPE_LOCAL = 3; 1012 } 1013 RouteType route_type = 8; 1014 MatchSet large_community_set = 9; 1015 repeated string next_hop_in_list = 10; 1016 repeated Family afi_safi_in = 11; 1017 } 1018 1019 enum RouteAction { 1020 NONE = 0; 1021 ACCEPT = 1; 1022 REJECT = 2; 1023 } 1024 1025 enum CommunityActionType { 1026 COMMUNITY_ADD = 0; 1027 COMMUNITY_REMOVE = 1; 1028 COMMUNITY_REPLACE = 2; 1029 } 1030 1031 message CommunityAction { 1032 CommunityActionType action_type = 1; 1033 repeated string communities = 2; 1034 } 1035 1036 enum MedActionType { 1037 MED_MOD = 0; 1038 MED_REPLACE = 1; 1039 } 1040 1041 message MedAction { 1042 MedActionType action_type = 1; 1043 int64 value = 2; 1044 } 1045 1046 message AsPrependAction { 1047 uint32 asn = 1; 1048 uint32 repeat = 2; 1049 bool use_left_most = 3; 1050 } 1051 1052 message NexthopAction { 1053 string address = 1; 1054 bool self = 2; 1055 } 1056 1057 message LocalPrefAction { 1058 uint32 value = 1; 1059 } 1060 1061 message Actions { 1062 RouteAction route_action = 1; 1063 CommunityAction community = 2; 1064 MedAction med = 3; 1065 AsPrependAction as_prepend = 4; 1066 CommunityAction ext_community = 5; 1067 NexthopAction nexthop = 6; 1068 LocalPrefAction local_pref = 7; 1069 CommunityAction large_community = 8; 1070 } 1071 1072 message Statement { 1073 string name = 1; 1074 Conditions conditions = 2; 1075 Actions actions = 3; 1076 } 1077 1078 message Policy { 1079 string name = 1; 1080 repeated Statement statements = 2; 1081 } 1082 1083 enum PolicyDirection { 1084 UNKNOWN = 0; 1085 IMPORT = 1; 1086 EXPORT = 2; 1087 } 1088 1089 message PolicyAssignment { 1090 string name = 1; 1091 PolicyDirection direction = 2; 1092 repeated Policy policies = 4; 1093 RouteAction default_action = 5; 1094 } 1095 1096 message RoutingPolicy { 1097 repeated DefinedSet defined_sets = 1; 1098 repeated Policy policies = 2; 1099 } 1100 1101 message Roa { 1102 uint32 as = 1; 1103 uint32 prefixlen = 2; 1104 uint32 maxlen = 3; 1105 string prefix = 4; 1106 RPKIConf conf = 5; 1107 } 1108 1109 message Vrf { 1110 string name = 1; 1111 // Route Distinguisher must be one of 1112 // RouteDistinguisherTwoOctetAS, 1113 // RouteDistinguisherIPAddressAS, 1114 // or RouteDistinguisherFourOctetAS. 1115 google.protobuf.Any rd = 2; 1116 // List of the Import Route Targets. Each must be one of 1117 // TwoOctetAsSpecificExtended, 1118 // IPv4AddressSpecificExtended, 1119 // or FourOctetAsSpecificExtended. 1120 repeated google.protobuf.Any import_rt = 3; 1121 // List of the Export Route Targets. Each must be one of 1122 // TwoOctetAsSpecificExtended, 1123 // IPv4AddressSpecificExtended, 1124 // or FourOctetAsSpecificExtended. 1125 repeated google.protobuf.Any export_rt = 4; 1126 uint32 id = 5; 1127 } 1128 1129 message DefaultRouteDistance { 1130 uint32 external_route_distance = 1; 1131 uint32 internal_route_distance = 2; 1132 } 1133 1134 message Global { 1135 uint32 as = 1; 1136 string router_id = 2; 1137 int32 listen_port = 3; 1138 repeated string listen_addresses = 4; 1139 repeated uint32 families = 5; 1140 bool use_multiple_paths = 6; 1141 RouteSelectionOptionsConfig route_selection_options = 7; 1142 DefaultRouteDistance default_route_distance = 8; 1143 Confederation confederation = 9; 1144 GracefulRestart graceful_restart = 10; 1145 ApplyPolicy apply_policy = 11; 1146 } 1147 1148 message Confederation { 1149 bool enabled = 1; 1150 uint32 identifier = 2; 1151 repeated uint32 member_as_list = 3; 1152 } 1153 1154 message RPKIConf { 1155 string address = 1; 1156 uint32 remote_port = 2; 1157 } 1158 1159 message RPKIState { 1160 google.protobuf.Timestamp uptime = 1; 1161 google.protobuf.Timestamp downtime = 2; 1162 bool up = 3; 1163 uint32 record_ipv4 = 4; 1164 uint32 record_ipv6 = 5; 1165 uint32 prefix_ipv4 = 6; 1166 uint32 prefix_ipv6 = 7; 1167 uint32 serial = 8; 1168 int64 received_ipv4 = 9; 1169 int64 received_ipv6 = 10; 1170 int64 serial_notify = 11; 1171 int64 cache_reset = 12; 1172 int64 cache_response = 13; 1173 int64 end_of_data = 14; 1174 int64 error = 15; 1175 int64 serial_query = 16; 1176 int64 reset_query = 17; 1177 } 1178 1179 message Rpki { 1180 RPKIConf conf = 1; 1181 RPKIState state = 2; 1182 }