code:
function Xniff::OnData(srcip, srcport, destip, destport, data, datalen)
It's an event, so it's being executed by the object Xniff.
For that you need to include the Xniff DLL in your project, see:
[Release] Xniff (ActiveX Packet Sniffer) - Examples inside