Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
NTPsec
ntpsec
Commits
bc1f1c05
Commit
bc1f1c05
authored
Aug 12, 2017
by
Eric S. Raymond
Browse files
Eliminate u_int, u_short, u_long. u_char homebrew types.
These caused too much turis around which compilers have them as builtins and which do not.
parent
cc9491c8
Pipeline
#10825273
failed with stages
in 4 minutes and 41 seconds
Changes
61
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
devel/trace/ntpsec-ntp-proto.ini
View file @
bc1f1c05
...
...
@@ -37,7 +37,7 @@ header = '#include "ntpd.h"'
[ntpsec-ntp-proto-signatures]
transmit
=
void, struct peer*
receive
=
void, struct recvbuf*
process_packet
=
void, struct peer*, struct pkt*, u
_
int
process_packet
=
void, struct peer*, struct pkt*, u
nsigned
int
poll_update
=
void, struct peer*, uint8_t
peer_clear
=
void, struct peer*, const char*
clock_filter
=
void, struct peer*, double, double, double
...
...
@@ -49,5 +49,5 @@ measure_precision = void, const bool
measure_tick_fuzz
=
double, void
set_sys_tick_precision
=
void, double
init_proto
=
void, const bool
proto_config
=
void, int, u
_
long, double, sockaddr_u*
proto_config
=
void, int, u
nsigned
long, double, sockaddr_u*
proto_clr_stats
=
void, void
devel/trace/ntpsec-ntp-worker.ini
View file @
bc1f1c05
...
...
@@ -26,7 +26,7 @@ header = '#include "ntp_worker.h"'
[ntpsec-ntp-worker-signatures]
close_all_except
=
void, int
close_all_beyond
=
void, int
available_blocking_child_slot
=
u
_
int, void
available_blocking_child_slot
=
u
nsigned
int, void
queue_blocking_request
=
int, blocking_work_req, void*, size_t, blocking_work_callback, void*
queue_blocking_response
=
int, blocking_child*, blocking_pipe_header*, size_t, const blocking_pipe_header*
process_blocking_resp
=
void, blocking_child*
...
...
docs/generic_howto.txt
View file @
bc1f1c05
...
...
@@ -103,12 +103,12 @@ doing the appropriate time stamping.
----------------------------------------------------------------------------------
struct clockformat
{
u
_
long (*input)();
u
nsigned
long (*input)();
/* input routine - your routine - cvt_<yourclock> */
u
_
long (*convert)();
u
nsigned
long (*convert)();
/* conversion routine - your routine - cvt_<yourclock> */
/* routine for handling RS232 sync events (time stamps) - usually sync_simple */
u
_
long (*syncpps)();
u
nsigned
long (*syncpps)();
/* PPS input routine - usually pps_one */
void *data;
/* local parameters - any parameters/data/configuration info your conversion
...
...
@@ -117,7 +117,7 @@ struct clockformat
/* clock format name - Name of the time code */
unsigned short length;
/* maximum length of data packet for your clock format */
u
_
long flags;
u
nsigned
long flags;
/* information for the parser what to look for */
};
----------------------------------------------------------------------------------
...
...
@@ -141,7 +141,7 @@ clocks for example)
-------------------------------------------------------------------------------------
struct clockinfo
{
u
_
long cl_flags; /* operation flags (io modes) */
u
nsigned
long cl_flags; /* operation flags (io modes) */
PARSE_F_PPSPPS use loopfilter PPS code
PARSE_F_PPSONSECOND PPS pulses are on second
usually flags stay 0 as they are used only for special setups
...
...
@@ -165,12 +165,12 @@ clocks for example)
u_fp cl_rootdelay; /* rootdelay */
NTP rootdelay estimate (usually 0)
u
_
long cl_basedelay; /* current offset - unsigned l_fp
u
nsigned
long cl_basedelay; /* current offset - unsigned l_fp
fractional part (fraction) by
which the RS232 time code is
delayed from the actual time. */
u
_
long cl_ppsdelay; /* current PPS offset - unsigned l_fp fractional
u
nsigned
long cl_ppsdelay; /* current PPS offset - unsigned l_fp fractional
time (fraction) by which the PPS time stamp is delayed (usually 0)
part */
...
...
@@ -184,22 +184,22 @@ clocks for example)
If the data format cann not ne detected automatically this is the name
as in clk_*.c clockformat.
u
_
char cl_type; /* clock type (ntp control) */
u
nsigned
char cl_type; /* clock type (ntp control) */
Type if clock as in clock status word (ntp control messages) - usually 0
u
_
long cl_maxunsync;
/* time to trust oscillator after losing synch
u
nsigned
long cl_maxunsync; /* time to trust oscillator after losing synch
*/
seconds a clock can be trusted after losing synchronisation.
u
_
long cl_speed;
/* terminal input & output baudrate */
u
_
long cl_cflag;
/* terminal io flags */
u
_
long cl_iflag;
/* terminal io flags */
u
_
long cl_oflag;
/* terminal io flags */
u
_
long cl_lflag;
/* terminal io flags */
u
nsigned
long cl_speed; /* terminal input & output baudrate */
u
nsigned
long cl_cflag; /* terminal io flags */
u
nsigned
long cl_iflag; /* terminal io flags */
u
nsigned
long cl_oflag; /* terminal io flags */
u
nsigned
long cl_lflag; /* terminal io flags */
termio*.h tty modes.
u
_
long cl_samples;
/* samples for median filter */
u
_
long cl_keep;
/* samples for median filter to keep */
u
nsigned
long cl_samples; /* samples for median filter */
u
nsigned
long cl_keep; /* samples for median filter to keep */
median filter parameters - smoothing and rejection of bad samples
} clockinfo[] = {
...,<other clocks>,...
...
...
docs/oncore-shmem.txt
View file @
bc1f1c05
...
...
@@ -87,16 +87,16 @@ look like
----------------------------------------
struct message {
u
_
int length;
u
_
char sequence;
u
_
char message[length];
u
nsigned
int length;
u
nsigned
char sequence;
u
nsigned
char message[length];
}
----------------------------------------
if something like that were legal. That is, there are two bytes
(caution, these may NOT be aligned with word boundaries, so the field
needs to be treated as a pair of u
_
char), that contains the length of
the next message. This is followed by a u
_
char sequence number, that is
needs to be treated as a pair of u
nsigned
char), that contains the length of
the next message. This is followed by a u
nsigned
char sequence number, that is
incremented whenever a new message of this type is received. This is
followed by \'length' characters of the actual message.
...
...
@@ -104,7 +104,7 @@ The next structure starts immediately following the last char of the
previous message (no alignment). Thus, each structure starts a distance
of \'length+3' from the previous structure.
Following the last structure, is a u
_
int containing a zero length to
Following the last structure, is a
n
u
nsigned
int containing a zero length to
indicate the end of the data.
The messages are recognized by reading the headers in the data itself,
...
...
include/gpstolfp.h
View file @
bc1f1c05
...
...
@@ -6,6 +6,6 @@
#define MAX_BUILD_GPSWEEK (6078)
/* testcase limit */
extern
void
gpstolfp
(
int
weeks
,
int
days
,
unsigned
long
seconds
,
l_fp
*
);
extern
void
gpsweekadj
(
u_int
*
week
,
u_int
build_week
);
extern
void
gpstocal
(
u_int
week
,
u_int
TOW
,
int
UTC_offset
,
struct
calendar
*
);
extern
void
caltogps
(
const
struct
calendar
*
,
int
UTC_offset
,
u_int
*
week
,
u_int
*
TOW
);
\ No newline at end of file
extern
void
gpsweekadj
(
unsigned
int
*
week
,
unsigned
int
build_week
);
extern
void
gpstocal
(
unsigned
int
week
,
unsigned
int
TOW
,
int
UTC_offset
,
struct
calendar
*
);
extern
void
caltogps
(
const
struct
calendar
*
,
int
UTC_offset
,
unsigned
int
*
week
,
unsigned
int
*
TOW
);
include/ntp.h
View file @
bc1f1c05
...
...
@@ -9,20 +9,6 @@
#include
<stddef.h>
#include
<math.h>
#if ( defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600)) \
|| (__STDC_VERSION__ >= 199901L)
/*
* Supply GCCisms that stop being visible if we tell it we need the
* prototype for strptime(3). Note that this conditionalization is
* not actually necessary with -std=gnu99; we're leaving it here as
* documentation. Ideally all these nonstandard types should go away
* to be replaced by POSIX typedefs.
*/
typedef
unsigned
long
u_long
;
typedef
unsigned
short
u_short
;
typedef
unsigned
int
u_int
;
#endif
#include
"ntp_fp.h"
#include
"ntp_types.h"
#include
"ntp_lists.h"
...
...
@@ -138,18 +124,18 @@ typedef struct __endpt {
sockaddr_u
mask
;
/* subnet mask */
sockaddr_u
bcast
;
/* broadcast address */
char
name
[
32
];
/* name of interface */
u
_
short
family
;
/* AF_INET/AF_INET6 */
u
_
short
phase
;
/* phase in update cycle */
u
nsigned
short
family
;
/* AF_INET/AF_INET6 */
u
nsigned
short
phase
;
/* phase in update cycle */
uint32_t
flags
;
/* interface flags */
uint32_t
addr_refid
;
/* IPv4 addr or IPv6 hash */
u
_
long
starttime
;
/* current_time at creation */
u
nsigned
long
starttime
;
/* current_time at creation */
volatile
long
received
;
/* number of incoming packets */
long
sent
;
/* number of outgoing packets */
long
notsent
;
/* number of send failures */
u
_
int
ifindex
;
/* for IPV6_MULTICAST_IF */
u
nsigned
int
ifindex
;
/* for IPV6_MULTICAST_IF */
bool
ignore_packets
;
/* listen-read-drop this? */
struct
peer
*
peers
;
/* list of peers using endpt */
u
_
int
peercnt
;
/* count of same */
u
nsigned
int
peercnt
;
/* count of same */
}
endpt
;
/*
...
...
@@ -229,7 +215,7 @@ struct peer {
uint8_t
hpoll
;
/* local poll interval */
uint8_t
minpoll
;
/* min poll interval */
uint8_t
maxpoll
;
/* max poll interval */
u
_
int
flags
;
/* association flags */
u
nsigned
int
flags
;
/* association flags */
uint8_t
cast_flags
;
/* additional flags */
uint8_t
last_event
;
/* last peer error code */
uint8_t
num_events
;
/* number of error events */
...
...
@@ -274,14 +260,14 @@ struct peer {
uint8_t
new_status
;
/* under-construction status */
uint8_t
reach
;
/* reachability register */
int
flash
;
/* protocol error test tally bits */
u
_
long
epoch
;
/* reference epoch */
u
nsigned
long
epoch
;
/* reference epoch */
int
burst
;
/* packets remaining in burst */
int
retry
;
/* retry counter */
int
filter_nextpt
;
/* index into filter shift register */
double
filter_delay
[
NTP_SHIFT
];
/* delay shift register */
double
filter_offset
[
NTP_SHIFT
];
/* offset shift register */
double
filter_disp
[
NTP_SHIFT
];
/* dispersion shift register */
u
_
long
filter_epoch
[
NTP_SHIFT
];
/* epoch shift register */
u
nsigned
long
filter_epoch
[
NTP_SHIFT
];
/* epoch shift register */
uint8_t
filter_order
[
NTP_SHIFT
];
/* filter sort index */
l_fp
rec
;
/* receive time stamp */
l_fp
xmt
;
/* transmit time stamp */
...
...
@@ -307,29 +293,29 @@ struct peer {
/*
* End of clear-to-zero area
*/
u
_
int
outcount
;
/* packets sent without reply */
u
_
long
update
;
/* receive epoch */
u
nsigned
int
outcount
;
/* packets sent without reply */
u
nsigned
long
update
;
/* receive epoch */
#define end_clear_to_zero update
int
unreach
;
/* watchdog counter */
int
throttle
;
/* rate control */
u
_
long
outdate
;
/* send time last packet */
u
_
long
nextdate
;
/* send time next packet */
u
nsigned
long
outdate
;
/* send time last packet */
u
nsigned
long
nextdate
;
/* send time next packet */
/*
* Statistic counters
*/
u
_
long
timereset
;
/* time stat counters were reset */
u
_
long
timereceived
;
/* last packet received time */
u
_
long
timereachable
;
/* last reachable/unreachable time */
u
_
long
sent
;
/* packets sent */
u
_
long
received
;
/* packets received */
u
_
long
processed
;
/* packets processed */
u
_
long
badauth
;
/* bad authentication (BOGON5) */
u
_
long
bogusorg
;
/* bogus origin (BOGON2, BOGON3) */
u
_
long
oldpkt
;
/* old duplicate (BOGON1) */
u
_
long
seldisptoolarge
;
/* bad header (BOGON6, BOGON7) */
u
_
long
selbroken
;
/* KoD received */
u
nsigned
long
timereset
;
/* time stat counters were reset */
u
nsigned
long
timereceived
;
/* last packet received time */
u
nsigned
long
timereachable
;
/* last reachable/unreachable time */
u
nsigned
long
sent
;
/* packets sent */
u
nsigned
long
received
;
/* packets received */
u
nsigned
long
processed
;
/* packets processed */
u
nsigned
long
badauth
;
/* bad authentication (BOGON5) */
u
nsigned
long
bogusorg
;
/* bogus origin (BOGON2, BOGON3) */
u
nsigned
long
oldpkt
;
/* old duplicate (BOGON1) */
u
nsigned
long
seldisptoolarge
;
/* bad header (BOGON6, BOGON7) */
u
nsigned
long
selbroken
;
/* KoD received */
};
/* pythonize-header: stop ignoring */
...
...
@@ -380,7 +366,7 @@ struct peer {
#define STRATUM_UNSPEC ((uint8_t)16)
/* unspecified */
/*
* Values for peer.flags (u
_
int)
* Values for peer.flags (u
nsigned
int)
*/
#define FLAG_CONFIG 0x0001
/* association was configured */
#define FLAG_PREEMPT 0x0002
/* preemptable association */
...
...
@@ -619,7 +605,7 @@ struct mon_data {
l_fp
last
;
/* last time seen */
int
leak
;
/* leaky bucket accumulator */
int
count
;
/* total packet count */
u
_
short
flags
;
/* restrict flags */
u
nsigned
short
flags
;
/* restrict flags */
uint8_t
vn_mode
;
/* packet mode & version */
uint8_t
cast_flags
;
/* flags MDF_?CAST */
sockaddr_u
rmtadr
;
/* address of remote host */
...
...
@@ -669,9 +655,9 @@ typedef struct restrict_u_tag restrict_u;
struct
restrict_u_tag
{
restrict_u
*
link
;
/* link to next entry */
uint32_t
count
;
/* number of packets matched */
u
_
short
flags
;
/* accesslist flags */
u
_
short
mflags
;
/* match flags */
u
_
long
expire
;
/* valid until time */
u
nsigned
short
flags
;
/* accesslist flags */
u
nsigned
short
mflags
;
/* match flags */
u
nsigned
long
expire
;
/* valid until time */
union
{
/* variant starting here */
res_addr4
v4
;
res_addr6
v6
;
...
...
include/ntp_calendar.h
View file @
bc1f1c05
...
...
@@ -245,6 +245,6 @@ ntpcal_date_to_time(const struct calendar * /* jd */);
* 2208988800. This is larger than 32-bit INT_MAX, so unsigned
* type is forced.
*/
#define JAN_1970 ((u
_
int)NTP_TO_UNIX_DAYS * (u
_
int)SECSPERDAY)
#define JAN_1970 ((u
nsigned
int)NTP_TO_UNIX_DAYS * (u
nsigned
int)SECSPERDAY)
#endif
include/ntp_config.h
View file @
bc1f1c05
...
...
@@ -47,7 +47,7 @@ struct attr_val_tag {
int
type
;
/* T_String, T_Integer, ... */
union
val
{
int
i
;
u
_
int
u
;
u
nsigned
int
u
;
int_range
r
;
double
d
;
char
*
s
;
...
...
@@ -61,7 +61,7 @@ typedef struct address_node_tag address_node;
struct
address_node_tag
{
address_node
*
link
;
char
*
address
;
u
_
short
type
;
/* family, AF_UNSPEC (0), AF_INET[6] */
u
nsigned
short
type
;
/* family, AF_UNSPEC (0), AF_INET[6] */
};
typedef
DECL_FIFO_ANCHOR
(
address_node
)
address_fifo
;
...
...
@@ -261,7 +261,7 @@ address_node *create_address_node(char *addr, int type);
void
destroy_address_node
(
address_node
*
my_node
);
attr_val
*
create_attr_dval
(
int
attr
,
double
value
);
attr_val
*
create_attr_ival
(
int
attr
,
int
value
);
attr_val
*
create_attr_uval
(
int
attr
,
u
_
int
value
);
attr_val
*
create_attr_uval
(
int
attr
,
u
nsigned
int
value
);
attr_val
*
create_attr_rangeval
(
int
attr
,
int
first
,
int
last
);
attr_val
*
create_attr_sval
(
int
attr
,
const
char
*
s
);
filegen_node
*
create_filegen_node
(
int
filegen_token
,
...
...
include/ntp_filegen.h
View file @
bc1f1c05
...
...
@@ -43,7 +43,7 @@ typedef struct filegen_tag {
extern
void
filegen_setup
(
FILEGEN
*
,
time_t
);
extern
void
filegen_config
(
FILEGEN
*
,
const
char
*
,
const
char
*
,
u
_int
,
u_
int
);
u
nsigned
int
,
unsigned
int
);
extern
void
filegen_statsdir
(
void
);
extern
FILEGEN
*
filegen_get
(
const
char
*
);
extern
void
filegen_register
(
const
char
*
,
const
char
*
,
FILEGEN
*
);
...
...
include/ntp_io.h
View file @
bc1f1c05
...
...
@@ -36,7 +36,7 @@ typedef enum {
extern
int
qos
;
extern
bool
is_ip_address
(
const
char
*
,
u
_
short
,
sockaddr_u
*
);
extern
bool
is_ip_address
(
const
char
*
,
u
nsigned
short
,
sockaddr_u
*
);
extern
void
add_nic_rule
(
nic_rule_match
match_type
,
const
char
*
if_name
,
int
prefixlen
,
nic_rule_action
action
);
...
...
include/ntp_refclock.h
View file @
bc1f1c05
...
...
@@ -38,7 +38,7 @@
struct
refclockstat
{
uint8_t
flags
;
/* clock flags */
uint8_t
haveflags
;
/* bit array of valid flags */
u
_
short
lencode
;
/* length of last timecode */
u
nsigned
short
lencode
;
/* length of last timecode */
const
char
*
p_lastcode
;
/* last timecode received */
uint32_t
polls
;
/* transmit polls */
uint32_t
noresponse
;
/* no response to poll */
...
...
@@ -71,7 +71,7 @@ struct refclockio {
struct
peer
*
srcclock
;
/* refclock peer */
size_t
datalen
;
/* length of data */
int
fd
;
/* file descriptor */
u
_
long
recvcount
;
/* count of receive completions */
u
nsigned
long
recvcount
;
/* count of receive completions */
bool
active
;
/* true when in use */
};
...
...
@@ -82,12 +82,12 @@ struct refclockio {
#define NCLKBUGTIMES 32
struct
refclockbug
{
uint8_t
nvalues
;
/* values following */
uint8_t
ntimes
;
/* times following */
u
_
short
svalues
;
/* values format sign array */
uint8_t
nvalues
;
/* values following */
uint8_t
ntimes
;
/* times following */
u
nsigned
short
svalues
;
/* values format sign array */
uint32_t
stimes
;
/* times format sign array */
uint32_t
values
[
NCLKBUGVALUES
];
/* real values */
l_fp
times
[
NCLKBUGTIMES
];
/* real times */
l_fp
times
[
NCLKBUGTIMES
];
/* real times */
};
/*
...
...
@@ -109,7 +109,7 @@ struct refclockproc {
uint8_t
lastevent
;
/* last exception event */
const
char
*
clockname
;
/* clock name (tag for logging) */
const
char
*
clockdesc
;
/* clock description */
u
_
long
nextaction
;
/* local activity timeout */
u
nsigned
long
nextaction
;
/* local activity timeout */
void
(
*
action
)(
struct
peer
*
);
/* timeout callback */
char
a_lastcode
[
BMAX
];
/* last timecode received */
...
...
@@ -143,11 +143,11 @@ struct refclockproc {
/*
* Status tallies
*/
u
_
long
timestarted
;
/* time we started this */
u
_
long
polls
;
/* polls sent */
u
_
long
noreply
;
/* no replies to polls */
u
_
long
badformat
;
/* bad format reply */
u
_
long
baddata
;
/* bad data reply */
u
nsigned
long
timestarted
;
/* time we started this */
u
nsigned
long
polls
;
/* polls sent */
u
nsigned
long
noreply
;
/* no replies to polls */
u
nsigned
long
badformat
;
/* bad format reply */
u
nsigned
long
baddata
;
/* bad data reply */
};
/*
...
...
@@ -181,7 +181,7 @@ extern void init_refclock (void);
extern
void
refclock_control
(
sockaddr_u
*
,
const
struct
refclockstat
*
,
struct
refclockstat
*
);
extern
int
refclock_open
(
char
*
,
u
_int
,
u_
int
);
extern
int
refclock_open
(
char
*
,
u
nsigned
int
,
unsigned
int
);
extern
void
refclock_timer
(
struct
peer
*
);
extern
void
refclock_transmit
(
struct
peer
*
);
extern
bool
refclock_process
(
struct
refclockproc
*
);
...
...
include/ntpd.h
View file @
bc1f1c05
...
...
@@ -40,7 +40,7 @@
extern
const
char
*
getconfig
(
const
char
*
);
extern
void
readconfig
(
const
char
*
);
extern
void
ctl_clr_stats
(
void
);
extern
u
_
short
ctlpeerstatus
(
struct
peer
*
);
extern
u
nsigned
short
ctlpeerstatus
(
struct
peer
*
);
extern
void
init_control
(
void
);
extern
void
process_control
(
struct
recvbuf
*
,
int
);
extern
void
report_event
(
int
,
struct
peer
*
,
const
char
*
);
...
...
@@ -53,8 +53,8 @@ extern int mprintf_event (int, struct peer *, const char *, ...)
* variable indices and text format.
*/
struct
ctl_var
{
u
_
short
code
;
u
_
short
flags
;
u
nsigned
short
code
;
u
nsigned
short
flags
;
const
char
*
text
;
};
/*
...
...
@@ -70,10 +70,10 @@ struct ctl_var {
#define RO (CAN_READ)
#define RW (CAN_READ|CAN_WRITE)
extern
char
*
add_var
(
struct
ctl_var
**
,
u
_long
,
u_
short
);
extern
char
*
add_var
(
struct
ctl_var
**
,
u
nsigned
long
,
unsigned
short
);
extern
void
free_varlist
(
struct
ctl_var
*
);
extern
void
set_var
(
struct
ctl_var
**
,
const
char
*
,
u
_long
,
u_
short
);
extern
void
set_sys_var
(
const
char
*
,
u
_long
,
u_
short
);
extern
void
set_var
(
struct
ctl_var
**
,
const
char
*
,
u
nsigned
long
,
unsigned
short
);
extern
void
set_sys_var
(
const
char
*
,
u
nsigned
long
,
unsigned
short
);
extern
const
char
*
get_ext_sys_var
(
const
char
*
tag
);
/* ntp_io.c */
...
...
@@ -109,7 +109,7 @@ extern void adj_host_clock(void);
extern
void
loop_config
(
int
,
double
);
extern
void
select_loop
(
int
);
extern
void
huffpuff
(
void
);
extern
u
_
int
sys_tai
;
extern
u
nsigned
int
sys_tai
;
extern
int
freq_cnt
;
/* ntp_monitor.c */
...
...
@@ -119,7 +119,7 @@ extern int freq_cnt;
extern
void
init_mon
(
void
);
extern
void
mon_start
(
int
);
extern
void
mon_stop
(
int
);
extern
u
_
short
ntp_monitor
(
struct
recvbuf
*
,
u
_
short
);
extern
u
nsigned
short
ntp_monitor
(
struct
recvbuf
*
,
u
nsigned
short
);
extern
void
mon_clearinterface
(
endpt
*
interface
);
extern
int
mon_get_oldest_age
(
l_fp
);
...
...
@@ -132,7 +132,7 @@ extern struct peer *findpeerbyassoc(associd_t);
extern
void
set_peerdstadr
(
struct
peer
*
,
endpt
*
);
extern
struct
peer
*
newpeer
(
sockaddr_u
*
,
const
char
*
,
endpt
*
,
uint8_t
,
uint8_t
,
uint8_t
,
uint8_t
,
u
_
int
,
uint8_t
,
uint32_t
,
uint8_t
,
uint8_t
,
u
nsigned
int
,
uint8_t
,
uint32_t
,
keyid_t
,
const
bool
);
extern
void
peer_update_hash
(
struct
peer
*
);
extern
void
peer_all_reset
(
void
);
...
...
@@ -160,26 +160,26 @@ extern void poll_update (struct peer *, uint8_t);
extern
void
clock_filter
(
struct
peer
*
,
double
,
double
,
double
);
extern
void
init_proto
(
const
bool
);
extern
void
set_sys_tick_precision
(
double
);
extern
void
proto_config
(
int
,
u
_
long
,
double
);
extern
void
proto_config
(
int
,
u
nsigned
long
,
double
);
extern
void
proto_clr_stats
(
void
);
/* ntp_restrict.c */
extern
void
init_restrict
(
void
);
extern
u
_
short
restrictions
(
sockaddr_u
*
);
extern
u
nsigned
short
restrictions
(
sockaddr_u
*
);
extern
void
hack_restrict
(
int
,
sockaddr_u
*
,
sockaddr_u
*
,
u
_short
,
u_short
,
u_
long
);
extern
void
restrict_source
(
sockaddr_u
*
,
bool
,
u
_
long
);
u
nsigned
short
,
unsigned
short
,
unsigned
long
);
extern
void
restrict_source
(
sockaddr_u
*
,
bool
,
u
nsigned
long
);
/* ntp_timer.c */
extern
void
init_timer
(
void
);
extern
void
reinit_timer
(
void
);
extern
void
timer
(
void
);
extern
void
timer_clr_stats
(
void
);
extern
void
timer_interfacetimeout
(
u
_
long
);
extern
void
timer_interfacetimeout
(
u
nsigned
long
);
extern
volatile
int
interface_interval
;
extern
u
_
long
orphwait
;
/* orphan wait time */
extern
u
nsigned
long
orphwait
;
/* orphan wait time */
/* ntp_util.c */
extern
void
init_util
(
void
);
...
...
@@ -195,7 +195,7 @@ extern void record_raw_stats (struct peer *,
int
leap
,
int
version
,
int
mode
,
int
stratum
,
int
ppoll
,
int
precision
,
double
root_delay
,
double
root_dispersion
,
uint32_t
refid
,
u
_
int
outcount
);
u
nsigned
int
outcount
);
extern
void
check_leap_file
(
bool
is_daily_check
,
time_t
systime
);
#ifdef ENABLE_DEBUG_TIMING
extern
void
record_timing_stats
(
const
char
*
);
...
...
@@ -233,19 +233,19 @@ extern void reset_auth_stats(void);
/*
* Other statistics of possible interest
*/
extern
u
_
long
packets_dropped
;
/*
total number of
packets dropped on reception */
extern
u
_
long
packets_ignored
;
/* received on wild card interface */
extern
u
_
long
packets_received
;
/* total number of packets received */
extern
u
_
long
packets_sent
;
/* total number of packets sent */
extern
u
_
long
packets_notsent
;
/* total number of packets which couldn't be sent */
extern
u
nsigned
long
packets_dropped
;
/*
#
packets dropped on reception */
extern
u
nsigned
long
packets_ignored
;
/* received on wild card interface */
extern
u
nsigned
long
packets_received
;
/* total number of packets received */
extern
u
nsigned
long
packets_sent
;
/* total number of packets sent */
extern
u
nsigned
long
packets_notsent
;
/* total number of packets which couldn't be sent */
extern
volatile
u
_
long
handler_calls
;
/* number of calls to interrupt handler */
extern
volatile
u
_
long
handler_pkts
;
/* number of pkts received by handler */
extern
u
_
long
io_timereset
;
/* time counters were reset */
extern
volatile
u
nsigned
long
handler_calls
;
/* number of calls to interrupt handler */
extern
volatile
u
nsigned
long
handler_pkts
;
/* number of pkts received by handler */
extern
u
nsigned
long
io_timereset
;
/* time counters were reset */
/* ntp_io.c */
extern
bool
disable_dynamic_updates
;
extern
u
_
int
sys_ifnum
;
/* next .ifnum to assign */
extern
u
nsigned
int
sys_ifnum
;
/* next .ifnum to assign */
extern
endpt
*
any_interface
;
/* IPv4 wildcard */
extern
endpt
*
any6_interface
;
/* IPv6 wildcard */
extern
endpt
*
loopback_interface
;
/* IPv4 loopback for refclocks */
...
...
@@ -286,20 +286,20 @@ extern double sys_jitter; /* system jitter (s) */
extern
uint8_t
mon_hash_bits
;
/* log2 size of hash table */
extern
mon_entry
**
mon_hash
;
/* MRU hash table */
extern
mon_entry
mon_mru_list
;
/* mru listhead */
extern
u
_
int
mon_enabled
;
/* MON_OFF (0) or other MON_* */
extern
u
_
int
mru_entries
;
/* mru list count */
extern
u
_
int
mru_peakentries
;
/* highest mru_entries */
extern
u
_
int
mru_initalloc
;
/* entries to preallocate */
extern
u
_
int
mru_incalloc
;
/* allocation batch factor */
extern
u
_
int
mru_mindepth
;
/* preempt above this */
extern
u
nsigned
int
mon_enabled
;
/* MON_OFF (0) or other MON_* */
extern
u
nsigned
int
mru_entries
;
/* mru list count */
extern
u
nsigned
int
mru_peakentries
;
/* highest mru_entries */
extern
u
nsigned
int
mru_initalloc
;
/* entries to preallocate */
extern
u
nsigned
int
mru_incalloc
;
/* allocation batch factor */
extern
u
nsigned
int
mru_mindepth
;
/* preempt above this */
extern
int
mru_maxage
;
/* recycle if older than this */
extern
int
mru_minage
;
/* recycle if older than this & full */
extern
u
_
int
mru_maxdepth
;
/* MRU size hard limit */
extern
u
_
long
mru_exists
;
/* slot already exists */
extern
u
_
long
mru_new
;
/* allocated new slot */
extern
u
_
long
mru_recycleold
;
/* recycle: age > maxage */
extern
u
_
long
mru_recyclefull
;
/* recycle: full and age > minage */
extern
u
_
long
mru_none
;
/* couldn't allocate slot */
extern
u
nsigned
int
mru_maxdepth
;
/* MRU size hard limit */
extern
u
nsigned
long
mru_exists
;
/* slot already exists */
extern
u
nsigned
long
mru_new
;
/* allocated new slot */
extern
u
nsigned
long
mru_recycleold
;
/* recycle: age > maxage */
extern
u
nsigned
long
mru_recyclefull
;
/* recycle: full and age > minage */
extern
u
nsigned
long
mru_none
;
/* couldn't allocate slot */
extern
int
mon_age
;
/* preemption limit */
/* ntp_peer.c */
...
...
@@ -334,18 +334,18 @@ extern int sys_minsane; /* minimum candidates */
/*
* Statistics counters
*/
extern
u
_
long
sys_stattime
;
/* time since reset */
extern
u
_
long
sys_received
;
/* packets received */
extern
u
_
long
sys_processed
;
/* packets for this host */
extern
u
_
long
sys_restricted
;
/* restricted packets */
extern
u
_
long
sys_newversion
;
/* current version */
extern
u
_
long
sys_oldversion
;
/* old version */
extern
u
_
long
sys_badlength
;
/* bad length or format */
extern
u
_
long
sys_badauth
;
/* bad authentication */
extern
u
_
long
sys_declined
;
/* declined */
extern
u
_
long
sys_limitrejected
;
/* rate exceeded */
extern
u
_
long
sys_kodsent
;
/* KoD sent */
extern
u
_
long
use_stattime
;
/* time since reset */
extern
u
nsigned
long
sys_stattime
;
/* time since reset */
extern
u
nsigned
long
sys_received
;
/* packets received */
extern
u
nsigned
long
sys_processed
;
/* packets for this host */
extern
u
nsigned
long
sys_restricted
;
/* restricted packets */
extern
u
nsigned
long
sys_newversion
;
/* current version */
extern
u
nsigned
long
sys_oldversion
;
/* old version */
extern
u
nsigned
long
sys_badlength
;
/* bad length or format */
extern
u
nsigned
long
sys_badauth
;
/* bad authentication */
extern
u
nsigned
long
sys_declined
;
/* declined */
extern
u
nsigned
long
sys_limitrejected
;
/* rate exceeded */
extern
u
nsigned
long
sys_kodsent
;
/* KoD sent */
extern
u
nsigned
long
use_stattime
;
/* time since reset */
/* Signalling */
extern
volatile
bool
sawALRM
;
...
...
@@ -368,14 +368,14 @@ extern void send_via_ntp_signd(struct recvbuf *, int, keyid_t, int,
#endif
/* ntp_timer.c */
extern
volatile
u
_
long
alarm_overflow
;
extern
u
_
long
current_time
;
/* seconds since startup */