Trace IPv6 hosts
ONOS-511: Implement NeighborSolicitation
Change-Id: I9aaf35d499cfc7885c74f9c4bf281210ef9f3969
ONOS-507: Trace NeighborSolicitation/NeighborAdvertisement/IPv6 packets in HostLocationProvider
* Complete Javadoc of IPv6, ICMP6, NeighborAdvertisement and NeighborSolicitation
- The Javadoc for serialize() is removed since the one in its superclass just works fine.
* Change 'diffServ' in IPv6 to 'trafficClass' to meet the field name in RFC.
- The setter method, getter method and unit test are also updated accordingly.
* Add IpAddress.isZero() to determine if this address is zero.
- The unit test is also updated accordingly.
* Fix misuse of IpAddress.valueOf(int) in HostLocationProvider
Change-Id: Id0d873aeb1bc61bf26d4964e7aab4bb06ccd0a38
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 6d2455a..4ad8f19 100644
--- a/utils/misc/src/main/java/org/onlab/packet/ICMP6.java
+++ b/utils/misc/src/main/java/org/onlab/packet/ICMP6.java
@@ -23,8 +23,7 @@
import java.util.Map;
/**
- * Implements ICMPv6 packet format.
- *
+ * Implements ICMPv6 packet format. (RFC 4443)
*/
public class ICMP6 extends BasePacket {
public static final byte HEADER_LENGTH = 4; // bytes
@@ -37,6 +36,7 @@
new HashMap<>();
static {
+ ICMP6.PROTOCOL_CLASS_MAP.put(ICMP6.NEIGHBOR_SOLICITATION, NeighborSolicitation.class);
ICMP6.PROTOCOL_CLASS_MAP.put(ICMP6.NEIGHBOR_ADVERTISEMENT, NeighborAdvertisement.class);
}
@@ -45,15 +45,18 @@
protected short checksum;
/**
- * @return the icmpType
+ * Gets ICMP6 type.
+ *
+ * @return the ICMP6 type
*/
public byte getIcmpType() {
return this.icmpType;
}
/**
- * @param icmpType
- * to set
+ * Sets ICMP6 type.
+ *
+ * @param icmpType the ICMP type to set
* @return this
*/
public ICMP6 setIcmpType(final byte icmpType) {
@@ -62,15 +65,18 @@
}
/**
- * @return the icmp code
+ * Gets ICMP6 code.
+ *
+ * @return the ICMP6 code
*/
public byte getIcmpCode() {
return this.icmpCode;
}
/**
- * @param icmpCode
- * code to set
+ * Sets ICMP6 code.
+ *
+ * @param icmpCode the ICMP6 code to set
* @return this
*/
public ICMP6 setIcmpCode(final byte icmpCode) {
@@ -79,6 +85,8 @@
}
/**
+ * Gets checksum.
+ *
* @return the checksum
*/
public short getChecksum() {
@@ -86,8 +94,9 @@
}
/**
- * @param checksum
- * the checksum to set
+ * Sets checksum.
+ *
+ * @param checksum the checksum to set
* @return this
*/
public ICMP6 setChecksum(final short checksum) {
@@ -95,11 +104,6 @@
return this;
}
- /**
- * Serializes the packet. Will compute and set the following fields if they
- * are set to specific values at the time serialize is called: -checksum : 0
- * -length : 0
- */
@Override
public byte[] serialize() {
byte[] payloadData = null;