NEEDED: code to generate IP/network statistics such as traffic, packets sent etc

I need code to generate statistics such as packets sent, received etc on a network. It should say what type of files (HTTP, RTP, UDP etc) are being sent and how busy the network is or any statistics along these lines. There are programs: IP monitor, IP watcher that do this but I need the code. Where can I get it?

PLEASE HELP URGENT
[343 byte] By [cia] at [2007-11-16 15:17:13]
# 1 Re: NEEDED: code to generate IP/network statistics such as traffic, packets sent etc
Use WSAIoctl API from winsock2.0 with SIO_RCVALL option to receive all packets from network. Also initialise appropriate headers before receiving.
kiran
kirannapit at 2007-11-9 13:45:37 >
# 2 Re: NEEDED: code to generate IP/network statistics such as traffic, packets sent etc
[Moved thread]
Andreas Masur at 2007-11-9 13:46:37 >
# 3 Re: NEEDED: code to generate IP/network statistics such as traffic, packets sent etc
maybe this ( http://www.dev-archive.com/Cpp/I-N/network/tcpip/article.php/c5413) will help
Mathew Joy at 2007-11-9 13:47:47 >