Shaminda Eranga took four wickets as Sri Lanka took control on day one of the first Test against Bangladesh in Dhaka.