iputil

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregatePrefixes added in v1.29.11

func AggregatePrefixes(prefixes []netip.Prefix) []netip.Prefix

AggregatePrefixes aggregates prefixes. Overlapping prefixes are merged.

func AreAddressesFromSameFamily

func AreAddressesFromSameFamily(addresses []netip.Addr) bool

func ArePrefixesFromSameFamily

func ArePrefixesFromSameFamily(prefixes []netip.Prefix) bool

func GroupAddressesByFamily

func GroupAddressesByFamily(vs []netip.Addr) ([]netip.Addr, []netip.Addr)

func GroupPrefixesByFamily added in v1.29.11

func GroupPrefixesByFamily(vs []netip.Prefix) ([]netip.Prefix, []netip.Prefix)

GroupPrefixesByFamily groups prefixes by IP family.

func IsPrefixesAllowAll

func IsPrefixesAllowAll(prefixes []netip.Prefix) bool

IsPrefixesAllowAll returns true if one of the prefixes allows all addresses. FIXME: it should return true if the aggregated prefix allows all addresses. Now it only checks one by one.

func ParseAddresses

func ParseAddresses(vs []string) ([]netip.Addr, error)

func ParsePrefix added in v1.29.3

func ParsePrefix(v string) (netip.Prefix, error)

ParsePrefix parses a CIDR string and returns a Prefix.

Types

type Family

type Family string
const (
	IPv4 Family = "IPv4"
	IPv6 Family = "IPv6"
)

func FamilyOfAddr

func FamilyOfAddr(addr netip.Addr) Family

Jump to

Keyboard shortcuts

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