Files
Easytier/easytier-proto/proto/api_config.proto
T
KKRainbow 1e40350c89 feat(wasi): expose protobuf RPC request ABI (#2477)
* feat(wasi): expose protobuf RPC request ABI

Add an instance-scoped asynchronous RPC session backed by the shared
operation broker. Reuse the existing dispatcher and management handlers.
WASI hosts can call PeerManageRpc and ConnectorManageRpc with the same
protobuf payloads as easytier-cli.

Export ABI version, submit, take, and free functions. Bind selectors to
the WASM instance handle and keep method errors in RpcResponse. Enable
management RPC explicitly in the Go-host WASM build.

* fix(gateway): serialize UDP client eviction

Serialize UDP client admission across forwarding rules so only one
eviction can claim and wait for a released semaphore permit. Retry
when cleanup concurrently removes the selected client.

Add a multithreaded regression test for the permit handoff while the
evicted client is still referenced.

* fix(gateway): publish UDP client admission atomically

Hold the admission guard through client and response-task publication
so a concurrent eviction cannot leave an orphan task holding the slot
permit.

Open the data-plane flow before entering the critical section and extend
the multithreaded regression test across the publication window.
2026-08-07 18:34:53 +08:00

90 lines
1.9 KiB
Protocol Buffer

syntax = "proto3";
import "common.proto";
import "acl.proto";
import "api_instance.proto";
import "api_manage.proto";
package api.config;
enum ConfigPatchAction {
ADD = 0;
REMOVE = 1;
CLEAR = 2;
}
message InstanceConfigPatch {
optional string hostname = 1;
optional common.Ipv4Inet ipv4 = 2;
optional common.Ipv6Inet ipv6 = 3;
repeated PortForwardPatch port_forwards = 4;
optional AclPatch acl = 5;
repeated ProxyNetworkPatch proxy_networks = 6;
repeated RoutePatch routes = 7;
repeated ExitNodePatch exit_nodes = 8;
repeated UrlPatch mapped_listeners = 9;
repeated UrlPatch connectors = 10;
optional bool ipv6_public_addr_provider = 11;
optional bool ipv6_public_addr_auto = 12;
optional string ipv6_public_addr_prefix = 13;
optional bool disable_relay_data = 14;
}
message PortForwardPatch {
ConfigPatchAction action = 1;
common.PortForwardConfigPb cfg = 2;
}
message StringPatch {
ConfigPatchAction action = 1;
string value = 2;
}
message UrlPatch {
ConfigPatchAction action = 1;
common.Url url = 2;
}
message AclPatch {
optional acl.Acl acl = 1;
repeated StringPatch tcp_whitelist = 2;
repeated StringPatch udp_whitelist = 3;
}
message ProxyNetworkPatch {
ConfigPatchAction action = 1;
common.Ipv4Inet cidr = 2;
optional common.Ipv4Inet mapped_cidr = 3;
}
message RoutePatch {
ConfigPatchAction action = 1;
common.Ipv4Inet cidr = 2;
}
message ExitNodePatch {
ConfigPatchAction action = 1;
common.IpAddr node = 2;
}
message PatchConfigRequest {
InstanceConfigPatch patch = 1;
api.instance.InstanceIdentifier instance = 2;
}
message PatchConfigResponse {}
message GetConfigRequest {
api.instance.InstanceIdentifier instance = 1;
}
message GetConfigResponse {
api.manage.NetworkConfig config = 1;
string toml_config = 2;
}
service ConfigRpc {
rpc PatchConfig(PatchConfigRequest) returns (PatchConfigResponse);
rpc GetConfig(GetConfigRequest) returns (GetConfigResponse);
}