netutils

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2015 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

netutils

Miscellaneous network utilities

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateDefaultGateway

func GenerateDefaultGateway(sna *net.IPNet) net.IP

Generate the default gateway IP Address for a subnet

func IPToUint32

func IPToUint32(ip net.IP) uint32

func Uint32ToIP

func Uint32ToIP(u uint32) net.IP

Types

type IPAllocator

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

func NewIPAllocator

func NewIPAllocator(network string, inUse []string) (*IPAllocator, error)

func (*IPAllocator) GetIP

func (ipa *IPAllocator) GetIP() (*net.IPNet, error)

func (*IPAllocator) ReleaseIP

func (ipa *IPAllocator) ReleaseIP(ip *net.IPNet) error

type SubnetAllocator

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

func NewSubnetAllocator

func NewSubnetAllocator(network string, capacity uint, inUse []string) (*SubnetAllocator, error)

func (*SubnetAllocator) GetNetwork

func (sna *SubnetAllocator) GetNetwork() (*net.IPNet, error)

func (*SubnetAllocator) ReleaseNetwork

func (sna *SubnetAllocator) ReleaseNetwork(ipnet *net.IPNet) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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