Control of infection dynamics, with applications to the HIV disease