aboutsummaryrefslogtreecommitdiffstats
path: root/tun/tun_windows.go
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-03-04 14:27:16 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-03-04 16:37:11 +0100
commit1fdf7b19a3b7237ad7e63ae3e08d77686649ec0e (patch)
tree124165516dbcfbb6dabaf630b38dd355b96667aa /tun/tun_windows.go
parentElaborate the failing step when forwarding errors on return (diff)
downloadwireguard-go-1fdf7b19a3b7237ad7e63ae3e08d77686649ec0e.tar.xz
wireguard-go-1fdf7b19a3b7237ad7e63ae3e08d77686649ec0e.zip
wintun: Resolve some of golint warnings
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'tun/tun_windows.go')
-rw-r--r--tun/tun_windows.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/tun/tun_windows.go b/tun/tun_windows.go
index e2752db..4c48af5 100644
--- a/tun/tun_windows.go
+++ b/tun/tun_windows.go
@@ -52,6 +52,10 @@ func packetAlign(size uint32) uint32 {
return (size + (packetExchangeAlignment - 1)) &^ (packetExchangeAlignment - 1)
}
+//
+// CreateTUN creates a Wintun adapter with the given name. Should a Wintun
+// adapter with the same name exist, it is reused.
+//
func CreateTUN(ifname string) (TUNDevice, error) {
// Does an interface with this name already exist?
wt, err := wintun.GetInterface(ifname, 0)
@@ -351,6 +355,9 @@ func (tun *NativeTun) Write(buff []byte, offset int) (int, error) {
return len(buff) - offset, tun.flush()
}
+//
+// GUID returns Windows adapter instance ID.
+//
func (tun *NativeTun) GUID() windows.GUID {
return *(*windows.GUID)(tun.wt)
}