[SNMP4J] Create PDU from ByteBuffer
Frank Fock
fock at agentpp.com
Fri May 30 00:56:01 CEST 2008
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