I'd like to propose having extlib::parse_cidr() function which returns a Structure similar to what ipcalc.pl returns (with bit values stripped):
➜ ipcalc 192.168.0.0/24
Address: 192.168.0.0
Netmask: 255.255.255.0
Wildcard: 0.0.0.255
Network: 192.168.0.0/24
HostMin: 192.168.0.1
HostMax: 192.168.0.254
Broadcast: 192.168.0.255
Hosts/Net: 254
My original problem was to get first usable IP in a routable range I have.
Please add your ideas and use-cases in comments below
I'd like to propose having
extlib::parse_cidr()function which returns a Structure similar to whatipcalc.plreturns (with bit values stripped):My original problem was to get first usable IP in a routable range I have.
Please add your ideas and use-cases in comments below