package
0.0.0-20240702114427-da4c1ac49fb1
Repository: https://github.com/facebook/time.git
Documentation: pkg.go.dev

# Functions

ClockAdjFreq adjusts PHC clock frequency in PPB.
ClockStep steps PHC clock by given step.
DeviceFromIface returns a path to a PHC device from a network interface.
FDToClockID converts file descriptor number to clockID.
FrequencyPPBFromDevice reads PHC device frequency in PPB.
IfaceInfo uses SIOCETHTOOL ioctl to get information for the give nic, i.e.
IfacesInfo is like net.Interfaces() but with added EthtoolTSinfo.
IfaceToPHCDevice returns path to PHC device associated with given network card iface.
MaxFreqAdjPPBFromDevice reads max value for frequency adjustments (in PPB) from ptp device.
OffsetBetweenDevices returns estimated difference between two PHC devices.
OffsetBetweenExtendedReadings returns estimated difference between two PHC SYS_OFFSET_EXTENDED readings.
ReadPTPClockCapsFromDevice reads ptp capabilities using ioctl.
ReadPTPSysOffsetExtended gets precise time from PHC along with SYS time to measure the call delay.
SysoffEstimateBasic logic based on calculate_offset from ptp4l phc_ctl.c.
SysoffEstimateExtended finds sample which took least time to be read, logic loosely based on sysoff_estimate from ptp4l sysoff.c.
Time returns time we got from network card.
TimeAndOffset returns time we got from network card + offset.
TimeAndOffsetFromDevice returns time we got from phc device + offset.
TimeFromDevice returns time we got from PTP device.

# Constants

DefaultMaxClockFreqPPB value came from linuxptp project (clockadj.c).
ExtendedNumProbes is the number of samples we request for IOCTL SYS_OFFSET_EXTENDED.
Methods we support to get time.
Methods we support to get time.

# Variables

SupportedMethods is a list of supported TimeMethods.

# Structs

EthtoolTSinfo holds a device's timestamping and PHC association as per Linux kernel's include/uapi/linux/ethtool.h.
IfaceData has both net.Interface and EthtoolTSinfo.
Ifreq is the request we send with SIOCETHTOOL IOCTL as per Linux kernel's include/uapi/linux/if.h.
PTPClockCaps as defined in linux/ptp_clock.h.
PTPClockTime as defined in linux/ptp_clock.h.
PTPSysOffsetExtended as defined in linux/ptp_clock.h.
SysoffResult is a result of PHC time measurement with related data.

# Type aliases

TimeMethod is method we use to get time.