003 File Manager
Current Path:
/usr/src/contrib/ntp/include
usr
/
src
/
contrib
/
ntp
/
include
/
📁
..
📄
Makefile.am
(1.2 KB)
📄
Makefile.in
(24.68 KB)
📄
README
(157 B)
📄
adjtime.h
(1.96 KB)
📄
ascii.h
(2.78 KB)
📄
audio.h
(283 B)
📄
binio.h
(3.26 KB)
📄
declcond.h
(803 B)
📄
gps.h
(2.84 KB)
📄
hopf6039.h
(3.51 KB)
📄
icom.h
(2.33 KB)
📄
ieee754io.h
(2.94 KB)
📄
intreswork.h
(808 B)
📄
iosignal.h
(1.46 KB)
📁
isc
📄
l_stdlib.h
(4.8 KB)
📄
lib_strbuf.h
(674 B)
📄
libntp.h
(436 B)
📄
libssl_compat.h
(4.25 KB)
📄
mbg_gps166.h
(36.84 KB)
📄
mx4200.h
(2.15 KB)
📄
ntif.h
(2.86 KB)
📄
ntp.h
(33.52 KB)
📄
ntp_assert.h
(2.73 KB)
📄
ntp_calendar.h
(14.99 KB)
📄
ntp_calgps.h
(4.02 KB)
📄
ntp_cmdargs.h
(38 B)
📄
ntp_config.h
(8.33 KB)
📄
ntp_control.h
(5.66 KB)
📄
ntp_crypto.h
(6.61 KB)
📄
ntp_datum.h
(1.07 KB)
📄
ntp_debug.h
(635 B)
📄
ntp_filegen.h
(1.76 KB)
📄
ntp_fp.h
(13.37 KB)
📄
ntp_if.h
(651 B)
📄
ntp_intres.h
(1.77 KB)
📄
ntp_io.h
(1.82 KB)
📄
ntp_keyacc.h
(658 B)
📄
ntp_libopts.h
(330 B)
📄
ntp_lineedit.h
(251 B)
📄
ntp_lists.h
(12.09 KB)
📄
ntp_machine.h
(7.18 KB)
📄
ntp_malloc.h
(1.18 KB)
📄
ntp_md5.h
(1.32 KB)
📄
ntp_net.h
(6.61 KB)
📄
ntp_prio_q.h
(1.93 KB)
📄
ntp_proto.h
(95 B)
📄
ntp_psl.h
(342 B)
📄
ntp_random.h
(402 B)
📄
ntp_refclock.h
(7.81 KB)
📄
ntp_request.h
(30.83 KB)
📄
ntp_rfc2553.h
(8.46 KB)
📄
ntp_select.h
(1.02 KB)
📄
ntp_stdlib.h
(9.83 KB)
📄
ntp_string.h
(708 B)
📄
ntp_syscall.h
(1.17 KB)
📄
ntp_syslog.h
(2.94 KB)
📄
ntp_tty.h
(2.61 KB)
📄
ntp_types.h
(7.21 KB)
📄
ntp_unixtime.h
(1.6 KB)
📄
ntp_worker.h
(5.54 KB)
📄
ntp_workimpl.h
(749 B)
📄
ntpd.h
(20.67 KB)
📄
ntpsim.h
(3.85 KB)
📄
parse.h
(14.58 KB)
📄
parse_conf.h
(2.76 KB)
📄
rc_cmdlength.h
(83 B)
📄
recvbuff.h
(3.84 KB)
📄
refclock_atom.h
(449 B)
📄
refidsmear.h
(89 B)
📄
safecast.h
(1.04 KB)
📄
ssl_applink.c
(2.1 KB)
📄
timepps-SCO.h
(11.67 KB)
📄
timepps-Solaris.h
(13.24 KB)
📄
timepps-SunOS.h
(11.78 KB)
📄
timespecops.h
(4.82 KB)
📄
timetoa.h
(2.62 KB)
📄
timevalops.h
(8.33 KB)
📄
timexsup.h
(1.37 KB)
📄
trimble.h
(8.01 KB)
📄
vint64ops.h
(1.05 KB)
Editing: ntp_control.h
#ifndef NTP_CONTROL_H #define NTP_CONTROL_H /* * ntp_control.h - definitions related to NTP mode 6 control messages */ #include "ntp_types.h" typedef union ctl_pkt_u_tag { u_char data[480 + MAX_MAC_LEN]; /* data + auth */ u_int32 u32[(480 + MAX_MAC_LEN) / sizeof(u_int32)]; } ctl_pkt_u; struct ntp_control { u_char li_vn_mode; /* leap, version, mode */ u_char r_m_e_op; /* response, more, error, opcode */ u_short sequence; /* sequence number of request */ u_short status; /* status word for association */ associd_t associd; /* association ID */ u_short offset; /* offset of this batch of data */ u_short count; /* count of data in this packet */ ctl_pkt_u u; }; /* * Length of the control header, in octets */ #define CTL_HEADER_LEN (offsetof(struct ntp_control, u)) #define CTL_MAX_DATA_LEN 468 /* * Limits and things */ #define CTL_MAXTRAPS 3 /* maximum number of traps we allow */ #define CTL_TRAPTIME (60*60) /* time out traps in 1 hour */ #define CTL_MAXAUTHSIZE 64 /* maximum size of an authen'ed req */ /* * Decoding for the r_m_e_op field */ #define CTL_RESPONSE 0x80 #define CTL_ERROR 0x40 #define CTL_MORE 0x20 #define CTL_OP_MASK 0x1f #define CTL_ISRESPONSE(r_m_e_op) ((CTL_RESPONSE & (r_m_e_op)) != 0) #define CTL_ISMORE(r_m_e_op) ((CTL_MORE & (r_m_e_op)) != 0) #define CTL_ISERROR(r_m_e_op) ((CTL_ERROR & (r_m_e_op)) != 0) #define CTL_OP(r_m_e_op) (CTL_OP_MASK & (r_m_e_op)) /* * Opcodes */ #define CTL_OP_UNSPEC 0 /* unspeciffied */ #define CTL_OP_READSTAT 1 /* read status */ #define CTL_OP_READVAR 2 /* read variables */ #define CTL_OP_WRITEVAR 3 /* write variables */ #define CTL_OP_READCLOCK 4 /* read clock variables */ #define CTL_OP_WRITECLOCK 5 /* write clock variables */ #define CTL_OP_SETTRAP 6 /* set trap address */ #define CTL_OP_ASYNCMSG 7 /* asynchronous message */ #define CTL_OP_CONFIGURE 8 /* runtime configuration */ #define CTL_OP_SAVECONFIG 9 /* save config to file */ #define CTL_OP_READ_MRU 10 /* retrieve MRU (mrulist) */ #define CTL_OP_READ_ORDLIST_A 11 /* ordered list req. auth. */ #define CTL_OP_REQ_NONCE 12 /* request a client nonce */ #define CTL_OP_UNSETTRAP 31 /* unset trap */ /* * {En,De}coding of the system status word */ #define CTL_SST_TS_UNSPEC 0 /* unspec */ #define CTL_SST_TS_ATOM 1 /* pps */ #define CTL_SST_TS_LF 2 /* lf radio */ #define CTL_SST_TS_HF 3 /* hf radio */ #define CTL_SST_TS_UHF 4 /* uhf radio */ #define CTL_SST_TS_LOCAL 5 /* local */ #define CTL_SST_TS_NTP 6 /* ntp */ #define CTL_SST_TS_UDPTIME 7 /* other */ #define CTL_SST_TS_WRSTWTCH 8 /* wristwatch */ #define CTL_SST_TS_TELEPHONE 9 /* telephone */ #define CTL_SYS_MAXEVENTS 15 #define CTL_SYS_STATUS(li, source, nevnt, evnt) \ (((((unsigned short)(li))<< 14)&0xc000) | \ (((source)<<8)&0x3f00) | \ (((nevnt)<<4)&0x00f0) | \ ((evnt)&0x000f)) #define CTL_SYS_LI(status) (((status)>>14) & 0x3) #define CTL_SYS_SOURCE(status) (((status)>>8) & 0x3f) #define CTL_SYS_NEVNT(status) (((status)>>4) & 0xf) #define CTL_SYS_EVENT(status) ((status) & 0xf) /* * {En,De}coding of the peer status word */ #define CTL_PST_CONFIG 0x80 #define CTL_PST_AUTHENABLE 0x40 #define CTL_PST_AUTHENTIC 0x20 #define CTL_PST_REACH 0x10 #define CTL_PST_BCAST 0x08 #define CTL_PST_SEL_REJECT 0 /* reject */ #define CTL_PST_SEL_SANE 1 /* x falsetick */ #define CTL_PST_SEL_CORRECT 2 /* . excess */ #define CTL_PST_SEL_SELCAND 3 /* - outlier */ #define CTL_PST_SEL_SYNCCAND 4 /* + candidate */ #define CTL_PST_SEL_EXCESS 5 /* # backup */ #define CTL_PST_SEL_SYSPEER 6 /* * sys.peer */ #define CTL_PST_SEL_PPS 7 /* o pps.peer */ #define CTL_PEER_MAXEVENTS 15 #define CTL_PEER_STATUS(status, nevnt, evnt) \ ((((status)<<8) & 0xff00) | \ (((nevnt)<<4) & 0x00f0) | \ ((evnt) & 0x000f)) #define CTL_PEER_STATVAL(status)(((status)>>8) & 0xff) #define CTL_PEER_NEVNT(status) (((status)>>4) & 0xf) #define CTL_PEER_EVENT(status) ((status) & 0xf) /* * {En,De}coding of the clock status word */ #define CTL_CLK_OKAY 0 #define CTL_CLK_NOREPLY 1 #define CTL_CLK_BADFORMAT 2 #define CTL_CLK_FAULT 3 #define CTL_CLK_PROPAGATION 4 #define CTL_CLK_BADDATE 5 #define CTL_CLK_BADTIME 6 #define CTL_CLK_STATUS(status, event) \ ((((status)<<8) & 0xff00) | \ ((event) & 0x00ff)) /* * Error code responses returned when the E bit is set. */ #define CERR_UNSPEC 0 #define CERR_PERMISSION 1 #define CERR_BADFMT 2 #define CERR_BADOP 3 #define CERR_BADASSOC 4 #define CERR_UNKNOWNVAR 5 #define CERR_BADVALUE 6 #define CERR_RESTRICT 7 #define CERR_NORESOURCE CERR_PERMISSION /* wish there was a different code */ /* * Definition of the structure used internally to hold trap information. * ntp_request.c wants to see this. */ struct ctl_trap { sockaddr_u tr_addr; /* address of trap recipient */ struct interface *tr_localaddr; /* interface to send this through */ u_long tr_settime; /* time trap was set */ u_long tr_count; /* async messages sent to this guy */ u_long tr_origtime; /* time trap was originally set */ u_long tr_resets; /* count of resets for this trap */ u_short tr_sequence; /* trap sequence id */ u_char tr_flags; /* trap flags */ u_char tr_version; /* version number of trapper */ }; extern struct ctl_trap ctl_traps[CTL_MAXTRAPS]; /* * Flag bits */ #define TRAP_INUSE 0x1 /* this trap is active */ #define TRAP_NONPRIO 0x2 /* this trap is non-priority */ #define TRAP_CONFIGURED 0x4 /* this trap was configured */ /* * Types of things we may deal with * shared between ntpq and library */ #define TYPE_SYS 1 #define TYPE_PEER 2 #define TYPE_CLOCK 3 /* * IFSTATS_FIELDS is the number of fields ntpd supplies for each ifstats * row. Similarly RESLIST_FIELDS for reslist. */ #define IFSTATS_FIELDS 12 #define RESLIST_FIELDS 4 #endif /* NTP_CONTROL_H */
Upload File
Create Folder