subnet

package
v1.27.3 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 4 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BelongsTo

func BelongsTo(parent *net.IPNet, child *net.IPNet) bool

BelongsTo checks if child is a subnet of parent

func Overlap

func Overlap(l, r *net.IPNet) bool

Overlap checks if two subnets overlap

func SplitInto8

func SplitInto8(parent *net.IPNet) ([]*net.IPNet, error)

SplitInto8 splits the parent IPNet into 8 subnets

Types

type CIDRMap added in v1.23.0

type CIDRMap struct {
	// contains filtered or unexported fields
}

CIDRMap is a helper structure to allocate unused CIDRs

func (*CIDRMap) Allocate added in v1.23.0

func (c *CIDRMap) Allocate(from string, mask net.IPMask) (*net.IPNet, error)

func (*CIDRMap) MarkInUse added in v1.23.0

func (c *CIDRMap) MarkInUse(s string) error

Jump to

Keyboard shortcuts

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