snmp
Class SNMPBERCodec
java.lang.Object
|
+--snmp.SNMPBERCodec
- public class SNMPBERCodec
- extends java.lang.Object
SNMPBERCodec defines methods for converting from ASN.1 BER encoding to SNMPObject subclasses. The extraction
process usually produces a tree structure of objects with an SNMPSequence object at the root; this
is the usual behavior when a received encoded message is received from an SNMP device.
Method Summary |
static byte[] |
encodeLength(int length)
Utility function for encoding a length as a BER byte sequence |
static SNMPObject |
extractEncoding(snmp.SNMPTLV theTLV)
Extracts an SNMP object given its type, length, value triple as an SNMPTLV object. |
static snmp.SNMPTLV |
extractNextTLV(byte[] enc,
int position)
Extracts the type, length and value of the SNMP object whose BER encoding begins at the
specified position in the given byte array. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SNMPINTEGER
public static final byte SNMPINTEGER
SNMPBITSTRING
public static final byte SNMPBITSTRING
SNMPOCTETSTRING
public static final byte SNMPOCTETSTRING
SNMPNULL
public static final byte SNMPNULL
SNMPOBJECTIDENTIFIER
public static final byte SNMPOBJECTIDENTIFIER
SNMPSEQUENCE
public static final byte SNMPSEQUENCE
SNMPIPADDRESS
public static final byte SNMPIPADDRESS
SNMPCOUNTER32
public static final byte SNMPCOUNTER32
SNMPGAUGE32
public static final byte SNMPGAUGE32
SNMPTIMETICKS
public static final byte SNMPTIMETICKS
SNMPOPAQUE
public static final byte SNMPOPAQUE
SNMPNSAPADDRESS
public static final byte SNMPNSAPADDRESS
SNMPCOUNTER64
public static final byte SNMPCOUNTER64
SNMPUINTEGER32
public static final byte SNMPUINTEGER32
SNMPGETREQUEST
public static final byte SNMPGETREQUEST
SNMPGETNEXTREQUEST
public static final byte SNMPGETNEXTREQUEST
SNMPGETRESPONSE
public static final byte SNMPGETRESPONSE
SNMPSETREQUEST
public static final byte SNMPSETREQUEST
SNMPv2pCOMMUNICATION
public static final byte SNMPv2pCOMMUNICATION
SNMPv2pAUTHORIZEDMESSAGE
public static final byte SNMPv2pAUTHORIZEDMESSAGE
SNMPv2pENCRYPTEDMESSAGE
public static final byte SNMPv2pENCRYPTEDMESSAGE
SNMPv2pENCRYPTEDDATA
public static final byte SNMPv2pENCRYPTEDDATA
SNMPUNKNOWNOBJECT
public static final byte SNMPUNKNOWNOBJECT
SNMPBERCodec
public SNMPBERCodec()
extractEncoding
public static SNMPObject extractEncoding(snmp.SNMPTLV theTLV)
throws SNMPBadValueException
- Extracts an SNMP object given its type, length, value triple as an SNMPTLV object.
Called by SNMPObject subclass constructors.
- Throws:
SNMPBadValueException
- Indicates byte array in value field is uninterprettable for
specified SNMP object type.
extractNextTLV
public static snmp.SNMPTLV extractNextTLV(byte[] enc,
int position)
- Extracts the type, length and value of the SNMP object whose BER encoding begins at the
specified position in the given byte array. (??what about errors??)
encodeLength
public static byte[] encodeLength(int length)
- Utility function for encoding a length as a BER byte sequence