diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-03-03 04:04:41 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-03-03 05:00:40 +0100 |
commit | 69f0fe67b63d90e523a5a1241fb1b46c2e8dbe03 (patch) | |
tree | 1ef86da3242afde462dcadb7241bb09f499d5bd7 /main_windows.go | |
parent | d435be35cac49af9367b2005d831d55e570c4b1b (diff) |
global: begin modularization
Diffstat (limited to 'main_windows.go')
-rw-r--r-- | main_windows.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/main_windows.go b/main_windows.go index 7104a20..39cdead 100644 --- a/main_windows.go +++ b/main_windows.go @@ -7,6 +7,8 @@ package main import ( "fmt" + "golang.zx2c4.com/wireguard/device" + "golang.zx2c4.com/wireguard/ipc" "os" "os/signal" "syscall" @@ -25,8 +27,8 @@ func main() { } interfaceName := os.Args[1] - logger := NewLogger( - LogLevelDebug, + logger := device.NewLogger( + device.LogLevelDebug, fmt.Sprintf("(%s) ", interfaceName), ) logger.Info.Println("Starting wireguard-go version", WireGuardGoVersion) @@ -43,11 +45,11 @@ func main() { os.Exit(ExitSetupFailed) } - device := NewDevice(tun, logger) + device := device.NewDevice(tun, logger) device.Up() logger.Info.Println("Device started") - uapi, err := UAPIListen(interfaceName) + uapi, err := ipc.UAPIListen(interfaceName) if err != nil { logger.Error.Println("Failed to listen on uapi socket:", err) os.Exit(ExitSetupFailed) @@ -63,7 +65,7 @@ func main() { errs <- err return } - go ipcHandle(device, conn) + go device.IpcHandle(conn) } }() logger.Info.Println("UAPI listener started") |