From 89c6fdac75494e608608c57db75476f69bf88a63 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sat, 11 Feb 2023 20:18:54 +0100 Subject: WIP: grpc-turnon --- tunnel/src/main/proto/libwg.proto | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tunnel/src/main/proto/libwg.proto') diff --git a/tunnel/src/main/proto/libwg.proto b/tunnel/src/main/proto/libwg.proto index e633ea46..24758940 100644 --- a/tunnel/src/main/proto/libwg.proto +++ b/tunnel/src/main/proto/libwg.proto @@ -15,6 +15,7 @@ service Libwg { rpc StopHttpProxy(StopHttpProxyRequest) returns (StopHttpProxyResponse); rpc Reverse(stream ReverseRequest) returns (stream ReverseResponse); rpc IpcSet(IpcSetRequest) returns (IpcSetResponse); + rpc TurnOn(TurnOnRequest) returns (TurnOnResponse); } message TunnelHandle { int32 handle = 1; } @@ -39,6 +40,17 @@ message InetSocketAddress { uint32 port = 2; } +message InetPrefix { + InetAddress address = 1; + uint32 prefixLenght = 2; +} + +enum TurnOnFlags { + NONE = 0x00; + ENABLE_DHCP = 0x01; + ENABLE_FOOBAR = 0x04; +} + message StopGrpcRequest { } @@ -101,3 +113,19 @@ message IpcSetRequest { message IpcSetResponse { Error error = 1; } + +message TurnOnRequest { + string interfaceName = 1; + int32 tunFd = 2; + string settings = 3; + // Bitwise-OR of TurnOnFlags. + optional uint32 flags = 4; + optional InetAddress linkLocalAddr = 5; +} + +message TurnOnResponse { + Error error = 1; + TunnelHandle tunnel = 2; + repeated InetPrefix addresses = 3; + // TODO add dns servers etc. +} -- cgit v1.2.3