mirror of
https://codeberg.org/lauralani/ipam.git
synced 2024-11-27 14:00:00 +01:00
rename SearchBestSubnet to FindBestSubnet
This commit is contained in:
parent
6154f16e11
commit
386a2bd33f
1 changed files with 2 additions and 2 deletions
|
@ -15,13 +15,13 @@ import (
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SearchBestSubnet tries to load the most fitting IP subnet file
|
// FindBestSubnet tries to load the most fitting IP subnet file
|
||||||
// on disk. It takes an IP object and tries to get the best subnet
|
// on disk. It takes an IP object and tries to get the best subnet
|
||||||
// (meaning the subnet with the smallest subnet size).
|
// (meaning the subnet with the smallest subnet size).
|
||||||
//
|
//
|
||||||
// Returns the best subnet as Subnet object and true if a suitable
|
// Returns the best subnet as Subnet object and true if a suitable
|
||||||
// subnet was found, otherwise an empty Subnet object and false.
|
// subnet was found, otherwise an empty Subnet object and false.
|
||||||
func SearchBestSubnet(ip netip.Addr) (Subnet, bool) {
|
func FindBestSubnet(ip netip.Addr) (Subnet, bool) {
|
||||||
subnets := ListSubnets()
|
subnets := ListSubnets()
|
||||||
var smallestprefix int = 0
|
var smallestprefix int = 0
|
||||||
bestmatch, _ := netip.ParsePrefix("0.0.0.0/32")
|
bestmatch, _ := netip.ParsePrefix("0.0.0.0/32")
|
||||||
|
|
Loading…
Reference in a new issue