iputils

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareBytes

func CompareBytes(b1 []byte, b2 []byte) int

func CompareIP

func CompareIP(ip1 string, ip2 string) int

func CompareLong

func CompareLong(i1 string, i2 string) int

func IsIPv4

func IsIPv4(ipString string) bool

func IsIPv6

func IsIPv6(ipString string) bool

func IsSameVersion

func IsSameVersion(ip1 string, ip2 string) bool

func IsValid

func IsValid(ipString string) bool

func ToBytes

func ToBytes(ip string) []byte

func ToHex

func ToHex(ip string) string

func ToLittleLong

func ToLittleLong(ip string) string

func ToLong

func ToLong(ip string) string

Types

type CIDR

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

func ParseCIDR

func ParseCIDR(s string) (*CIDR, error)

func (*CIDR) Contains

func (this *CIDR) Contains(ip net.IP) bool

func (*CIDR) From

func (this *CIDR) From() net.IP

func (*CIDR) IsIPv4

func (this *CIDR) IsIPv4() bool

func (*CIDR) IsIPv6

func (this *CIDR) IsIPv6() bool

func (*CIDR) String

func (this *CIDR) String() string

func (*CIDR) To

func (this *CIDR) To() net.IP

type IP

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

func NewIP

func NewIP(rawIP net.IP) IP

func ParseIP

func ParseIP(ipString string) IP

func (IP) Between

func (this IP) Between(ipFrom IP, ipTo IP) bool

func (IP) Compare

func (this IP) Compare(anotherIP IP) int

func (IP) IsIPv4

func (this IP) IsIPv4() bool

func (IP) IsIPv6

func (this IP) IsIPv6() bool

func (IP) IsValid

func (this IP) IsValid() bool

func (IP) Mod

func (this IP) Mod(d int) int

func (IP) Raw

func (this IP) Raw() net.IP

func (IP) String

func (this IP) String() string

func (IP) ToLong

func (this IP) ToLong() string

Jump to

Keyboard shortcuts

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