Documentation
¶
Overview ¶
Package netutil provides network utility functions for CIDR and IP address operations. It is primarily used for Aquanaut's IPAM functionality to handle CIDR overlap detection and boundary calculations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CIDROverlaps ¶
CIDROverlaps checks if two CIDRs overlap. This function properly detects cases where the network addresses don't contain each other, but the CIDR ranges still overlap.
Parameters: - cidr1, cidr2: The two CIDRs to check for overlap
Returns: - true if the CIDRs overlap, false otherwise - If either CIDR is invalid, returns false - If the CIDRs are from different address families (IPv4 vs IPv6), returns false
func CalculateLastIP ¶
CalculateLastIP calculates the last IP address in a network. This is used to check for partial CIDR overlaps and boundary conditions.
Parameters: - network: The network to calculate the last IP for
Returns: - The last IP address in the network
Types ¶
This section is empty.