Documentation
¶
Index ¶
- func CreateVethPair(name1, name2 string) error
- func DeleteVethPair(name1, name2 string) error
- func GenerateIfaceName(nlh *netlink.Handle, prefix string, len int) (string, error)
- func GenerateMACFromIP(ip net.IP) net.HardwareAddr
- func GenerateRandomMAC() net.HardwareAddr
- func GenerateRandomName(prefix string, size int) (string, error)
- func SetInterfaceIP(name string, ipstr string) error
- func SetInterfaceMac(name string, macaddr string) error
- func SetLinkUp(name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateVethPair ¶
CreateVethPair creates veth interface pairs with specified name
func DeleteVethPair ¶
DeleteVethPair deletes veth interface pairs
func GenerateIfaceName ¶
GenerateIfaceName returns an interface name using the passed in prefix and the length of random bytes. The api ensures that the there are is no interface which exists with that name.
func GenerateMACFromIP ¶
func GenerateMACFromIP(ip net.IP) net.HardwareAddr
GenerateMACFromIP returns a locally administered MAC address where the 4 least significant bytes are derived from the IPv4 address.
func GenerateRandomMAC ¶
func GenerateRandomMAC() net.HardwareAddr
GenerateRandomMAC returns a new 6-byte(48-bit) hardware address (MAC)
func GenerateRandomName ¶
GenerateRandomName returns a new name joined with a prefix. This size specified is used to truncate the randomly generated value
func SetInterfaceIP ¶
SetInterfaceIP Set IP address of an interface
func SetInterfaceMac ¶
SetInterfaceMac Set mac address of an interface
Types ¶
This section is empty.