简体   繁体   English

jNetPcap vs Jpcap

[英]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? 在性能方面,我应该使用哪一个,jNetPcap还是Jpcap?

Thanks! 谢谢!

The referenced post contains an admittedly biased opinion by the owner of the jNetPcap project. 引用的帖子包含了jNetPcap项目所有者的公认偏见。 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. 两个项目之间明显的一个区别是jNetPcap使用JNI来访问本机代码。 PCap4j ( http://www.pcap4j.org/ ) uses JNA for access to native code and a "com.sun" JNA compatibility library ( https://github.com/twall/jna ). PCap4j( http://www.pcap4j.org/ )使用JNA访问本机代码和“com.sun”JNA兼容库( 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. 此外,最新版本的jNetPcap不构建在Mac OSX上,即使手动应用,发布到支持论坛的补丁文件也不起作用。 PCap4j run on Mac OSX if the instructions at http://tomute.hateblo.jp/entry/2013/01/27/003209 are followed; 如果遵循http://tomute.hateblo.jp/entry/2013/01/27/003209中的说明,PCap4j在Mac OSX上运行; for PCap4J 1.3.0 you must replace the JNA 3.3.0 library with the newer versions JNA 4.1.0. 对于PCap4J 1.3.0,您必须使用较新版本的JNA 4.1.0替换JNA 3.3.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 以下命令行是Mac OSX 10.9.5上PCap4j 1.3.0的示例: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

I was looking for the same thing.. Just for the ones who come across with this question. 我正在寻找同样的事情..只是为了那些遇到这个问题的人。 Here is the link . 这是链接

I researched it and found three Java wrapper libraries for pcap: jpcap, jNetPcap, and Jpcap. 我研究了它,发现了三个用于pcap的Java包装器库:jpcap,jNetPcap和Jpcap。 But both jpcap and jNetPcap were unsuitable for SNeO because they seemed to be designed for mainly capturing packets and not to be useful for making and sending packets so much. 但是jpcap和jNetPcap都不适合SNeO,因为它们似乎主要用于捕获数据包而不是用于制作和发送数据包这么多。 On the other hand, Jpcap looked useful for making and sending packets. 另一方面,Jpcap看起来对于发送和发送数据包很有用。 But it had a defect in capturing ICMP packets and its development seemed to be stopped long ago. 但它在捕获ICMP数据包方面存在缺陷,而且它的开发似乎很久以前就停止了。 That's why Pcap4j. 这就是Pcap4j的原因。

https://github.com/kaitoy/pcap4j#system-requirements https://github.com/kaitoy/pcap4j#system-requirements

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM