summaryrefslogtreecommitdiffhomepage
path: root/tunnel/tools/libwg-go/service.go
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2023-02-14 02:58:39 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2023-03-23 22:55:18 +0100
commitca01611b38570e7ce80edf9842faf135b9af643a (patch)
treee58e7c0fff696077111c1f5c04b348472e80a1cd /tunnel/tools/libwg-go/service.go
parent09d10106bc1dfe8764d8c432042fb0dd2b88e5c1 (diff)
WIP: dhcp dev
Turn off blocks
Diffstat (limited to 'tunnel/tools/libwg-go/service.go')
-rw-r--r--tunnel/tools/libwg-go/service.go17
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
+}