diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-21 19:00:58 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-21 19:00:58 +0200 |
commit | 2ae22ac65daac44c9d4b2eb530db9e8863f4a21a (patch) | |
tree | 40b58353f729c0c225aa0345cb43eaf7c8811f54 /uapi_windows.go | |
parent | ff3f2455e5cd74bd45c2f124a1d275462e33a4a0 (diff) |
Remove broken windows cruft
Diffstat (limited to 'uapi_windows.go')
-rw-r--r-- | uapi_windows.go | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/uapi_windows.go b/uapi_windows.go deleted file mode 100644 index 41808f7..0000000 --- a/uapi_windows.go +++ /dev/null @@ -1,50 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 - * - * Copyright (C) 2017-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. - * Copyright (C) 2017-2018 Mathias N. Hall-Andersen <mathias@hall-andersen.dk>. - */ - -package main - -/* UAPI on windows uses a bidirectional named pipe - */ - -import ( - "fmt" - "github.com/Microsoft/go-winio" - "golang.org/x/sys/windows" - "net" -) - -const ( - ipcErrorIO = -int64(windows.ERROR_BROKEN_PIPE) - ipcErrorProtocol = -int64(windows.ERROR_INVALID_NAME) - ipcErrorInvalid = -int64(windows.ERROR_INVALID_PARAMETER) - ipcErrorPortInUse = -int64(windows.ERROR_ALREADY_EXISTS) -) - -const PipeNameFmt = "\\\\.\\pipe\\wireguard-ipc-%s" - -type UAPIListener struct { - listener net.Listener -} - -func (uapi *UAPIListener) Accept() (net.Conn, error) { - return nil, nil -} - -func (uapi *UAPIListener) Close() error { - return uapi.listener.Close() -} - -func (uapi *UAPIListener) Addr() net.Addr { - return nil -} - -func NewUAPIListener(name string) (net.Listener, error) { - path := fmt.Sprintf(PipeNameFmt, name) - return winio.ListenPipe(path, &winio.PipeConfig{ - InputBufferSize: 2048, - OutputBufferSize: 2048, - }) -} |