On Mon, Nov 14, 2022 at 04:34:05AM -0800, Hal Murray wrote:
> Is there a URL for the spec?  I don't want an RFC.  Good comments in a header 
> file may be enough.  A separate document may be better if there are 
> complications that need explaining.

Here is the structure of the message with some comments:
https://git.tuxfamily.org/chrony/chrony.git/tree/refclock_sock.c#n38

If you started with a copy of the SHM driver in ntpd, it would need to
be modified to use a datagram Unix socket instead of the shared memory
segment, listen for messages on the socket (io_addclock()) instead of
polling in the _timer() function, and interpret the fields in the
message like this:

- "tv" field in SOCK is the same as receiveTimeStamp in SHM
- tv + offset is clockTimestamp
- messages with non-zero pulse can be ignored in the initial
  implementation as nothing really uses it
- leap has the same meaning
- magic is a protocol sanity+version check, should be always
  0x534f434b

The missing fields precision and samples can be set to -30 and 1
respectively.

That should be it. I can help with the patch if interested.

> is there a version number?

No. If there was a need to make an incompatible change, we can change
the magic number.

-- 
Miroslav Lichvar



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to