wifi detect when pinged

I want to use a ping to the wifi board to activate a GPIO.
i can use the wifiserver to detect connections on port 80 but this is a bit clumsy, ideally i would like to ping the device and have the GPIO activated.
I have seen plenty of examples of how to ping some thing but not how to detect that I have been pinged.
any suggestions?
thanks