Mitigation of Cyber-physical Attacks in Industry 4.0 using Secure Function Blocks