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