Class ICMPEcho

  • All Implemented Interfaces:
    IPacket

    public class ICMPEcho
    extends BasePacket
    ICMP packet class for echo purpose.
    • Field Detail

      • ICMP_ECHO_HEADER_LENGTH

        public static final short ICMP_ECHO_HEADER_LENGTH
        See Also:
        Constant Field Values
    • Constructor Detail

      • ICMPEcho

        public ICMPEcho()
    • 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
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class BasePacket
      • deserializer

        public static Deserializer<ICMPEcho> deserializer()
        Deserializer function for ICMPEcho packets.
        Returns:
        deserializer function
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object