jNetPcap 1.X

jNetPcap 1.X module: libpcap and packet decoder

New libpcap 1.0.0 API calls example

This example demonstrates how to check for and use various API version specific 'pcap' library functions. 'pcap' library, from tcpdump.org team, is evolving and typically adds new function calls to its public API every year. This creates a problem for jnetpcap library integrators as some needed functionality may or may not be present on various client systems. Operating system package installers can typically check for pre-requisite package requirements and make sure that minimum versions of 'pcap' library are installed first before jnetpcap package can be installed. However most users of jnetpcap prefer to use ZIP or TAR format, which does not provide dependency checking mechanism and its up to the user or JVM to resolve and report problems are runtime. Java is also platform independent and writing the code once and run anywhere is a bit more tricky to accomplish when you have such native library dependencies.

jNetPcap version 1.4 introduces a new "native library" management package which facilitates additional checks and information about the state of the loaded native libraries. It allows very specific checks, at runtime, for native symbols without causing exceptions or errors. The library package is exposed through a small set of methods in the Pcap class. These methods make it convenient and easy to check if specific 'pcap' library functionality exists at runtime on any platform, client and even with specific runtime setup.

1.3 Beta 4 performance

Latest beta 4 update being tested:

Test#Packets/sec (1000s)bits/s (Millions)PcapPacketGeneral ScanTcp-only ScanCopyPeerNotes
1102235yesyesnoyesno
2100229noyesnoyesnoPcapPacket reused
36281,438yesnonoyesno
4100229noyesnoyesnoExtra new Object(){};
58251,850nononoyesno
6114n/anoyesnonoyes
73,500n/anonononoyes
81,290677nonoyesyesyescopy tcp payload only
91,0502,280nonoyesyesyescopy all packets