📄 ntp.h
字号:
/* ntp.h * NTP definitions for the sntpdate * * Copyright 2003 Norimasa Matsumoto <matsu@netfort.gr.jp> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * */#ifndef NTP_H#define NTP_H#define NTP_SERV "ntp"#define NTP_VN 4#define NTP_MODE_CLIENT 3#define NTP_MODE_SERVER 4#define NTP_TIMEOUT_SEC 5#define NTP_TIMEOUT_USEC 0#define ntp_li(x) ( (x>>6) & 3 )#define ntp_vn(x) ( (x>>3) & 7 )#define ntp_mode(x) ( x & 7 )#define min( a, b ) ( (a>b)?(b):(a) )typedef struct { unsigned int sec; unsigned int fsec;} ntp_time;struct pkt { unsigned char li_vn_mode; /* leap indicator, version and mode */ unsigned char stratum; /* peer stratum */ unsigned char ppoll; /* peer poll interval */ char precision; /* peer clock precision */ unsigned int rootdelay; /* distance to primary clock */ unsigned int rootdispersion; /* clock dispersion */ unsigned int refid; /* reference clock ID */ ntp_time reftime; /* time peer clock was last updated */ ntp_time org; /* originate time stamp */ ntp_time rec; /* receive time stamp */ ntp_time xmt; /* transmit time stamp */};#endif /* NTP_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -