Package org.onlab.packet
Class ICMPEcho
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.ICMPEcho
-
- All Implemented Interfaces:
IPacket
public class ICMPEcho extends BasePacket
ICMP packet class for echo purpose.
-
-
Field Summary
Fields Modifier and Type Field Description static shortICMP_ECHO_HEADER_LENGTH-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description ICMPEcho()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Deserializer<ICMPEcho>deserializer()Deserializer function for ICMPEcho packets.booleanequals(java.lang.Object obj)shortgetIdentifier()Gets the identifier.shortgetSequenceNum()Gets the sequence number.inthashCode()byte[]serialize()Serializes the packet.ICMPEchosetIdentifier(short identifier)Sets the identifier.ICMPEchosetSequenceNum(short sequenceNum)Sets the sequencer number.java.lang.StringtoString()-
Methods inherited from class org.onlab.packet.BasePacket
clone, getParent, getPayload, resetChecksum, setParent, setPayload
-
-
-
-
Field Detail
-
ICMP_ECHO_HEADER_LENGTH
public static final short ICMP_ECHO_HEADER_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
setIdentifier
public ICMPEcho setIdentifier(short identifier)
Sets the identifier.- Parameters:
identifier- identifier- Returns:
- this
-
getIdentifier
public short getIdentifier()
Gets the identifier.- Returns:
- identifier
-
setSequenceNum
public ICMPEcho setSequenceNum(short sequenceNum)
Sets the sequencer number.- Parameters:
sequenceNum- sequence number- Returns:
- this
-
getSequenceNum
public short getSequenceNum()
Gets the sequence number.- Returns:
- sequence number
-
serialize
public byte[] serialize()
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- Returns:
- a byte[] containing this packet and payloads
-
hashCode
public int hashCode()
- Overrides:
hashCodein classBasePacket
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classBasePacket
-
deserializer
public static Deserializer<ICMPEcho> deserializer()
Deserializer function for ICMPEcho packets.- Returns:
- deserializer function
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-