Hi Brice,

You can do this by creating an OctetString.fromHexString("<the logged 
pdu>",':'):

OctetString message = OctetString.fromHexString(..,':');

Then get the input stream by:

BERInputStream is = new BERInputStream(ByteBuffer.wrap(message.getValue()));

Then let your MesssageDispatcherImpl decode the PDU:

MessageDispatcher md = new MessageDispatcherImpl();
SecurityProtocols.addDefaultProtocols();
md.addCommandResponder(this);
md.processMessage(null, new UpdAddress(), is);

Then you implement the CommandResponder interface and
you have the decoded PDU.

Best regards,
Frank



On 19.02.2010 15:19, Brice Fines wrote:
> Hi Frank,
>
> Is it possible to rebuild a TRAP object (PDUv1) just using data from the
> log?
> For example:
> org.snmp4j.transport.DefaultUdpTransportMapping$ListenThread<run>
> Received message from /10.xxx.x.xxx/162 with length 107:
> 30:69:02:01:00:04:03:61:74:6d:a4:5f:06:0c:2b:06:01:04:01:81:3f:27:01:01:82:01:40:04:82:20:01:0a:02:01:06:02:01:0d:43:02:58:61:30:3f:30:12:06:0d:2b:06:01:04:01:81:3f:27:0d:02:01:0a:00:02:01:03:30:29:06:0e:2b:06:01:04:01:81:3f:27:0d:02:03:02:0c:00:04:17:31:36:2f:30:32:2f:32:30:31:30:20:31:31:3a:31:37:3a:34:39:20:2d:36:30
>
> (My app hung, and I want to try to reproduce the last TRAP that were
> received.)
> If it's possible, can you provide an example?
> Thanks in advance
> Regards
> Brice
> _______________________________________________
> SNMP4J mailing list
> SNMP4J@agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com

_______________________________________________
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j

Reply via email to