xnet

package
v0.3.5-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPrivateIPNet added in v0.2.8

func IsPrivateIPNet(ipn *net.IPNet) bool

func ParseCIDR

func ParseCIDR(s string) (*IP, *IPNet, error)

Types

type IP

type IP struct {
	IP net.IP
}

func ParseIP

func ParseIP(s string) IP

func Uint32ToIP

func Uint32ToIP(n uint32) IP

func (IP) Equal

func (ip IP) Equal(other IP) bool

func (IP) Isv4

func (ip IP) Isv4() bool

func (*IP) Scan

func (ip *IP) Scan(src interface{}) error

func (IP) String

func (ip IP) String() string

func (*IP) ToUint32

func (ip *IP) ToUint32() uint32

func (*IP) Value

func (ip *IP) Value() (driver.Value, error)

type IPMask

type IPMask struct {
	IPMask net.IPMask
}

func (*IPMask) Size

func (mask *IPMask) Size() (ones, bits int)

func (*IPMask) ToUint32

func (mask *IPMask) ToUint32() uint32

type IPNet

type IPNet struct {
	IPNet net.IPNet
}

func (*IPNet) BroadcastAddr

func (net *IPNet) BroadcastAddr() IP

func (*IPNet) FirstUsable

func (net *IPNet) FirstUsable() IP

func (*IPNet) IP

func (net *IPNet) IP() *IP

func (*IPNet) LastUsable

func (net *IPNet) LastUsable() IP

func (*IPNet) Mask

func (net *IPNet) Mask() *IPMask

func (*IPNet) NetworkAddr

func (net *IPNet) NetworkAddr() IP

func (*IPNet) String

func (net *IPNet) String() string

Jump to

Keyboard shortcuts

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