I've seen a few methods to detect ARP Spoofing attacks through code(such as this), and ways to defend against these attacks through software and switches (like arp spoofing protection on LAN). How would I prevent arp spoofing with my own code(conceptually)? I wasn't sure if this would be better for Stackoverflow or this site.
EDIT: I don't care so much about any specific language, psuedocode would be great but I'm also fine with just the conceptual side of things.