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

# Functions

ConnFd returns file descriptor of a connection.
EnableHWTimestamps enables HW timestamps (TX and RX) on the socket.
EnableHWTimestampsRx enables HW RX timestamps on the socket.
EnableSWTimestamps enables SW timestamps (TX and RX) on the socket.
EnableSWTimestampsRx enables SW RX timestamps on the socket.
EnableTimestamps enables timestamps on the socket based on requested type.
IPToSockaddr converts IP + port into a socket address Somewhat copy from https://github.com/golang/go/blob/16cd770e0668a410a511680b2ac1412e554bd27b/src/net/ipsock_posix.go#L145.
NewSockaddrWithPort creates a new socket address with the same IP and new port.
ReadPacketWithRXTimestamp returns byte packet and HW RX timestamp.
ReadPacketWithRXTimestampBuf writes byte packet into provide buffer buf, and returns number of bytes copied to the buffer, client ip and HW RX timestamp.
ReadTXtimestamp returns HW TX timestamp.
ReadTXtimestampBuf returns HW TX timestamp, needs to be provided 2 buffers which all can be re-used after ReadTXtimestampBuf finishes.
SockaddrToAddr converts socket address to a netip.Addr Somewhat copy from https://github.com/golang/go/blob/658b5e66ecbc41a49e6fb5aa63c5d9c804cf305f/src/net/udpsock_posix.go#L15.
SockaddrToIP converts socket address to an IP Somewhat copy from https://github.com/golang/go/blob/658b5e66ecbc41a49e6fb5aa63c5d9c804cf305f/src/net/udpsock_posix.go#L15.
SockaddrToPort converts socket address to an IP Somewhat copy from https://github.com/golang/go/blob/658b5e66ecbc41a49e6fb5aa63c5d9c804cf305f/src/net/udpsock_posix.go#L15.

# Constants

ControlSizeBytes is a socket control message containing TX/RX timestamp If the read fails we may endup with multiple timestamps in the buffer which is best to read right away.
EthtoolGetTSInfo is get time stamping and PHC info command.
HW is a hardware timestamp.
HWRX is a hardware RX timestamp.
PayloadSizeBytes is a size of maximum ptp packet which is usually up to 66 bytes.
SW is a software timestamp.
SWRX is a software RX timestamp.
Unsupported is a string for unsupported timestamp.

# Variables

AttemptsTXTS is configured amount of attempts to read TX timestamp.
TimeoutTXTS is configured timeout to read TX timestamp.

# Type aliases

Timestamp is a type of timestamp.