package merge
import "github.com/open-policy-agent/opa/internal/cidr/merge"
Package merge provides helper functions for merging a list of IP addresses and subnets into the smallest possible list of CIDRs. Original Implementation: https://github.com/cilium/cilium
Index ¶
- func GetAddressRange(ipNet net.IPNet) (net.IP, net.IP)
- func GetPreviousIP(ip net.IP) net.IP
- func RangeToCIDRs(firstIP, lastIP net.IP) []*net.IPNet
Functions ¶
func GetAddressRange ¶
GetAddressRange returns the first and last addresses in the given CIDR range.
func GetPreviousIP ¶
GetPreviousIP returns the previous IP from the given IP address.
func RangeToCIDRs ¶
RangeToCIDRs converts the range of IPs covered by firstIP and lastIP to a list of CIDRs that contains all of the IPs covered by the range.
Source Files ¶
- Version
- v1.4.2 (latest)
- Published
- May 2, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 6 hours ago –
Tools for package owners.