Decode received SNMP packet.

Namespace:  SnmpSharpNet
Assembly:  SnmpSharpNet (in SnmpSharpNet.dll) Version: 0.7.0.0 (0.7.0.0)

Syntax

C#
public override int decode(
	byte[] buffer,
	int length
)
Visual Basic (Declaration)
Public Overrides Function decode ( _
	buffer As Byte(), _
	length As Integer _
) As Integer
Visual C++
public:
virtual int decode(
	array<unsigned char>^ buffer, 
	int length
) override

Parameters

buffer
Type: array< System..::.Byte >[]()[]
BER encoded packet buffer
length
Type: System..::.Int32
BER encoded packet buffer length

Return Value

Buffer position after the decoded packet.

Exceptions

ExceptionCondition
SnmpSharpNet..::.SnmpExceptionThrown when invalid encoding has been found in the packet
System..::.OverflowExceptionThrown when parsed header points to more data then is available in the packet
SnmpInvalidVersionExceptionThrown when parsed packet is not SNMP version 1
SnmpInvalidPduTypeExceptionThrown when received PDU is of a type not supported by SNMP version 1

See Also