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

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

?? refclock_arc.c

?? 網絡時間協議NTP 源碼 版本v4.2.0b 該源碼用于linux平臺下
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* * refclock_arc - clock driver for ARCRON MSF/DCF/WWVB receivers */#ifdef HAVE_CONFIG_H#include <config.h>#endif#if defined(REFCLOCK) && defined(CLOCK_ARCRON_MSF)static const char arc_version[] = { "V1.3 2003/02/21" };/* define PRE_NTP420 for compatibility to previous versions of NTP (at least   to 4.1.0 */#undef PRE_NTP420#ifndef ARCRON_NOT_KEEN#define ARCRON_KEEN 1 /* Be keen, and trusting of the clock, if defined. */#endif#ifndef ARCRON_NOT_MULTIPLE_SAMPLES#define ARCRON_MULTIPLE_SAMPLES 1 /* Use all timestamp bytes as samples. */#endif#ifndef ARCRON_NOT_LEAPSECOND_KEEN#ifndef ARCRON_LEAPSECOND_KEEN#undef ARCRON_LEAPSECOND_KEEN /* Respond quickly to leap seconds: doesn't work yet. */#endif#endif/*Code by Derek Mulcahy, <derek@toybox.demon.co.uk>, 1997.Modifications by Damon Hart-Davis, <d@hd.org>, 1997.Modifications by Paul Alfille, <palfille@partners.org>, 2003.Modifications by Christopher Price, <cprice@cs-home.com>, 2003.Modifications by Nigel Roles <nigel@9fs.org>, 2003.THIS CODE IS SUPPLIED AS IS, WITH NO WARRANTY OF ANY KIND.  USE ATYOUR OWN RISK.Orginally developed and used with ntp3-5.85 by Derek Mulcahy.Built against ntp3-5.90 on Solaris 2.5 using gcc 2.7.2.This code may be freely copied and used and incorporated in othersystems providing the disclaimer and notice of authorship arereproduced.-------------------------------------------------------------------------------Nigel's notes:1) Called tcgetattr() before modifying, so that fields correctly initialised   for all operating systems2) Altered parsing of timestamp line so that it copes with fields which are   not always ASCII digits (e.g. status field when battery low)-------------------------------------------------------------------------------Christopher's notes:MAJOR CHANGES SINCE V1.2 ======================== 1) Applied patch by Andrey Bray <abuse@madhouse.demon.co.uk>    2001-02-17 comp.protocols.time.ntp 2) Added WWVB support via clock mode command, localtime/UTC time configured    via flag1=(0=UTC, 1=localtime) 3) Added ignore resync request via flag2=(0=resync, 1=ignore resync) 4) Added simplified conversion from localtime to UTC with dst/bst translation 5) Added average signal quality poll 6) Fixed a badformat error when no code is available due to stripping     \n & \r's  7) Fixed a badformat error when clearing lencode & memset a_lastcode in poll    routine 8) Lots of code cleanup, including standardized DEBUG macros and removal     of unused code -------------------------------------------------------------------------------Author's original note:I enclose my ntp driver for the Galleon Systems Arc MSF receiver.It works (after a fashion) on both Solaris-1 and Solaris-2.I am currently using ntp3-5.85.  I have been running the code forabout 7 months without any problems.  Even coped with the change to BST!I had to do some funky things to read from the clock because it uses thepower from the receive lines to drive the transmit lines.  This makes thecode look a bit stupid but it works.  I also had to put in some delays toallow for the turnaround time from receive to transmit.  These delaysare between characters when requesting a time stamp so that shouldn't affectthe results too drastically....The bottom line is that it works but could easily be improved.  You arefree to do what you will with the code.  I haven't been able to determinehow good the clock is.  I think that this requires a known good clockto compare it against.-------------------------------------------------------------------------------Damon's notes for adjustments:MAJOR CHANGES SINCE V1.0======================== 1) Removal of pollcnt variable that made the clock go permanently    off-line once two time polls failed to gain responses. 2) Avoiding (at least on Solaris-2) terminal becoming the controlling    terminal of the process when we do a low-level open(). 3) Additional logic (conditional on ARCRON_LEAPSECOND_KEEN being    defined) to try to resync quickly after a potential leap-second    insertion or deletion. 4) Code significantly slimmer at run-time than V1.0.GENERAL======= 1) The C preprocessor symbol to have the clock built has been changed    from ARC to ARCRON_MSF to CLOCK_ARCRON_MSF to minimise the    possiblity of clashes with other symbols in the future. 2) PRECISION should be -4/-5 (63ms/31ms) for the following reasons:     a) The ARC documentation claims the internal clock is (only)        accurate to about 20ms relative to Rugby (plus there must be        noticable drift and delay in the ms range due to transmission        delays and changing atmospheric effects).  This clock is not        designed for ms accuracy as NTP has spoilt us all to expect.     b) The clock oscillator looks like a simple uncompensated quartz        crystal of the sort used in digital watches (ie 32768Hz) which        can have large temperature coefficients and drifts; it is not        clear if this oscillator is properly disciplined to the MSF        transmission, but as the default is to resync only once per        *day*, we can imagine that it is not, and is free-running.  We        can minimise drift by resyncing more often (at the cost of        reduced battery life), but drift/wander may still be        significant.     c) Note that the bit time of 3.3ms adds to the potential error in        the the clock timestamp, since the bit clock of the serial link        may effectively be free-running with respect to the host clock        and the MSF clock.  Actually, the error is probably 1/16th of        the above, since the input data is probably sampled at at least        16x the bit rate.    By keeping the clock marked as not very precise, it will have a    fairly large dispersion, and thus will tend to be used as a    `backup' time source and sanity checker, which this clock is    probably ideal for.  For an isolated network without other time    sources, this clock can probably be expected to provide *much*    better than 1s accuracy, which will be fine.    By default, PRECISION is set to -4, but experience, especially at a    particular geographic location with a particular clock, may allow    this to be altered to -5.  (Note that skews of +/- 10ms are to be    expected from the clock from time-to-time.)  This improvement of    reported precision can be instigated by setting flag3 to 1, though    the PRECISION will revert to the normal value while the clock    signal quality is unknown whatever the flag3 setting.    IN ANY CASE, BE SURE TO SET AN APPROPRIATE FUDGE FACTOR TO REMOVE    ANY RESIDUAL SKEW, eg:        server 127.127.27.0 # ARCRON MSF radio clock unit 0.        # Fudge timestamps by about 20ms.        fudge 127.127.27.0 time1 0.020    You will need to observe your system's behaviour, assuming you have    some other NTP source to compare it with, to work out what the    fudge factor should be.  For my Sun SS1 running SunOS 4.1.3_U1 with    my MSF clock with my distance from the MSF transmitter, +20ms    seemed about right, after some observation. 3) REFID has been made "MSFa" to reflect the MSF time source and the    ARCRON receiver. 4) DEFAULT_RESYNC_TIME is the time in seconds (by default) before    forcing a resync since the last attempt.  This is picked to give a    little less than an hour between resyncs and to try to avoid    clashing with any regular event at a regular time-past-the-hour    which might cause systematic errors.    The INITIAL_RESYNC_DELAY is to avoid bothering the clock and    running down its batteries unnecesarily if ntpd is going to crash    or be killed or reconfigured quickly.  If ARCRON_KEEN is defined    then this period is long enough for (with normal polling rates)    enough time samples to have been taken to allow ntpd to sync to    the clock before the interruption for the clock to resync to MSF.    This avoids ntpd syncing to another peer first and then    almost immediately hopping to the MSF clock.    The RETRY_RESYNC_TIME is used before rescheduling a resync after a    resync failed to reveal a statisfatory signal quality (too low or    unknown). 5) The clock seems quite jittery, so I have increased the    median-filter size from the typical (previous) value of 3.  I    discard up to half the results in the filter.  It looks like maybe    1 sample in 10 or so (maybe less) is a spike, so allow the median    filter to discard at least 10% of its entries or 1 entry, whichever    is greater. 6) Sleeping *before* each character sent to the unit to allow required    inter-character time but without introducting jitter and delay in    handling the response if possible. 7) If the flag ARCRON_KEEN is defined, take time samples whenever    possible, even while resyncing, etc.  We rely, in this case, on the    clock always giving us a reasonable time or else telling us in the    status byte at the end of the timestamp that it failed to sync to    MSF---thus we should never end up syncing to completely the wrong    time. 8) If the flag ARCRON_OWN_FILTER is defined, use own versions of    refclock median-filter routines to get round small bug in 3-5.90    code which does not return the median offset. XXX Removed this    bit due NTP Version 4 upgrade - dlm. 9) We would appear to have a year-2000 problem with this clock since    it returns only the two least-significant digits of the year.  But    ntpd ignores the year and uses the local-system year instead, so    this is in fact not a problem.  Nevertheless, we attempt to do a    sensible thing with the dates, wrapping them into a 100-year    window. 10)Logs stats information that can be used by Derek's Tcl/Tk utility    to show the status of the clock. 11)The clock documentation insists that the number of bits per    character to be sent to the clock, and sent by it, is 11, including    one start bit and two stop bits.  The data format is either 7+even    or 8+none.TO-DO LIST==========  * Eliminate use of scanf(), and maybe sprintf().  * Allow user setting of resync interval to trade battery life for    accuracy; maybe could be done via fudge factor or unit number.  * Possibly note the time since the last resync of the MSF clock to    MSF as the age of the last reference timestamp, ie trust the    clock's oscillator not very much...  * Add very slow auto-adjustment up to a value of +/- time2 to correct    for long-term errors in the clock value (time2 defaults to 0 so the    correction would be disabled by default).  * Consider trying to use the tty_clk/ppsclock support.  * Possibly use average or maximum signal quality reported during    resync, rather than just the last one, which may be atypical.*//* Notes for HKW Elektronik GmBH Radio clock driver *//* Author Lyndon David, Sentinet Ltd, Feb 1997      *//* These notes seem also to apply usefully to the ARCRON clock. *//* The HKW clock module is a radio receiver tuned into the Rugby *//* MSF time signal tranmitted on 60 kHz. The clock module connects *//* to the computer via a serial line and transmits the time encoded *//* in 15 bytes at 300 baud 7 bits two stop bits even parity *//* Clock communications, from the datasheet *//* All characters sent to the clock are echoed back to the controlling *//* device. *//* Transmit time/date information *//* syntax ASCII o<cr> *//* Character o may be replaced if neccesary by a character whose code *//* contains the lowest four bits f(hex) eg *//* syntax binary: xxxx1111 00001101 *//* DHD note:You have to wait for character echo + 10ms before sending next character.*//* The clock replies to this command with a sequence of 15 characters *//* which contain the complete time and a final <cr> making 16 characters *//* in total. *//* The RC computer clock will not reply immediately to this command because *//* the start bit edge of the first reply character marks the beginning of *//* the second. So the RC Computer Clock will reply to this command at the *//* start of the next second *//* The characters have the following meaning *//* 1. hours tens   *//* 2. hours units  *//* 3. minutes tens *//* 4. minutes units *//* 5. seconds tens  *//* 6. seconds units *//* 7. day of week 1-monday 7-sunday *//* 8. day of month tens *//* 9. day of month units *//* 10. month tens *//* 11. month units *//* 12. year tens *//* 13. year units *//* 14. BST/UTC status *//*      bit 7   parity *//*      bit 6   always 0 *//*      bit 5   always 1 *//*      bit 4   always 1 *//*      bit 3   always 0 *//*      bit 2   =1 if UTC is in effect, complementary to the BST bit *//*      bit 1   =1 if BST is in effect, according to the BST bit     *//*      bit 0   BST/UTC change impending bit=1 in case of change impending *//* 15. status *//*      bit 7   parity *//*      bit 6   always 0 *//*      bit 5   always 1 *//*      bit 4   always 1 *//*      bit 3   =1 if low battery is detected *//*      bit 2   =1 if the very last reception attempt failed and a valid *//*              time information already exists (bit0=1) *//*              =0 if the last reception attempt was successful *//*      bit 1   =1 if at least one reception since 2:30 am was successful *//*              =0 if no reception attempt since 2:30 am was successful *//*      bit 0   =1 if the RC Computer Clock contains valid time information *//*              This bit is zero after reset and one after the first *//*              successful reception attempt *//* DHD note:Also note g<cr> command which confirms that a resync is in progress, andif so what signal quality (0--5) is available.Also note h<cr> command which starts a resync to MSF signal.*/#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>#if defined(HAVE_BSD_TTYS)#include <sgtty.h>#endif /* HAVE_BSD_TTYS */#if defined(HAVE_SYSV_TTYS)#include <termio.h>#endif /* HAVE_SYSV_TTYS */#if defined(HAVE_TERMIOS)#include <termios.h>#endif/* * This driver supports the ARCRON MSF/DCF/WWVB Radio Controlled Clock *//* * Interface definitions */#define DEVICE          "/dev/arc%d"    /* Device name and unit. */#define SPEED           B300            /* UART speed (300 baud) */#define PRECISION       (-4)            /* Precision  (~63 ms). */#define HIGHPRECISION   (-5)            /* If things are going well... */#define REFID           "MSFa"          /* Reference ID. */#define REFID_MSF       "MSF"           /* Reference ID. */#define REFID_DCF77     "DCF"           /* Reference ID. */#define REFID_WWVB      "WWVB"          /* Reference ID. */#define DESCRIPTION     "ARCRON MSF/DCF/WWVB Receiver"#ifdef PRE_NTP420#define MODE ttlmax#else#define MODE ttl#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成av人片| 成人h动漫精品| 国产成人超碰人人澡人人澡| 色八戒一区二区三区| 久久伊人中文字幕| 午夜精品免费在线| 色悠悠久久综合| 久久精品亚洲国产奇米99| 偷窥少妇高潮呻吟av久久免费| 成人综合在线观看| 欧美精品一区二| 青娱乐精品在线视频| 欧美午夜寂寞影院| 亚洲免费在线电影| 99re这里都是精品| 亚洲国产精华液网站w| 国产一区二区在线观看免费| 欧美精品xxxxbbbb| 亚洲高清免费一级二级三级| 97se亚洲国产综合在线| 久久久久久久性| 久久爱www久久做| 日韩免费高清av| 日本成人在线网站| 在线成人av影院| 丝袜美腿高跟呻吟高潮一区| 欧美日韩午夜在线视频| 亚洲国产精品久久久久秋霞影院 | 日韩三级中文字幕| 亚洲成人www| 欧美日韩高清一区二区三区| 亚洲午夜久久久久久久久电影网| 92国产精品观看| 亚洲品质自拍视频网站| 91亚洲国产成人精品一区二三| 欧美国产成人在线| 成人av在线观| 亚洲另类一区二区| 欧美猛男gaygay网站| 人人超碰91尤物精品国产| 日韩精品一区二区三区中文不卡| 天堂久久一区二区三区| 日韩视频免费观看高清完整版| 麻豆精品久久精品色综合| 2020国产精品久久精品美国| 国产一区二区电影| 亚洲人一二三区| 欧美精品在线观看播放| 精品在线免费观看| 国产日韩欧美综合在线| 91日韩精品一区| 丝袜脚交一区二区| 久久精品视频一区| 91网站最新地址| 日韩av电影免费观看高清完整版在线观看| 91麻豆精品国产无毒不卡在线观看 | 日本在线不卡视频| 欧美成人精品高清在线播放| 国产精品香蕉一区二区三区| 国产精品理论在线观看| 欧美午夜精品一区二区三区| 麻豆高清免费国产一区| 综合亚洲深深色噜噜狠狠网站| 欧美手机在线视频| 国产麻豆精品在线| 亚洲欧美色一区| 精品毛片乱码1区2区3区| 懂色av中文字幕一区二区三区| 夜夜嗨av一区二区三区网页| 欧美成人高清电影在线| 91在线云播放| 国产美女精品在线| 亚洲午夜精品久久久久久久久| 久久综合久久综合久久| 91久久国产最好的精华液| 精品一区二区精品| 亚洲制服丝袜一区| 国产日韩欧美一区二区三区乱码 | 亚洲啪啪综合av一区二区三区| 欧美精品一二三四| 91亚洲资源网| 国产suv一区二区三区88区| 亚洲va欧美va国产va天堂影院| 欧美国产视频在线| 日韩欧美国产高清| 欧美另类z0zxhd电影| a美女胸又www黄视频久久| 久久精品国产成人一区二区三区| 亚洲品质自拍视频网站| 国产日韩欧美亚洲| 精品欧美一区二区久久| 欧美日韩亚州综合| 色哟哟国产精品免费观看| 国产精品一区在线观看你懂的| 视频在线在亚洲| 亚洲综合无码一区二区| 国产精品不卡在线| 国产三级精品在线| 精品国产sm最大网站免费看| 欧美日韩国产精选| 欧美影视一区二区三区| 91丝袜国产在线播放| 成人av电影在线网| 粉嫩av亚洲一区二区图片| 国产永久精品大片wwwapp| 久久疯狂做爰流白浆xx| 免费欧美日韩国产三级电影| 亚瑟在线精品视频| 亚洲va欧美va人人爽| 亚洲一区视频在线观看视频| 亚洲人成网站在线| 一区二区三区影院| 一区二区三区四区国产精品| 亚洲欧美日韩国产综合在线| 国产精品午夜在线观看| 国产精品三级视频| 中文字幕高清一区| 综合久久国产九一剧情麻豆| 日韩伦理电影网| 亚洲国产中文字幕在线视频综合| 亚洲激情综合网| 婷婷久久综合九色国产成人| 亚洲高清不卡在线观看| 亚洲成人先锋电影| 蜜臀av在线播放一区二区三区| 日本不卡高清视频| 国产一区二区网址| 成人av中文字幕| 欧美三级电影精品| 日韩天堂在线观看| 国产日韩精品一区二区浪潮av| 国产精品乱人伦| 亚洲精品国久久99热| 五月激情丁香一区二区三区| 麻豆91在线观看| 国产精品18久久久久久久久久久久 | 日韩影院在线观看| 欧美a级一区二区| 国产乱码精品一区二区三区忘忧草| 成人中文字幕电影| 欧美色网一区二区| 日韩免费看网站| 亚洲手机成人高清视频| 午夜激情综合网| 国产精一区二区三区| 在线免费av一区| 日韩免费福利电影在线观看| 国产精品久线在线观看| 亚洲18影院在线观看| 国产suv精品一区二区三区| 色综合色综合色综合色综合色综合| 制服丝袜亚洲精品中文字幕| 国产三级精品视频| 视频一区二区三区中文字幕| 国精产品一区一区三区mba桃花 | 国产精品91xxx| 欧美日精品一区视频| 久久亚洲捆绑美女| 亚洲自拍偷拍综合| 国产·精品毛片| 91精品麻豆日日躁夜夜躁| 国产精品嫩草99a| 蜜桃视频一区二区| 在线中文字幕不卡| 中文字幕国产一区二区| 久久99日本精品| 欧美主播一区二区三区美女| 国产日韩欧美激情| 麻豆国产精品视频| 欧美日免费三级在线| 1024成人网| 国产美女主播视频一区| 91精品国产色综合久久ai换脸 | 99久久精品99国产精品| 精品噜噜噜噜久久久久久久久试看| 亚洲伦理在线免费看| 成人高清视频在线| 国产蜜臀97一区二区三区| 激情文学综合网| 91精品福利在线一区二区三区| 亚洲美女精品一区| 99久久精品国产观看| 国产精品乱人伦| 成人黄色网址在线观看| 久久精品人人爽人人爽| 久久福利视频一区二区| 日韩视频一区二区| 美腿丝袜一区二区三区| 在线成人免费视频| 日本欧美一区二区在线观看| 欧美系列在线观看| 亚洲午夜三级在线| 欧美日本在线看| 亚洲国产精品欧美一二99| 欧美日韩综合在线免费观看| 亚洲午夜久久久久| 欧美福利视频一区| 欧美aaaaaa午夜精品| 日韩三级在线免费观看| 精品伊人久久久久7777人|