3 inherit (import ./internal.nix { inherit lib; }) _ipv6;
8 Creates an `IPv6Address` object from an IPv6 address as a string. If
9 the prefix length is omitted, it defaults to 64. The parser is limited
10 to the first two versions of IPv6 addresses addressed in RFC 4291.
11 The form "x:x:x:x:x:x:d.d.d.d" is not yet implemented. Addresses are
12 NOT compressed, so they are not always the same as the canonical text
13 representation of IPv6 addresses defined in RFC 5952.
18 fromString :: String -> IPv6Address
24 fromString "2001:DB8::ffff/32"
26 address = "2001:db8:0:0:0:0:0:ffff";
33 - [addr] An IPv6 address with optional prefix length.
38 splittedAddr = _ipv6.split addr;
40 addrInternal = splittedAddr.address;
41 prefixLength = splittedAddr.prefixLength;
43 address = _ipv6.toStringFromExpandedIp addrInternal;
46 inherit address prefixLength;