utils

package
v0.19.87 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrBits added in v0.19.77

func AddrBits(ip net.IP) int

Return the length of a full prefix (no subnetting) for the given IP address. Returns 32 for ipv4 addresses, and 128 for ipv6 addresses.

func AllInterfaceAddrs

func AllInterfaceAddrs() ([]net.Addr, error)

Return all IP addresses that are currently in use on the local host.

This function differs from net.InterfaceAddrs() in that peer addresses for point-to-point interfaces are returned by this function, in addition to local interface addresses.

func GetDialIP added in v0.19.77

func GetDialIP(addr string) (net.IP, *net.IPNet, error)

func IncIP added in v0.16.45

func IncIP(ip net.IP)

func NextIP

func NextIP(lower, upper net.IP) (net.IP, error)

return the next available IP address in the range of provided IPs

Types

This section is empty.

Jump to

Keyboard shortcuts

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