dualstack

package
v1.14.3-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package dualstack provides tools for managing both ipv4 and ipv6 addresses

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPPool

type IPPool struct {
	IPv4IPPool *ippool.IPPool
	IPv6IPPool *ippool.IPPool
}

IPPool holds available IPv4 and IPv6 addresses in the structure of red-black tree

func New

func New() *IPPool

New instantiates a dualstack ip pool as red-black tree

func (*IPPool) AddIPNet

func (p *IPPool) AddIPNet(ipNet *net.IPNet)

AddIPNet - adds ip addresses from network to the pool

func (*IPPool) AddIPNetString

func (p *IPPool) AddIPNetString(ipNetString string)

AddIPNetString - adds ip addresses from network to the pool by string value

func (*IPPool) ContainsIP

func (p *IPPool) ContainsIP(ip net.IP) bool

ContainsIP checks that pool contains ip

func (*IPPool) ContainsIPNet

func (p *IPPool) ContainsIPNet(ipNet *net.IPNet) bool

ContainsIPNet checks that pool contains ip net

func (*IPPool) ContainsIPNetString

func (p *IPPool) ContainsIPNetString(ipNetRaw string) bool

ContainsIPNetString parses ip net and checks that pool contains ip net

func (*IPPool) ContainsIPString

func (p *IPPool) ContainsIPString(in string) bool

ContainsIPString parses ip string and checks that pool contains ip

func (*IPPool) PullIP

func (p *IPPool) PullIP(ip net.IP) (*net.IPNet, error)

PullIP - returns requested IP address from the pool

func (*IPPool) PullIPString

func (p *IPPool) PullIPString(in string) (*net.IPNet, error)

PullIPString - returns requested IP address from the pool by string

Jump to

Keyboard shortcuts

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