I'm looking for a fast way to parse PCAP file packets.
I'm currently using jNetPcap like so:
Pcap pcap = Pcap.openOffline(file, errbuf);
pcap.loop(10, jpacketHandler, "jNetPcap rocks!");
But it is pretty slow, is there any other good Java libraries that can parse PCAP files?
Just stumbled upon pcap parsing task in Java and found a pcap parser in Kaitai Struct. Surprisingly, it turns out to be blazing fast — probably because it's not a wrapper over C pcap library, but just a raw parser instead. My average results (on the same box, of course) are as following:
So, if you don't need capturing, I wholeheartedly recommend trying out Kaitai Struct parser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With