From ca01611b38570e7ce80edf9842faf135b9af643a Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Tue, 14 Feb 2023 02:58:39 +0100 Subject: WIP: dhcp dev Turn off blocks --- tunnel/tools/libwg-go/service.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tunnel/tools/libwg-go/service.go') diff --git a/tunnel/tools/libwg-go/service.go b/tunnel/tools/libwg-go/service.go index 1f2e629c..66bdd5ef 100644 --- a/tunnel/tools/libwg-go/service.go +++ b/tunnel/tools/libwg-go/service.go @@ -244,3 +244,20 @@ func (e *LibwgServiceImpl) IpcSet(ctx context.Context, req *gen.IpcSetRequest) ( return r, nil } + +func (e *LibwgServiceImpl) Dhcp(ctx context.Context, req *gen.DhcpRequest) (*gen.DhcpResponse, error) { + leases, err := RunDhcp(ctx) + if err != nil { + r := &gen.DhcpResponse{ + Error: &gen.Error{ + Message: fmt.Sprintf("RunDhcp failed: %v", err), + }, + } + return r, nil + } + + r := &gen.DhcpResponse{ + Leases: leases, + } + return r, nil +} -- cgit v1.2.3