caretta-sync/core/proto/caretta_sync.remote_node.proto

98 lines
2.5 KiB
Protocol Buffer
Raw Normal View History

2025-09-30 08:07:17 +09:00
syntax = "proto3";
package caretta_sync.remote_node;
import "caretta_sync.common.proto";
import "tripod_id.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
service RemoteNode {
rpc Info(RemoteNodeInfoRequest) returns (RemoteNodeInfoResponse);
2025-10-01 07:19:35 +09:00
rpc List(stream RemoteNodeListRequest) returns (stream RemoteNodeListResponse);
2025-09-30 08:07:17 +09:00
}
message RemoteNodeIdentifier {
2025-10-01 07:19:35 +09:00
oneof identifier {
2025-09-30 08:07:17 +09:00
tripod_id.Double id = 1;
caretta_sync.common.PublicKey public_key = 2;
}
}
message RemoteNodeInfoRequest {
RemoteNodeIdentifier remote_node = 1;
}
2025-10-01 07:19:35 +09:00
message RemoteNodeListRequest {}
2025-09-30 08:07:17 +09:00
message RemoteNodeInfoResponse {
RemoteNodeInfo remote_node_info = 1;
}
2025-10-01 07:19:35 +09:00
message RemoteNodeListResponse {
2025-09-30 08:07:17 +09:00
RemoteNodeInfo remote_node_info = 1;
}
message RemoteNodeInfo {
tripod_id.Double id = 1;
bool authorized = 2;
caretta_sync.common.PublicKey public_key = 3;
string relay_url = 4;
repeated RemoteNodeDirectAddrInfo addrs = 5;
2025-10-01 07:19:35 +09:00
RemoteNodeConnectionType conn_type = 6;
2025-09-30 08:07:17 +09:00
google.protobuf.Duration latency = 7;
google.protobuf.Duration last_used = 8;
}
2025-10-01 07:19:35 +09:00
message RemoteNodeConnectionType {
oneof conn_type {
caretta_sync.common.SocketAddr direct = 1;
caretta_sync.common.Url relay = 2;
RemoteNodeConnectionTypeMixed mixed = 3;
google.protobuf.Empty none = 4;
}
}
message RemoteNodeConnectionTypeMixed {
caretta_sync.common.SocketAddr socket_addr = 1;
caretta_sync.common.Url relay_url = 2;
}
2025-09-30 08:07:17 +09:00
message RemoteNodeRelayUrlInfo {
caretta_sync.common.Url relay_url = 1;
google.protobuf.Duration last_alive = 2;
google.protobuf.Duration latency = 3;
}
message RemoteNodeDirectAddrInfo {
2025-10-01 07:19:35 +09:00
caretta_sync.common.SocketAddr addr = 1;
2025-09-30 08:07:17 +09:00
google.protobuf.Duration latency = 2;
RemoteNodeLastControl last_control = 3;
google.protobuf.Duration last_payload = 4;
google.protobuf.Duration last_alive = 5;
repeated RemoteNodeSource sources = 6;
}
message RemoteNodeLastControl {
google.protobuf.Duration duration = 1;
2025-10-01 07:19:35 +09:00
RemoteNodeControlMsg control_msg = 2;
}
enum RemoteNodeControlMsg {
PING = 0;
PONG = 1;
CALL_ME_MAYBE = 2;
2025-09-30 08:07:17 +09:00
}
message RemoteNodeSource {
2025-10-01 07:19:35 +09:00
oneof source = {
google.protobuf.Empty saved = 1;
google.protobuf.Empty udp = 2;
google.protobuf.Empty Relay = 3;
google.protobuf.Empty App = 4;
string discovery = 5;
string named_app = 6
};
google.protobuf.Duration duration = 7;
2025-09-30 08:07:17 +09:00
}