t = new CommunityTarget();
t.setVersion(SnmpConstants.version2c);
((CommunityTarget)t).setCommunity(community);
}
else {
UserTarget ut = new UserTarget();
t = ut;
String ae = (String)
ArgumentParser.getValue(settings, oAuthoritativeEngineID, 0);
if (ae != null) {
ut.setAuthoritativeEngineID(createOctetString(ae, null).getValue());
}
ut.setSecurityModel(USM.SECURITY_MODEL_USM);
String sn = (String)
ArgumentParser.getValue(settings, oSecurityName, 0);
if (sn != null) {
ut.setSecurityName(createOctetString(sn, null));
}
Integer secLevel =
(Integer) ArgumentParser.getValue(settings, oSecLevel, 0);
if (secLevel == null) {
if (settings.containsKey(oPrivPassphrase)) {
ut.setSecurityLevel(SecurityLevel.AUTH_PRIV);
}
else if (settings.containsKey(oAuthPassphrase)) {
ut.setSecurityLevel(SecurityLevel.AUTH_NOPRIV);
}
else {
ut.setSecurityLevel(SecurityLevel.NOAUTH_NOPRIV);
}
}
else {
ut.setSecurityLevel(secLevel.intValue());
}
}
int retries = 0;
Number r = (Number) ArgumentParser.getValue(settings, oRetries, 0);
if (r != null) {