Skip to main content

ipAddressSet

ipAddressSet(ipSubnets: Bag<IpSubnet>) : Set<IpAddress>

Returns a set of IP addresses from a collection of subnets, such as ipAddressSet([ipSubnet("1.2.3.4/24"), ipSubnet("5.6.7.8/24")]).

warning

ipSubnets must only contain IPv4 subnets. Providing an IPv6 subnet will cause a runtime error. If the set requires more than 20,000 subnets to express, then a runtime error will occur.

A bag of IpSubsets is different than a set of IpAddresses. For example, if subnets = bag([ipSubnet("1.2.3.0/32"), ipSubnet("1.2.3.1/32")]), then

  • toString(subnets) returns "[1.2.3.0/32, 1.2.3.1/32]" but
  • toString(ipAddressSet(subnets)) returns "[1.2.3.0/31]".

See also

Types

Functions