Magnetic fields of the terrestrial planets