Theory of generation of bow-shock-associated hydromagnetic waves in the upstream interplanetary medium