Documentation
¶
Overview ¶
Package ipv4utils provides utilities for working with IPv4 addresses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Merge ¶
Merge merges an IP to a value.
Merging an IP allows for the use of operations on the IP.
func Split ¶
Split splits a value into an IP.
After merging an IP to perform operations on it, Split can be used to put the IP back into a slice.
func Subnet ¶
Subnet subnets a network with the provided amount of bits.
The network IP may have host bits set, as long as this address is a valid network address within the new subnet mask.
This means that you can provide an offset for subnetting through the network IP:
Network IP: 192.168.1.128/24, bits: 1 -> First subnet is 192.168.1.128/25, not 192.168.1.0/25
The channel to provide the subnets is unbuffered and closed once subnetting is completed.
Types ¶
This section is empty.