Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jNetPcap vs Jpcap

wondering any of you can give me a bit of comments + insights please. In term of performance, which one should I use, jNetPcap or Jpcap?

Thanks!

like image 883
Gilbeg Avatar asked Sep 02 '10 03:09

Gilbeg


1 Answers

The referenced post contains an admittedly biased opinion by the owner of the jNetPcap project. It is hardly a reliable source for a true comparison.

One difference that is obvious between the two projects is that jNetPcap uses JNI for access to native code. PCap4j (http://www.pcap4j.org/) uses JNA for access to native code and a "com.sun" JNA compatibility library (https://github.com/twall/jna).

Also, the latest version of jNetPcap does not build on Mac OSX and the patch file that was posted to the support forums does not work, even if manually applied. PCap4j run on Mac OSX if the instructions at http://tomute.hateblo.jp/entry/2013/01/27/003209 are followed; for PCap4J 1.3.0 you must replace the JNA 3.3.0 library with the newer versions JNA 4.1.0.

The following command line is an example for PCap4j 1.3.0 on Mac OSX 10.9.5: sudo java -cp pcap4j-core-1.3.0.jar:pcap4j-packetfactory-static-1.3.0.jar:./libs/jna-4.1.0.jar:./libs/slf4j-api-1.7.10.jar:./libs/slf4j-nop-1.7.10.jar:pcap4j-sample-1.3.0.jar -Dorg.pcap4j.core.pcapLibName=libpcap.dylib -Dorg.pcap4j.sample.Loop.count=2 org.pcap4j.sample.Loop icmp

like image 64
posicks Avatar answered Sep 27 '22 19:09

posicks