ip

package
v1.5.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

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