Quasi-monoenergetic ion beam acceleration by laser-driven shock and solitary waves in near-critical plasmas