Print the min & max IPs
This commit is contained in:
parent
70a1a6d6af
commit
7ae766bd8a
@ -49,9 +49,7 @@ in rec {
|
|||||||
in intToIpv4
|
in intToIpv4
|
||||||
(leftShift (rightShift fullMask insignificantBits) insignificantBits);
|
(leftShift (rightShift fullMask insignificantBits) insignificantBits);
|
||||||
|
|
||||||
networkMinIp = network:
|
networkMinIp = network: intToIpv4 (1 + (ipv4ToInt (getNetworkBase network)));
|
||||||
intToIpv4
|
|
||||||
(1 + (ipv4ToInt (getNetworkBase (trace "NETWORK: ${network}" network))));
|
|
||||||
|
|
||||||
networkMaxIp = network:
|
networkMaxIp = network:
|
||||||
intToIpv4 (rightPadBits (ipv4ToInt (getNetworkBase network))
|
intToIpv4 (rightPadBits (ipv4ToInt (getNetworkBase network))
|
||||||
@ -67,8 +65,8 @@ in rec {
|
|||||||
ip-int = ipv4ToInt ip;
|
ip-int = ipv4ToInt ip;
|
||||||
net-min = networkMinIp network;
|
net-min = networkMinIp network;
|
||||||
net-max = networkMaxIp network;
|
net-max = networkMaxIp network;
|
||||||
in (ip-int >= (ipv4ToInt networkMinIp))
|
in (ip-int >= (ipv4ToInt (trace "MIN-IP: ${networkMinIp}" networkMinIp)))
|
||||||
&& (ip-int <= (ipv4ToInt networkMaxIp));
|
&& (ip-int <= (ipv4ToInt (trace "MIN-IP: ${networkMinIp}" networkMaxIp)));
|
||||||
|
|
||||||
getNetworkMask = network: toInt (elemAt (splitString "/" network) 1);
|
getNetworkMask = network: toInt (elemAt (splitString "/" network) 1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user