|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opennms.protocols.icmpd.MessageHeader | +--org.opennms.protocols.icmpd.DataSendMessage
Defines the data send message for the transmission of an icmp message to a remote host. The icmp message is treated as an array of bytes and should be placed onto the wire raw by the daemon. The format of the message is as follows:
+--------+--------+----------------+ | TYPE | CODE | SEQUENCE | +--------+--------+----------------+ | LENGTH | ADDR LEN | +-----------------+----------------+ | ADDRESS DATA | | | +----------------------------------+ | DATA LENGTH | +----------------------------------+ | ICMP DATA | | | +----------------------------------+
Field Summary | |
static byte |
CODE
The code for the message |
private byte[] |
m_addrData
|
private byte[] |
m_data
|
private int |
m_dataLen
|
static byte |
TYPE
The type for the message |
Fields inherited from class org.opennms.protocols.icmpd.MessageHeader |
m_code, m_length, m_reserved, m_sequence, m_type, sm_seq, TYPE_CONTROL, TYPE_DATA |
Constructor Summary | |
|
DataSendMessage()
Class constructor. |
|
DataSendMessage(InetAddress addr,
byte[] icmp)
Constructs a new DataSendMessage object with the specified IP address and ICMP data. |
(package private) |
DataSendMessage(MessageHeader hdr,
InputStream istream)
Constructs a new object with the passed header and reads the remaining information from the passed input stream. |
Method Summary | |
private void |
calculateLength()
Calculates the length of the packet based on the current values of the private fields. |
byte[] |
getAddress()
Returns the byte array that contains the address data for the object. |
int |
getAddressLength()
Returns the length of the IP address information. |
byte[] |
getData()
Retreives the actual data encapsulated by the class. |
int |
getDataLength()
Returns the length of the data encapsulated by the class. |
void |
setAddress(byte[] buf)
Used to set the address data contained by the message object. |
void |
setAddress(InetAddress addr)
Sets the address for the object. |
void |
setData(byte[] buf)
Used to set the current data encapsulated by the class. |
(package private) void |
write(OutputStream ostream)
Writes self to the passed output stream. |
Methods inherited from class org.opennms.protocols.icmpd.MessageHeader |
align4, getCode, getLength, getSequence, getType, makeInt, makeShort, nextSequenceId, read, setSequence |
Methods inherited from class java.lang.Object |
|
Field Detail |
private byte[] m_addrData
private byte[] m_data
private int m_dataLen
public static final byte TYPE
public static final byte CODE
Constructor Detail |
public DataSendMessage()
DataSendMessage(MessageHeader hdr, InputStream istream) throws IOException
hdr
- The header object to copy into self.istream
- The stream containing the remaining data for the object.IOException
- Thrown if an error occurs with the input stream
or there is insufficent data returned from the stream.IllegalArgumentException
- Thrown if the header's type and
code fields are not valid for the object.public DataSendMessage(InetAddress addr, byte[] icmp)
Method Detail |
public int getAddressLength()
public byte[] getAddress()
getAddressLength()
public void setAddress(byte[] buf)
buf
- The address data.public void setAddress(InetAddress addr)
addr
- The new address for the message.public int getDataLength()
public byte[] getData()
getDataLength()
public void setData(byte[] buf)
buf
- The buffer encapsulate in the object.private void calculateLength()
void write(OutputStream ostream) throws IOException
write
in class MessageHeader
ostream
- The output stream to write self to.IOException
- Thrown if an error occurs with the
ostream object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |