|
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.ErrorMessage
Defines the default error handler object for processing ICMP error messages. All error messages follow the same format. The first 8 bytes is the ICMP header. Immediantly after the ICMP header is the IP packet in error, including any option data. After the IP header is the first 8 bytes of protocol data. This is enough to hold a UDP header or the first 8 bytes of a TCP header.
Field Summary | |
private IPHeader |
m_iphdr
|
private byte[] |
m_protoData
|
Constructor Summary | |
|
ErrorMessage(byte[] buf,
int offset)
Creates a new ICMP timestamp reply from the spcified data at the specific offset. |
protected |
ErrorMessage(byte type,
byte code)
Creates a new ICMP Error Message object. |
Method Summary | |
IPHeader |
getIPHeader()
Used to access the IP Header that caused the ICMP error message to be generated. |
byte[] |
getProtocolData()
Retreives the 8 bytes of protocol data that caused the error. |
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. |
protected void |
setIPHeader(IPHeader hdr)
Sets the IP header in error. |
protected void |
setProtocolData(byte[] pd)
Sets the protocol data that caused the error. |
Methods inherited from class org.opennms.protocols.icmp.ICMPHeader |
byteToInt, byteToShort, computeChecksum, computeChecksum, getChecksum, getCode, getIdentity, getNetworkSize, getSequenceId, getType, isEchoReply, isEchoRequest, nextSequenceId, setChecksum, setCode, setIdentity, setNextSequenceId, setSequenceId, setType, storeToBuffer, toBytes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private IPHeader m_iphdr
private byte[] m_protoData
Constructor Detail |
protected ErrorMessage(byte type, byte code)
type
- The ICMP type.code
- The specific code for the message.public ErrorMessage(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.Method Detail |
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.public final IPHeader getIPHeader()
protected void setIPHeader(IPHeader hdr)
hdr
- The IP header in errorpublic final byte[] getProtocolData()
protected void setProtocolData(byte[] pd)
pd
- The 8 bytes of protocol data.
java.lang.IndexOutOfBoundsException
- Thrown when pd.length is less than 8.
java.lang.IllegalArgumentException
- Thrown when pd.length is greater than 8.
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |