syntax = "proto3";

package bio.bgp;

import "net/api/net.proto";
import "route/api/route.proto";
import "protocols/bgp/api/session.proto";
option go_package = "github.com/bio-routing/bio-rd/protocols/bgp/api";

message ListSessionsRequest {
    SessionFilter filter = 1;
}

message SessionFilter {
    bio.net.IP neighbor_ip = 1;
    string vrf_name = 2;
}

message ListSessionsResponse {
    repeated Session sessions = 1;
}

message DumpRIBRequest {
    bio.net.IP peer = 1;
    uint32 afi = 2;
    uint32 safi = 3;
    string vrf_name = 4;
}

service BgpService {
    rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse) {}
    rpc DumpRIBIn(DumpRIBRequest) returns (stream bio.route.Route) {}
    rpc DumpRIBOut(DumpRIBRequest) returns (stream bio.route.Route) {}
}
