Skip to main content

Crate statime_netptp

Crate statime_netptp 

Source
Expand description

Network handling for PTP/CSPTP in ntpd-rs/statime.

This crate provides abstractions for dealing with the fact that both PTP and CSPTP need sockets with local bindings on ports 319 and 320. The operating system can only hand out 1 of those sockets per interface, plus a fallback socket. This crate provides multiplexing for multiple uses of this one socket, making implementing of simultaneous use of PTP and CSPTP, as well as more than one CSPTP connection at the same time, easier.

This is mostly intended as an internal crate for the ntpd-rs/statime ecosystem, though we plan to keep the version numbering consistent with semver. Be aware that we might be making breaking changes fairly often though when using this crate, and that we might not be receptive to changes making it work better for your particular use case if those changes have no value for ntpd-rs/statime ecosystem.

Structs§

ConnectedSocket
A socket that connected to a specific remote.
Interface
A handle for a network interface
NetworkManager
The primary management struct for the PTP/CSPTP network sockets.
OpenSocket
A socket not connected to a specific remote.
RecvResult
Result from a receive operation.

Enums§

TimestampingClock
Description of which clock to use for timestamping messages.

Constants§

CACHED_TIMESTAMPS
The number of old send timestamps that are stored per interface.
MAX_PACKET_SIZE
The maximum size for incoming packets
PACKET_BUFFER_SIZE
The number of incoming packets that are buffered for a socket.
TIMESTAMP_FETCH_TIMEOUT
The amount of time we are willing to wait for a send timestamp.

Traits§

PtpAddressFamily
An address type which can be used for PTP/CSPTP traffic.