import ipaddress


def _calculate_address_pool(addrmask, ipv6=False):
    """
    Return a pool of addresses contained in the network.

    @param addrmask: Network in IP/mask format.
    @return: A list of ip addresses
    """
    if ipv6:
        netobj = ipaddress.IPv6Network(addrmask, strict=False)
    else:
        netobj = ipaddress.IPv4Network(addrmask, strict=False)

    return [format(addr) for addr in netobj]