template <>
class WireServer
Defined at line 2252 of file fidling/gen/sdk/fidl/fuchsia.net.tun/fuchsia.net.tun/cpp/fidl/fuchsia.net.tun/cpp/wire_messaging.h
Pure-virtual interface to be implemented by a server.
This interface uses typed channels (i.e. |::fidl::ClientEnd
<
::fuchsia_net_tun::Device>|
and |::fidl::ServerEnd
<
::fuchsia_net_tun::Device>|).
Public Methods
void WireServer ()
Defined at line 2255 of file fidling/gen/sdk/fidl/fuchsia.net.tun/fuchsia.net.tun/cpp/fidl/fuchsia.net.tun/cpp/wire_messaging.h
void WriteFrame (::fuchsia_net_tun::wire::DeviceWriteFrameRequest * request, WriteFrameCompleter::Sync & completer)
Writes a frame to the device (data coming from network-end).
If the device was created with the
[`fuchsia.net.tun/DeviceConfig.blocking`] option set to `true`, calls to
`WriteFrame` block until there is one buffer available to fulfill the
request.
+ request `frame` inbound frame data and metadata.
* error `ZX_ERR_NOT_FOUND` if [`Frame.port`] references an unknown port.
* error `ZX_ERR_INVALID_ARGS` if `frame` is invalid.
* error `ZX_ERR_BAD_STATE` if the device is offline.
* error `ZX_ERR_NO_RESOURCES` if more than
[`fuchsia.net.tun/MAX_PENDING_OPERATIONS`] calls to `WriteFrame` are
pending.
* error `ZX_ERR_SHOULD_WAIT` if `blocking` is set to `false` and there
are no buffers available to fulfill the request.
void ReadFrame (ReadFrameCompleter::Sync & completer)
Gets the next frame from the device (data coming from host-end).
If the device was created with the
[`fuchsia.net.tun/DeviceConfig.blocking`] option set to `true`, calls to
`ReadFrame` block until there is a frame available to be read.
- response `frame` outbound frame data and metadata.
* error `ZX_ERR_NO_RESOURCES` if more than
[`fuchsia.net.tun/MAX_PENDING_OPERATIONS`] calls to `ReadFrame` are
pending.
* error `ZX_ERR_SHOULD_WAIT` if `blocking` is set to `false` and there
are no frames to be read.
void GetSignals (GetSignalsCompleter::Sync & completer)
Retrieves signals eventpair.
- response `signals` an eventpair that is signalled with
`SIGNAL_READABLE` and `SIGNAL_WRITABLE` when read and write buffers are
available, respectively.
void AddPort (::fuchsia_net_tun::wire::DeviceAddPortRequest * request, AddPortCompleter::Sync & completer)
Creates a new port on this device.
+ request `config` new port configuration.
+ request `port` grants control over the port. Closed with an epitaph if
`config` is not valid.
void GetDevice (::fuchsia_net_tun::wire::DeviceGetDeviceRequest * request, GetDeviceCompleter::Sync & completer)
Connects to the underlying device endpoint.
+ request `device` device handle.
void DelegateRxLease (::fuchsia_net_tun::wire::DeviceDelegateRxLeaseRequest * request, DelegateRxLeaseCompleter::Sync & completer)
Delegates an rx lease through the tun device.
See documentation on [`fuchsia.hardware.network/DelegatedRxLease`] for
proper usage.
Handler bind_handler (async_dispatcher_t * dispatcher)
|bind_handler| returns a handler that binds incoming connections to this
server implementation.
The returned handler borrows the server instance.
The server must outlive the provided |dispatcher|. Only after
the dispatcher is shutdown will it be safe to destroy the servers.
The server should not be moved.
void ~WireServer ()
Defined at line 2256 of file fidling/gen/sdk/fidl/fuchsia.net.tun/fuchsia.net.tun/cpp/fidl/fuchsia.net.tun/cpp/wire_messaging.h