ADDED:
* num-addrs subcommand, to get the number of hosts/addresses in a given
  prefix length
* get-net subcommand, to more easily get a single subnet from either the
  beginning or the end of a prefix. (MUCH FASTER than CIDR-splitting!)
This commit is contained in:
brent saner
2025-04-13 18:25:32 -04:00
parent c05f9c4d47
commit 860ad5842b
16 changed files with 334 additions and 78 deletions

View File

@@ -5,6 +5,7 @@ import (
`net/netip`
`sync`
`github.com/go-playground/validator/v10`
`github.com/go-resty/resty/v2`
)
@@ -39,8 +40,12 @@ var (
)
var (
// TODO
cacheLock sync.RWMutex
// validate *validator.Validate = validator.New(validator.WithRequiredStructEnabled(), validator.WithPrivateFieldValidation())
validate *validator.Validate = validator.New(validator.WithRequiredStructEnabled())
)
var (
cacheLock sync.RWMutex // TODO
cacheClient *resty.Client
// IPv4: https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml#iana-ipv4-special-registry-1
// IPv6: https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml