Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Real time reading of multiple pcap 'instances' at once

by Corion (Patriarch)
on Nov 15, 2008 at 12:24 UTC ( #723791=note: print w/replies, xml ) Need Help??

in reply to Real time reading of multiple pcap 'instances' at once

At least under Linux or other unixish OSes, the select approach of reading from multiple tcpdump instances should work. Otherwise, I'd aim for the mod//Net::Pcap approach, using pcap_loop() to read some packets. Also, consider combining the "queries" you hand to the different Pcap instances into one large query. For example, if you want to capture (HTTP) traffic between the local machine and two different hosts, use the following specification:

(dest && (tcp port 80)) ||(src && (tcp port 80)) ||(dest && (tcp port 80)) ||(src && (tcp port 80))

So if you have traffic going over different (known) ports to different (known) machines/IP addresses, the simplest approach might be to capture them all in one stream and sort them out in your Perl code again.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://723791]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2023-10-03 14:54 GMT
Find Nodes?
    Voting Booth?

    No recent polls found