inetutil

package
v2.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToUint32

func BytesToUint32(b []byte) uint32

BytesToUint32 converts a 4-byte big-endian slice to uint32.

func IP4ToString

func IP4ToString(b []byte) string

IP4ToString formats 4 bytes as a dotted-quad IP string.

func Ipv4ToUint32

func Ipv4ToUint32(addr string) uint32

func ParseCIDR

func ParseCIDR(cidr string) (net.IP, *net.IPNet, error)

ParseCIDR parses a CIDR string and returns the IP and network.

func ParsePrivateAddress

func ParsePrivateAddress(addr string) ([]byte, error)

func ParsePrivateIP

func ParsePrivateIP(addr string) ([]byte, error)

ParsePrivateIP validates that addr is a private IPv4 address (RFC 1918) and returns its 4-byte representation.

Private ranges:

  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16

func Uint32ToBytes

func Uint32ToBytes(v uint32) []byte

Uint32ToBytes converts a uint32 to a 4-byte big-endian slice.

func Uint32ToIp

func Uint32ToIp(v uint32) net.IP

func Uint32ToIpv4

func Uint32ToIpv4(v uint32) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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