[ntp:questions] new driver development

Dave Hart hart at ntp.org
Fri Mar 18 16:26:03 UTC 2011

On Fri, Mar 18, 2011 at 3:30 PM, "Rob" wrote:
> How is the ntp.conf file parsed and the driver initialized in ntpd?
> Is the value of a fudge flag even available at the moment a driver
> is initialized?

The entire file is parsed for syntax and translated into a machine
representation before any of it is applied.  The issue is the refclock
interface contract, where the startup entry is called first, then the
fudge is provided immediately after via the control entrypoint.
Without an extension of that refclock interface, a driver can't vary
its start behavior based on a fudge.  It can look at setvar variables.

That is why I suggested using the existing mode approach, since the
mode is available to the driver startup function.  Well, that and an
interest in seeing as much common code as practical, to retain
maintainability and clarity.  We don't need two different drivers
simply to use two different APIs for mapping a shared memory region
into our process.

Dave Hart

More information about the questions mailing list