Package org.opennms.protocols.snmp
Interface SnmpSyntax
-
- All Known Implementing Classes:
SnmpCounter32,SnmpCounter64,SnmpEndOfMibView,SnmpGauge32,SnmpInt32,SnmpIPAddress,SnmpNoSuchInstance,SnmpNoSuchObject,SnmpNull,SnmpObjectId,SnmpOctetString,SnmpOpaque,SnmpPduBulk,SnmpPduPacket,SnmpPduRequest,SnmpPduTrap,SnmpTimeTicks,SnmpUInt32,SnmpV2Error,SnmpV2PartyClock,SnmpVarBind
public interface SnmpSyntaxThis class defines the interface that must be implemented by all object that can be passed or received to/from a SNMP agent and manager. These include intergers, counters, strings, etc al. The interface defines the methods for encoding and decoding buffers. It also defines the methods for duplicating objects and getting the ASN.1 type.- Version:
- 1.1.1.1
- Author:
- Brian Weaver
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intdecodeASN(byte[] buf, int offset, AsnEncoder encoder)Decodes the ASN.1 buffer and sets the values in the SnmpSyntax object.SnmpSyntaxduplicate()Creates a duplicate (in memory) object of the caller.intencodeASN(byte[] buf, int offset, AsnEncoder encoder)Encodes the data object in the specified buffer using the AsnEncoder objectbytetypeId()Returns the ASN.1 type of the implementor object.
-
-
-
Method Detail
-
typeId
byte typeId()
Returns the ASN.1 type of the implementor object.
-
encodeASN
int encodeASN(byte[] buf, int offset, AsnEncoder encoder) throws AsnEncodingExceptionEncodes the data object in the specified buffer using the AsnEncoder object- Parameters:
buf- The buffer to write the encoded informationoffset- The location to start writing the encoded dataencoder- The object used to encode the data- Returns:
- Returns the offset in buf to the byte immedantly after the last encode byte for the SnmpSyntax file
- Throws:
AsnEncodingException- Thrown if an encoding error occurs
-
decodeASN
int decodeASN(byte[] buf, int offset, AsnEncoder encoder) throws AsnDecodingExceptionDecodes the ASN.1 buffer and sets the values in the SnmpSyntax object.- Parameters:
buf- The encoded data bufferoffset- The offset of the first valid byteencoder- The object used to decode the ASN.1 data- Returns:
- Returns the index to the byte of data immedantly after the last byte of encoded data.
- Throws:
AsnDecodingException- Thrown if an encoding error occurs
-
duplicate
SnmpSyntax duplicate()
Creates a duplicate (in memory) object of the caller. Similar to the clone() method.
-
-