Releases: slytechs-repos/jnetpcap-wrapper
v2.3.1+jdk21
Release v2.3.1+jdk21
Bug Fixes:
- Fixed Pcap.findAllDevs() crash on macOS when enumerating network interfaces (gh-61)
- Corrected address structure length calculation for BSD/MacOS derived systems
- Fixed JDK 21 specific issue in Pcap1_0.create method
This release is specifically built for JDK 21 LTS with Foreign Function & Memory API (FFM) preview features enabled.
v2.3.1
Release v2.3.1
Bug Fixes:
- Fixed Pcap.findAllDevs() crash on macOS when enumerating network interfaces (gh-61)
- Corrected address structure length calculation for BSD/MacOS derived systems
- Improved compatibility with JDK 22+ on MacOS/BSD systems
This release is built for JDK 22+ with stable Foreign Function & Memory API (FFM).
v2.3.0+jdk21.preview
jNetPcap v2.3.0+jdk21.preview
This release backports jNetPcap to JDK 21, maintaining feature parity with the main JDK 22+ version while adapting to JDK 21's Foreign Function API.
Requirements
- JDK 21
--enable-preview
and--enable-native-access=org.jnetpcap
flags required
Changes
- Backported Foreign Function & Memory API from JDK 22+ to JDK 21
- Maintained all core functionality from v2.3.0
- No changes to public APIs
Migration
From JDK 22+:
- No code changes required
- Update JVM flags for JDK 21 compatibility
From earlier JDK 21 versions:
<dependency>
<groupId>com.slytechs.jnet.jnetpcap</groupId>
<artifactId>jnetpcap-wrapper</artifactId>
<version>2.3.0+jdk21.preview</version>
</dependency>
Known Issues
- None
Acknowledgments
Thanks to all contributors who helped test the JDK 21 backport.
v2.3.0
Release Notes for jNetPcap Wrapper v2.3.0
Addressing Critical Compatibility Issues with Java 23
Resolved Issue
- Fixed IndexOutOfBounds Exception in
Pcap.findAllDevs()
Issue #57 has been resolved. This problem was triggered by changes introduced in Java 23's Foreign Function & Memory API (FFM). Specifically, the error occurred during the memory handling for union structures inSaLayout.get(MemorySegment)
.
Background
The Java 23 update introduced stricter alignment and boundary checks in the FFM API. These checks highlighted inconsistencies in how memory layouts were being handled within jNetPcap
. The issue manifested when users attempted to call Pcap.findAllDevs()
on Java 23, resulting in an IndexOutOfBoundsException
.
Key Fixes
- Adjusted memory layout alignment to conform to the new requirements of Java 23.
- Updated the use of
MemoryLayout.select()
andvarHandle()
to ensure consistent behavior across Java versions. - Introduced robust boundary checks for handling memory segments, particularly for union structures, preventing out-of-bound memory access.
Impact
- The library now functions correctly with Java 23, resolving all known compatibility issues.
- Ensures stable operation across Java 22, Java 23, and earlier versions.
Testing and Validation
- Comprehensive unit tests were added to validate compatibility across multiple platforms (Linux, macOS, Windows) and Java versions (21 LTS, 22, 23, and early-access 24).
- Special thanks to contributors and users who reported and assisted in resolving the issue, especially @hamid-nazari, @arisona, and @SecureNetWizard.
Acknowledgments
This release addresses a critical issue reported by the community and incorporates contributions that were vital in diagnosing and resolving the problem. We thank all contributors for their effort and diligence in ensuring the stability and reliability of the library.
Additional Updates
This release also includes:
- Updated dependencies and improved test coverage.
- Further optimizations for native library integration.
For a detailed changelog and to download the release, visit jNetPcap Wrapper v2.3.0 on GitHub.
Thank you for using jNetPcap Wrapper!
v2.2.1
v2.2.1
jnetpcap-wrapper 2.2.1
This release contains minor changes to facilitate deployment to the Maven Central Repository.
Changes:
- Updated POM file to allow release deployment to s01.oss.sonatype.org server
- No functional changes to the wrapper code
Deployment:
This version is now available on Maven Central. Update your dependencies to use this release.
Release 2.2.0
Release Notes: Version 2.2.0
We are excited to announce the release of version 2.2.0 of the jNetPcap Wrapper! This release includes several significant updates and enhancements:
Key Updates
- JDK 22 Support: This version now fully supports JDK 22, allowing you to leverage the latest features and improvements of the Java platform.
- Foreign Function API Updates: The Foreign Function (FF) API has been updated to the final version in JDK 22. This includes numerous improvements and optimizations for better performance and usability.
- Special thanks to @hamid-nazari for your invaluable contributions and updates to the FF API integration.
Detailed Changes
JDK 22 Integration:
- Updated the project to support JDK 22, ensuring compatibility and allowing users to take advantage of the latest Java enhancements.
- Final FF API Implementation:
- Integrated the final version of the Foreign Function API from JDK 22, enhancing the way native functions are accessed and utilized within the application.
Acknowledgments
We would like to extend our gratitude to all contributors and users who provided feedback and suggestions. Special thanks to @hamid-nazari for your contributions to the FF API updates.
v2.0.0
Production release version 2.0.0
Full production release of jNetPcap v2 API with up to native libpcap 1.10 API compatibility.
JDK Compatibility
jNetPcap library relies on Panama Foreign Function and Memory (JEP 442) feature which has been released but as a JDK preview feature, the release provides binary files for multiple JDKs to enable its usage.
Provides binary jar file support for the following JDKs with Foreign Function support:
- JDK19 (preview feature 1)
- JDK20 (preview feature 2)
- JDK21 LTS (preview feature 3)
- JDK22 FFM fully incorporated as part JDK public API, no
--enable-preview
command line options required
Note: JDK 22 as of this release is an "early-access" JDK.
Note: when using JDK 19, 20 or 21, the --enable-preview
command line option is required to enable JDK feature preview of Panama FFM (JEP 442) feature.
Note: the command line option --enable-native-access=org.jnetpcap
is required to allow jNetPcap access to native functions and memory.
All future releases (2.1.0 +) will only provide JDK 21 LTS and JDK 22 binary support going forward. JDK 19 and 20 binaries will not be provided in future releases.
What's Changed
- Initial public jNetPcap API release for up to libpcap 1.10 API
v2.0.0-alpha.2
jNetPcap v2.X relies exclusively on Foreign Function feature currently in JDK preview which allows binding to native libraries without the need of use of JNI or any other external modules such as JNA.
- This release updated the public API by merging
PcapHandler
types for use in mainPcap
class, from what used to be a separatePcapReceiver
class. This simplifies the usage of the library. - A better implementation of
PcapHeader
has been provided, while reducing the number of implementing classes to a single class. - A internal implementation hook has been provided to allow the module jnetpcap-pro to extend and provide protocol level features
- Issue #28 was fixed which prevented proper usage in Windows based systems due to incorrect ABI being selected on x64 bit systems
- Several system properties which override certain behaviors were added, including manual ABI selection
Note: JDK 20 has been released and work has begun to make the neccessary changes to the FF dependent parts of jNetPcap code. This means that current implementation of this release which is dependent on "exact" JDK 19 Foreign Function feature API and is incompatible with JDK 20 and beyond. However the public API will be identical in future jNetPcap releases making this release the only backward compatible to be used with JDK19.
Note: The next release "alpha.3" will provide compatibility with the JDK 20 Foreign Function feature.
v2.0.0-alpha.1
This release is a preview release that requires JDK 19 specifically.
jNetPcap v2.X relies exclusively on Foreign Function feature currently in JDK preview which allows binding to native libraries without the need of use of JNI or any other external modules such as JNA.
It has been announced by the JDK developers that Foreign Function feature will go further refinement in next release of JDK 20. This means that current implementation of this release which is dependent on "exact" JDK 19 Foreign Function feature API and will be incompatible with future JDK 20.
A new release "alpha.2" will be provided at the time with updated usage of the JDK 20 Foreign Function feature.
What's Changed
- importing from private repo by @slytechs-repos in #1
- Removed bin and target folders by @slytechs-repos in #2
- Added NetIp4Address class to to simplify return value of Pcap.lookupNet by @slytechs-repos in #4
- fixed up invalid javadoc tag by @slytechs-repos in #5
- fixed up all javadoc errors and warnings by @slytechs-repos in #6
- Changed from plural form of time units to singular, which was a typo by @slytechs-repos in #7
- Added platform depedent Profiles to pom.xml. Added 'osx-homebrew' and… by @slytechs-repos in #10
- Working on standalone javadoc in pom.xml file by @slytechs-repos in #11
- Cleaned up Foreign Function upcall implementation by @slytechs-repos in #12
- Cleanup of javadoc comments by @slytechs-repos in #14
New Contributors
- @slytechs-repos made their first contribution in #1
Full Changelog: https://github.com/slytechs-repos/jnetpcap/commits/v2.0.0-alpha.1