summaryrefslogtreecommitdiff
path: root/src/uapi_windows.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2018-02-04 16:08:26 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2018-02-04 16:08:26 +0100
commita0f54cbe5ac2cd8b8296c2c57c30029dd349cff0 (patch)
tree64574090d79ff3899c5c18e5268e450028e4656b /src/uapi_windows.go
parent5871ec04deb8f4715cab37146940baa35c08cbee (diff)
downloadwireguard-go-a0f54cbe5ac2cd8b8296c2c57c30029dd349cff0.tar.gz
wireguard-go-a0f54cbe5ac2cd8b8296c2c57c30029dd349cff0.zip
Align with go library layout
Diffstat (limited to 'src/uapi_windows.go')
-rw-r--r--src/uapi_windows.go44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/uapi_windows.go b/src/uapi_windows.go
deleted file mode 100644
index a4599a5..0000000
--- a/src/uapi_windows.go
+++ /dev/null
@@ -1,44 +0,0 @@
-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,
- })
-}