http://qs321.pair.com?node_id=936756


in reply to tshark RTCP capture via PERL

Tshark, wireshark, and tcpdump are all the same thing. They use libpcap to capture network data and dump it to files. The main difference is that tshark and wireshark have all kinds of slick decoders built right in.

For realtime captures and things, choose Net::Pcap::Easy. I wrote this module. Mostly people are turned of by the word Easy, and I can't blame them, but I think I've done a reasonable job making it easier for me to use. The main thing was to get all the information you need on one manpage.

The real work is in Net::Pcap. It uses NetPacket to do decodes… I find it rather difficult to use in the raw, for one thing the truth values are backwards (like in C) and for another the documentation spans many man pages, but this is surely the more traditional way to do it. I'm also peripherally aware of a POE module that does event based pcaps.

Anyway, I highly recommend you do this a little more natively, rather than trying to grok the random outputs of tshark. Those could change without any notice at all (even just moving from machine to machine) and then you'll have to go back and tweak your regexps and things.