summaryrefslogtreecommitdiffhomepage
path: root/tun
diff options
context:
space:
mode:
Diffstat (limited to 'tun')
-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 8218fc3..03e04a2 100644
--- a/tun/tun_windows.go
+++ b/tun/tun_windows.go
@@ -373,3 +373,10 @@ func (tun *NativeTun) Write(buff []byte, offset int) (int, error) {
func (tun *NativeTun) GUID() windows.GUID {
return tun.wt.CfgInstanceID
}
+
+//
+// GUID returns Windows adapter instance ID.
+//
+func (tun *NativeTun) LUID() uint64 {
+ return ((uint64(tun.wt.LUIDIndex) & ((1 << 24) - 1)) << 24) | ((uint64(tun.wt.IfType) & ((1 << 16) - 1)) << 48)
+}