monitoring traffic on specific port
I've been working on building a program that monitors the network traffic on my local machine. All this program does is:
- shows the total amount of transmitted and received data on an interface eg.(eth1)
- shows the overall incoming and outgoing data transfer rate on an interface (realtime)
I can do the above by reading the /proc/net/dev system file. But now I would like to add another function where my program can show the incoming and outgoing transfer rate of each port for example port 80 or port 25 (specified by user). I don't think there is any information in the /proc/net system files that can be used to show the transfer rate on each port. What could be the simplest way to do this?
Im using python as my programming language for this program btw.
Last edited by lildee; 10-03-2009 at 05:24 AM.