darcy95 has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I'm using Net::Pcap module for my project. The code looks like this:
my $pcapPayload = Net::Pcap::open_offline($pcapFile,\$error); while (my $pkt = Net::Pcap::next($pcapPayload, \%pcapHeader)) { my $ether_data = NetPacket::Ethernet::strip($pkt); my $ether_obj = NetPacket::Ethernet->decode($pkt); my $ip = NetPacket::IP->decode($ether_obj->{'data'}); ... }
This works very fine with a single small pcap file.
However, what I need now is getting pcap data from an input stream.
The reason why I need to do this is, because traffic data is not saved in pcap format, so it should first be converted into pcap files, but the files are very huge.
So, what my program should do is something like this:
> sth2pcap-convert.pl large-non-pcap-files | my-program.pl -o output.logDoes anyone know how to read data from input stream in perl?
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to read pcap data from stream not from files.
by almut (Canon) on May 06, 2010 at 14:56 UTC | |
|
Re: How to read pcap data from stream not from files.
by gman (Friar) on May 06, 2010 at 17:36 UTC | |
|
Re: How to read pcap data from stream not from files.
by AR (Friar) on May 06, 2010 at 14:06 UTC | |
by almut (Canon) on May 06, 2010 at 14:45 UTC | |
by afoken (Chancellor) on May 09, 2010 at 05:34 UTC | |
by Anonymous Monk on May 06, 2010 at 14:19 UTC | |
by AR (Friar) on May 06, 2010 at 14:29 UTC | |
by darcy95 (Initiate) on May 06, 2010 at 14:38 UTC |