ip

package
v1.5.2-dev Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2019 License: Apache-2.0 Imports: 6 Imported by: ? 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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllOnesAddr

func AllOnesAddr(subnet *net.IPNet) net.IP

AllOnesAddr returns the all-ones address for a subnet

func AllZerosAddr

func AllZerosAddr(subnet *net.IPNet) net.IP

AllZerosAddr returns the all-zeros address for a subnet

func Empty

func Empty(i net.IPNet) bool

Empty determines if net.IPNet is empty

func IsRoutableIP

func IsRoutableIP(ip net.IP, subnet *net.IPNet) bool

func IsUnspecifiedIP

func IsUnspecifiedIP(ip net.IP) bool

func IsUnspecifiedSubnet

func IsUnspecifiedSubnet(n *net.IPNet) bool

func ParseIPandMask

func ParseIPandMask(s string) (net.IPNet, error)

ParseIPandMask parses a CIDR format address (e.g. 1.1.1.1/8)

Types

type Range

type Range struct {
	FirstIP net.IP `vic:"0.1" scope:"read-only" key:"first"`
	LastIP  net.IP `vic:"0.1" scope:"read-only" key:"last"`
}

func NewRange

func NewRange(first, last net.IP) *Range

func ParseRange

func ParseRange(r string) *Range

func (*Range) Equal

func (i *Range) Equal(other *Range) bool

func (*Range) MarshalText

func (i *Range) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface

func (*Range) Network

func (i *Range) Network() *net.IPNet

Network returns the network that this range represents, if any

func (*Range) Overlaps

func (i *Range) Overlaps(other Range) bool

func (*Range) String

func (i *Range) String() string

func (*Range) UnmarshalText

func (i *Range) UnmarshalText(text []byte) error

UmarshalText implements the encoding.TextUnmarshaler interface

Jump to

Keyboard shortcuts

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