* specified in the listen() method. It extracts a {@link Variable}
* according to the configured OID prefix and sends its value to the event
* bus.
*/
public void processPdu(CommandResponderEvent event) {
Address addr = event.getPeerAddress();
if (addr == null) {
return;
}
String s = addr.toString().split("/")[0];
if (s == null) {
logger.error("TRAP: failed to translate address {}", addr);
dispatchPdu(addr, event.getPDU());
} else {
// Need to change the port to 161, which is what the bindings are configured for since
// at least some SNMP devices send traps from a random port number. Otherwise the trap
// won't be found as the address check will fail. It feels like there should be a better
// way to do this!!!
Address address = GenericAddress.parse("udp:" + s + "/161");
dispatchPdu(address, event.getPDU());
}
}