# Functions
Delete deletes the named interface if netNS is not nil Exists switch in the network namespace before deleting.
Exists test check if the named interface exists if netNS is not nil switch in the network namespace before checking.
Get link by name from optional namespace.
GetMAC gets the mac address from the Interface.
HardwareAddrFromInputBytes returns a deterministic hardware address for a given byte slice.
HasDefaultGW tests if a link as a default gateway configured it return the ip of the gateway if there is one.
HostIPV6Iface return the first physical interface to have an ipv6 public address.
IPv6SuffixFromInputBytes returns a deterministic IPv6 suffix for a given byte slice, with n equals the amount of bytes the suffix has.
IPv6SuffixFromInputBytesAsHex returns a deterministic IPv6 suffix hex-encoded for a given byte slice, with n equals the amount of bytes the suffix has.
IsPlugged test if an interface has a cable plugged in.
IsPluggedTimeout is like IsPlugged but retry for duration time before returning.
IsULA checks if IPv6 is a ULA ip.
IsVirtEth tests if an interface is a veth.
LinkFilter list all the links of a certain type.
MakeVethPair attach the given interface to the given bridge with veth cable in case of providing a namespace, the interface will be moved there
- name: name of the veth interface - master: name of the master bridge to attach the veth peer to - mtu: mtu - netNs: network namespace to move the veth interface into.
ParentIface return the parent interface fof iface if netNS is not nil, switch to the network namespace before checking iface.
RandomName generate a random string that can be used for interface or network namespace if prefix is not None, the random name is prefixed with it.
SetLoUp brings the lo interface up.
SetMAC Sets the mac addr of an interface if netNS is not nil switch in the network namespace before setting.
VethByName loads one end of a veth pair given its name.