common

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: GPL-2.0 Imports: 3 Imported by: 7

README

Common Utilities for IPREF

This package contains common utilities between the various IPREF Go packages (gw, dns-agent, etc.).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IP

type IP netip.Addr // IPv4 or IPv6 address; Zone() must be ""

func IPBits

func IPBits(l, n int) IP

func IPFromSlice

func IPFromSlice(ip []byte) IP

The slice must be 4 or 16 bytes

func IPFromUint32

func IPFromUint32(ip uint32) IP

func IPNum

func IPNum(l int, n uint32) IP

func MustParseIP

func MustParseIP(s string) IP

func ParseIP

func ParseIP(s string) (IP, error)

func (IP) Add

func (a IP) Add(b IP) IP

func (IP) And

func (a IP) And(b IP) IP

func (IP) AsSlice

func (ip IP) AsSlice() []byte

func (IP) AsSlice4

func (ip IP) AsSlice4() []byte

func (IP) AsSlice6

func (ip IP) AsSlice6() []byte

func (IP) AsUint32

func (ip IP) AsUint32() uint32

func (IP) ByteFromEnd

func (ip IP) ByteFromEnd(i int) byte

func (IP) Is4

func (ip IP) Is4() bool

func (IP) Is6

func (ip IP) Is6() bool

func (IP) IsLinkLocal

func (ip IP) IsLinkLocal() bool

func (IP) IsZero

func (ip IP) IsZero() bool

Tests if the IP is equal to the zero-initialized value. This is distinct from the zero IP address (eg. 0.0.0.0 or ::).

func (IP) IsZeroAddr

func (ip IP) IsZeroAddr() bool

func (IP) Len

func (ip IP) Len() int

func (IP) Not

func (a IP) Not() IP

func (IP) Or

func (a IP) Or(b IP) IP

func (IP) String

func (ip IP) String() string

func (IP) Ver

func (ip IP) Ver() int

func (IP) XOr

func (a IP) XOr(b IP) IP

Jump to

Keyboard shortcuts

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