nnip

package
v1.18.9 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IpToAddr

func IpToAddr(slice net.IP) netip.Addr

IpToAddr converts the net.IP to netip.Addr. If slice's length is not 4 or 16, IpToAddr returns netip.Addr{}

func PrefixCompare added in v1.18.8

func PrefixCompare(p, p2 netip.Prefix) int

PrefixCompare returns an integer comparing two prefixes. The result will be 0 if p == p2, -1 if p < p2, and +1 if p > p2. modify from https://github.com/golang/go/issues/61642#issuecomment-1848587909

func UnMasked

func UnMasked(p netip.Prefix) netip.Addr

UnMasked returns p's last IP address. If p is invalid, UnMasked returns netip.Addr{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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