Skip to content

Commit 8e92535

Browse files
author
Toni Lappalainen
committed
Release 1.1.2
1 parent 26e37b2 commit 8e92535

20 files changed

Lines changed: 34 additions & 40 deletions

‎build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group = 'io.github.hirsivaja'
8-
version = '1.1.1'
8+
version = '1.1.2'
99

1010
repositories {
1111
mavenCentral()

‎src/main/java/com/github/hirsivaja/ip/icmp/GenericIcmpMessage.java‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ public static IcmpMessage decode(ByteBuffer in, IcmpType type, IcmpCode code) {
2525
return new GenericIcmpMessage(type, code, payload);
2626
}
2727

28-
@Override
29-
public IcmpType type() {
30-
return type;
31-
}
32-
3328
public byte[] rawPayload() {
3429
return payload.array();
3530
}

‎src/main/java/com/github/hirsivaja/ip/icmp/IcmpCode.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public sealed interface IcmpCode permits IcmpCode.GenericIcmpCode, IcmpCodes {
66

77
byte code();
88

9-
public static IcmpCode fromType(IcmpType type, byte code) {
9+
static IcmpCode fromType(IcmpType type, byte code) {
1010
for (IcmpCode identifier : IcmpCodes.values()) {
1111
if (identifier.type() == type && identifier.code() == code) {
1212
return identifier;

‎src/main/java/com/github/hirsivaja/ip/icmp/IcmpType.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public sealed interface IcmpType permits IcmpType.GenericIcmpType, IcmpTypes {
44

55
byte type();
66

7-
public static IcmpType fromType(byte type) {
7+
static IcmpType fromType(byte type) {
88
for (IcmpType identifier : IcmpTypes.values()) {
99
if (identifier.type() == type) {
1010
return identifier;

‎src/main/java/com/github/hirsivaja/ip/icmpv6/Icmpv6Code.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public sealed interface Icmpv6Code permits Icmpv6Code.GenericIcmpv6Code, Icmpv6C
44
Icmpv6Type type();
55
byte code();
66

7-
public static Icmpv6Code fromType(Icmpv6Type type, byte code) {
7+
static Icmpv6Code fromType(Icmpv6Type type, byte code) {
88
for (Icmpv6Code identifier : Icmpv6Codes.values()) {
99
if (identifier.type() == type && identifier.code() == code) {
1010
return identifier;
@@ -13,5 +13,5 @@ public static Icmpv6Code fromType(Icmpv6Type type, byte code) {
1313
return new GenericIcmpv6Code(type, code);
1414
}
1515

16-
public record GenericIcmpv6Code(Icmpv6Type type, byte code) implements Icmpv6Code {}
16+
record GenericIcmpv6Code(Icmpv6Type type, byte code) implements Icmpv6Code {}
1717
}

‎src/main/java/com/github/hirsivaja/ip/icmpv6/Icmpv6Message.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ static Icmpv6Message decode(ByteBuffer in, Icmpv6Type type, Icmpv6Code code) {
4949
case Icmpv6Types.CERTIFICATION_PATH_SOLICITATION -> CertificationPathSolicitation.decode(in);
5050
case Icmpv6Types.CERTIFICATION_PATH_ADVERTISEMENT -> CertificationPathAdvertisement.decode(in);
5151
case Icmpv6Types.MULTICAST_ROUTER_ADVERTISEMENT -> MulticastRouterAdvertisement.decode(in, code);
52-
case Icmpv6Types.MULTICAST_ROUTER_SOLICITATION -> MulticastRouterSolicitation.decode(in);
53-
case Icmpv6Types.MULTICAST_ROUTER_TERMINATION -> MulticastRouterTermination.decode(in);
52+
case Icmpv6Types.MULTICAST_ROUTER_SOLICITATION -> MulticastRouterSolicitation.decode();
53+
case Icmpv6Types.MULTICAST_ROUTER_TERMINATION -> MulticastRouterTermination.decode();
5454
case Icmpv6Types.RPL -> RplControlMessage.decode(in, code);
5555
case Icmpv6Types.EXTENDED_ECHO_REQUEST -> ExtendedEchoRequest.decode(in);
5656
case Icmpv6Types.EXTENDED_ECHO_REPLY -> ExtendedEchoReply.decode(in, code);

‎src/main/java/com/github/hirsivaja/ip/icmpv6/Icmpv6Type.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
public sealed interface Icmpv6Type permits Icmpv6Type.GenericIcmpv6Type, Icmpv6Types {
44
byte type();
55

6-
public static Icmpv6Type fromType(byte type) {
6+
static Icmpv6Type fromType(byte type) {
77
for (Icmpv6Type identifier : Icmpv6Types.values()) {
88
if (identifier.type() == type) {
99
return identifier;
@@ -12,5 +12,5 @@ public static Icmpv6Type fromType(byte type) {
1212
return new GenericIcmpv6Type(type);
1313
}
1414

15-
public record GenericIcmpv6Type(byte type) implements Icmpv6Type {}
15+
record GenericIcmpv6Type(byte type) implements Icmpv6Type {}
1616
}

‎src/main/java/com/github/hirsivaja/ip/icmpv6/mrd/MulticastRouterSolicitation.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public int length() {
2020
return BASE_LEN;
2121
}
2222

23-
public static Icmpv6Message decode(ByteBuffer in) {
23+
public static Icmpv6Message decode() {
2424
return new MulticastRouterSolicitation();
2525
}
2626

‎src/main/java/com/github/hirsivaja/ip/icmpv6/mrd/MulticastRouterTermination.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public int length() {
2020
return BASE_LEN;
2121
}
2222

23-
public static Icmpv6Message decode(ByteBuffer in) {
23+
public static Icmpv6Message decode() {
2424
return new MulticastRouterTermination();
2525
}
2626

‎src/main/java/com/github/hirsivaja/ip/icmpv6/ndp/MobilePrefixAdvertisement.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
import java.util.List;
1212

1313
public record MobilePrefixAdvertisement(short identifier, boolean mFlag, boolean oFlag, List<NdpOption> options) implements Icmpv6Message {
14-
private final static int MO = 0xC000;
15-
private final static int M = 0x8000;
16-
private final static int O = 0x4000;
14+
private static final int MO = 0xC000;
15+
private static final int M = 0x8000;
16+
private static final int O = 0x4000;
1717

1818
@Override
1919
public void encode(ByteBuffer out) {
@@ -47,7 +47,7 @@ public static Icmpv6Message decode(ByteBuffer in) {
4747
}
4848
case M -> mFlag = true;
4949
case O -> oFlag = true;
50-
default -> {}
50+
default -> {/* BOTH FLAGS FALSE */}
5151
}
5252
List<NdpOption> options = new ArrayList<>();
5353
while(in.remaining() > 2) {

0 commit comments

Comments
 (0)