Counting ICMP ping failures

Hello,

I'm after some beginner's advice on programming the Arduino, I want to continuously ping a LAN IP every so often and switch a relay (to power cycle a modem) if it doesn't get a response from say the last 10 pings.

I've pored over Blake Foster's ICMP ping library

http://playground.arduino.cc/Code/ICMPPing

But I can't figure out how I could count successive ping failures.

My hardware is an UNO with the Ethernet Shield.

Thanks,

You mean repeatedly, not continuously. Continuously pinging is called a denial of service
attack!