|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.protocols.icmp.ICMPHeader
org.opennms.protocols.icmp.TimestampReply
This is the implementation of an ICMP timestamp reply object. The object can be stored in a buffer to send or loaded from a received buffer. The class is marked final since it is not intended to be extended.
Field Summary | |
private int |
m_origStamp
|
private int |
m_recvStamp
|
private int |
m_xmitStamp
|
Constructor Summary | |
TimestampReply()
Creates a new ICMP Timestamp Reply object. |
|
TimestampReply(byte[] buf,
int offset)
Creates a new ICMP timestamp reply from the spcified data at the specific offset. |
Method Summary | |
void |
computeChecksum()
Computes the ones compliment 16-bit checksum for the ICMP message. |
int |
getOriginateTS()
Retreives the current timestamp of the reqeust object. |
int |
getReceiveTS()
Retreives the current received timestamp of the reqeust object. |
int |
getTransmitTS()
Retreives the current transmit timestamp of the reply object. |
int |
loadFromBuffer(byte[] buf,
int offset)
Reads the ICMP Address Mask Reqeust from the specified buffer and sets the internal fields equal to the data. |
void |
setOriginateTS()
Sets the originate timestamp to the current date in millisecond resolution. |
void |
setOriginateTS(int ts)
Sets the originate timestamp to the passed value. |
void |
setReceiveTS()
Sets the receive timestamp to the current date in millisecond resolution. |
void |
setReceiveTS(int ts)
Sets the receive timestamp to the passed value. |
void |
setTransmitTS()
Sets the transmit timestamp to the current date in millisecond resolution. |
void |
setTransmitTS(int ts)
Sets the tranmit timestamp to the passed value. |
int |
storeToBuffer(byte[] buf,
int offset)
Writes the ICMP address mask reply out to the specified buffer at the starting offset. |
byte[] |
toBytes()
Converts the object to an array of bytes. |
Methods inherited from class org.opennms.protocols.icmp.ICMPHeader |
byteToInt, byteToShort, computeChecksum, getChecksum, getCode, getIdentity, getNetworkSize, getSequenceId, getType, isEchoReply, isEchoRequest, nextSequenceId, setChecksum, setCode, setIdentity, setNextSequenceId, setSequenceId, setType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private int m_origStamp
private int m_recvStamp
private int m_xmitStamp
Constructor Detail |
public TimestampReply()
public TimestampReply(byte[] buf, int offset)
buf
- The buffer containing the data.offset
- The start of the icmp data.
java.lang.IndexOutOfBoundsException
- Thrown if there is not sufficent data in the buffer.
java.lang.IllegalArgumentException
- Thrown if the ICMP type is not an Timestamp Reply.Method Detail |
public final void computeChecksum()
computeChecksum
in class ICMPHeader
public final int storeToBuffer(byte[] buf, int offset)
storeToBuffer
in class ICMPHeader
buf
- The storage buffer.offset
- The location to start in buf.
java.lang.IndexOutOfBoundsException
- Thrown if the buffer does not have enough storage space.public final int loadFromBuffer(byte[] buf, int offset)
loadFromBuffer
in class ICMPHeader
buf
- The buffer to read the data from.offset
- The offset to start reading data.
java.lang.IndexOutOfBoundsException
- Thrown if there is not sufficent data in the buffer.
java.lang.IllegalArgumentException
- Thrown if the ICMP type is not an Timestamp Reply.public final void setOriginateTS()
Date.getTime()
public final void setOriginateTS(int ts)
ts
- The timestamp in millisecondspublic final int getOriginateTS()
public final void setReceiveTS()
Date.getTime()
public final void setReceiveTS(int ts)
ts
- The timestamp in millisecondspublic final int getReceiveTS()
public final void setTransmitTS()
Date.getTime()
public final void setTransmitTS(int ts)
ts
- The timestamp in millisecondspublic final int getTransmitTS()
public final byte[] toBytes()
toBytes
in class ICMPHeader
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |