[SNMP4J] Inconsistent SnmpFrameworkMIB.snmpEngineBoots

Mark Gorokhov mark.gorokhov at comtechmobile.com
Fri Jan 25 15:50:19 CET 2008


The declaration of scalar SnmpFrameworkMIB.snmpEngineBoots 
is not consistent. 

This object is created as an anonymous MOScalar class with 
getValue() returning boots counter from USM class. At the 
same time it does not override setValue(). It means that 
call to setValue() puts a value into MOScalar object, but 
returns a value from USM object. 

Adding the method would solve the problem:
  public int setValue(Variable value) {
    if (value.getSyntax() == SMIConstants.SYNTAX_INTEGER32) {
      getUSM().setEngineBoots(((Integer32)value).getValue());
      return SnmpConstants.SNMP_ERROR_SUCCESS;
    }
    return SnmpConstants.SNMP_ERROR_BAD_VALUE;
  }

Thanks,
Mark G.




More information about the SNMP4J mailing list