utils

package
v0.0.0-...-46547a1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2019 License: ISC Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomMac

func GenerateRandomMac() tcpip.LinkAddress

GenerateRandomMac generates a random. locally-administered MAC address.

func IpToAddress

func IpToAddress(ip net.IP) tcpip.Address

IpToAddress converts IP to tcpip.Address, ignoring the protocol.

func IpToAddressAndProto

func IpToAddressAndProto(ip net.IP) (tcpip.NetworkProtocolNumber, tcpip.Address)

ipToAddressAndProto converts IP to tcpip.Address and a protocol number.

Note: don't use 'len(ip)' to determine IP version because length is always 16.

func NewTapLink(tapName string, addr tcpip.LinkAddress) tcpip.LinkEndpointID
func NewTunLink(tunName string) tcpip.LinkEndpointID

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL