Documentation
¶
Overview ¶
Package iputil provides utilities for IPv4/IPv6 related utils
Index ¶
- func GenerateIPs(ipBlock string, n int) []string
- func GenerateIPsWithStep(startIP string, count int, stepIP string) ([]string, error)
- func GenerateIPv6s(baseIP net.IP, n int) ([]string, error)
- func GenerateIPv6sWithStep(startIP string, count int, stepIP string) ([]string, error)
- func GenerateMACs(startMAC string, count int, stepMACStr string) []string
- func IPEqual(got, want string) bool
- func IncrementMAC(startMAC string, i int) (string, error)
- func NextIPMultiSteps(ip net.IP, count int) net.IP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateIPs ¶
GenerateIPs creates list of n IPs using ipBlock
func GenerateIPsWithStep ¶
GenerateIPsWithStep creates a list of IPv4 addresses. Returns a slice of IPv4 address strings or an error if inputs are invalid.
func GenerateIPv6s ¶
GenerateIPv6s generates a list of consecutive IPv6 addresses starting from a given base IP.
func GenerateIPv6sWithStep ¶
GenerateIPv6sWithStep creates a list of IPv6 addresses. Returns a slice of IPv6 address strings or an error if inputs are invalid.
func GenerateMACs ¶
GenerateMACs returns a slice of MAC address strings. Returns generated MAC addresses or an empty slice on parse errors.
func IPEqual ¶
IPEqual compares two strings by parsing them as IP addresses for semantic equality. If parsing fails for either, it falls back to a standard direct string comparison.
func IncrementMAC ¶
IncrementMAC increments the given MAC address by `i` and returns the result. This is just a convenience wrapper around GenerateMACs.
Types ¶
This section is empty.