⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 70

📁 Unix/Linux 网络时间协议版本3 Network Time Protocol Version 3 (NTP) distribution for Unix systems
💻
📖 第 1 页 / 共 2 页
字号:
  extern int sigvec P((int, struct sigvec *, struct sigvec *));****************** 343,349 ****    /*-----------------------------------------------------------------------   * extract a bitfield from DCF77 datastream!  * All numeric field are LSB first.   * buf holds a pointer to a DCF77 data buffer in symbolic   *     representation   * idx holds the index to the field description in rawdcfcode--- 344,350 ----    /*-----------------------------------------------------------------------   * extract a bitfield from DCF77 datastream!  * All numeric fields are LSB first.   * buf holds a pointer to a DCF77 data buffer in symbolic   *     representation   * idx holds the index to the field description in rawdcfcode****************** 889,895 ****      return;      LPRINTF("set_time: %s ", pr_timeval(offset));!   msyslog(LOG_NOTICE, "setting time (offset %s)", pr_timeval(offset));      if (gettimeofday(&the_time, 0L) == -1)      {--- 890,896 ----      return;      LPRINTF("set_time: %s ", pr_timeval(offset));!   syslog(LOG_NOTICE, "setting time (offset %s)", pr_timeval(offset));      if (gettimeofday(&the_time, 0L) == -1)      {****************** 1080,1086 ****  	   * completely lost information  	   */  	  sync_state = NO_SYNC;! 	  msyslog(LOG_INFO, "DCF77 reception lost (timeout)");  	  last_notice = ticks;  	}        else--- 1081,1087 ----  	   * completely lost information  	   */  	  sync_state = NO_SYNC;! 	  syslog(LOG_INFO, "DCF77 reception lost (timeout)");  	  last_notice = ticks;  	}        else****************** 1089,1095 ****  	 */  	if ((ticks - last_notice) > NOTICE_INTERVAL)  	  {! 	    msyslog(LOG_NOTICE, "still not synchronized to DCF77 - check receiver/signal");  	    last_notice = ticks;  	  }      }--- 1090,1096 ----  	 */  	if ((ticks - last_notice) > NOTICE_INTERVAL)  	  {! 	    syslog(LOG_NOTICE, "still not synchronized to DCF77 - check receiver/signal");  	    last_notice = ticks;  	  }      }****************** 1100,1134 ****  }    /*-----------------------------------------------------------------------!  * break association from terminal to avaoid catching terminal   * or process group related signals (-> daemon operation)   */  static void detach()  {!   int s;  !   if (fork())!     exit(0);  !   for (s = 0; s < 3; s++)!     (void) close(s);!   (void) open("/", 0);!   (void) dup2(0, 1);!   (void) dup2(0, 2);! ! #if defined(NTP_POSIX_SOURCE) || defined(_POSIX_)!   (void) setsid();! #else  /* _POSIX_ */! #ifndef BSD!   (void) setpgrp();! #else  /* BSD */!   (void) setpgrp(0, getpid());! #endif /* BSD */! #endif /* _POSIX_ */! #if defined(hpux)!   if (fork())!     exit(0);! #endif /* hpux */  }    /*-------------------------------------------------------------------------- 1101,1167 ----  }    /*-----------------------------------------------------------------------!  * break association from terminal to avoid catching terminal   * or process group related signals (-> daemon operation)   */  static void detach()  {! #   ifdef HAVE_DAEMON!       daemon(0, 0);! #   else /* not HAVE_DAEMON */!       if (fork())! 	exit(0);  !       {! 	u_long s;! 	int max_fd;! ! #if defined(HAVE_SYSCONF) && defined(_SC_OPEN_MAX)! 	max_fd = sysconf(_SC_OPEN_MAX);! #else /* HAVE_SYSCONF && _SC_OPEN_MAX */! 	max_fd = getdtablesize();! #endif /* HAVE_SYSCONF && _SC_OPEN_MAX */! 	for (s = 0; s < max_fd; s++)! 	  (void) close(s);! 	(void) open("/", 0);! 	(void) dup2(0, 1);! 	(void) dup2(0, 2);! #ifdef SYS_DOMAINOS! 	{! 	  uid_$t puid;! 	  status_$t st;! ! 	  proc2_$who_am_i(&puid);! 	  proc2_$make_server(&puid, &st);! 	}! #endif /* SYS_DOMAINOS */! #if defined(HAVE_SETPGID) || defined(HAVE_SETSID)! # ifdef HAVE_SETSID! 	if (setsid() == (pid_t)-1)! 	  syslog(LOG_ERR, "dcfd: setsid(): %m");! # else! 	if (setpgid(0, 0) == -1)! 	  syslog(LOG_ERR, "dcfd: setpgid(): %m");! # endif! #else /* HAVE_SETPGID || HAVE_SETSID */! 	{! 	  int fid;  ! 	  fid = open("/dev/tty", 2);! 	  if (fid >= 0)! 	    {! 	      (void) ioctl(fid, (u_long) TIOCNOTTY, (char *) 0);! 	      (void) close(fid);! 	    }! # ifdef HAVE_SETPGRP_O! 	  (void) setpgrp();! # else /* HAVE_SETPGRP_0 */! 	  (void) setpgrp(0, getpid());! # endif /* HAVE_SETPGRP_0 */! 	}! #endif /* HAVE_SETPGID || HAVE_SETSID */!       }! #endif /* not HAVE_DAEMON */  }    /*-----------------------------------------------------------------------****************** 1312,1319 ****          memset(term.c_cc, 0, sizeof(term.c_cc));        term.c_cc[VMIN] = 1;! #ifdef NO_PARENB_IGNPAR /* Was: defined(SYS_IRIX4) || defined(SYS_IRIX5) */!       /* somehow doesn't grok PARENB & IGNPAR (mj) */        term.c_cflag = B50|CS8|CREAD|CLOCAL;  #else        term.c_cflag = B50|CS8|CREAD|CLOCAL|PARENB;--- 1345,1351 ----          memset(term.c_cc, 0, sizeof(term.c_cc));        term.c_cc[VMIN] = 1;! #ifdef NO_PARENB_IGNPAR        term.c_cflag = B50|CS8|CREAD|CLOCAL;  #else        term.c_cflag = B50|CS8|CREAD|CLOCAL|PARENB;****************** 1335,1341 ****  	detach();                /*!        * get msyslog() initialized         */  #ifdef LOG_DAEMON        openlog("dcfd", LOG_PID, LOG_DAEMON);--- 1367,1373 ----  	detach();                /*!        * get syslog() initialized         */  #ifdef LOG_DAEMON        openlog("dcfd", LOG_PID, LOG_DAEMON);****************** 1356,1362 ****    	if (sigvec(SIGALRM, &vec, (struct sigvec *)0) == -1)  	  {! 	    msyslog(LOG_ERR, "sigvec(SIGALRM): %m");  	    exit(1);  	  }        }--- 1388,1394 ----    	if (sigvec(SIGALRM, &vec, (struct sigvec *)0) == -1)  	  {! 	    syslog(LOG_ERR, "sigvec(SIGALRM): %m");  	    exit(1);  	  }        }****************** 1375,1381 ****  	        if (setitimer(ITIMER_REAL, &it, (struct itimerval *)0) == -1)  	{! 	  msyslog(LOG_ERR, "setitimer: %m");  	  exit(1);  	}        }--- 1407,1413 ----  	        if (setitimer(ITIMER_REAL, &it, (struct itimerval *)0) == -1)  	{! 	  syslog(LOG_ERR, "setitimer: %m");  	  exit(1);  	}        }****************** 1383,1389 ****        (void) alarm(1<<ADJINTERVAL);  #endif  !       PRINTF("  DCF77 monitor - Copyright 1993-1996 Frank Kardel\n\n");          pbuf[60] = '\0';        for ( i = 0; i < 60; i++)--- 1415,1421 ----        (void) alarm(1<<ADJINTERVAL);  #endif  !       PRINTF("  DCF77 monitor - Copyright (C) 1993 - 1997 by Frank Kardel\n\n");          pbuf[60] = '\0';        for ( i = 0; i < 60; i++)****************** 1433,1439 ****  		      if (sync_state == SYNC)  			{  			  sync_state = NO_SYNC;! 			  msyslog(LOG_INFO, "DCF77 reception lost (bad data)");  			}  		      errs++;  		    }--- 1465,1471 ----  		      if (sync_state == SYNC)  			{  			  sync_state = NO_SYNC;! 			  syslog(LOG_INFO, "DCF77 reception lost (bad data)");  			}  		      errs++;  		    }****************** 1498,1504 ****  		      if (sync_state == SYNC)  			{  			  sync_state = NO_SYNC;! 			  msyslog(LOG_INFO, "DCF77 reception lost (data mismatch)");  			}  		      errs++;  		      rtc = CVT_FAIL|CVT_BADTIME|CVT_BADDATE;--- 1530,1536 ----  		      if (sync_state == SYNC)  			{  			  sync_state = NO_SYNC;! 			  syslog(LOG_INFO, "DCF77 reception lost (data mismatch)");  			}  		      errs++;  		      rtc = CVT_FAIL|CVT_BADTIME|CVT_BADDATE;****************** 1520,1526 ****  		      last_sync = ticks;  		      if (sync_state == NO_SYNC)  			{! 			  msyslog(LOG_INFO, "receiving DCF77");  			}  		      else  			{--- 1552,1558 ----  		      last_sync = ticks;  		      if (sync_state == NO_SYNC)  			{! 			  syslog(LOG_INFO, "receiving DCF77");  			}  		      else  			{****************** 1587,1593 ****        /*         * lost IO - sorry guys         */!       msyslog(LOG_ERR, "TERMINATING - cannot read from device %s (%m)", file);          (void)close(fd);      }--- 1619,1625 ----        /*         * lost IO - sorry guys         */!       syslog(LOG_ERR, "TERMINATING - cannot read from device %s (%m)", file);          (void)close(fd);      }Index: xntpd/ntp_proto.cdiff -c xntpd/ntp_proto.c:1.1.1.45 xntpd/ntp_proto.c:3.46*** xntpd/ntp_proto.c:1.1.1.45	Sun Jan 19 13:22:08 1997--- xntpd/ntp_proto.c	Sun Jan 19 13:45:35 1997****************** 511,518 ****  	} else {  #ifdef DEBUG  		if (debug > 2)! 			printf("receive: bad length %d %d\n",! 			    rbufp->recv_length, (int) sizeof(struct pkt));  #endif  		sys_badlength++;  		return;--- 511,518 ----  	} else {  #ifdef DEBUG  		if (debug > 2)! 			printf("receive: bad length %d %ld\n",! 			    rbufp->recv_length, sizeof(struct pkt));  #endif  		sys_badlength++;  		return;Index: xntpd/refclock_parse.cdiff -c xntpd/refclock_parse.c:1.1.1.30 xntpd/refclock_parse.c:3.98*** xntpd/refclock_parse.c:1.1.1.30	Sun Jan 19 13:10:41 1997--- xntpd/refclock_parse.c	Sun Jan 19 15:11:59 1997****************** 1,7 ****  /*!  * /src/NTP/REPOSITORY/v4/xntpd/refclock_parse.c,v 3.96 1996/12/01 16:05:49 kardel Exp   *!  * refclock_parse.c,v 3.96 1996/12/01 16:05:49 kardel Exp   *   * generic reference clock driver for receivers   *--- 1,7 ----  /*!  * /src/NTP/REPOSITORY/v4/xntpd/refclock_parse.c,v 3.98 1997/01/19 14:11:59 kardel Exp   *!  * refclock_parse.c,v 3.98 1997/01/19 14:11:59 kardel Exp   *   * generic reference clock driver for receivers   ******************* 9,15 ****   * available and configured. Currently the STREAMS module   * is only available for Suns running SunOS 4.x and SunOS5.x   *!  * Copyright (c) 1989,1990,1991,1992,1993,1994,1995,1996 by Frank Kardel   * Friedrich-Alexander Universitt Erlangen-Nrnberg, Germany   *   * This program is distributed in the hope that it will be useful,--- 9,15 ----   * available and configured. Currently the STREAMS module   * is only available for Suns running SunOS 4.x and SunOS5.x   *!  * Copyright (c) 1989,1990,1991,1992,1993,1994,1995,1996, 1997 by Frank Kardel   * Friedrich-Alexander Universitt Erlangen-Nrnberg, Germany   *   * This program is distributed in the hope that it will be useful,****************** 144,150 ****  #include "parse.h"    #if !defined(NO_SCCSID) && !defined(lint) && !defined(__GNUC__)! static char rcsid[]="refclock_parse.c,v 3.96 1996/12/01 16:05:49 kardel Exp";  #endif    /**===========================================================================--- 144,150 ----  #include "parse.h"    #if !defined(NO_SCCSID) && !defined(lint) && !defined(__GNUC__)! static char rcsid[]="refclock_parse.c,v 3.98 1997/01/19 14:11:59 kardel Exp";  #endif    /**===========================================================================****************** 1238,1244 ****  static int  ppsclock_init   P((struct parseunit *));  static int  stream_init     P((struct parseunit *));  static void stream_end      P((struct parseunit *));- static void stream_nop      P((struct parseunit *));  static int  stream_enable   P((struct parseunit *));  static int  stream_disable  P((struct parseunit *));  static int  stream_setcs    P((struct parseunit *, parsectl_t *));--- 1238,1243 ----****************** 1433,1447 ****  }    /*---------------------------------------------------  * STREAM nop-  */- static void- stream_nop(parse)-      struct parseunit *parse;- {- }- - /*--------------------------------------------------   * STREAM enable   */  static int--- 1432,1437 ----****************** 3128,3149 ****  }    /*---------------------------------------------------  * parse_leap - called when a leap second occurs-  */- - static void- parse_leap()- {- 	/*- 	 * PARSE encodes the LEAP correction direction.- 	 * For timecodes that do not pass on the leap correction direction- 	 * the default PARSEB_LEAPADD must be used. It may then be modified- 	 * with a fudge flag (flag2).- 	 */- }- - - /*--------------------------------------------------   * parse_control - set fudge factors, return statistics   */  static void--- 3118,3123 ----****************** 3371,3377 ****        sprintf(tt, "refclock_iomode=\"%s\"", parse->binding->bd_description);          tt = add_var(&out->kv_list, 128, RO);!       sprintf(tt, "refclock_driver_version=\"refclock_parse.c,v 3.96 1996/12/01 16:05:49 kardel Exp\"");          out->lencode       = strlen(outstatus);        out->lastcode      = outstatus;--- 3345,3351 ----        sprintf(tt, "refclock_iomode=\"%s\"", parse->binding->bd_description);          tt = add_var(&out->kv_list, 128, RO);!       sprintf(tt, "refclock_driver_version=\"refclock_parse.c,v 3.98 1997/01/19 14:11:59 kardel Exp\"");          out->lencode       = strlen(outstatus);        out->lastcode      = outstatus;****************** 4266,4271 ****--- 4240,4251 ----   * History:   *   * refclock_parse.c,v+  * Revision 3.98  1997/01/19 14:11:59  kardel+  * removed superfluous functions+  *+  * Revision 3.97  1997/01/19 12:46:01  kardel+  * 3-5.88.1 reconcilation+  *   * Revision 3.96  1996/12/01 16:05:49  kardel   * freeze for 5.86.12.2 PARSE-Patch   *

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -