[SNMP4J] [Question]about the TimeCheck:

wei tong thinkinrelativity at gmail.com
Wed Jul 8 09:58:12 CEST 2009


   hi all,hi Frank,

    I read the following code and RFC,i knew the code implements the
TimeWindow.but i cant understand clearly,

    why a Request with different EngineID can jump the time Check?

    that means if we using a snmptool to sent trap to local TrapReceiver, it
will be refused after 150 sec
    because the "entry.getLatestReceivedTime()" is always zero.

    thx for all.

    if (localTime.getEngineID().equals(entry.getEngineID())) {
      /* Entry found, we are authoritative */
      if ((localTime.getEngineBoots() == 2147483647) ||
          (localTime.getEngineBoots() != entry.getEngineBoots()) ||
          (Math.abs(now + localTime.getTimeDiff() -
entry.getLatestReceivedTime())
           > 150)) {
        if (logger.isDebugEnabled()) {
          logger.debug(
              "CheckTime: received message outside time window
(authorative):"+
              ((localTime.getEngineBoots() !=
                entry.getEngineBoots()) ? "engineBoots differ" :
               ""+(Math.abs(now + localTime.getTimeDiff() -
                            entry.getLatestReceivedTime()))+" > 150"));
        }
        return SnmpConstants.SNMPv3_USM_NOT_IN_TIME_WINDOW;
      }
      else {
        if (logger.isDebugEnabled()) {
          logger.debug("CheckTime: time ok (authorative)");
        }
        return SnmpConstants.SNMPv3_USM_OK;
      }
    }
    else ...



More information about the SNMP4J mailing list