ipnet

package
v0.3.12-test Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Increment

func Increment(ip net.IP)

Increment increments the given net.IP by one bit. Incrementing the last IP in an IP space (IPv4, IPV6) is undefined.

Types

type Generator

type Generator struct {
	*net.IPNet
	// contains filtered or unexported fields
}

Generator is a net.IPnet wrapper that you can iterate over

func New

func New(cidr string) (*Generator, error)

New creates a new Generator from a CIDR string, or an error if the CIDR is invalid.

func NewFromIPNet

func NewFromIPNet(ipNet *net.IPNet) *Generator

NewFromIPNet creates a new Generator from a *net.IPNet

func (*Generator) First

func (g *Generator) First() net.IP

First returns the first net.IP in the subnet

func (*Generator) Next

func (g *Generator) Next() net.IP

Next returns the next net.IP in the subnet

Jump to

Keyboard shortcuts

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