Index: src/include/drvTS.h
===================================================================
RCS file: /usr/local/epicsmgr/cvsroot/epics/base/src/include/Attic/drvTS.h,v
retrieving revision 1.4.2.2
diff -c -r1.4.2.2 drvTS.h
*** src/include/drvTS.h	12 Jul 2002 22:18:35 -0000	1.4.2.2
--- src/include/drvTS.h	31 Mar 2005 13:22:00 -0000
***************
*** 40,45 ****
--- 40,48 ----
  #define TS_SECS_ASYNC_TRY_MASTER (60*5) /* every five minutes */
  #define TS_SECS_SYNC_TRY_MASTER (60*1) /* every one minute */
  
+ /*mask values for TSstampTrans.mask and TSinfo.mask */
+ #define TS_STAMP_FROM_UNIX 0x0001
+ 
  #define UDP_TIME_PORT 37
  #define UDP_NTP_PORT 123
  
***************
*** 78,83 ****
--- 81,87 ----
  	struct timespec unix_time;	/* time using 1900 epoch */
  	unsigned long sync_rate; 	/* master sends sync at this rate */
  	unsigned long clock_hz;		/* master clock this frequency (tick rate) */
+ 	unsigned long mask;             /*extra info*/
  };
  typedef struct TSstampTransStruct TSstampTrans;
  
***************
*** 106,111 ****
--- 110,116 ----
  
  	struct sockaddr hunt;	/* broadcast address info */
  	struct sockaddr master;	/* socket info for contacting master */
+ 	unsigned long mask;     /*extra info*/
  };
  typedef struct TSinfoStruct TSinfo;
  
Index: src/db/drvTS.c
===================================================================
RCS file: /usr/local/epicsmgr/cvsroot/epics/base/src/db/Attic/drvTS.c,v
retrieving revision 1.28.2.9
diff -c -r1.28.2.9 drvTS.c
*** src/db/drvTS.c	10 Feb 2003 14:54:16 -0000	1.28.2.9
--- src/db/drvTS.c	31 Mar 2005 13:22:00 -0000
***************
*** 1037,1042 ****
--- 1037,1043 ----
  
      /* set the EPICS event time table sync entry (current time) */
      key=intLock();
+     TSdata.mask |= TS_STAMP_FROM_UNIX;
      TSdata.event_table[TSdata.sync_event]=tp;
      TSdata.event_table[0]=tp;
      intUnlock(key);
***************
*** 1255,1260 ****
--- 1256,1262 ----
  	    htonl(TSdata.event_table[TSdata.sync_event].tv_sec);
  	stran.master_time.tv_nsec=
  	    htonl(TSdata.event_table[TSdata.sync_event].tv_nsec);
+         stran.mask = TSdata.mask; TSdata.mask = 0;
  	if(sendto(soc,(char*)&stran,sizeof(stran),0,
  	    (struct sockaddr*)&sin,sizeof(sin))<0)
  	{ perror("sendto failed"); }
***************
*** 1497,1502 ****
--- 1499,1505 ----
  	    TSprintf("TSsyncClient: invalid packet received\n");
  	    continue;
  	}
+         if(mlen<sizeof(stran)) stran.mask = 0;
  
  	/* get the master time out of packet */
  	mast_time.tv_sec=ntohl(stran.master_time.tv_sec);
***************
*** 1513,1522 ****
  	if( TSdata.event_table[TSdata.sync_event].tv_sec!=mast_time.tv_sec
  	|| TSdata.event_table[TSdata.sync_event].tv_nsec!=mast_time.tv_nsec)
  	{
! 	    TSprintf("sync Slave not in sync: %lu,%lu != %lu,%lu\n",
! 		TSdata.event_table[TSdata.sync_event].tv_sec,
! 		TSdata.event_table[TSdata.sync_event].tv_nsec,
! 		mast_time.tv_sec, mast_time.tv_nsec);
  	    key=intLock();
  	    TSdata.event_table[TSdata.sync_event].tv_sec=mast_time.tv_sec;
  	    TSdata.event_table[TSdata.sync_event].tv_nsec=mast_time.tv_nsec;
--- 1516,1537 ----
  	if( TSdata.event_table[TSdata.sync_event].tv_sec!=mast_time.tv_sec
  	|| TSdata.event_table[TSdata.sync_event].tv_nsec!=mast_time.tv_nsec)
  	{
!             int dir;
!             struct timespec diffFromMaster;
!             double timeDiff;
! 
!             dir = TScalcDiff(&TSdata.event_table[TSdata.sync_event],
!                     &mast_time,&diffFromMaster);
!             timeDiff = diffFromMaster.tv_sec;
!             timeDiff += diffFromMaster.tv_nsec/(double)TS_BILLION;
!             if(dir<0) timeDiff = -timeDiff;
!             if(!(stran.mask&TS_STAMP_FROM_UNIX)
!             || (fabs(timeDiff) > 0.1) ) {
!                TSprintf("TSasynClient time differs from master "
!                    "master resynced %s diff from master %f\n",
!                    (stran.mask&TS_STAMP_FROM_UNIX ? "Yes" : "No"),
!                    timeDiff);
!             }
  	    key=intLock();
  	    TSdata.event_table[TSdata.sync_event].tv_sec=mast_time.tv_sec;
  	    TSdata.event_table[TSdata.sync_event].tv_nsec=mast_time.tv_nsec;
