[SNMP4J] snmpv3 traps with localized engines

Matthieu Casanova chocolat.mou at gmail.com
Wed Aug 8 12:36:45 CEST 2007


Hi, I'm trying to use snmpv3 traps with a localized engine but I can't
(it works fine without localized engine).

What I've done is :
adding a localized user :
		UsmUser usmUser = new UsmUser(new OctetString("SHADES"),
									  AuthSHA.ID,
									  new OctetString("SHADESAuthPassword"),
									  PrivDES.ID,
									  new OctetString("SHADESPrivPassword"),
									  new OctetString("cacaboum"));
		snmp.getUSM().addUser(new OctetString("SHADES"), usmUser);

Adding an engine (I think this part is strange, is that normal to do that ?)

MPv3 processingModel = (MPv3) snmp.getMessageProcessingModel(3);
UdpAddress address = new UdpAddress("10.165.11.170/162");
processingModel.addEngineID(address, new OctetString("cacaboum"));

Of course my target has this address "10.165.11.170/162".

And when I send my trap it answers -1404 because it cannot find a
target with the good context engine.
I'm not sure but in MPv3 line 645 I have this

641    if (scopedPDU.isConfirmedPdu()) {
642      flags |= MPv3_REPORTABLE_FLAG;
643    }
644    else {
645      secEngineID = localEngineID;
646    }

Before that the secEngineID is "cacaboum" so it should be good, but
since I'm sending a trap, it's not a confirmedPDU and the secEngineID
get the localEngineID value that is not "cacaboum", so the USM will
try to find a target with my address but the localEngineID instead of
"cacaboum" as localEngineID.
Is it a bug or is it me that have done something wrong ?
thanks

Matthieu



More information about the SNMP4J mailing list