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

108 lines
2.9 KiB
Protocol Buffer
Raw Normal View History

2025-09-30 08:07:17 +09:00
syntax = "proto3";
2025-10-01 08:02:25 +09:00
package caretta_sync;
2025-09-30 08:07:17 +09:00
2025-10-01 08:08:13 +09:00
import "caretta_sync/common.proto";
2025-09-30 08:07:17 +09:00
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;
2025-10-01 08:02:25 +09:00
caretta_sync.PublicKey public_key = 2;
2025-09-30 08:07:17 +09:00
}
}
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;
}
2025-10-01 08:02:25 +09:00
2025-09-30 08:07:17 +09:00
message RemoteNodeInfo {
2025-10-01 08:02:25 +09:00
// A messege of iroh::RemoteInfo.
message RemoteInfo {
message ConnectionType {
message Mixed {
caretta_sync.SocketAddr socket_addr = 1;
caretta_sync.Url relay_url = 2;
}
oneof conn_type {
caretta_sync.SocketAddr direct = 1;
caretta_sync.Url relay = 2;
Mixed mixed = 3;
google.protobuf.Empty none = 4;
}
}
message DirectAddrInfo {
message LastControl {
enum ControlMsg {
PING = 0;
PONG = 1;
CALL_ME_MAYBE = 2;
}
google.protobuf.Duration duration = 1;
ControlMsg control_msg = 2;
}
2025-10-01 12:50:25 +09:00
message SourceDuration {
2025-10-01 08:02:25 +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;
}
caretta_sync.SocketAddr addr = 1;
google.protobuf.Duration latency = 2;
LastControl last_control = 3;
google.protobuf.Duration last_payload = 4;
google.protobuf.Duration last_alive = 5;
2025-10-01 12:50:25 +09:00
repeated SourceDuration sources = 6;
2025-10-01 08:02:25 +09:00
}
message RelayUrlInfo {
caretta_sync.Url relay_url = 1;
google.protobuf.Duration last_alive = 2;
google.protobuf.Duration latency = 3;
}
bool authorized = 2;
caretta_sync.PublicKey public_key = 3;
RelayUrlInfo relay_url = 4;
repeated DirectAddrInfo addrs = 5;
ConnectionType conn_type = 6;
google.protobuf.Duration latency = 7;
google.protobuf.Duration last_used = 8;
2025-10-01 07:19:35 +09:00
}
2025-10-01 08:02:25 +09:00
tripod_id.Double public_id = 1;
RemoteInfo remote_info = 2;
2025-10-01 07:19:35 +09:00
}
2025-09-30 08:07:17 +09:00
2025-10-01 07:19:35 +09:00
2025-09-30 08:07:17 +09:00
2025-10-01 08:02:25 +09:00