Documentation
¶
Index ¶
- func BytesToUint32(b []byte) uint32
- func IP4ToString(b []byte) string
- func Ipv4ToUint32(addr string) uint32
- func ParseCIDR(cidr string) (net.IP, *net.IPNet, error)
- func ParsePrivateAddress(addr string) ([]byte, error)
- func ParsePrivateIP(addr string) ([]byte, error)
- func Uint32ToBytes(v uint32) []byte
- func Uint32ToIp(v uint32) net.IP
- func Uint32ToIpv4(v uint32) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToUint32 ¶
BytesToUint32 converts a 4-byte big-endian slice to uint32.
func IP4ToString ¶
IP4ToString formats 4 bytes as a dotted-quad IP string.
func Ipv4ToUint32 ¶
func ParsePrivateAddress ¶
func ParsePrivateIP ¶
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 ¶
Uint32ToBytes converts a uint32 to a 4-byte big-endian slice.
func Uint32ToIp ¶
func Uint32ToIpv4 ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.