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
In reply to How to read pcap data from stream not from files. by darcy95
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |