diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2023-02-14 02:58:39 +0100 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2023-02-24 21:11:59 +0100 |
commit | 96c64e741ea467edaa39147f1e3e531680f60056 (patch) | |
tree | ab7c1478dc2efbdacf8215efed5de46180de7a5a /tunnel/tools/libwg-go/service.go | |
parent | 54167976f25edbddabaed633c99de0cabae4a7b9 (diff) |
WIP: dhcp dev
Turn off blocks
Diffstat (limited to 'tunnel/tools/libwg-go/service.go')
-rw-r--r-- | tunnel/tools/libwg-go/service.go | 17 |
1 files changed, 17 insertions, 0 deletions
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 +} |