When a battery is committed against the person of a custodial officer as defined in Section 831 of the Penal Code, and the person committing the offense knows or reasonably should know that the victim is a custodial officer engaged in the performance of his or her duties, and the custodial officer is engaged in the performance of his or her duties, the offense shall be punished by imprisonment pursuant to subdivision (h) of Section 1170.
Ca. Pen. Code § 243.1