|
|||||||||
| 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.netmgt.ping.Packet
public final class Packet
The ping packet for discovery
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
Packet(byte[] buf)
Creates a new discovery ping packet from the passed buffer. |
|
Packet(long tid)
Creates a new discovery ping packet that can be sent to a remote protocol stack. |
|
| Method Summary | |
|---|---|
void |
computeChecksum()
Computes and stores the current checksum based upon the data currently contained in the object. |
static int |
getNetworkSize()
Returns the network size for this packet. |
long |
getPingRTT()
Gets the ping Round Trip Time |
long |
getReceivedTime()
Gets the currently set received time. |
long |
getSentTime()
Returns the time the packet was sent. |
long |
getTID()
Returns the currently set Thread ID |
int |
loadFromBuffer(byte[] buf,
int offset)
Loads the data from the passed buffer into the current object. |
void |
setPingRTT(long time)
Sets the ping Round Trip Time |
long |
setReceivedTime()
Sets the recieved time for the packet. |
void |
setReceivedTime(long time)
Sets the received time to the passed value. |
long |
setSentTime()
Sets the sent time to the current time. |
void |
setSentTime(long time)
Sets the sent time to the passed value. |
void |
setTID(long tid)
Sets the current Thread Id |
int |
storeToBuffer(byte[] buf,
int offset)
Writes the objects data out to the specified buffer at the starting offset. |
byte[] |
toBytes()
Converts the object into an array of bytes which is suitable for transmission to remote hosts. |
| Methods inherited from class org.opennms.protocols.icmp.ICMPHeader |
|---|
byteToInt, byteToShort, computeChecksum, getChecksum, getCode, getIdentity, 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 |
| Constructor Detail |
|---|
public Packet(long tid)
tid - The thread id for the packet.System.currentTimeMillis()public Packet(byte[] buf)
buf - The buffer containing a refected ping packet.| Method Detail |
|---|
public final long getSentTime()
public final long setSentTime()
System.currentTimeMillis()public final void setSentTime(long time)
time - The new sent time.public final long getReceivedTime()
public final long setReceivedTime()
System.currentTimeMillis()public final void setReceivedTime(long time)
time - The new received time.public final void setPingRTT(long time)
public final long getPingRTT()
public static final int getNetworkSize()
public final void computeChecksum()
computeChecksum in class ICMPHeaderpublic final long getTID()
public final void setTID(long tid)
public final int loadFromBuffer(byte[] buf,
int offset)
loadFromBuffer in class ICMPHeaderbuf - The buffer to load fromoffset - The offset to begin loading from
java.lang.IndexOutOfBoundsException - Thrown if there is not enough data contained in the buffer
to sufficent set the state of the object
public final int storeToBuffer(byte[] buf,
int offset)
storeToBuffer in class ICMPHeaderbuf - 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 byte[] toBytes()
toBytes in class ICMPHeader
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||