79 lines
1.6 KiB
Protocol Buffer
79 lines
1.6 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package agent;
|
|
|
|
option go_package = "l_vpn_proto/proto";
|
|
|
|
service WireGuardAgent {
|
|
rpc GetClientConfigs(GetClientConfigsRequest) returns (GetClientConfigsResponse);
|
|
rpc RegisterClient(RegisterClientRequest) returns (RegisterClientResponse);
|
|
rpc UnregisterClient(UnregisterClientRequest) returns (UnregisterClientResponse);
|
|
rpc GetServerStatus(GetServerStatusRequest) returns (GetServerStatusResponse);
|
|
rpc PingHosts(PingHostsRequest) returns (PingHostsResponse);
|
|
}
|
|
|
|
message GetClientConfigsRequest {}
|
|
|
|
message ClientConfig {
|
|
string name = 1;
|
|
string public_key = 2;
|
|
string private_key = 3;
|
|
string endpoint = 4;
|
|
string allowed_ips = 5;
|
|
string created_at = 6;
|
|
}
|
|
|
|
message GetClientConfigsResponse {
|
|
bool success = 1;
|
|
string error = 2;
|
|
repeated ClientConfig clients = 3;
|
|
}
|
|
|
|
message RegisterClientRequest {
|
|
string name = 1;
|
|
string allowed_ips = 2;
|
|
}
|
|
|
|
message RegisterClientResponse {
|
|
bool success = 1;
|
|
string error = 2;
|
|
ClientConfig client = 3;
|
|
}
|
|
|
|
message UnregisterClientRequest {
|
|
string public_key = 1;
|
|
}
|
|
|
|
message UnregisterClientResponse {
|
|
bool success = 1;
|
|
string error = 2;
|
|
}
|
|
|
|
message GetServerStatusRequest {}
|
|
|
|
message GetServerStatusResponse {
|
|
bool success = 1;
|
|
string error = 2;
|
|
string interface_name = 3;
|
|
string public_key = 4;
|
|
string listening_port = 5;
|
|
int32 peers_count = 6;
|
|
}
|
|
|
|
message PingHostsRequest {
|
|
repeated string hosts = 1;
|
|
}
|
|
|
|
message PingResult {
|
|
string host = 1;
|
|
double latency_ms = 2; // -1 if unreachable
|
|
bool reachable = 3;
|
|
string error = 4;
|
|
}
|
|
|
|
message PingHostsResponse {
|
|
bool success = 1;
|
|
string error = 2;
|
|
repeated PingResult results = 3;
|
|
}
|