Savarese.Org

org.savarese.vserv.tcpip
Class ICMPEchoPacket

java.lang.Object
  extended byorg.savarese.vserv.tcpip.IPPacket
      extended byorg.savarese.vserv.tcpip.ICMPPacket
          extended byorg.savarese.vserv.tcpip.ICMPEchoPacket

public class ICMPEchoPacket
extends ICMPPacket

ICMPEchoPacket extends ICMPPacket to implement ICMP echo request and reply packets.

Author:
Daniel F. Savarese

Field Summary
static int OFFSET_IDENTIFIER
          Offset into the ICMP packet of the identifier header value.
static int OFFSET_SEQUENCE
          Offset into the ICMP packet of the sequence number header value.
 
Fields inherited from class org.savarese.vserv.tcpip.ICMPPacket
OFFSET_CODE, OFFSET_ICMP_CHECKSUM, OFFSET_TYPE, TYPE_ECHO_REPLY, TYPE_ECHO_REQUEST
 
Fields inherited from class org.savarese.vserv.tcpip.IPPacket
_data_, LENGTH_DESTINATION_ADDRESS, LENGTH_SOURCE_ADDRESS, OFFSET_DESTINATION_ADDRESS, OFFSET_FLAGS, OFFSET_IDENTIFICATION, OFFSET_IP_CHECKSUM, OFFSET_PROTOCOL, OFFSET_SOURCE_ADDRESS, OFFSET_TOTAL_LENGTH, OFFSET_TTL, OFFSET_TYPE_OF_SERVICE, PROTOCOL_ICMP, PROTOCOL_IP, PROTOCOL_TCP, PROTOCOL_UDP
 
Constructor Summary
ICMPEchoPacket(ICMPEchoPacket packet)
          Creates a new ICMP echo packet that is a copy of a given packet.
ICMPEchoPacket(int size)
          Creates a new ICMP echo packet of a given size.
 
Method Summary
 int getICMPHeaderByteLength()
           
 int getIdentifier()
           
 int getSequenceNumber()
           
 void setIdentifier(int id)
          Sets the identifier header field.
 void setSequenceNumber(int seq)
          Sets the sequence number.
 
Methods inherited from class org.savarese.vserv.tcpip.ICMPPacket
computeICMPChecksum, computeICMPChecksum, copyData, getCode, getCombinedHeaderByteLength, getICMPChecksum, getICMPDataByteLength, getICMPPacketByteLength, getType, setCode, setData, setICMPDataByteLength, setIPHeaderLength, setType
 
Methods inherited from class org.savarese.vserv.tcpip.IPPacket
_computeChecksum_, computeIPChecksum, computeIPChecksum, copy, getData, getDestination, getDestination, getDestinationAsInetAddress, getDestinationAsWord, getFragmentOffset, getIdentification, getIPChecksum, getIPFlags, getIPHeaderByteLength, getIPHeaderLength, getIPPacketLength, getIPVersion, getProtocol, getSource, getSource, getSourceAsInetAddress, getSourceAsWord, getTTL, getTypeOfService, setDestinationAsWord, setFragmentOffset, setIdentification, setIPFlags, setIPPacketLength, setIPVersion, setProtocol, setSourceAsWord, setTTL, setTypeOfService, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OFFSET_IDENTIFIER

public static final int OFFSET_IDENTIFIER
Offset into the ICMP packet of the identifier header value.

See Also:
Constant Field Values

OFFSET_SEQUENCE

public static final int OFFSET_SEQUENCE
Offset into the ICMP packet of the sequence number header value.

See Also:
Constant Field Values
Constructor Detail

ICMPEchoPacket

public ICMPEchoPacket(int size)
Creates a new ICMP echo packet of a given size.

Parameters:
size - The number of bytes in the packet.

ICMPEchoPacket

public ICMPEchoPacket(ICMPEchoPacket packet)
Creates a new ICMP echo packet that is a copy of a given packet.

Parameters:
packet - The packet to replicate.
Method Detail

getICMPHeaderByteLength

public int getICMPHeaderByteLength()
Specified by:
getICMPHeaderByteLength in class ICMPPacket
Returns:
The number of bytes in the ICMP packet header.

setIdentifier

public final void setIdentifier(int id)
Sets the identifier header field.

Parameters:
id - The new identifier.

getIdentifier

public final int getIdentifier()
Returns:
The identifier header field.

setSequenceNumber

public final void setSequenceNumber(int seq)
Sets the sequence number.

Parameters:
seq - The new sequence number.

getSequenceNumber

public final int getSequenceNumber()
Returns:
The sequence number.

Savarese.Org

Copyright © 2004-2005 Daniel F. Savarese. All Rights Reserved.