Re: [SNMP4J] [Question]about the TimeCheck:

2009-07-09 Thread Frank Fock
Hi,

wei tong wrote:
 why a Request with different EngineID can jump the time Check?

Since the engine IDs differ, which timestamps
do you want to compare?


 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.

I cannot follow your argumentation here. Have you
read the USM RFC and understood what getTimeDiff()
computes? Then please rephrase your question.

Best regards,
Frank

 
 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 ...
 ___
 SNMP4J mailing list
 SNMP4J@agentpp.org
 http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com

___
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j


[SNMP4J] [Question]about the TimeCheck:

2009-07-08 Thread wei tong
   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 ...
___
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j