class DevicePair
Defined at line 4787 of file fidling/gen/sdk/fidl/fuchsia.net.tun/fuchsia.net.tun/hlcpp/fuchsia/net/tun/cpp/fidl.h
Provides control over a pair of network devices.
A `DevicePair` is a simpler version of `Device` that "shorts" two network
device interfaces, named its "left" and "right" ends. The internal state of
a `DevicePair` is not accessible, like it is for `Device` and it provides a
more streamlined (and considerably faster) pair of
[`fuchsia.hardware.network/Device`]s. The transmit side of each port of the
left end is connected to the receive side of the port with the same
identifier on the right end, and vice-versa. A `DevicePair`'s port online
signal is handled internally (online if any of the ends has an active data
session). If MAC addresses are provided on creation, the only supported MAC
filtering mode is `PROMISCUOUS`.
This protocol encodes the underlying object's lifetime in both directions;
the underlying object is alive iff both ends of the protocol are open. That
is:
- Closing the client end causes the object to be destroyed.
- Observing a closure of the server end indicates the object no longer
exists.
Public Methods
void ~DevicePair ()
void AddPort (::fuchsia::net::tun::DevicePairPortConfig config, AddPortCallback callback)
Adds a logical port to this device pair.
+ request `config` port configuration.
* error `ZX_ERR_INVALID_ARGS` if `config` is invalid.
* error `ZX_ERR_ALREADY_EXISTS` if the provided port identifier is
already in use.
void RemovePort (uint8_t id, RemovePortCallback callback)
Removes a logical port created by
[`fuchsia.net.tun/DevicePair.AddPort`].
+ request `id` identifier of the port to remove.
* error `ZX_ERR_NOT_FOUND` if `id` does not map to an existing port.
void GetLeft (::fidl::InterfaceRequest< ::fuchsia::hardware::network::Device> device)
Connects to the underlying left device endpoint.
+ request `device` handle serve the left device endpoint on.
void GetRight (::fidl::InterfaceRequest< ::fuchsia::hardware::network::Device> device)
Connects to the underlying right device endpoint.
+ request `device` handle serve the right device endpoint on.
void GetLeftPort (uint8_t id, ::fidl::InterfaceRequest< ::fuchsia::hardware::network::Port> port)
Connects to an underlying left port.
+ request `id` requested port identifier.
+ request `port` grants access to the requested port on the left device.
void GetRightPort (uint8_t id, ::fidl::InterfaceRequest< ::fuchsia::hardware::network::Port> port)
Connects to an underlying right port.
+ request `id` requested port identifier.
+ request `port` grants access to the requested port on the right device.