Refclocks and formatting

Ian Bruene ianbruene at gmail.com
Sun Apr 16 23:24:35 UTC 2017


@ESR

In the units project I discovered that the string formatting for 
refclocks is handled in a completely different manner from the rest of 
the code. Specifically ntpq/mon call ntp.ntpc.statustoa which is a C 
library, instead of calling hypothetical formatting functions in 
pylib/util.py like they do for everything else.

As far as I can tell from a cursory examination of the code the reason 
for this is so it can use the same bitmask #defines as the rest of the 
system. Is this correct? If so does that need to remain the case, if not 
then why is the complexity of a language bridge being maintained? If it 
has to stay this way the unit formatters *can* munch on the output of 
statustoa.


Related @anyone: is there a way to make ntpd produce a fake refclock for 
testing purposes? I don't have the hardware for it to produce one 
naturally, and unit testing / careful examination of the logic can only 
go so far. Pushing the testing burden onto someone else's patience is 
suboptimal as well.

-- 
In the end; what separates a Man, from a Slave? Money? Power?
No. A Man Chooses, a Slave Obeys. -- Andrew Ryan




More information about the devel mailing list