Print the min & max IPs

This commit is contained in:
niten 2023-11-03 12:29:09 -07:00
parent 70a1a6d6af
commit 7ae766bd8a
1 changed files with 3 additions and 5 deletions

View File

@ -49,9 +49,7 @@ in rec {
in intToIpv4
(leftShift (rightShift fullMask insignificantBits) insignificantBits);
networkMinIp = network:
intToIpv4
(1 + (ipv4ToInt (getNetworkBase (trace "NETWORK: ${network}" network))));
networkMinIp = network: intToIpv4 (1 + (ipv4ToInt (getNetworkBase network)));
networkMaxIp = network:
intToIpv4 (rightPadBits (ipv4ToInt (getNetworkBase network))
@ -67,8 +65,8 @@ in rec {
ip-int = ipv4ToInt ip;
net-min = networkMinIp network;
net-max = networkMaxIp network;
in (ip-int >= (ipv4ToInt networkMinIp))
&& (ip-int <= (ipv4ToInt networkMaxIp));
in (ip-int >= (ipv4ToInt (trace "MIN-IP: ${networkMinIp}" networkMinIp)))
&& (ip-int <= (ipv4ToInt (trace "MIN-IP: ${networkMinIp}" networkMaxIp)));
getNetworkMask = network: toInt (elemAt (splitString "/" network) 1);