I was migrating from opendmk to snmp4j and I tried to access message id and message flags from an SNMP V3 TRAP but found that the StateReference object which contains these values is set to null in the CommandResponderEvent.
Digging further i found that the MPV3.prepareDataElements() method sets the statereference to null. I think this is a bug due to which i dont get the data parsed from the SNMPTrap Header. Is there any other way that i can access the msgId and msgFlagsfrom header or is there a possibility of fixing this.
The StateReference is supposed by RFC 3412 §7.2.6 to be used for “stateReference = reference to state information to be used for a possible Response”. For an unconfirmed trap, there will be never a response. Therefore the state information should be released early, for security reasons, although section 7.2.14 of RFC 3412 does not explicitly require that.