83 lines
2.2 KiB
Protocol Buffer
83 lines
2.2 KiB
Protocol Buffer
// Copyright 2021 Rayhaan Jaufeerally.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
syntax = "proto3";
|
|
|
|
package bgpd.grpc;
|
|
|
|
enum AddressFamily {
|
|
UNKNOWN = 0;
|
|
IPv4 = 1;
|
|
IPv6 = 2;
|
|
}
|
|
|
|
message Prefix {
|
|
bytes ip_prefix = 1;
|
|
int32 prefix_len = 2;
|
|
AddressFamily address_family = 3;
|
|
}
|
|
|
|
// Path represents the metadata associated with the route to a particular
|
|
// prefix.
|
|
message Path {
|
|
bytes nexthop = 1;
|
|
string peer_name = 2;
|
|
uint32 local_pref = 3;
|
|
uint32 med = 4;
|
|
repeated uint32 as_path = 5;
|
|
// TODO: Path attributes. Not yet supported because we need to generate proto
|
|
// definitions for all of them.
|
|
}
|
|
|
|
message PathSet {
|
|
uint64 epoch = 1;
|
|
Prefix prefix = 2;
|
|
repeated Path paths = 3;
|
|
}
|
|
|
|
message StreamPathsRequest { AddressFamily address_family = 1; }
|
|
|
|
message DumpPathsRequest { AddressFamily address_family = 1; };
|
|
|
|
message DumpPathsResponse {
|
|
uint64 epoch = 1;
|
|
repeated PathSet path_sets = 2;
|
|
};
|
|
|
|
service RouteService {
|
|
// DumpPaths returns all the paths currently in the RIB.
|
|
rpc DumpPaths(DumpPathsRequest) returns (DumpPathsResponse);
|
|
// StreamPaths dumps the existing routes and starts streaming updates to the
|
|
// RIB.
|
|
rpc StreamPaths(StreamPathsRequest) returns (stream PathSet);
|
|
}
|
|
|
|
message PeerStatusRequest {}
|
|
|
|
message PeerStatus {
|
|
string peer_name = 1;
|
|
string state = 2;
|
|
uint64 session_established_time = 3;
|
|
uint64 last_messaage_time = 4;
|
|
uint64 route_updates_in = 5;
|
|
uint64 route_updates_out = 6;
|
|
}
|
|
|
|
message PeerStatusResponse { repeated PeerStatus peer_status = 1; }
|
|
|
|
// BGPServerAdminService implements an administrative interface to
|
|
// view the status and control the operation of this BGP server.
|
|
service BGPServerAdminService {
|
|
rpc PeerStatus(PeerStatusRequest) returns (PeerStatusResponse);
|
|
} |