Refactor org.onlab.packet.{TCP,UDP,ICMP6}
- ONOS-1012: Fix TCP checksum when using IPv6
- ONOS-1013: Fix UDP checksum when using IPv6
- ONOS-1593: Remove get/setTcpChecksum
- Remove unnecessary parameter of getUrgentPointer() in TCP
- Complete javadoc for TCP
- Add unit test for {TCP,UDP,ICMP6}
Change-Id: Iad5eeb35812ede6764a9a9a4a57b9837e5ea5dd6
diff --git a/utils/misc/src/main/java/org/onlab/packet/ICMP6.java b/utils/misc/src/main/java/org/onlab/packet/ICMP6.java
index 03d3102..5c2a6e6 100644
--- a/utils/misc/src/main/java/org/onlab/packet/ICMP6.java
+++ b/utils/misc/src/main/java/org/onlab/packet/ICMP6.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 Open Networking Laboratory
+ * Copyright 2014-2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,6 +34,8 @@
public class ICMP6 extends BasePacket {
public static final byte HEADER_LENGTH = 4; // bytes
+ public static final byte ECHO_REQUEST = (byte) 0x80;
+ public static final byte ECHO_REPLY = (byte) 0x81;
public static final byte ROUTER_SOLICITATION = (byte) 0x85;
public static final byte ROUTER_ADVERTISEMENT = (byte) 0x86;
public static final byte NEIGHBOR_SOLICITATION = (byte) 0x87;
@@ -149,8 +151,8 @@
}
}
if (ipv6Parent != null) {
- bbChecksum.put(((IPv6) ipv6Parent).getSourceAddress());
- bbChecksum.put(((IPv6) ipv6Parent).getDestinationAddress());
+ bbChecksum.put(ipv6Parent.getSourceAddress());
+ bbChecksum.put(ipv6Parent.getDestinationAddress());
} else {
// NOTE: IPv6 source and destination addresses unknown. Use zeroes.
bbChecksum.put(ZERO_ADDRESS);