MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / ToIPv6

Function ToIPv6

pkg/util/ip/ip.go:43–49  ·  view source on GitHub ↗

ToIPv6 converts the buffer with IPv6 address in network byte order to an IP-typed address.

(buffer []byte)

Source from the content-addressed store, hash-verified

41
42// ToIPv6 converts the buffer with IPv6 address in network byte order to an IP-typed address.
43func 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}

Callers 3

NewParamFunction · 0.92
UnmarshalRawMethod · 0.92
TestToIPv6Function · 0.85

Calls 1

CallMethod · 0.65

Tested by 1

TestToIPv6Function · 0.68