Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
ardikars committed Dec 4, 2023
1 parent 6068d5a commit 533dd40
Show file tree
Hide file tree
Showing 28 changed files with 468 additions and 192 deletions.
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ SPDX-License-Identifier: MIT OR Apache-2.0

All notable changes to this project will be documented in this file.

## [1.5.1] - 2023-12-04

## Added

* Adding dll search path for Npcap. [#295](https://github.com/ardikars/pcap/pull/295)

## Fixed

* Fix typo [#293](https://github.com/ardikars/pcap/discussions/293)

## [1.5.0] - 2023-01-01

### Added
Expand Down
2 changes: 1 addition & 1 deletion codec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SPDX-License-Identifier: MIT OR Apache-2.0
<parent>
<artifactId>pcap</artifactId>
<groupId>com.ardikars.pcap</groupId>
<version>1.5.0</version>
<version>1.5.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
25 changes: 18 additions & 7 deletions codec/src/test/java/pcap/codec/AbstractPacketTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ class AbstractPacketTest {

@Test
void equalsAndHasCodeTest()
throws ErrorException, PermissionDeniedException, PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException, RadioFrequencyModeNotSupportedException,
NoSuchDeviceException, ActivatedException, InterfaceNotUpException,
throws ErrorException,
PermissionDeniedException,
PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException,
RadioFrequencyModeNotSupportedException,
NoSuchDeviceException,
ActivatedException,
InterfaceNotUpException,
InterfaceNotSupportTimestampTypeException {
Service service = Service.Creator.create("PcapService");
try (final Pcap pcap = service.live(service.interfaces(), new DefaultLiveOptions())) {
Expand Down Expand Up @@ -70,10 +75,16 @@ void equalsAndHasCodeTest()

@Test
void calculate()
throws UnknownHostException, ErrorException, PermissionDeniedException,
PromiscuousModePermissionDeniedException, TimestampPrecisionNotSupportedException,
RadioFrequencyModeNotSupportedException, NoSuchDeviceException, ActivatedException,
InterfaceNotUpException, InterfaceNotSupportTimestampTypeException {
throws UnknownHostException,
ErrorException,
PermissionDeniedException,
PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException,
RadioFrequencyModeNotSupportedException,
NoSuchDeviceException,
ActivatedException,
InterfaceNotUpException,
InterfaceNotSupportTimestampTypeException {
InetAddress dstIp4 = Inet4Address.getByName("127.0.0.1");
InetAddress srcIp4 = Inet4Address.getByName("127.0.0.1");
InetAddress dstIp6 = Inet4Address.getByName("::1");
Expand Down
11 changes: 8 additions & 3 deletions codec/src/test/java/pcap/codec/ethernet/EthernetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ class EthernetTest {

@Test
void readWrite()
throws ErrorException, PermissionDeniedException, PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException, RadioFrequencyModeNotSupportedException,
NoSuchDeviceException, ActivatedException, InterfaceNotUpException,
throws ErrorException,
PermissionDeniedException,
PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException,
RadioFrequencyModeNotSupportedException,
NoSuchDeviceException,
ActivatedException,
InterfaceNotUpException,
InterfaceNotSupportTimestampTypeException {
Service service = Service.Creator.create("PcapService");
try (final Pcap pcap = service.live(service.interfaces(), new DefaultLiveOptions())) {
Expand Down
22 changes: 16 additions & 6 deletions codec/src/test/java/pcap/codec/ip/Ip4Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ class Ip4Test {

@Test
void readWrite()
throws ErrorException, PermissionDeniedException, PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException, RadioFrequencyModeNotSupportedException,
NoSuchDeviceException, ActivatedException, InterfaceNotUpException,
throws ErrorException,
PermissionDeniedException,
PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException,
RadioFrequencyModeNotSupportedException,
NoSuchDeviceException,
ActivatedException,
InterfaceNotUpException,
InterfaceNotSupportTimestampTypeException {
Service service = Service.Creator.create("PcapService");
try (final Pcap pcap = service.live(service.interfaces(), new DefaultLiveOptions())) {
Expand Down Expand Up @@ -214,9 +219,14 @@ public void execute() throws Throwable {
// see: https://github.com/ardikars/pcap/issues/149
@Test
void issue149()
throws ErrorException, RadioFrequencyModeNotSupportedException, ActivatedException,
InterfaceNotSupportTimestampTypeException, PromiscuousModePermissionDeniedException,
InterfaceNotUpException, PermissionDeniedException, NoSuchDeviceException,
throws ErrorException,
RadioFrequencyModeNotSupportedException,
ActivatedException,
InterfaceNotSupportTimestampTypeException,
PromiscuousModePermissionDeniedException,
InterfaceNotUpException,
PermissionDeniedException,
NoSuchDeviceException,
TimestampPrecisionNotSupportedException {
final byte[] bytes =
Hexs.parseHex(
Expand Down
11 changes: 8 additions & 3 deletions codec/src/test/java/pcap/codec/ip/Ip6Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ class Ip6Test {

@Test
void readWrite()
throws ErrorException, PermissionDeniedException, PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException, RadioFrequencyModeNotSupportedException,
NoSuchDeviceException, ActivatedException, InterfaceNotUpException,
throws ErrorException,
PermissionDeniedException,
PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException,
RadioFrequencyModeNotSupportedException,
NoSuchDeviceException,
ActivatedException,
InterfaceNotUpException,
InterfaceNotSupportTimestampTypeException {
Service service = Service.Creator.create("PcapService");
try (final Pcap pcap = service.live(service.interfaces(), new DefaultLiveOptions())) {
Expand Down
11 changes: 8 additions & 3 deletions codec/src/test/java/pcap/codec/loopback/LoopbackTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ class LoopbackTest {

@Test
void readWrite()
throws ErrorException, PermissionDeniedException, PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException, RadioFrequencyModeNotSupportedException,
NoSuchDeviceException, ActivatedException, InterfaceNotUpException,
throws ErrorException,
PermissionDeniedException,
PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException,
RadioFrequencyModeNotSupportedException,
NoSuchDeviceException,
ActivatedException,
InterfaceNotUpException,
InterfaceNotSupportTimestampTypeException {
Service service = Service.Creator.create("PcapService");
try (final Pcap pcap = service.live(service.interfaces(), new DefaultLiveOptions())) {
Expand Down
11 changes: 8 additions & 3 deletions codec/src/test/java/pcap/codec/sll/SllTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ class SllTest {

@Test
void readWrite()
throws ErrorException, PermissionDeniedException, PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException, RadioFrequencyModeNotSupportedException,
NoSuchDeviceException, ActivatedException, InterfaceNotUpException,
throws ErrorException,
PermissionDeniedException,
PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException,
RadioFrequencyModeNotSupportedException,
NoSuchDeviceException,
ActivatedException,
InterfaceNotUpException,
InterfaceNotSupportTimestampTypeException {
Service service = Service.Creator.create("PcapService");
try (final Pcap pcap = service.live(service.interfaces(), new DefaultLiveOptions())) {
Expand Down
22 changes: 16 additions & 6 deletions codec/src/test/java/pcap/codec/tcp/TcpTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ class TcpTest {

@Test
void readWrite()
throws ErrorException, PermissionDeniedException, PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException, RadioFrequencyModeNotSupportedException,
NoSuchDeviceException, ActivatedException, InterfaceNotUpException,
throws ErrorException,
PermissionDeniedException,
PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException,
RadioFrequencyModeNotSupportedException,
NoSuchDeviceException,
ActivatedException,
InterfaceNotUpException,
InterfaceNotSupportTimestampTypeException {
Service service = Service.Creator.create("PcapService");
try (final Pcap pcap = service.live(service.interfaces(), new DefaultLiveOptions())) {
Expand Down Expand Up @@ -178,9 +183,14 @@ public void execute() throws Throwable {

@Test
void flags()
throws ErrorException, PermissionDeniedException, PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException, RadioFrequencyModeNotSupportedException,
NoSuchDeviceException, ActivatedException, InterfaceNotUpException,
throws ErrorException,
PermissionDeniedException,
PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException,
RadioFrequencyModeNotSupportedException,
NoSuchDeviceException,
ActivatedException,
InterfaceNotUpException,
InterfaceNotSupportTimestampTypeException {
Service service = Service.Creator.create("PcapService");
try (final Pcap pcap = service.live(service.interfaces(), new DefaultLiveOptions())) {
Expand Down
11 changes: 8 additions & 3 deletions codec/src/test/java/pcap/codec/udp/UdpTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ class UdpTest {

@Test
void readWrite()
throws ErrorException, PermissionDeniedException, PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException, RadioFrequencyModeNotSupportedException,
NoSuchDeviceException, ActivatedException, InterfaceNotUpException,
throws ErrorException,
PermissionDeniedException,
PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException,
RadioFrequencyModeNotSupportedException,
NoSuchDeviceException,
ActivatedException,
InterfaceNotUpException,
InterfaceNotSupportTimestampTypeException {
Service service = Service.Creator.create("PcapService");
try (final Pcap pcap = service.live(service.interfaces(), new DefaultLiveOptions())) {
Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SPDX-License-Identifier: MIT OR Apache-2.0
<parent>
<artifactId>pcap</artifactId>
<groupId>com.ardikars.pcap</groupId>
<version>1.5.0</version>
<version>1.5.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
1 change: 1 addition & 0 deletions common/src/main/java/pcap/common/net/MacAddress.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public final class MacAddress implements Serializable {
public static final int MAC_ADDRESS_LENGTH = 6;

private static final Pattern REGEX = Pattern.compile("[:-]");

/** Zero MAC Address (00:00:00:00:00:00). */
public static final MacAddress ZERO = valueOf("00:00:00:00:00:00");

Expand Down
2 changes: 1 addition & 1 deletion jdk7/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SPDX-License-Identifier: MIT OR Apache-2.0
<parent>
<artifactId>pcap</artifactId>
<groupId>com.ardikars.pcap</groupId>
<version>1.5.0</version>
<version>1.5.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ void interestOperations(DefaultSelection selection, int interestOperations) {

@Override
public Iterable<Selectable> select(Timeout timeout)
throws TimeoutException, NoSuchSelectableException, IllegalStateException,
throws TimeoutException,
NoSuchSelectableException,
IllegalStateException,
IllegalArgumentException {
checkOpenState();
validateSelect(timeout);
Expand All @@ -150,7 +152,9 @@ public Iterable<Selectable> select(Timeout timeout)

@Override
public int select(Consumer<Selection> consumer, Timeout timeout)
throws TimeoutException, NoSuchSelectableException, IllegalStateException,
throws TimeoutException,
NoSuchSelectableException,
IllegalStateException,
IllegalArgumentException {
checkOpenState();
validateSelect(timeout);
Expand Down
18 changes: 13 additions & 5 deletions jdk7/src/main/java/pcap/jdk7/internal/DefaultService.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,14 @@ public Pcap offline(String source, OfflineOptions options) throws ErrorException

@Override
public Pcap live(Interface source, LiveOptions options)
throws InterfaceNotSupportTimestampTypeException, InterfaceNotUpException,
RadioFrequencyModeNotSupportedException, ActivatedException, PermissionDeniedException,
NoSuchDeviceException, PromiscuousModePermissionDeniedException, ErrorException,
throws InterfaceNotSupportTimestampTypeException,
InterfaceNotUpException,
RadioFrequencyModeNotSupportedException,
ActivatedException,
PermissionDeniedException,
NoSuchDeviceException,
PromiscuousModePermissionDeniedException,
ErrorException,
TimestampPrecisionNotSupportedException {
Utils.requireNonNull(source, "source: null (expected: source != null).");
Pointer pointer = NativeMappings.PLATFORM_DEPENDENT.pcap_create(source.name(), errbuf(true));
Expand Down Expand Up @@ -258,8 +263,11 @@ void checkSetTimestampPrecision(int result)
}

void checkActivate(Pointer pointer, int result)
throws PromiscuousModePermissionDeniedException, RadioFrequencyModeNotSupportedException,
InterfaceNotUpException, NoSuchDeviceException, ActivatedException,
throws PromiscuousModePermissionDeniedException,
RadioFrequencyModeNotSupportedException,
InterfaceNotUpException,
NoSuchDeviceException,
ActivatedException,
PermissionDeniedException {
String message = "Error occurred when activate a handle";
if (result == 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ void interestOperations(DefaultSelection selection, int interestOperations) {

@Override
public Iterable<Selectable> select(Timeout timeout)
throws TimeoutException, NoSuchSelectableException, IllegalStateException,
throws TimeoutException,
NoSuchSelectableException,
IllegalStateException,
IllegalArgumentException {
checkOpenState();
validateSelect(timeout);
Expand All @@ -95,7 +97,9 @@ public Iterable<Selectable> select(Timeout timeout)

@Override
public int select(Consumer<Selection> consumer, Timeout timeout)
throws TimeoutException, NoSuchSelectableException, IllegalStateException,
throws TimeoutException,
NoSuchSelectableException,
IllegalStateException,
IllegalArgumentException {
checkOpenState();
validateSelect(timeout);
Expand Down
1 change: 0 additions & 1 deletion jdk7/src/main/java/pcap/jdk7/internal/NativeMappings.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import com.sun.jna.PointerType;
import com.sun.jna.Structure;
import com.sun.jna.ptr.PointerByReference;

import java.io.File;
import java.lang.reflect.Method;
import java.net.InetAddress;
Expand Down
22 changes: 16 additions & 6 deletions jdk7/src/test/java/pcap/jdk7/internal/DefaultPcapDumperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ void setUp() throws ErrorException {

@Test
void dump()
throws ErrorException, PermissionDeniedException, PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException, RadioFrequencyModeNotSupportedException,
NoSuchDeviceException, ActivatedException, InterfaceNotUpException,
throws ErrorException,
PermissionDeniedException,
PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException,
RadioFrequencyModeNotSupportedException,
NoSuchDeviceException,
ActivatedException,
InterfaceNotUpException,
InterfaceNotSupportTimestampTypeException {
Interface source = loopbackInterface(service);
try (Pcap live = service.live(source, new DefaultLiveOptions())) {
Expand Down Expand Up @@ -134,9 +139,14 @@ public void execute() throws Throwable {

@Test
void equalsAndHashCode()
throws ErrorException, PermissionDeniedException, PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException, RadioFrequencyModeNotSupportedException,
NoSuchDeviceException, ActivatedException, InterfaceNotUpException,
throws ErrorException,
PermissionDeniedException,
PromiscuousModePermissionDeniedException,
TimestampPrecisionNotSupportedException,
RadioFrequencyModeNotSupportedException,
NoSuchDeviceException,
ActivatedException,
InterfaceNotUpException,
InterfaceNotSupportTimestampTypeException {
Interface source = loopbackInterface(service);
try (Pcap live = service.live(source, new DefaultLiveOptions())) {
Expand Down
Loading

0 comments on commit 533dd40

Please sign in to comment.