com.veraxsystems.icmp.jni
Class IcmpEchoResponse

java.lang.Object
  extended by com.veraxsystems.icmp.jni.IcmpEchoResponse

public class IcmpEchoResponse
extends java.lang.Object

Class defines content of a data received as a response of ICMP EchoRequest. It contains only important attributes of ICMP message that are sufficient to recognize result of ICMP EchoRequest processing (getStatus()).


Constructor Summary
IcmpEchoResponse()
          Constructor for ICMP response.
 
Method Summary
 byte[] getData()
          Get data received in ICMP response message.
 java.net.InetAddress getDestinationAddress()
          Get address of host the ICMP EchoRequest was sent to.
 int getMessageId()
          Get ICMP EchoRequest message id combined as integer from identifier+sequenceNumber (see RFC792).
 long getResponseTime()
          Get time response was received.
 java.net.InetAddress getSourceAddress()
          Get address of host that was a source of ICMP response.
 IcmpStatus getStatus()
          Get status of ICMP response.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IcmpEchoResponse

public IcmpEchoResponse()
Constructor for ICMP response. The creation time is automatically assigned during object construction. It is assumed, that response creation time is equal to response receive time

Method Detail

getData

public byte[] getData()
Get data received in ICMP response message. This value is available only when EchoReply message is received.

Returns:
data received

getMessageId

public int getMessageId()
Get ICMP EchoRequest message id combined as integer from identifier+sequenceNumber (see RFC792). Used as part of filter for unique message identification.

Returns:
identifier of ICMP message

getSourceAddress

public java.net.InetAddress getSourceAddress()
Get address of host that was a source of ICMP response. On successful EchoRequest processing it is the address of host provided as destination in ICMP EchoRequest. In case network rejected the request, it is address of device (host) that has rejected the message.

Returns:
network address

getDestinationAddress

public java.net.InetAddress getDestinationAddress()
Get address of host the ICMP EchoRequest was sent to.

Returns:
network address

getStatus

public IcmpStatus getStatus()
Get status of ICMP response. The result enumeration describes type of ICMP response and is calculated from type and code attributes of ICMP response message as defined in RFC 792.

Returns:
status if ICMP processing

getResponseTime

public long getResponseTime()
Get time response was received. It is assumed creation time is equal to response time.

Returns:
time response was received. Value in milliseconds