亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? refclock_wwvb.c

?? 網絡時間協議NTP 源碼 版本v4.2.0b 該源碼用于linux平臺下
?? C
字號:
/* * refclock_wwvb - clock driver for Spectracom WWVB and GPS receivers */#ifdef HAVE_CONFIG_H#include <config.h>#endif#if defined(REFCLOCK) && defined(CLOCK_SPECTRACOM)#include "ntpd.h"#include "ntp_io.h"#include "ntp_refclock.h"#include "ntp_calendar.h"#include "ntp_stdlib.h"#include <stdio.h>#include <ctype.h>/* * This driver supports the Spectracom Model 8170 and Netclock/2 WWVB * Synchronized Clocks and the Netclock/GPS Master Clock. Both the WWVB * and GPS clocks have proven reliable sources of time; however, the * WWVB clocks have proven vulnerable to high ambient conductive RF * interference. The claimed accuracy of the WWVB clocks is 100 us * relative to the broadcast signal, while the claimed accuracy of the * GPS clock is 50 ns; however, in most cases the actual accuracy is * limited by the resolution of the timecode and the latencies of the * serial interface and operating system. * * The WWVB and GPS clocks should be configured for 24-hour display, * AUTO DST off, time zone 0 (UTC), data format 0 or 2 (see below) and * baud rate 9600. If the clock is to used as the source for the IRIG * Audio Decoder (refclock_irig.c in this distribution), it should be * configured for AM IRIG output and IRIG format 1 (IRIG B with * signature control). The GPS clock can be configured either to respond * to a 'T' poll character or left running continuously.  * * There are two timecode formats used by these clocks. Format 0, which * is available with both the Netclock/2 and 8170, and format 2, which * is available only with the Netclock/2, specially modified 8170 and * GPS. * * Format 0 (22 ASCII printing characters): * * <cr><lf>i  ddd hh:mm:ss TZ=zz<cr><lf> * *	on-time = first <cr> *	hh:mm:ss = hours, minutes, seconds *	i = synchronization flag (' ' = in synch, '?' = out of synch) * * The alarm condition is indicated by other than ' ' at a, which occurs * during initial synchronization and when received signal is lost for * about ten hours. * * Format 2 (24 ASCII printing characters): * * <cr><lf>iqyy ddd hh:mm:ss.fff ld * *	on-time = <cr> *	i = synchronization flag (' ' = in synch, '?' = out of synch) *	q = quality indicator (' ' = locked, 'A'...'D' = unlocked) *	yy = year (as broadcast) *	ddd = day of year *	hh:mm:ss.fff = hours, minutes, seconds, milliseconds * * The alarm condition is indicated by other than ' ' at a, which occurs * during initial synchronization and when received signal is lost for * about ten hours. The unlock condition is indicated by other than ' ' * at q. * * The q is normally ' ' when the time error is less than 1 ms and a * character in the set 'A'...'D' when the time error is less than 10, * 100, 500 and greater than 500 ms respectively. The l is normally ' ', * but is set to 'L' early in the month of an upcoming UTC leap second * and reset to ' ' on the first day of the following month. The d is * set to 'S' for standard time 'I' on the day preceding a switch to * daylight time, 'D' for daylight time and 'O' on the day preceding a * switch to standard time. The start bit of the first <cr> is * synchronized to the indicated time as returned. * * This driver does not need to be told which format is in use - it * figures out which one from the length of the message. The driver * makes no attempt to correct for the intrinsic jitter of the radio * itself, which is a known problem with the older radios. * * Fudge Factors * * This driver can retrieve a table of quality data maintained * internally by the Netclock/2 clock. If flag4 of the fudge * configuration command is set to 1, the driver will retrieve this * table and write it to the clockstats file when the first timecode * message of a new day is received. * * PPS calibration fudge time 1: format 0 .003134, format 2 .004034 *//* * Interface definitions */#define	DEVICE		"/dev/wwvb%d" /* device name and unit */#define	SPEED232	B9600	/* uart speed (9600 baud) */#define	PRECISION	(-13)	/* precision assumed (about 100 us) */#define	REFID		"WWVB"	/* reference ID */#define	DESCRIPTION	"Spectracom WWVB/GPS Receiver" /* WRU */#define	LENWWVB0	22	/* format 0 timecode length */#define LENWWVB1	22	/* format 1 timecode length */#define	LENWWVB2	24	/* format 2 timecode length */#define LENWWVB3        29      /* format 3 timecode length */#define MONLIN		15	/* number of monitoring lines *//* * WWVB unit control structure */struct wwvbunit {	l_fp	laststamp;	/* last receive timestamp */	u_char	lasthour;	/* last hour (for monitor) */	u_char	linect;		/* count ignored lines (for monitor */};/* * Function prototypes */static	int	wwvb_start	P((int, struct peer *));static	void	wwvb_shutdown	P((int, struct peer *));static	void	wwvb_receive	P((struct recvbuf *));static	void	wwvb_poll	P((int, struct peer *));static	void	wwvb_timer	P((int, struct peer *));/* * Transfer vector */struct	refclock refclock_wwvb = {	wwvb_start,		/* start up driver */	wwvb_shutdown,		/* shut down driver */	wwvb_poll,		/* transmit poll message */	noentry,		/* not used (old wwvb_control) */	noentry,		/* initialize driver (not used) */	noentry,		/* not used (old wwvb_buginfo) */	wwvb_timer		/* called once per second */};/* * wwvb_start - open the devices and initialize data for processing */static intwwvb_start(	int unit,	struct peer *peer	){	register struct wwvbunit *up;	struct refclockproc *pp;	int fd;	char device[20];	/*	 * Open serial port. Use CLK line discipline, if available.	 */	sprintf(device, DEVICE, unit);	if (!(fd = refclock_open(device, SPEED232, LDISC_CLK)))		return (0);	/*	 * Allocate and initialize unit structure	 */	if (!(up = (struct wwvbunit *)	      emalloc(sizeof(struct wwvbunit)))) {		close(fd);		return (0);	}	memset((char *)up, 0, sizeof(struct wwvbunit));	pp = peer->procptr;	pp->unitptr = (caddr_t)up;	pp->io.clock_recv = wwvb_receive;	pp->io.srcclock = (caddr_t)peer;	pp->io.datalen = 0;	pp->io.fd = fd;	if (!io_addclock(&pp->io)) {		close(fd);		free(up);		return (0);	}	/*	 * Initialize miscellaneous variables	 */	peer->precision = PRECISION;	pp->clockdesc = DESCRIPTION;	memcpy((char *)&pp->refid, REFID, 4);	return (1);}/* * wwvb_shutdown - shut down the clock */static voidwwvb_shutdown(	int unit,	struct peer *peer	){	register struct wwvbunit *up;	struct refclockproc *pp;	pp = peer->procptr;	up = (struct wwvbunit *)pp->unitptr;	io_closeclock(&pp->io);	free(up);}/* * wwvb_receive - receive data from the serial interface */static voidwwvb_receive(	struct recvbuf *rbufp	){	struct wwvbunit *up;	struct refclockproc *pp;	struct peer *peer;	l_fp	trtmp;		/* arrival timestamp */	int	tz;		/* time zone */	int	day, month;	/* ddd conversion */	int	temp;		/* int temp */	char	syncchar;	/* synchronization indicator */	char	qualchar;	/* quality indicator */	char	leapchar;	/* leap indicator */	char	dstchar;	/* daylight/standard indicator */	char	tmpchar;	/* trashbin */	/*	 * Initialize pointers and read the timecode and timestamp	 */	peer = (struct peer *)rbufp->recv_srcclock;	pp = peer->procptr;	up = (struct wwvbunit *)pp->unitptr;	temp = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &trtmp);	/*	 * Note we get a buffer and timestamp for both a <cr> and <lf>,	 * but only the <cr> timestamp is retained. Note: in format 0 on	 * a Netclock/2 or upgraded 8170 the start bit is delayed 100	 * +-50 us relative to the pps; however, on an unmodified 8170	 * the start bit can be delayed up to 10 ms. In format 2 the	 * reading precision is only to the millisecond. Thus, unless	 * you have a PPS gadget and don't have to have the year, format	 * 0 provides the lowest jitter.	 */	if (temp == 0) {		up->laststamp = trtmp;		return;	}	pp->lencode = temp;	pp->lastrec = up->laststamp;	/*	 * We get down to business, check the timecode format and decode	 * its contents. This code uses the timecode length to determine	 * format 0, 2 or 3. If the timecode has invalid length or is	 * not in proper format, we declare bad format and exit.	 */	syncchar = qualchar = leapchar = dstchar = ' ';	tz = 0;	switch (pp->lencode) {	case LENWWVB0:		/*		 * Timecode format 0: "I  ddd hh:mm:ss DTZ=nn"		 */		if (sscanf(pp->a_lastcode,		    "%c %3d %2d:%2d:%2d%c%cTZ=%2d",		    &syncchar, &pp->day, &pp->hour, &pp->minute,		    &pp->second, &tmpchar, &dstchar, &tz) == 8)			pp->nsec = 0;			break;	case LENWWVB2:		/*		 * Timecode format 2: "IQyy ddd hh:mm:ss.mmm LD" */		if (sscanf(pp->a_lastcode,		    "%c%c %2d %3d %2d:%2d:%2d.%3ld %c",		    &syncchar, &qualchar, &pp->year, &pp->day,		    &pp->hour, &pp->minute, &pp->second, &pp->nsec,		    &leapchar) == 9)			pp->nsec *= 1000000;			break;	case LENWWVB3:	   	/*		 * Timecode format 3: "0003I yyyymmdd hhmmss+0000SL#"		 */		if (sscanf(pp->a_lastcode,		    "0003%c %4d%2d%2d %2d%2d%2d+0000%c%c",		    &syncchar, &pp->year, &month, &day, &pp->hour,		    &pp->minute, &pp->second, &dstchar, &leapchar) == 8)		    {			pp->day = ymd2yd(pp->year, month, day);			pp->nsec = 0;			break;		}	default:		/*		 * Unknown format: If dumping internal table, record		 * stats; otherwise, declare bad format.		 */		if (up->linect > 0) {			up->linect--;			record_clock_stats(&peer->srcadr,			    pp->a_lastcode);		} else {			refclock_report(peer, CEVNT_BADREPLY);		}		return;	}	/*	 * Decode synchronization, quality and leap characters. If	 * unsynchronized, set the leap bits accordingly and exit.	 * Otherwise, set the leap bits according to the leap character.	 * Once synchronized, the dispersion depends only on the	 * quality character.	 */	switch (qualchar) {	    case ' ':		pp->disp = .001;		pp->lastref = pp->lastrec;		break;	    case 'A':		pp->disp = .01;		break;	    case 'B':		pp->disp = .1;		break;	    case 'C':		pp->disp = .5;		break;	    case 'D':		pp->disp = MAXDISPERSE;		break;	    default:		pp->disp = MAXDISPERSE;		refclock_report(peer, CEVNT_BADREPLY);		break;	}	if (syncchar != ' ')		pp->leap = LEAP_NOTINSYNC;	else if (leapchar == 'L')		pp->leap = LEAP_ADDSECOND;	else		pp->leap = LEAP_NOWARNING;	/*	 * Process the new sample in the median filter and determine the	 * timecode timestamp.	 */	if (!refclock_process(pp))		refclock_report(peer, CEVNT_BADTIME);	if (peer->disp > MAXDISTANCE)		refclock_receive(peer);}/* * wwvb_timer - called once per second by the transmit procedure */static voidwwvb_timer(	int unit,	struct peer *peer	){	register struct wwvbunit *up;	struct refclockproc *pp;	char	pollchar;	/* character sent to clock */	/*	 * Time to poll the clock. The Spectracom clock responds to a	 * 'T' by returning a timecode in the format(s) specified above.	 * Note there is no checking on state, since this may not be the	 * only customer reading the clock. Only one customer need poll	 * the clock; all others just listen in.	 */	pp = peer->procptr;	up = (struct wwvbunit *)pp->unitptr;	if (up->linect > 0)		pollchar = 'R';	else		pollchar = 'T';	if (write(pp->io.fd, &pollchar, 1) != 1)		refclock_report(peer, CEVNT_FAULT);}/* * wwvb_poll - called by the transmit procedure */static voidwwvb_poll(	int unit,	struct peer *peer	){	register struct wwvbunit *up;	struct refclockproc *pp;	/*	 * Sweep up the samples received since the last poll. If none	 * are received, declare a timeout and keep going.	 */	pp = peer->procptr;	up = (struct wwvbunit *)pp->unitptr;	pp->polls++;	/*	 * If the monitor flag is set (flag4), we dump the internal	 * quality table at the first timecode beginning the day.	 */	if (pp->sloppyclockflag & CLK_FLAG4 && pp->hour <	    (int)up->lasthour)		up->linect = MONLIN;	up->lasthour = pp->hour;	/*	 * Process median filter samples. If none received, declare a	 * timeout and keep going.	 */	if (pp->coderecv == pp->codeproc) {		refclock_report(peer, CEVNT_TIMEOUT);		return;	}	refclock_receive(peer);	record_clock_stats(&peer->srcadr, pp->a_lastcode);#ifdef DEBUG	if (debug)		printf("wwvb: timecode %d %s\n", pp->lencode,		    pp->a_lastcode);#endif}#elseint refclock_wwvb_bs;#endif /* REFCLOCK */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看91精品国产入口| 欧美成va人片在线观看| 在线不卡免费av| 亚洲精品一区二区三区99| 亚洲人吸女人奶水| 精品无人区卡一卡二卡三乱码免费卡| 欧美三级乱人伦电影| 欧美在线观看你懂的| 久久久99免费| 日韩成人一级大片| 91国在线观看| 亚洲国产精品传媒在线观看| 青青草国产精品亚洲专区无| 91啪亚洲精品| 国产精品无遮挡| 韩国女主播一区| 欧美丰满美乳xxx高潮www| 亚洲免费观看高清在线观看| 国产精品一区免费在线观看| 91精品国产综合久久福利| 亚洲欧洲成人精品av97| 国产精品88av| 精品国产乱码久久久久久1区2区| 亚洲综合偷拍欧美一区色| 99在线精品一区二区三区| 久久久久久久久伊人| 免费在线成人网| 7777女厕盗摄久久久| 一区二区高清在线| 色中色一区二区| 亚洲第一成人在线| 色哦色哦哦色天天综合| 中文字幕在线一区二区三区| 风间由美一区二区三区在线观看 | 欧美大胆人体bbbb| 三级久久三级久久| 在线电影欧美成精品| 丝袜美腿成人在线| 51精品视频一区二区三区| 亚洲国产va精品久久久不卡综合| 91小宝寻花一区二区三区| 亚洲欧美综合色| 99国产精品一区| 亚洲裸体在线观看| 日本电影欧美片| 亚洲高清免费观看高清完整版在线观看 | 色域天天综合网| 亚洲精品成人a在线观看| 色婷婷亚洲精品| 亚洲国产日韩综合久久精品| 欧美日韩一区小说| 久久精品国产免费看久久精品| 欧美大片顶级少妇| 国产精品66部| 亚洲美女免费在线| 在线成人免费观看| 久久99精品国产麻豆不卡| 久久精品男人天堂av| 91在线视频免费观看| 亚洲一区二区三区小说| 91.com在线观看| 国产美女精品人人做人人爽 | 国产精品一二三在| 1区2区3区国产精品| 欧美美女喷水视频| 国产一区高清在线| 亚洲手机成人高清视频| 欧美色中文字幕| 激情综合网天天干| 最新热久久免费视频| 欧美一区二区精品| 福利一区在线观看| 亚洲福利国产精品| 国产婷婷色一区二区三区在线| av电影一区二区| 日本美女一区二区三区| 国产精品日日摸夜夜摸av| 欧美日韩一级二级三级| 久热成人在线视频| 亚洲黄色小说网站| 久久亚洲二区三区| 欧洲视频一区二区| 国产在线不卡一区| 亚洲福利一二三区| 中文字幕第一区二区| 欧美老年两性高潮| 97se亚洲国产综合自在线| 美女脱光内衣内裤视频久久网站 | 日本午夜精品视频在线观看| 国产精品女主播av| 日韩免费在线观看| 欧美天堂一区二区三区| 高清在线成人网| 美女网站色91| 午夜在线成人av| 中文字幕亚洲成人| 欧美精品一区二区三区在线播放| 色综合天天综合在线视频| 国产麻豆欧美日韩一区| 日产国产欧美视频一区精品| 日韩理论片中文av| 国产欧美精品一区二区色综合朱莉| 在线不卡欧美精品一区二区三区| 色婷婷激情一区二区三区| 丁香另类激情小说| 国产乱码精品一品二品| 麻豆精品在线看| 日韩成人一级大片| 天堂成人国产精品一区| 亚洲一区二区黄色| 亚洲精品视频在线| 亚洲欧美区自拍先锋| 国产精品灌醉下药二区| 国产精品理伦片| 国产午夜精品一区二区三区视频| 精品国产精品一区二区夜夜嗨| 欧美三级电影一区| 欧美日韩国产美| 91.麻豆视频| 日韩一级二级三级| 欧美一区二区三级| 日韩欧美在线一区二区三区| 91麻豆精品国产91久久久使用方法 | 成人免费视频视频| 国产成人精品影视| 国产精品一级黄| 丁香婷婷综合色啪| 99re在线精品| 在线视频中文字幕一区二区| 在线一区二区观看| 欧美久久久久久久久中文字幕| 欧美日韩不卡在线| 日韩女优毛片在线| 日本一区二区视频在线| 中文字幕在线一区免费| 一区二区三区欧美日| 亚洲va欧美va人人爽午夜| 青椒成人免费视频| 久久99国产精品尤物| 成人污视频在线观看| 色婷婷国产精品| 4438成人网| 国产视频亚洲色图| 亚洲私人黄色宅男| 丝袜a∨在线一区二区三区不卡 | 欧美日韩在线观看一区二区 | 亚洲国产精品久久人人爱蜜臀| 午夜激情久久久| 国产精品99久| 91福利国产精品| 欧美电影免费观看高清完整版在线观看| 精品久久免费看| 国产精品久久久久久久蜜臀| 亚洲男女毛片无遮挡| 日韩av在线播放中文字幕| 国产尤物一区二区在线| 色哟哟亚洲精品| 欧美变态tickling挠脚心| ㊣最新国产の精品bt伙计久久| 日韩精品91亚洲二区在线观看| 国产乱码精品1区2区3区| 色香蕉久久蜜桃| 欧美成人欧美edvon| 亚洲视频一二三| 蜜臀久久99精品久久久久宅男| 国产91精品精华液一区二区三区 | 色欧美乱欧美15图片| 欧美成人精品福利| 亚洲女人的天堂| 久久99国内精品| 欧美性受xxxx黑人xyx性爽| 2017欧美狠狠色| 亚洲123区在线观看| 成人性生交大片免费看视频在线| 欧美日韩不卡一区| 成人欧美一区二区三区视频网页| 麻豆中文一区二区| 欧美色涩在线第一页| 中文一区一区三区高中清不卡| 国产高清精品在线| 欧美性xxxxx极品少妇| 中文字幕国产一区二区| 美腿丝袜一区二区三区| 欧美性猛交xxxxxxxx| 国产精品久久久久婷婷二区次| 久久国产精品99久久人人澡| 欧美区在线观看| 亚洲愉拍自拍另类高清精品| 成人午夜电影久久影院| 国产亚洲精品久| 蜜桃av一区二区| 日韩视频一区二区三区| 日韩中文字幕亚洲一区二区va在线 | 天天综合天天做天天综合| 色婷婷国产精品| 亚洲精品欧美在线| 91麻豆成人久久精品二区三区| 国产精品久久久久久一区二区三区 | 国产中文字幕精品| 日韩亚洲欧美成人一区|