SSF.OS
Class ICMPHeader

java.lang.Object
  |
  +--SSF.OS.ProtocolMessage
        |
        +--SSF.OS.ICMPHeader

public class ICMPHeader
extends ProtocolMessage

ICMP packet Header class.


Field Summary
 int datalen
           
 IpHeader failedHeader
           
 int icmpCode
           
 int icmpType
           
 int id
           
 int originTimestamp
          These timestamps are in hundredths of seconds.
 int receiveTimestamp
          These timestamps are in hundredths of seconds.
 int seq
           
 int transmitTimestamp
          These timestamps are in hundredths of seconds.
 
Method Summary
 int bytecount()
          Returns the total number of bytes in this ICMP packet.
 int header_bytecount()
          Returns nominal size (in bytes) of the ICMP header only.
 IpHeader ipHeader()
           
static ICMPHeader makeEchoRequestMessage(int id, int seq, int len, int destAddr)
           
static ICMPHeader makeEchoResponseMessage(ICMPHeader request)
           
static ICMPHeader makeHostUnreachableMessage(IpHeader problem)
           
static ICMPHeader makePortUnreachableMessage(IpHeader problem)
           
static ICMPHeader makeProtocolUnreachableMessage(IpHeader problem)
           
static ICMPHeader makeTimeExceededMessage(IpHeader problem)
           
static ICMPHeader makeTimestampRequestMessage(int id, int seq, int destAddr, long now)
           
static ICMPHeader makeTimestampResponseMessage(ICMPHeader request, long now)
           
 java.lang.String toString()
           
 
Methods inherited from class SSF.OS.ProtocolMessage
carryPayload, copy, dropHeader, dropPayload, frombytes, fromVersion, payload, previous, size, tobytes, version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

failedHeader

public IpHeader failedHeader

icmpType

public int icmpType

icmpCode

public int icmpCode

id

public int id

seq

public int seq

datalen

public int datalen

originTimestamp

public int originTimestamp
These timestamps are in hundredths of seconds.


receiveTimestamp

public int receiveTimestamp
These timestamps are in hundredths of seconds.


transmitTimestamp

public int transmitTimestamp
These timestamps are in hundredths of seconds.

Method Detail

makeEchoRequestMessage

public static ICMPHeader makeEchoRequestMessage(int id,
                                                int seq,
                                                int len,
                                                int destAddr)

makeEchoResponseMessage

public static ICMPHeader makeEchoResponseMessage(ICMPHeader request)

makeTimestampRequestMessage

public static ICMPHeader makeTimestampRequestMessage(int id,
                                                     int seq,
                                                     int destAddr,
                                                     long now)

makeTimestampResponseMessage

public static ICMPHeader makeTimestampResponseMessage(ICMPHeader request,
                                                      long now)

makeHostUnreachableMessage

public static ICMPHeader makeHostUnreachableMessage(IpHeader problem)

makeProtocolUnreachableMessage

public static ICMPHeader makeProtocolUnreachableMessage(IpHeader problem)

makePortUnreachableMessage

public static ICMPHeader makePortUnreachableMessage(IpHeader problem)

makeTimeExceededMessage

public static ICMPHeader makeTimeExceededMessage(IpHeader problem)

toString

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

ipHeader

public IpHeader ipHeader()

header_bytecount

public int header_bytecount()
Returns nominal size (in bytes) of the ICMP header only. Includes the size of the IP header of packet that caused the error, for DESTINATION_UNREACHABLE and TIME_EXCEEDED, plus first eight bytes of the IP packet's payload.

Overrides:
header_bytecount in class ProtocolMessage

bytecount

public int bytecount()
Returns the total number of bytes in this ICMP packet.

Overrides:
bytecount in class ProtocolMessage