ntpdsim status and question
Tom Enterline
tenterline at gmail.com
Wed Dec 30 17:07:00 UTC 2015
Status:
The first issue working with the ntpdsim was that the sodium library
was missing. The fix to the nptd waf recipe (wscript) was
straightforward.
The ntpsim.c versions of adj_systime and step_systime had fewer
arguments compared to the libntp versions, so I added the missing
arguments to the ntpsim.c versions.
ntpsim.c was looking for a ntp_srandom(seed.tv_nsec). I couldn't find
any such, so I replaced it with a call to srandom(seed.tv_nsec).
Question:
As aluded to, there are two different copies of adj_systime and step_systime.
One copy is in libntp/systime.c, included if SIM macro IS NOT defined.
One copy is in nptd/ntpsim.c, included if SIM macro IS defined.
Using the current build scripts, when libntp/systime.c is built, SIM
is NOT defined, so we end up with two copies of adj_systime and
step_systime when building nptdsim.
I can think of several approaches to solving this, e.g.
splitting out the libntp versions of adj_systime and step_systime into
a separate file,
and/or compiling a version of systime.c with the SIM macro defined
specifically for ntpdsim,
or looking for link options so that the one copy needed is included,
etc.
What is the preferred approach?
More information about the devel
mailing list