utils

package
v0.31.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrBits

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

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

func IncIP

func IncIP(ip net.IP)

func Ip2IPnet

func Ip2IPnet(ip net.IP) *net.IPNet

func IsLocallyAssigned

func IsLocallyAssigned(addr, lower, upper net.IP) bool

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