lib: ip: add 'isValidIp4'
This commit is contained in:
parent
5a06ab74bb
commit
0112dd87ac
|
@ -124,4 +124,7 @@ rec {
|
||||||
(zipListsWith (lhs: rhs: lhs - rhs) to from);
|
(zipListsWith (lhs: rhs: lhs - rhs) to from);
|
||||||
in
|
in
|
||||||
map (nthInRange4 arg) (range 0 numAddresses);
|
map (nthInRange4 arg) (range 0 numAddresses);
|
||||||
|
|
||||||
|
isValidIp4 = ip:
|
||||||
|
(builtins.all (n: n >= 0 && n < 256) ip) && (builtins.length ip == 4);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue