Dynamical structure factor of one-dimensional hard rods