nettools/conntest/probe/src/prt.cpp
branchRCL_3
changeset 14 c6b52d057a05
parent 0 857a3e953887
equal deleted inserted replaced
9:a17829cb5e59 14:c6b52d057a05
   305 		newTime.UniversalTime();
   305 		newTime.UniversalTime();
   306 		TTimeIntervalMicroSeconds interval = newTime.MicroSecondsFrom(iTimeOrigin);
   306 		TTimeIntervalMicroSeconds interval = newTime.MicroSecondsFrom(iTimeOrigin);
   307 
   307 
   308 		const TInt KMicrosInASecond = 1000000;
   308 		const TInt KMicrosInASecond = 1000000;
   309 
   309 
   310 		//TUint32 micros = interval.Int64().Low();
   310 		// To avoid possible overflow caused by microsecond accuracy (32 bits
   311 		TUint32 micros = I64LOW(interval.Int64());//.Low();  x.Low() -> I64LOW(x)
   311 		// of microseconds is just a bit over an hour), use 64-bit variables
   312 		TUint32 secs = micros / KMicrosInASecond;
   312 		// in calculation of timestamp
   313 		micros -= (secs * KMicrosInASecond);
   313 		TInt64 secs = interval.Int64() / KMicrosInASecond;
   314 
   314 
   315 		//
   315 		//
   316 		// Reuse the protocol and flags fields of
   316 		// Reuse the protocol and flags fields of
   317 		// RMBufPktInfo to store the time-stamp
   317 		// RMBufPktInfo to store the time-stamp
   318 		//
   318 		//
   319 		RMBufPktInfo* info = RMBufPacket::PeekInfoInChain(copy);
   319 		RMBufPktInfo* info = RMBufPacket::PeekInfoInChain(copy);
   320 		info->iProtocol = static_cast<TInt>(secs);
   320 		// Just let the seconds overflow in case of timestamp is over the
   321 		info->iFlags = static_cast<TUint>(micros);
   321 		// integer scope (nothing reasonable to do in this case anyway)
       
   322 		info->iProtocol = static_cast<TInt>( secs );
       
   323 		info->iFlags = static_cast<TUint>( interval.Int64() - ( secs * KMicrosInASecond ));
   322 
   324 
   323 		iQueue.Append(copy);
   325 		iQueue.Append(copy);
   324 		iDumpCb.CallBack();
   326 		iDumpCb.CallBack();
   325 		}
   327 		}
   326 	else
   328 	else