cidr

package
v0.6.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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