ToIPv6 converts the buffer with IPv6 address in network byte order to an IP-typed address.
(buffer []byte)
| 41 | |
| 42 | // ToIPv6 converts the buffer with IPv6 address in network byte order to an IP-typed address. |
| 43 | func ToIPv6(buffer []byte) net.IP { |
| 44 | ipv6 := make([]uint16, 46) |
| 45 | if rtlIpv6AddressToString != nil { |
| 46 | _, _, _ = rtlIpv6AddressToString.Call(uintptr(unsafe.Pointer(&buffer[0])), uintptr(unsafe.Pointer(&ipv6[0]))) |
| 47 | } |
| 48 | return net.ParseIP(syscall.UTF16ToString(ipv6)) |
| 49 | } |