java.lang.Object | |
↳ | com.sun.jmx.snmp.SnmpMsg |
![]() |
A partially decoded representation of an SNMP packet. It contains the information contained in any SNMP message (SNMPv1, SNMPv2 or SNMPv3).
This API is a Sun Microsystems internal API and is subject to change without notice.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
address | Source or destination address. | ||||||||||
data | Encoding of the PDU. | ||||||||||
dataLength | Number of useful bytes in the data field. |
||||||||||
port | Source or destination port. | ||||||||||
securityParameters | Security parameters. | ||||||||||
version | The protocol version. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Decodes the specified bytes and initializes this message.
| |||||||||||
Gets the PDU encoded in this message.
| |||||||||||
For SNMP Runtime private use only.
| |||||||||||
Dumps the content of a byte buffer using hexadecimal form.
| |||||||||||
Encodes this message and puts the result in the specified byte array.
| |||||||||||
Initializes this message with the specified
pdu . | |||||||||||
For SNMP Runtime private use only.
| |||||||||||
Returns the encoded SNMP version present in the passed byte array.
| |||||||||||
Returns the associated request ID.
| |||||||||||
Dumps this message in a string.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Source or destination address.
For an incoming message it's the source.
For an outgoing message it's the destination.
Encoding of the PDU.
This is usually the BER encoding of the PDU's syntax
defined in RFC1157 and RFC1902. However, this can be authenticated
or encrypted data (but you need to implemented your own
SnmpPduFactory
class).
Number of useful bytes in the data
field.
Source or destination port.
For an incoming message it's the source.
For an outgoing message it's the destination.
Security parameters. Contain informations according to Security Model (Usm, community string based, ...).
The protocol version.
decodeMessage
and encodeMessage
do not
perform any check on this value.
decodeSnmpPdu
and encodeSnmpPdu
only
accept the values 0 (for SNMPv1), 1 (for SNMPv2) and 3 (for SNMPv3).
Decodes the specified bytes and initializes this message. For internal use only.
inputBytes | The bytes to be decoded. |
---|
SnmpStatusException | If the specified bytes are not a valid encoding. |
---|
Gets the PDU encoded in this message.
This method decodes the data field and returns the resulting PDU.
SnmpStatusException | If the encoding is not valid. |
---|
For SNMP Runtime private use only.
BerException |
---|
Dumps the content of a byte buffer using hexadecimal form.
b | The buffer to dump. |
---|---|
offset | The position of the first byte to be dumped. |
len | The number of bytes to be dumped starting from offset. |
Encodes this message and puts the result in the specified byte array. For internal use only.
outputBytes | An array to receive the resulting encoding. |
---|
ArrayIndexOutOfBoundsException | If the result does not fit into the specified array. |
---|---|
SnmpTooBigException |
Initializes this message with the specified pdu
.
This method initializes the data field with an array of
maxDataLength
bytes. It encodes the pdu
.
The resulting encoding is stored in the data field
and the length of the encoding is stored in dataLength
.
If the encoding length exceeds maxDataLength
,
the method throws an exception.
pdu | The PDU to be encoded. |
---|---|
maxDataLength | The maximum length permitted for the data field. |
SnmpStatusException | If the specified pdu is not valid. |
---|---|
SnmpTooBigException | If the resulting encoding does not fit
into maxDataLength bytes. |
ArrayIndexOutOfBoundsException | If the encoding exceeds maxDataLength .
|
For SNMP Runtime private use only.
Returns the encoded SNMP version present in the passed byte array.
data | The unmarshalled SNMP message. |
---|
SnmpStatusException |
---|
Returns the associated request ID.
data | The flat message. |
---|
SnmpStatusException |
---|
Dumps this message in a string.