pub struct NetworkManager<A: PtpAddressFamily>(/* private fields */);Expand description
The primary management struct for the PTP/CSPTP network sockets.
Root of the hierarchy for opening sockets. Allows opening of specific interfaces and configuring the clock sources used for those interface. These interfaces can then be used to create sockets, which can be used to handle the actual network traffic.
Implementations§
Source§impl<A: PtpAddressFamily> NetworkManager<A>
impl<A: PtpAddressFamily> NetworkManager<A>
Source§impl<A: PtpAddressFamily> NetworkManager<A>
impl<A: PtpAddressFamily> NetworkManager<A>
Sourcepub fn open_general(&self) -> Interface<A>
pub fn open_general(&self) -> Interface<A>
Get a reference to the general interface.
This interface can be used to create sockets which don’t care about which network interface their messages actually transit through. Timestamping of their messages will always be done with the system clock, as that is the only clock guaranteed to be available for timestamping on all network interfaces.
Sourcepub fn open_interface(
&self,
interface: InterfaceName,
clock: TimestampingClock,
) -> Result<Interface<A>>
pub fn open_interface( &self, interface: InterfaceName, clock: TimestampingClock, ) -> Result<Interface<A>>
Open a specific network interface.
This opens the specified network interface, configuring it such that the requested clock can be used for timestamping. If the interface was already previously opened, it will return a reference to it.
§Errors
Returns any IO errors that occured when trying to create a socket for the specified interface.
Will also error when the interface is already open, but was created with a different clock for timestamping than currently requested, unless the currently requested clock is the system clock.