util

package
v3.4.7 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstIPInSubnet

func FirstIPInSubnet(addr *net.IPNet) (net.IP, error)

FirstIPInSubnet gets the first IP in a subnet

func GenerateNetworkFilters

func GenerateNetworkFilters(filters map[string][]string) ([]types.FilterFunc, error)

func GetLiveNetworkNames

func GetLiveNetworkNames() ([]string, error)

GetLiveNetworkNames returns a list of network interface names on the system

func GetLiveNetworkSubnets

func GetLiveNetworkSubnets() ([]*net.IPNet, error)

GetLiveNetworkSubnets returns a slice of subnets representing what the system has defined as network interfaces

func GetRandomIPv6Subnet

func GetRandomIPv6Subnet() (net.IPNet, error)

GetRandomIPv6Subnet returns a random internal ipv6 subnet as described in RFC3879.

func IsIPv4

func IsIPv4(netIP net.IP) bool

IsIPv4 returns true if netIP is IPv4.

func IsIPv6

func IsIPv6(netIP net.IP) bool

IsIPv6 returns true if netIP is IPv6.

func LastIPInSubnet

func LastIPInSubnet(addr *net.IPNet) (net.IP, error)

LastIPInSubnet gets the last IP in a subnet

func NetworkIntersectsWithNetworks

func NetworkIntersectsWithNetworks(n *net.IPNet, networklist []*net.IPNet) bool

func NextSubnet

func NextSubnet(subnet *net.IPNet) (*net.IPNet, error)

NextSubnet returns subnet incremented by 1

Types

This section is empty.

Jump to

Keyboard shortcuts

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