Accept all readable v3 Traps

I’d like to have a receiver accept all readable (NOAUTH_NOPRIV) v3 traps.

Looking into it, seems SNMP4j first gets the Trap and decodes it, populating the securityName along with other data. It then checks to authenticate it against USM if and only if securityLevel > NOAUTH_NOPRIV OR if the securityName.length > 0.

Edit: My question is how do I intercept a PDU before SNMP4j authenticates it.

What is your question?

My question is how do I intercept a PDU before SNMP4j authenticates it.

I actually found my solution to this. By extending MPv3 and USM to create my own custom versions I can operate on a Trap before calling USM.processIncomingMsg(…). This way I can accept all “readable traps” even if I don’t have the correct entries in the USM userTable.

OK, alternatively you could get the transport message by implementing a TransportListener.