|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.outbackinc.services.protocol.snmp.SnmpAsn1Encoder
The SnmpAsn1Encoder class contains static methods to do ASN.1 encoding for SNMP packets. This class is provided for implementers of future SNMPv3 security models, otherwise it should not be normally used in JSNMP applications.
SnmpConstants
Method Summary | |
static int |
decodeLength(byte[] cbBuffer,
int iPos)
Decode an ASN.1 length at iPos. |
static int |
encodeCounter(byte[] cbBuffer,
int iPos,
java.lang.Long lNum)
Encode a SnmpConstants.ASN_COUNTER type into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeGauge(byte[] cbBuffer,
int iPos,
java.lang.Long lNum)
Encode a SnmpConstants.ASN_GAUGE type into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeInteger(byte[] cbBuffer,
int iPos,
java.math.BigInteger igr)
Encode a SnmpConstants.ASN_INTEGER type into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeIpAddress(byte[] cbBuffer,
int iPos,
byte[] address)
Encode a SnmpConstants.ASN_IPADDRESS type into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeLength(byte[] cbBuffer,
int iPos,
int iLength)
Encode a length value into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeMaxLength(byte[] cbBuffer,
int iPos,
int iLength)
Encode a length value (using the maximum amount of space within the packet [3 bytes]) into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeMaxSequence(byte[] cbBuffer,
int iPos,
int iLength)
Encode a SnmpConstants.ASN_SEQUENCE type (using the maximum amount of space within the packet [3 bytes]) into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeNull(byte[] cbBuffer,
int iPos)
Encode a SnmpConstants.ASN_NULL type into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeOctetString(byte[] cbBuffer,
int iPos,
byte[] octets)
Encode a SnmpConstants.ASN_OCTSTR type into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeOID(byte[] cbBuffer,
int iPos,
java.lang.String szOID)
Encode a SnmpConstants.ASN_OID type into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeOIDWithNull(byte[] cbBuffer,
int iPos,
java.lang.String szOID)
Encode an OID with a SnmpConstants.ASN_NULL type into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeOIDWithValue(byte[] cbBuffer,
int iPos,
java.lang.String szOID,
byte bType,
java.lang.Object value)
Encode an OID with a type and value into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeOpaque(byte[] cbBuffer,
int iPos,
byte[] opaque)
Encode a SnmpConstants.ASN_OPAQUE type into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeRequestID(byte[] cbBuffer,
int iPos,
int iRequestID)
Encode a message request identifier into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeTimeTicks(byte[] cbBuffer,
int iPos,
java.lang.Long lNum)
Encode a SnmpConstants.ASN_TIMETICKS type into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeType(byte[] cbBuffer,
int iPos,
byte bType)
Encode a type code into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeUnsigned32Bit(byte[] cbBuffer,
int iPos,
java.lang.Long lNum)
Encode a SnmpConstants.ASN_UINTEGER32 type into it's ASN.1 byte representation and return the current encoding buffer index. |
static int |
encodeUnsigned64Bit(byte[] cbBuffer,
int iPos,
java.math.BigInteger igrNum)
Encode a SnmpConstants.ASN_COUNTER64 type into it's ASN.1 byte representation and return the current encoding buffer index. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static int encodeLength(byte[] cbBuffer, int iPos, int iLength) throws java.lang.ArrayIndexOutOfBoundsException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.iLength
- length value to encode.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferpublic static int encodeMaxLength(byte[] cbBuffer, int iPos, int iLength) throws java.lang.ArrayIndexOutOfBoundsException
cbBuffer
- encoding buffer.ipos
- current encoding buffer index.iLength
- length value to encode.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferpublic static int encodeType(byte[] cbBuffer, int iPos, byte bType) throws java.lang.ArrayIndexOutOfBoundsException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.bType
- The ASN.1 type (as defined in SnmpConstants).java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferpublic static int encodeMaxSequence(byte[] cbBuffer, int iPos, int iLength) throws java.lang.ArrayIndexOutOfBoundsException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.iLength
- length value to encode.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferSnmpConstants
public static int encodeInteger(byte[] cbBuffer, int iPos, java.math.BigInteger igr) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.igr
- integer to encode.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferjava.lang.IllegalArgumentException
- if value argument is null or out of rangeSnmpConstants
public static int encodeOctetString(byte[] cbBuffer, int iPos, byte[] octets) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.octets
- octets to encode.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferjava.lang.IllegalArgumentException
- if value argument is nullSnmpConstants
public static int encodeRequestID(byte[] cbBuffer, int iPos, int iRequestID) throws java.lang.ArrayIndexOutOfBoundsException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.iRequestID
- request ID to encode.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferpublic static int encodeCounter(byte[] cbBuffer, int iPos, java.lang.Long lNum) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.igrNum
- value to encode.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferjava.lang.IllegalArgumentException
- if value argument is null or out of rangeSnmpConstants
public static int encodeGauge(byte[] cbBuffer, int iPos, java.lang.Long lNum) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.igrNum
- value to encode.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferjava.lang.IllegalArgumentException
- if value argument is null or out of rangeSnmpConstants
public static int encodeTimeTicks(byte[] cbBuffer, int iPos, java.lang.Long lNum) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.igrNum
- value to encode.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferjava.lang.IllegalArgumentException
- if value argument is null or out of rangeSnmpConstants
public static int encodeUnsigned32Bit(byte[] cbBuffer, int iPos, java.lang.Long lNum) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.igrNum
- value to encode.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferjava.lang.IllegalArgumentException
- if value argument is null or out of rangeSnmpConstants
public static int encodeUnsigned64Bit(byte[] cbBuffer, int iPos, java.math.BigInteger igrNum) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.igrNum
- value to encode.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferjava.lang.IllegalArgumentException
- if value argument is null or out of rangeSnmpConstants
public static int encodeOID(byte[] cbBuffer, int iPos, java.lang.String szOID) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.szOID
- value to encode.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferjava.lang.IllegalArgumentException
- if value argument is nullSnmpConstants
public static int encodeIpAddress(byte[] cbBuffer, int iPos, byte[] address) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.address
- value to encode.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferjava.lang.IllegalArgumentException
- if value argument is nullSnmpConstants
public static int encodeOpaque(byte[] cbBuffer, int iPos, byte[] opaque) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.opaque
- value to encode.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferjava.lang.IllegalArgumentException
- if value argument is nullSnmpConstants
public static int encodeNull(byte[] cbBuffer, int iPos) throws java.lang.ArrayIndexOutOfBoundsException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferSnmpConstants
public static int encodeOIDWithValue(byte[] cbBuffer, int iPos, java.lang.String szOID, byte bType, java.lang.Object value) throws java.lang.ArrayIndexOutOfBoundsException, SnmpUnsupportedTypeException, java.lang.IllegalArgumentException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.szOID
- OID to encode.bType
- OID value type.value
- OID value.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferSnmpUnsupportedTypeException
- if bType is unsupportedjava.lang.IllegalArgumentException
- if szOID is null or 'value' is wrong type for 'bType' or value argument is null or out of rangepublic static int encodeOIDWithNull(byte[] cbBuffer, int iPos, java.lang.String szOID) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.szOID
- OID to encode.java.lang.ArrayIndexOutOfBoundsException
- if iPos plus the size of the encoded value exceeds the size of cbBufferjava.lang.IllegalArgumentException
- if szOID is nullSnmpConstants
public static int decodeLength(byte[] cbBuffer, int iPos) throws java.lang.IllegalArgumentException
cbBuffer
- encoding buffer.iPos
- current encoding buffer index.java.lang.IllegalArgumentException
- wrong field length
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Home Services Products Purchase Contact Us About Us Legal Ceramics
Copyright © 2003-2008 jSNMP Enterprises All rights reserved.