Documentation ¶
Index ¶
- func ClearBitsOutsideRange(ipAllocMap *bitset.BitSet, ipRange string, subnetLen uint)
- func ClearReservedEntries(b *bitset.BitSet, subnetLen uint)
- func ConvertBandwidth(bandwidth string) int64
- func CreateBitset(numBitsWide uint) *bitset.BitSet
- func GetFirstLocalAddr() (string, error)
- func GetHostIntfName(intf string) string
- func GetIPAddrRange(ipCIDR string, subnetLen uint) string
- func GetIPNumber(subnetIP string, subnetLen uint, allocSubnetLen uint, hostIP string) (uint, error)
- func GetIPv6HostID(subnetAddr string, subnetLen uint, hostAddr string) (string, error)
- func GetInterfaceIP(linkName string) (string, error)
- func GetLocalAddrList() ([]string, error)
- func GetMyAddr() (string, error)
- func GetNetlinkAddrList() ([]string, error)
- func GetNextIPv6HostID(hostID, subnetAddr string, subnetLen uint, IPv6AllocMap map[string]bool) (string, error)
- func GetSubnetAddr(ipStr string, length uint) string
- func GetSubnetIP(subnetIP string, subnetLen uint, allocSubnetLen, hostID uint) (string, error)
- func GetSubnetIPv6(subnetAddr string, subnetLen uint, hostID string) (string, error)
- func HostIfToIP(hostIf string) (string, error)
- func InitSubnetBitset(b *bitset.BitSet, subnetLen uint)
- func IsAddrLocal(findAddr string) bool
- func IsIPv6(ip string) bool
- func IsOverlappingSubnet(inputSubnet string, existingSubnet string) bool
- func IsOverlappingSubnetv6(inputIPv6Subnet string, existingIPv6Subnet string) bool
- func ParseCIDR(cidrStr string) (string, uint, error)
- func PortToHostIPMAC(port int) (string, string)
- func ReserveIPv6HostID(hostID string, IPv6AllocMap *map[string]bool)
- func SetBitsOutsideRange(ipAllocMap *bitset.BitSet, ipRange string, subnetLen uint)
- func SetIPMasquerade(intf, netmask string) error
- func SetInterfaceIP(name string, ipstr string) error
- func SetInterfaceMac(name string, macaddr string) error
- func ValidateNetworkRangeParams(ipRange string, subnetLen uint) error
- type TagRange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearBitsOutsideRange ¶
ClearBitsOutsideRange sets all IPs outside range as used
func ClearReservedEntries ¶
ClearReservedEntries clears reserved bits
func ConvertBandwidth ¶
ConvertBandwidth will change the format of the bandwidth to int64 format and return the updated bw. eg:- 2 kb bandwidth will be converted to 2*1024 and the result in Int64 format will be returned.
func CreateBitset ¶
CreateBitset initializes a bit set with 2^numBitsWide bits
func GetFirstLocalAddr ¶
GetFirstLocalAddr returns the first ip address
func GetHostIntfName ¶
GetHostIntfName gets the host access interface name
func GetIPAddrRange ¶
GetIPAddrRange returns IP CIDR as a ip address range
func GetIPNumber ¶
GetIPNumber obtains the host id from the host IP. SEe `GetSubnetIP` for more information.
func GetIPv6HostID ¶
GetIPv6HostID obtains the host id from the host IP. SEe `GetSubnetIP` for more information.
func GetInterfaceIP ¶
GetInterfaceIP obtains the ip addr of a local interface on the host.
func GetLocalAddrList ¶
GetLocalAddrList returns a list of local IP addresses
func GetNetlinkAddrList ¶
GetNetlinkAddrList returns a list of local IP addresses
func GetNextIPv6HostID ¶
func GetNextIPv6HostID(hostID, subnetAddr string, subnetLen uint, IPv6AllocMap map[string]bool) (string, error)
GetNextIPv6HostID returns the next available hostId in the AllocMap
func GetSubnetAddr ¶
GetSubnetAddr returns a subnet given a subnet range
func GetSubnetIP ¶
GetSubnetIP given a subnet IP and host identifier, calculates an IP within the subnet for use.
func GetSubnetIPv6 ¶
GetSubnetIPv6 given a subnet IP and host identifier, calculates an IPv6 address within the subnet for use.
func InitSubnetBitset ¶
InitSubnetBitset initializes a bit set with 2^(32 - subnetLen) bits
func IsOverlappingSubnet ¶
IsOverlappingSubnet verifies the Overlapping of subnet
func IsOverlappingSubnetv6 ¶
IsOverlappingSubnetv6 verifies the Overlapping of subnet for v6 networks
func PortToHostIPMAC ¶
PortToHostIPMAC gets IP and MAC based on port number
func ReserveIPv6HostID ¶
ReserveIPv6HostID sets the hostId in the AllocMap
func SetBitsOutsideRange ¶
SetBitsOutsideRange sets all IPs outside range as used
func SetIPMasquerade ¶
SetIPMasquerade sets a ip masquerade rule.
func SetInterfaceIP ¶
SetInterfaceIP : Set IP address of an interface
func SetInterfaceMac ¶
SetInterfaceMac : Set mac address of an interface
func ValidateNetworkRangeParams ¶
ValidateNetworkRangeParams verifies the network range format