cidr

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIPv4Cidrs added in v1.2.0

func GetIPv4Cidrs(cidrs []string) ([]string, error)

GetIPv4Cidrs gets the IPv4 CIDRs from a string slice.

func GetIPv6Cidrs added in v1.2.0

func GetIPv6Cidrs(cidrs []string) ([]string, error)

GetIPv6Cidrs gets the IPv6 CIDRs from a string slice.

func SplitIntoSubnetsIPv4

func SplitIntoSubnetsIPv4(cidrBlock string, numSubnets int) ([]*net.IPNet, error)

SplitIntoSubnetsIPv4 splits a IPv4 CIDR into a specified number of subnets. If the number of required subnets isn't a power of 2 then then CIDR will be split into the the next highest power of 2 and you will end up with unused ranges. NOTE: this code is adapted from kops https://github.com/kubernetes/kops/blob/c323819e6480d71bad8d21184516e3162eaeca8f/pkg/util/subnet/subnet.go#L46

Types

This section is empty.

Jump to

Keyboard shortcuts

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