So anyways, the question is how can I get in real time data from tcpdump, very, VERY fast?
If you just want to know that, then I'm sorry I don't know. :)
If you consider the TMTOWTDI, here is a couple of thoughs for you:
-
If you have a REALLY loaded network, write your own (or use one of the existing) daemons in C to store the data into the database (like MySQL) for example. You can later use Perl to extract the data, generate reports, and/or do any other fancy thingies.
-
Since you've mentioned that you are using a Linux box, you can use iptables(8) to do the counting. Check the manual for the --uid-owner and --gid-owner parameters. In this way, you will not have to write any C. You will also have very exact data and you will be use your hardware with most efficiency, since it'll be the kernel itself doing your job. :)
P.S.: Sorry for kind of off-topic answer though. :)
Leonid Mamtchenkov