wintun: add LUID accessor
This commit is contained in:
parent
7a8553aef0
commit
2d847a38a2
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue