Documentation ¶
Index ¶
- Variables
- func CIDR2Addr(c *CIDR) (addr *netlink.Addr)
- func IPv4CIDRString2Mask(ip string) (string, error)
- func LinkAddrList() (Addrs []netlink.Addr)
- func LinkAddrListByName(linkName string) (Addrs []netlink.Addr)
- func LinkDefaultAddr(link string) *netlink.Addr
- func LinkIPv4AddrListByName(linkName string) (Addrs []netlink.Addr)
- func LinkIPv6AddrListByName(linkName string) (Addrs []netlink.Addr)
- func LinkList() ([]netlink.Link, error)
- func LinkNames() (names []string)
- func SubNet(addr *netlink.Addr) (ip net.IP, subnet *net.IPNet, err error)
- type CIDR
- type LinkAddr
- type LoadBalancerIPs
Constants ¶
This section is empty.
Variables ¶
var Bits string
Bits default link CIDR bits abbrev
var Debug bool
Debug set by initializer
var IP string
IP default link IP
var LinkDevice string
LinkDevice default link device to use for external ip addresses
Functions ¶
func IPv4CIDRString2Mask ¶
IPv4CIDRString2Mask ip/bit string to subnet mask
func LinkAddrList ¶
LinkAddrList of all devices for all families
func LinkAddrListByName ¶
LinkAddrListByName addresses for one device for all address families
func LinkDefaultAddr ¶
LinkDefaultAddr assume that the first address is canonical for a device and shouldn't be modified, removed and describes the subnet bits/routes
func LinkIPv4AddrListByName ¶
LinkIPv4AddrListByName addresses for one device for ipv4
func LinkIPv6AddrListByName ¶
LinkIPv6AddrListByName addresses for one device for ipv6
Types ¶
type CIDR ¶
CIDR ip/bits CIDR struct
var DefaultCIDR *CIDR
DefaultCIDR default link device to use for external ip addresses
func LinkDefaultCIDR ¶
LinkDefaultCIDR assume that the first address is canonical for a device and shouldn't be modified, removed and describes the subnet bits/routes
func StringToCIDR ¶
StringToCIDR cidr ip/bits string to type CIDR
func (*CIDR) CIDRDevString ¶
CIDRDevString from CIDR with device
func (*CIDR) GetEtherIfaceFromIP ¶
GetEtherIfaceFromIP returns the link device name for which an address would be assigned
func (*CIDR) SetEtherIfaceFromIP ¶
SetEtherIfaceFromIP returns the link device name for which an address would be assigned
type LoadBalancerIPs ¶
LoadBalancerIPs load balancer IPs
func (*LoadBalancerIPs) AddAddr ¶
func (mips *LoadBalancerIPs) AddAddr(IPNet, LinkDevice string)
AddAddr adds an address to a network LinkDevice
func (*LoadBalancerIPs) Keys ¶
func (mips *LoadBalancerIPs) Keys() (IPNets []string)
Keys of managed ip map | thread safe
func (*LoadBalancerIPs) RemoveAddr ¶
func (mips *LoadBalancerIPs) RemoveAddr(IPNet, LinkDevice string)
RemoveAddr from networks
func (*LoadBalancerIPs) String ¶
func (mips *LoadBalancerIPs) String() string
String from managed ip map | thread safe