summaryrefslogtreecommitdiffhomepage
path: root/app/tools/libwg-go/src/tun/api-android.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-03-03 04:47:11 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-03-03 05:43:42 +0100
commit49cc63467812ed9946f4a98eb73658f2ce0b2aac (patch)
treeb6e1f54465e57ae0161fcd61a701d41c18902b09 /app/tools/libwg-go/src/tun/api-android.go
parentc93e81c632d2be7faa53ad2803a61444710ae962 (diff)
libwg-go: don't use submodule
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/tools/libwg-go/src/tun/api-android.go')
-rw-r--r--app/tools/libwg-go/src/tun/api-android.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/app/tools/libwg-go/src/tun/api-android.go b/app/tools/libwg-go/src/tun/api-android.go
deleted file mode 100644
index 75e80c5a..00000000
--- a/app/tools/libwg-go/src/tun/api-android.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/* SPDX-License-Identifier: Apache-2.0
- *
- * Copyright (C) 2017-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
- */
-
-package tun
-
-import (
- "golang.zx2c4.com/wireguard/rwcancel"
- "os"
-)
-
-func CreateTUNFromFD(tunFd int) (TUNDevice, string, error) {
- file := os.NewFile(uintptr(tunFd), "/dev/tun")
- tun := &nativeTun{
- tunFile: file,
- fd: file.Fd(),
- events: make(chan TUNEvent, 5),
- errors: make(chan error, 5),
- nopi: true,
- }
- var err error
- tun.fdCancel, err = rwcancel.NewRWCancel(int(tun.fd))
- if err != nil {
- return nil, "", err
- }
- name, err := tun.Name()
- if err != nil {
- tun.fdCancel.Cancel()
- return nil, "", err
- }
- return tun, name, nil
-}