netutil

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrRangeToPrefixes

func AddrRangeToPrefixes(start, end netip.Addr) []netip.Prefix

AddrRangeToPrefixes converts an ip address range into a list of CIDR prefixes.

func ParseIPNumber

func ParseIPNumber(rawIPNumber string) (addr netip.Addr, err error)

ParseIPNumber converts a raw base-10 IP number into an IP address. For example:

42540986356047386130018232263459733504 == 2001:1890:17dd:4500::

For numbers less than the max uint32 an IPv4 address is returned, else an IPv6 address is returned.

func PrefixToAddrRange

func PrefixToAddrRange(prefix netip.Prefix) (start, end netip.Addr)

PrefixToAddrRange returns a CIDR prefix's inclusive ip address range

Types

This section is empty.

Jump to

Keyboard shortcuts

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