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 short
ICMP_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.boolean
equals(java.lang.Object obj)
short
getIdentifier()
Gets the identifier.short
getSequenceNum()
Gets the sequence number.int
hashCode()
byte[]
serialize()
Serializes the packet.ICMPEcho
setIdentifier(short identifier)
Sets the identifier.ICMPEcho
setSequenceNum(short sequenceNum)
Sets the sequencer number.java.lang.String
toString()
-
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:
hashCode
in classBasePacket
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classBasePacket
-
deserializer
public static Deserializer<ICMPEcho> deserializer()
Deserializer function for ICMPEcho packets.- Returns:
- deserializer function
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-