[SNMP4J] Create PDU from ByteBuffer

Norman Elton normelton at gmail.com
Fri May 30 15:29:58 CEST 2008


Frank,

Thanks for the tip. It appears that this method requires that I
process and strip off the SNMP version and community string, as well
as the wrapper surrounding the entire SNMP message. Is there a method
someplace that can take care of this for me?

Thanks!

Norman

On Thu, May 29, 2008 at 6:56 PM, Frank Fock <fock at agentpp.com> wrote:
> Hi Norman,
>
> it is as simple as
>
> BERInputStream berInputStream =
>        new BERInputStream(myByteBuffer);
> PDU pdu = new PDU();
> pdu.decodeBER(berInputStream);
>
> Best regards,
> Frank
>
> Norman Elton wrote:
>>
>> I've got a server that listens for both SNMP PDUs and Radius requests
>> (long story). Right now, I've got one thread that extends
>> CommandResponder and is listening for incoming PDUs, and another
>> thread running a DatagramChannel listening for Radius UDP packets.
>>
>> I'd like to streamline this and have one thread, calling a select() on
>> two DatagramChannels. When I get a SNMP PDU; however, I don't see a
>> way to instantiate a PDU object to "decode" the packet.
>>
>> Is there a way to create a PDU from a given ByteBuffer that's already
>> been read off the wire, rather than having SNMP run it's own
>> "listener"?
>>
>> Hope this makes sense, thanks for your help!
>>
>> Norman Elton
>>
>> =======
>> Network Engineering
>> College of William & Mary
>> _______________________________________________
>> SNMP4J mailing list
>> SNMP4J at agentpp.org
>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>
> --
> AGENT++
> http://www.agentpp.com
> http://www.mibexplorer.com
> http://www.mibdesigner.com
>



More information about the SNMP4J mailing list