//
// Aspia Project
// Copyright (C) 2016-2024 Dmitry Chapyshev <dmitry@aspia.ru>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

syntax = "proto3";

option optimize_for = LITE_RUNTIME;

import "router_common.proto";

package proto;

message RelayKeyPool
{
    string peer_host = 1;
    uint32 peer_port = 2;
    repeated RelayKey key = 3; // A pool of one time keys.
}

message RelayKeyUsed
{
    uint32 key_id = 1;
}

// Sent from relay to router.
message RelayStat
{
    repeated PeerConnection peer_connection = 1;
    int64 uptime = 2;
}

// Sent from relay to router.
message RelayToRouter
{
    RelayKeyPool key_pool = 1;
    RelayStat relay_stat  = 2;
}

// Sent from router to relay.
message RouterToRelay
{
    RelayKeyUsed key_used = 1;
    PeerConnectionRequest peer_connection_request = 2;
}
