Skip to main content

fidl_fuchsia_net_test_realm/
fidl_fuchsia_net_test_realm.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_net_test_realm__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub struct ControllerMarker;
16
17impl fidl::endpoints::ProtocolMarker for ControllerMarker {
18    type Proxy = ControllerProxy;
19    type RequestStream = ControllerRequestStream;
20    #[cfg(target_os = "fuchsia")]
21    type SynchronousProxy = ControllerSynchronousProxy;
22
23    const DEBUG_NAME: &'static str = "fuchsia.net.test.realm.Controller";
24}
25impl fidl::endpoints::DiscoverableProtocolMarker for ControllerMarker {}
26pub type ControllerStartHermeticNetworkRealmResult = Result<(), Error>;
27pub type ControllerStopHermeticNetworkRealmResult = Result<(), Error>;
28pub type ControllerAddInterfaceResult = Result<(), Error>;
29pub type ControllerStartStubResult = Result<(), Error>;
30pub type ControllerStopStubResult = Result<(), Error>;
31pub type ControllerPingResult = Result<(), Error>;
32pub type ControllerPollUdpResult = Result<Vec<u8>, Error>;
33pub type ControllerJoinMulticastGroupResult = Result<(), Error>;
34pub type ControllerLeaveMulticastGroupResult = Result<(), Error>;
35pub type ControllerStartDhcpv6ClientResult = Result<(), Error>;
36pub type ControllerStopDhcpv6ClientResult = Result<(), Error>;
37pub type ControllerStartOutOfStackDhcpv4ClientResult = Result<(), Error>;
38pub type ControllerStopOutOfStackDhcpv4ClientResult = Result<(), Error>;
39
40pub trait ControllerProxyInterface: Send + Sync {
41    type StartHermeticNetworkRealmResponseFut: std::future::Future<Output = Result<ControllerStartHermeticNetworkRealmResult, fidl::Error>>
42        + Send;
43    fn r#start_hermetic_network_realm(
44        &self,
45        netstack: Netstack,
46    ) -> Self::StartHermeticNetworkRealmResponseFut;
47    type StopHermeticNetworkRealmResponseFut: std::future::Future<Output = Result<ControllerStopHermeticNetworkRealmResult, fidl::Error>>
48        + Send;
49    fn r#stop_hermetic_network_realm(&self) -> Self::StopHermeticNetworkRealmResponseFut;
50    type AddInterfaceResponseFut: std::future::Future<Output = Result<ControllerAddInterfaceResult, fidl::Error>>
51        + Send;
52    fn r#add_interface(
53        &self,
54        mac_address: &fidl_fuchsia_net::MacAddress,
55        name: &str,
56        wait_any_ip_address: bool,
57    ) -> Self::AddInterfaceResponseFut;
58    type StartStubResponseFut: std::future::Future<Output = Result<ControllerStartStubResult, fidl::Error>>
59        + Send;
60    fn r#start_stub(&self, component_url: &str) -> Self::StartStubResponseFut;
61    type StopStubResponseFut: std::future::Future<Output = Result<ControllerStopStubResult, fidl::Error>>
62        + Send;
63    fn r#stop_stub(&self) -> Self::StopStubResponseFut;
64    type PingResponseFut: std::future::Future<Output = Result<ControllerPingResult, fidl::Error>>
65        + Send;
66    fn r#ping(
67        &self,
68        target: &fidl_fuchsia_net::IpAddress,
69        payload_length: u16,
70        interface_name: Option<&str>,
71        timeout: i64,
72    ) -> Self::PingResponseFut;
73    type PollUdpResponseFut: std::future::Future<Output = Result<ControllerPollUdpResult, fidl::Error>>
74        + Send;
75    fn r#poll_udp(
76        &self,
77        target: &fidl_fuchsia_net::SocketAddress,
78        payload: &[u8],
79        timeout: i64,
80        num_retries: u16,
81    ) -> Self::PollUdpResponseFut;
82    type JoinMulticastGroupResponseFut: std::future::Future<Output = Result<ControllerJoinMulticastGroupResult, fidl::Error>>
83        + Send;
84    fn r#join_multicast_group(
85        &self,
86        address: &fidl_fuchsia_net::IpAddress,
87        interface_id: u64,
88    ) -> Self::JoinMulticastGroupResponseFut;
89    type LeaveMulticastGroupResponseFut: std::future::Future<Output = Result<ControllerLeaveMulticastGroupResult, fidl::Error>>
90        + Send;
91    fn r#leave_multicast_group(
92        &self,
93        address: &fidl_fuchsia_net::IpAddress,
94        interface_id: u64,
95    ) -> Self::LeaveMulticastGroupResponseFut;
96    type StartDhcpv6ClientResponseFut: std::future::Future<Output = Result<ControllerStartDhcpv6ClientResult, fidl::Error>>
97        + Send;
98    fn r#start_dhcpv6_client(
99        &self,
100        params: &fidl_fuchsia_net_dhcpv6::NewClientParams,
101    ) -> Self::StartDhcpv6ClientResponseFut;
102    type StopDhcpv6ClientResponseFut: std::future::Future<Output = Result<ControllerStopDhcpv6ClientResult, fidl::Error>>
103        + Send;
104    fn r#stop_dhcpv6_client(&self) -> Self::StopDhcpv6ClientResponseFut;
105    type StartOutOfStackDhcpv4ClientResponseFut: std::future::Future<
106            Output = Result<ControllerStartOutOfStackDhcpv4ClientResult, fidl::Error>,
107        > + Send;
108    fn r#start_out_of_stack_dhcpv4_client(
109        &self,
110        payload: &ControllerStartOutOfStackDhcpv4ClientRequest,
111    ) -> Self::StartOutOfStackDhcpv4ClientResponseFut;
112    type StopOutOfStackDhcpv4ClientResponseFut: std::future::Future<
113            Output = Result<ControllerStopOutOfStackDhcpv4ClientResult, fidl::Error>,
114        > + Send;
115    fn r#stop_out_of_stack_dhcpv4_client(
116        &self,
117        payload: &ControllerStopOutOfStackDhcpv4ClientRequest,
118    ) -> Self::StopOutOfStackDhcpv4ClientResponseFut;
119}
120#[derive(Debug)]
121#[cfg(target_os = "fuchsia")]
122pub struct ControllerSynchronousProxy {
123    client: fidl::client::sync::Client,
124}
125
126#[cfg(target_os = "fuchsia")]
127impl fidl::endpoints::SynchronousProxy for ControllerSynchronousProxy {
128    type Proxy = ControllerProxy;
129    type Protocol = ControllerMarker;
130
131    fn from_channel(inner: fidl::Channel) -> Self {
132        Self::new(inner)
133    }
134
135    fn into_channel(self) -> fidl::Channel {
136        self.client.into_channel()
137    }
138
139    fn as_channel(&self) -> &fidl::Channel {
140        self.client.as_channel()
141    }
142}
143
144#[cfg(target_os = "fuchsia")]
145impl ControllerSynchronousProxy {
146    pub fn new(channel: fidl::Channel) -> Self {
147        Self { client: fidl::client::sync::Client::new(channel) }
148    }
149
150    pub fn into_channel(self) -> fidl::Channel {
151        self.client.into_channel()
152    }
153
154    /// Waits until an event arrives and returns it. It is safe for other
155    /// threads to make concurrent requests while waiting for an event.
156    pub fn wait_for_event(
157        &self,
158        deadline: zx::MonotonicInstant,
159    ) -> Result<ControllerEvent, fidl::Error> {
160        ControllerEvent::decode(self.client.wait_for_event::<ControllerMarker>(deadline)?)
161    }
162
163    /// Starts a hermetic network realm corresponding to `netstack`.
164    ///
165    /// Any previously running hermetic network realm will be terminated before
166    /// the new realm is started. The configured realm will contain a subset of
167    /// the components in the standard network realm. In particular, it will
168    /// contain:
169    ///
170    ///  * A Netstack instance that corresponds to the provided `netstack`
171    ///  * A DHCP server
172    ///  * A DHCPv6 client
173    ///  * A DNS resolver
174    ///
175    /// + request `netstack` the type of Netstack that will be run.
176    /// * error `INTERNAL` for internal errors, including failure to start the
177    ///     specified `netstack`.
178    pub fn r#start_hermetic_network_realm(
179        &self,
180        mut netstack: Netstack,
181        ___deadline: zx::MonotonicInstant,
182    ) -> Result<ControllerStartHermeticNetworkRealmResult, fidl::Error> {
183        let _response = self.client.send_query::<
184            ControllerStartHermeticNetworkRealmRequest,
185            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
186            ControllerMarker,
187        >(
188            (netstack,),
189            0x58c1fa7335d4c5c2,
190            fidl::encoding::DynamicFlags::empty(),
191            ___deadline,
192        )?;
193        Ok(_response.map(|x| x))
194    }
195
196    /// Stops any running hermetic network realm.
197    ///
198    /// All components in the hermetic network realm will be stopped. Similarly,
199    /// any interfaces that were previously disabled on the system's Netstack
200    /// will be re-enabled on a best-effort basis. That is, a failure to
201    /// re-enable an interface will not result in this method returning an
202    /// error.
203    ///
204    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if a hermetic network realm
205    ///     is not running.
206    /// * error `INTERNAL` for internal errors, including failure to destroy the
207    ///     realm.
208    pub fn r#stop_hermetic_network_realm(
209        &self,
210        ___deadline: zx::MonotonicInstant,
211    ) -> Result<ControllerStopHermeticNetworkRealmResult, fidl::Error> {
212        let _response = self.client.send_query::<
213            fidl::encoding::EmptyPayload,
214            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
215            ControllerMarker,
216        >(
217            (),
218            0x49d3c2501cd2f635,
219            fidl::encoding::DynamicFlags::empty(),
220            ___deadline,
221        )?;
222        Ok(_response.map(|x| x))
223    }
224
225    /// Attaches an interface to the hermetic Netstack.
226    ///
227    /// The interface that corresponds to `mac_address` will disabled on the
228    /// system's Netstack, but enabled on the hermetic Netstack.
229    ///
230    /// + request `mac_address` address of the interface to be added to the
231    ///     hermetic Netstack.
232    /// + request `name` the name to assign to the new interface.
233    /// + request `wait_any_ip_address` whether to wait for any IP address to be
234    ///     assigned to the interface before returning. This is helpful for
235    ///     tests that want to ensure the autoconfigured IP address is assigned
236    ///     and has completed duplicate address detection before proceeding.
237    /// * error `ALREADY_EXISTS` if an interface with `name` already exists on
238    ///     the hermetic Netstack.
239    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
240    ///     hermetic network realm.
241    /// * error `INTERFACE_NOT_FOUND` if an interface with `mac_address` could
242    ///     not be found on the system.
243    /// * error `INTERNAL` for internal errors, including failure to read the
244    ///     system's interfaces or configure an interface.
245    pub fn r#add_interface(
246        &self,
247        mut mac_address: &fidl_fuchsia_net::MacAddress,
248        mut name: &str,
249        mut wait_any_ip_address: bool,
250        ___deadline: zx::MonotonicInstant,
251    ) -> Result<ControllerAddInterfaceResult, fidl::Error> {
252        let _response = self.client.send_query::<
253            ControllerAddInterfaceRequest,
254            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
255            ControllerMarker,
256        >(
257            (mac_address, name, wait_any_ip_address,),
258            0x668ded2d2b619c15,
259            fidl::encoding::DynamicFlags::empty(),
260            ___deadline,
261        )?;
262        Ok(_response.map(|x| x))
263    }
264
265    /// Starts a test stub.
266    ///
267    /// Any previously running stub will be terminated before the provided
268    /// stub corresponding to `component_url` is started.
269    ///
270    /// + request `component_url` the URL of the component to run.
271    /// * error `COMPONENT_NOT_FOUND` if a component correspodning to
272    ///     `component_url` could not be resolved.
273    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
274    ///     hermetic network realm.
275    /// * error `INTERNAL` for internal errors, including failure to add the
276    ///     desired stub within the hermetic network realm.
277    /// * error `INVALID_ARGUMENTS` if the `component_url` is malformed.
278    pub fn r#start_stub(
279        &self,
280        mut component_url: &str,
281        ___deadline: zx::MonotonicInstant,
282    ) -> Result<ControllerStartStubResult, fidl::Error> {
283        let _response = self.client.send_query::<
284            ControllerStartStubRequest,
285            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
286            ControllerMarker,
287        >(
288            (component_url,),
289            0x6523a401f22bf664,
290            fidl::encoding::DynamicFlags::empty(),
291            ___deadline,
292        )?;
293        Ok(_response.map(|x| x))
294    }
295
296    /// Stops the currently running stub.
297    ///
298    /// Other existing hermetic network realm components will continue to be run
299    /// after this is invoked.
300    ///
301    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
302    ///     hermetic network realm.
303    /// * error `STUB_NOT_RUNNING` if there is no running stub.
304    /// * error `INTERNAL` for internal errors, including failure to destroy the
305    ///     stub component.
306    pub fn r#stop_stub(
307        &self,
308        ___deadline: zx::MonotonicInstant,
309    ) -> Result<ControllerStopStubResult, fidl::Error> {
310        let _response = self.client.send_query::<
311            fidl::encoding::EmptyPayload,
312            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
313            ControllerMarker,
314        >(
315            (),
316            0x582c32b564ff4bb4,
317            fidl::encoding::DynamicFlags::empty(),
318            ___deadline,
319        )?;
320        Ok(_response.map(|x| x))
321    }
322
323    /// Sends an ICMP echo request to the `target` using a socket provided by
324    /// the hermetic Netstack.
325    ///
326    /// + request `target` the address to ping.
327    /// + request `payload_length` the body size of the ICMP packet.
328    ///     Specifically, the packet body will be filled with zeros of
329    ///     `payload_length`.
330    /// + request `interface_name` an optional interface to bind the socket to.
331    /// + request `timeout` a timeout in nanoseconds to wait for a reply. If
332    ///     less than or equal to 0, then returns success immediately after the
333    ///     ping is sent.
334    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
335    ///     hermetic network realm.
336    /// * error `INTERFACE_NOT_FOUND` if `interface_name` does not exist in the
337    ///     hermetic Netstack.
338    /// * error `INTERNAL` for internal errors, including failure to create a
339    ///     socket or generate the ping request and response.
340    /// * error `INVALID_ARGUMENTS` if `target` corresponds to a link-local
341    ///     address and an `interface_name` is not specified or the
342    ///     `payload_length` exceeds the maximum allowable size.
343    /// * error `PING_FAILED` if there was an error sending or receiving the
344    ///     ping.
345    /// * error `TIMEOUT_EXCEEDED` if the ping reply is not received before the
346    ///     specifed `timeout`.
347    pub fn r#ping(
348        &self,
349        mut target: &fidl_fuchsia_net::IpAddress,
350        mut payload_length: u16,
351        mut interface_name: Option<&str>,
352        mut timeout: i64,
353        ___deadline: zx::MonotonicInstant,
354    ) -> Result<ControllerPingResult, fidl::Error> {
355        let _response = self.client.send_query::<
356            ControllerPingRequest,
357            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
358            ControllerMarker,
359        >(
360            (target, payload_length, interface_name, timeout,),
361            0x60c9b6cf952fa4d1,
362            fidl::encoding::DynamicFlags::empty(),
363            ___deadline,
364        )?;
365        Ok(_response.map(|x| x))
366    }
367
368    /// Polls the specified socket address with UDP datagrams containing the specified payload
369    /// using a socket provided by the hermetic Netstack.
370    ///
371    /// Waits for a single reply from the target address and returns it.
372    ///
373    /// + request `target` the socket address to poll.
374    /// + request `payload` the content to place in the UDP datagram.
375    /// + request `timeout` a timeout in nanoseconds to wait for a reply, per retry.
376    /// + request `num_retries` the number of poll attempts to make before giving up and returning
377    ///     an error.
378    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
379    ///     hermetic network realm.
380    /// * error `ADDRESS_UNREACHABLE` if all poll attempts expire without successfully receiving
381    ///     a reply from the target address, and no route was found to the target address.
382    /// * error `TIMEOUT_EXCEEDED` if the target address was routable, but all of the retry
383    ///     attempts expire without successfully receiving a reply from the target address.
384    /// * error `INTERNAL` for internal errors, including failure to create a socket or other
385    ///     failures to send/receive datagrams from the target address.
386    pub fn r#poll_udp(
387        &self,
388        mut target: &fidl_fuchsia_net::SocketAddress,
389        mut payload: &[u8],
390        mut timeout: i64,
391        mut num_retries: u16,
392        ___deadline: zx::MonotonicInstant,
393    ) -> Result<ControllerPollUdpResult, fidl::Error> {
394        let _response = self.client.send_query::<
395            ControllerPollUdpRequest,
396            fidl::encoding::ResultType<ControllerPollUdpResponse, Error>,
397            ControllerMarker,
398        >(
399            (target, payload, timeout, num_retries,),
400            0x333fb354db30f664,
401            fidl::encoding::DynamicFlags::empty(),
402            ___deadline,
403        )?;
404        Ok(_response.map(|x| x.payload))
405    }
406
407    /// Joins a multicast group.
408    ///
409    /// Membership will be maintained until `LeaveMulticastGroup` or
410    /// `StopHermeticNetworkRealm` is invoked.
411    ///
412    /// + request `address` the group address to join.
413    /// + request `interface_id` the interface that should be used to join the
414    ///     group. A value of 0 indicates that any interface may be used.
415    /// * error `ADDRESS_IN_USE` if the provided `address` was previously
416    ///     joined.
417    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
418    ///     hermetic network realm.
419    /// * error `INTERNAL` for internal errors.
420    /// * error `INVALID_ARGUMENTS` if the specified `interface_id` does not
421    ///     exist or the `address` does not correspond to a valid multicast
422    ///     address.
423    pub fn r#join_multicast_group(
424        &self,
425        mut address: &fidl_fuchsia_net::IpAddress,
426        mut interface_id: u64,
427        ___deadline: zx::MonotonicInstant,
428    ) -> Result<ControllerJoinMulticastGroupResult, fidl::Error> {
429        let _response = self.client.send_query::<
430            ControllerJoinMulticastGroupRequest,
431            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
432            ControllerMarker,
433        >(
434            (address, interface_id,),
435            0xbdbb4095640a3f4,
436            fidl::encoding::DynamicFlags::empty(),
437            ___deadline,
438        )?;
439        Ok(_response.map(|x| x))
440    }
441
442    /// Leaves a multicast group that was previously joined using the
443    /// `JoinMulticastGroup` method.
444    ///
445    /// + request `address` the group address to leave.
446    /// + request `interface_id` the interface that was previously used to join
447    ///     the multicast group.
448    /// * error `ADDRESS_NOT_AVAILABLE` if the provided `address` was not
449    ///     previously joined.
450    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
451    ///     hermetic network realm.
452    /// * error `INTERNAL` for internal errors, including failure to connect
453    ///     to hermetic network realm services.
454    /// * error `INVALID_ARGUMENTS` if the specified `interface_id` does not
455    ///     exist or the `address` does not correspond to a valid multicast
456    ///     address.
457    pub fn r#leave_multicast_group(
458        &self,
459        mut address: &fidl_fuchsia_net::IpAddress,
460        mut interface_id: u64,
461        ___deadline: zx::MonotonicInstant,
462    ) -> Result<ControllerLeaveMulticastGroupResult, fidl::Error> {
463        let _response = self.client.send_query::<
464            ControllerLeaveMulticastGroupRequest,
465            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
466            ControllerMarker,
467        >(
468            (address, interface_id,),
469            0x32ecf4e40124a29a,
470            fidl::encoding::DynamicFlags::empty(),
471            ___deadline,
472        )?;
473        Ok(_response.map(|x| x))
474    }
475
476    /// Starts a DHCPv6 client with the provided parameters.
477    ///
478    /// + request `params` parameters to start this DHCPv6 client with.
479    ///     Required.
480    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
481    ///     hermetic network realm.
482    /// * error `INTERNAL` for internal errors, including failure to connect
483    ///     to hermetic network realm services.
484    /// * error `INVALID_ARGUMENTS` if any required parameters are omitted.
485    /// * error `ALREADY_EXISTS` if there is a client running on the interface
486    ///     identified by `params.interface_id` already.
487    pub fn r#start_dhcpv6_client(
488        &self,
489        mut params: &fidl_fuchsia_net_dhcpv6::NewClientParams,
490        ___deadline: zx::MonotonicInstant,
491    ) -> Result<ControllerStartDhcpv6ClientResult, fidl::Error> {
492        let _response = self.client.send_query::<
493            ControllerStartDhcpv6ClientRequest,
494            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
495            ControllerMarker,
496        >(
497            (params,),
498            0x756c9b70864b7744,
499            fidl::encoding::DynamicFlags::empty(),
500            ___deadline,
501        )?;
502        Ok(_response.map(|x| x))
503    }
504
505    /// Stops all DHCPv6 clients.
506    ///
507    /// * error `DHCPV6_CLIENT_NOT_RUNNING` if no DHCPv6 client is running.
508    pub fn r#stop_dhcpv6_client(
509        &self,
510        ___deadline: zx::MonotonicInstant,
511    ) -> Result<ControllerStopDhcpv6ClientResult, fidl::Error> {
512        let _response = self.client.send_query::<
513            fidl::encoding::EmptyPayload,
514            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
515            ControllerMarker,
516        >(
517            (),
518            0x16e93478e663d523,
519            fidl::encoding::DynamicFlags::empty(),
520            ___deadline,
521        )?;
522        Ok(_response.map(|x| x))
523    }
524
525    /// Starts a DHCPv4 client on the provided interface.
526    ///
527    /// + request `interface_id` the interface to start a DHCPv4 client on.
528    ///     Required.
529    pub fn r#start_out_of_stack_dhcpv4_client(
530        &self,
531        mut payload: &ControllerStartOutOfStackDhcpv4ClientRequest,
532        ___deadline: zx::MonotonicInstant,
533    ) -> Result<ControllerStartOutOfStackDhcpv4ClientResult, fidl::Error> {
534        let _response = self.client.send_query::<
535            ControllerStartOutOfStackDhcpv4ClientRequest,
536            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
537            ControllerMarker,
538        >(
539            payload,
540            0x37eeec41c0077625,
541            fidl::encoding::DynamicFlags::empty(),
542            ___deadline,
543        )?;
544        Ok(_response.map(|x| x))
545    }
546
547    /// Stops the DHCPv4 client on the provided interface.
548    ///
549    /// + request `interface_id` the interface to stop a DHCPv4 client client on.
550    ///     Required.
551    /// * error `DHCPV4_CLIENT_NOT_RUNNING` if no DHCPv4 client is running.
552    /// * error `DHCPV4_CLIENT_SHUTDOWN_FAILED` if shutting down the DHCPv4 client
553    ///   failed.
554    pub fn r#stop_out_of_stack_dhcpv4_client(
555        &self,
556        mut payload: &ControllerStopOutOfStackDhcpv4ClientRequest,
557        ___deadline: zx::MonotonicInstant,
558    ) -> Result<ControllerStopOutOfStackDhcpv4ClientResult, fidl::Error> {
559        let _response = self.client.send_query::<
560            ControllerStopOutOfStackDhcpv4ClientRequest,
561            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
562            ControllerMarker,
563        >(
564            payload,
565            0x5d47aa5213164364,
566            fidl::encoding::DynamicFlags::empty(),
567            ___deadline,
568        )?;
569        Ok(_response.map(|x| x))
570    }
571}
572
573#[cfg(target_os = "fuchsia")]
574impl From<ControllerSynchronousProxy> for zx::NullableHandle {
575    fn from(value: ControllerSynchronousProxy) -> Self {
576        value.into_channel().into()
577    }
578}
579
580#[cfg(target_os = "fuchsia")]
581impl From<fidl::Channel> for ControllerSynchronousProxy {
582    fn from(value: fidl::Channel) -> Self {
583        Self::new(value)
584    }
585}
586
587#[cfg(target_os = "fuchsia")]
588impl fidl::endpoints::FromClient for ControllerSynchronousProxy {
589    type Protocol = ControllerMarker;
590
591    fn from_client(value: fidl::endpoints::ClientEnd<ControllerMarker>) -> Self {
592        Self::new(value.into_channel())
593    }
594}
595
596#[derive(Debug, Clone)]
597pub struct ControllerProxy {
598    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
599}
600
601impl fidl::endpoints::Proxy for ControllerProxy {
602    type Protocol = ControllerMarker;
603
604    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
605        Self::new(inner)
606    }
607
608    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
609        self.client.into_channel().map_err(|client| Self { client })
610    }
611
612    fn as_channel(&self) -> &::fidl::AsyncChannel {
613        self.client.as_channel()
614    }
615}
616
617impl ControllerProxy {
618    /// Create a new Proxy for fuchsia.net.test.realm/Controller.
619    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
620        let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
621        Self { client: fidl::client::Client::new(channel, protocol_name) }
622    }
623
624    /// Get a Stream of events from the remote end of the protocol.
625    ///
626    /// # Panics
627    ///
628    /// Panics if the event stream was already taken.
629    pub fn take_event_stream(&self) -> ControllerEventStream {
630        ControllerEventStream { event_receiver: self.client.take_event_receiver() }
631    }
632
633    /// Starts a hermetic network realm corresponding to `netstack`.
634    ///
635    /// Any previously running hermetic network realm will be terminated before
636    /// the new realm is started. The configured realm will contain a subset of
637    /// the components in the standard network realm. In particular, it will
638    /// contain:
639    ///
640    ///  * A Netstack instance that corresponds to the provided `netstack`
641    ///  * A DHCP server
642    ///  * A DHCPv6 client
643    ///  * A DNS resolver
644    ///
645    /// + request `netstack` the type of Netstack that will be run.
646    /// * error `INTERNAL` for internal errors, including failure to start the
647    ///     specified `netstack`.
648    pub fn r#start_hermetic_network_realm(
649        &self,
650        mut netstack: Netstack,
651    ) -> fidl::client::QueryResponseFut<
652        ControllerStartHermeticNetworkRealmResult,
653        fidl::encoding::DefaultFuchsiaResourceDialect,
654    > {
655        ControllerProxyInterface::r#start_hermetic_network_realm(self, netstack)
656    }
657
658    /// Stops any running hermetic network realm.
659    ///
660    /// All components in the hermetic network realm will be stopped. Similarly,
661    /// any interfaces that were previously disabled on the system's Netstack
662    /// will be re-enabled on a best-effort basis. That is, a failure to
663    /// re-enable an interface will not result in this method returning an
664    /// error.
665    ///
666    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if a hermetic network realm
667    ///     is not running.
668    /// * error `INTERNAL` for internal errors, including failure to destroy the
669    ///     realm.
670    pub fn r#stop_hermetic_network_realm(
671        &self,
672    ) -> fidl::client::QueryResponseFut<
673        ControllerStopHermeticNetworkRealmResult,
674        fidl::encoding::DefaultFuchsiaResourceDialect,
675    > {
676        ControllerProxyInterface::r#stop_hermetic_network_realm(self)
677    }
678
679    /// Attaches an interface to the hermetic Netstack.
680    ///
681    /// The interface that corresponds to `mac_address` will disabled on the
682    /// system's Netstack, but enabled on the hermetic Netstack.
683    ///
684    /// + request `mac_address` address of the interface to be added to the
685    ///     hermetic Netstack.
686    /// + request `name` the name to assign to the new interface.
687    /// + request `wait_any_ip_address` whether to wait for any IP address to be
688    ///     assigned to the interface before returning. This is helpful for
689    ///     tests that want to ensure the autoconfigured IP address is assigned
690    ///     and has completed duplicate address detection before proceeding.
691    /// * error `ALREADY_EXISTS` if an interface with `name` already exists on
692    ///     the hermetic Netstack.
693    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
694    ///     hermetic network realm.
695    /// * error `INTERFACE_NOT_FOUND` if an interface with `mac_address` could
696    ///     not be found on the system.
697    /// * error `INTERNAL` for internal errors, including failure to read the
698    ///     system's interfaces or configure an interface.
699    pub fn r#add_interface(
700        &self,
701        mut mac_address: &fidl_fuchsia_net::MacAddress,
702        mut name: &str,
703        mut wait_any_ip_address: bool,
704    ) -> fidl::client::QueryResponseFut<
705        ControllerAddInterfaceResult,
706        fidl::encoding::DefaultFuchsiaResourceDialect,
707    > {
708        ControllerProxyInterface::r#add_interface(self, mac_address, name, wait_any_ip_address)
709    }
710
711    /// Starts a test stub.
712    ///
713    /// Any previously running stub will be terminated before the provided
714    /// stub corresponding to `component_url` is started.
715    ///
716    /// + request `component_url` the URL of the component to run.
717    /// * error `COMPONENT_NOT_FOUND` if a component correspodning to
718    ///     `component_url` could not be resolved.
719    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
720    ///     hermetic network realm.
721    /// * error `INTERNAL` for internal errors, including failure to add the
722    ///     desired stub within the hermetic network realm.
723    /// * error `INVALID_ARGUMENTS` if the `component_url` is malformed.
724    pub fn r#start_stub(
725        &self,
726        mut component_url: &str,
727    ) -> fidl::client::QueryResponseFut<
728        ControllerStartStubResult,
729        fidl::encoding::DefaultFuchsiaResourceDialect,
730    > {
731        ControllerProxyInterface::r#start_stub(self, component_url)
732    }
733
734    /// Stops the currently running stub.
735    ///
736    /// Other existing hermetic network realm components will continue to be run
737    /// after this is invoked.
738    ///
739    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
740    ///     hermetic network realm.
741    /// * error `STUB_NOT_RUNNING` if there is no running stub.
742    /// * error `INTERNAL` for internal errors, including failure to destroy the
743    ///     stub component.
744    pub fn r#stop_stub(
745        &self,
746    ) -> fidl::client::QueryResponseFut<
747        ControllerStopStubResult,
748        fidl::encoding::DefaultFuchsiaResourceDialect,
749    > {
750        ControllerProxyInterface::r#stop_stub(self)
751    }
752
753    /// Sends an ICMP echo request to the `target` using a socket provided by
754    /// the hermetic Netstack.
755    ///
756    /// + request `target` the address to ping.
757    /// + request `payload_length` the body size of the ICMP packet.
758    ///     Specifically, the packet body will be filled with zeros of
759    ///     `payload_length`.
760    /// + request `interface_name` an optional interface to bind the socket to.
761    /// + request `timeout` a timeout in nanoseconds to wait for a reply. If
762    ///     less than or equal to 0, then returns success immediately after the
763    ///     ping is sent.
764    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
765    ///     hermetic network realm.
766    /// * error `INTERFACE_NOT_FOUND` if `interface_name` does not exist in the
767    ///     hermetic Netstack.
768    /// * error `INTERNAL` for internal errors, including failure to create a
769    ///     socket or generate the ping request and response.
770    /// * error `INVALID_ARGUMENTS` if `target` corresponds to a link-local
771    ///     address and an `interface_name` is not specified or the
772    ///     `payload_length` exceeds the maximum allowable size.
773    /// * error `PING_FAILED` if there was an error sending or receiving the
774    ///     ping.
775    /// * error `TIMEOUT_EXCEEDED` if the ping reply is not received before the
776    ///     specifed `timeout`.
777    pub fn r#ping(
778        &self,
779        mut target: &fidl_fuchsia_net::IpAddress,
780        mut payload_length: u16,
781        mut interface_name: Option<&str>,
782        mut timeout: i64,
783    ) -> fidl::client::QueryResponseFut<
784        ControllerPingResult,
785        fidl::encoding::DefaultFuchsiaResourceDialect,
786    > {
787        ControllerProxyInterface::r#ping(self, target, payload_length, interface_name, timeout)
788    }
789
790    /// Polls the specified socket address with UDP datagrams containing the specified payload
791    /// using a socket provided by the hermetic Netstack.
792    ///
793    /// Waits for a single reply from the target address and returns it.
794    ///
795    /// + request `target` the socket address to poll.
796    /// + request `payload` the content to place in the UDP datagram.
797    /// + request `timeout` a timeout in nanoseconds to wait for a reply, per retry.
798    /// + request `num_retries` the number of poll attempts to make before giving up and returning
799    ///     an error.
800    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
801    ///     hermetic network realm.
802    /// * error `ADDRESS_UNREACHABLE` if all poll attempts expire without successfully receiving
803    ///     a reply from the target address, and no route was found to the target address.
804    /// * error `TIMEOUT_EXCEEDED` if the target address was routable, but all of the retry
805    ///     attempts expire without successfully receiving a reply from the target address.
806    /// * error `INTERNAL` for internal errors, including failure to create a socket or other
807    ///     failures to send/receive datagrams from the target address.
808    pub fn r#poll_udp(
809        &self,
810        mut target: &fidl_fuchsia_net::SocketAddress,
811        mut payload: &[u8],
812        mut timeout: i64,
813        mut num_retries: u16,
814    ) -> fidl::client::QueryResponseFut<
815        ControllerPollUdpResult,
816        fidl::encoding::DefaultFuchsiaResourceDialect,
817    > {
818        ControllerProxyInterface::r#poll_udp(self, target, payload, timeout, num_retries)
819    }
820
821    /// Joins a multicast group.
822    ///
823    /// Membership will be maintained until `LeaveMulticastGroup` or
824    /// `StopHermeticNetworkRealm` is invoked.
825    ///
826    /// + request `address` the group address to join.
827    /// + request `interface_id` the interface that should be used to join the
828    ///     group. A value of 0 indicates that any interface may be used.
829    /// * error `ADDRESS_IN_USE` if the provided `address` was previously
830    ///     joined.
831    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
832    ///     hermetic network realm.
833    /// * error `INTERNAL` for internal errors.
834    /// * error `INVALID_ARGUMENTS` if the specified `interface_id` does not
835    ///     exist or the `address` does not correspond to a valid multicast
836    ///     address.
837    pub fn r#join_multicast_group(
838        &self,
839        mut address: &fidl_fuchsia_net::IpAddress,
840        mut interface_id: u64,
841    ) -> fidl::client::QueryResponseFut<
842        ControllerJoinMulticastGroupResult,
843        fidl::encoding::DefaultFuchsiaResourceDialect,
844    > {
845        ControllerProxyInterface::r#join_multicast_group(self, address, interface_id)
846    }
847
848    /// Leaves a multicast group that was previously joined using the
849    /// `JoinMulticastGroup` method.
850    ///
851    /// + request `address` the group address to leave.
852    /// + request `interface_id` the interface that was previously used to join
853    ///     the multicast group.
854    /// * error `ADDRESS_NOT_AVAILABLE` if the provided `address` was not
855    ///     previously joined.
856    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
857    ///     hermetic network realm.
858    /// * error `INTERNAL` for internal errors, including failure to connect
859    ///     to hermetic network realm services.
860    /// * error `INVALID_ARGUMENTS` if the specified `interface_id` does not
861    ///     exist or the `address` does not correspond to a valid multicast
862    ///     address.
863    pub fn r#leave_multicast_group(
864        &self,
865        mut address: &fidl_fuchsia_net::IpAddress,
866        mut interface_id: u64,
867    ) -> fidl::client::QueryResponseFut<
868        ControllerLeaveMulticastGroupResult,
869        fidl::encoding::DefaultFuchsiaResourceDialect,
870    > {
871        ControllerProxyInterface::r#leave_multicast_group(self, address, interface_id)
872    }
873
874    /// Starts a DHCPv6 client with the provided parameters.
875    ///
876    /// + request `params` parameters to start this DHCPv6 client with.
877    ///     Required.
878    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
879    ///     hermetic network realm.
880    /// * error `INTERNAL` for internal errors, including failure to connect
881    ///     to hermetic network realm services.
882    /// * error `INVALID_ARGUMENTS` if any required parameters are omitted.
883    /// * error `ALREADY_EXISTS` if there is a client running on the interface
884    ///     identified by `params.interface_id` already.
885    pub fn r#start_dhcpv6_client(
886        &self,
887        mut params: &fidl_fuchsia_net_dhcpv6::NewClientParams,
888    ) -> fidl::client::QueryResponseFut<
889        ControllerStartDhcpv6ClientResult,
890        fidl::encoding::DefaultFuchsiaResourceDialect,
891    > {
892        ControllerProxyInterface::r#start_dhcpv6_client(self, params)
893    }
894
895    /// Stops all DHCPv6 clients.
896    ///
897    /// * error `DHCPV6_CLIENT_NOT_RUNNING` if no DHCPv6 client is running.
898    pub fn r#stop_dhcpv6_client(
899        &self,
900    ) -> fidl::client::QueryResponseFut<
901        ControllerStopDhcpv6ClientResult,
902        fidl::encoding::DefaultFuchsiaResourceDialect,
903    > {
904        ControllerProxyInterface::r#stop_dhcpv6_client(self)
905    }
906
907    /// Starts a DHCPv4 client on the provided interface.
908    ///
909    /// + request `interface_id` the interface to start a DHCPv4 client on.
910    ///     Required.
911    pub fn r#start_out_of_stack_dhcpv4_client(
912        &self,
913        mut payload: &ControllerStartOutOfStackDhcpv4ClientRequest,
914    ) -> fidl::client::QueryResponseFut<
915        ControllerStartOutOfStackDhcpv4ClientResult,
916        fidl::encoding::DefaultFuchsiaResourceDialect,
917    > {
918        ControllerProxyInterface::r#start_out_of_stack_dhcpv4_client(self, payload)
919    }
920
921    /// Stops the DHCPv4 client on the provided interface.
922    ///
923    /// + request `interface_id` the interface to stop a DHCPv4 client client on.
924    ///     Required.
925    /// * error `DHCPV4_CLIENT_NOT_RUNNING` if no DHCPv4 client is running.
926    /// * error `DHCPV4_CLIENT_SHUTDOWN_FAILED` if shutting down the DHCPv4 client
927    ///   failed.
928    pub fn r#stop_out_of_stack_dhcpv4_client(
929        &self,
930        mut payload: &ControllerStopOutOfStackDhcpv4ClientRequest,
931    ) -> fidl::client::QueryResponseFut<
932        ControllerStopOutOfStackDhcpv4ClientResult,
933        fidl::encoding::DefaultFuchsiaResourceDialect,
934    > {
935        ControllerProxyInterface::r#stop_out_of_stack_dhcpv4_client(self, payload)
936    }
937}
938
939impl ControllerProxyInterface for ControllerProxy {
940    type StartHermeticNetworkRealmResponseFut = fidl::client::QueryResponseFut<
941        ControllerStartHermeticNetworkRealmResult,
942        fidl::encoding::DefaultFuchsiaResourceDialect,
943    >;
944    fn r#start_hermetic_network_realm(
945        &self,
946        mut netstack: Netstack,
947    ) -> Self::StartHermeticNetworkRealmResponseFut {
948        fn _decode(
949            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
950        ) -> Result<ControllerStartHermeticNetworkRealmResult, fidl::Error> {
951            let _response = fidl::client::decode_transaction_body::<
952                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
953                fidl::encoding::DefaultFuchsiaResourceDialect,
954                0x58c1fa7335d4c5c2,
955            >(_buf?)?;
956            Ok(_response.map(|x| x))
957        }
958        self.client.send_query_and_decode::<
959            ControllerStartHermeticNetworkRealmRequest,
960            ControllerStartHermeticNetworkRealmResult,
961        >(
962            (netstack,),
963            0x58c1fa7335d4c5c2,
964            fidl::encoding::DynamicFlags::empty(),
965            _decode,
966        )
967    }
968
969    type StopHermeticNetworkRealmResponseFut = fidl::client::QueryResponseFut<
970        ControllerStopHermeticNetworkRealmResult,
971        fidl::encoding::DefaultFuchsiaResourceDialect,
972    >;
973    fn r#stop_hermetic_network_realm(&self) -> Self::StopHermeticNetworkRealmResponseFut {
974        fn _decode(
975            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
976        ) -> Result<ControllerStopHermeticNetworkRealmResult, fidl::Error> {
977            let _response = fidl::client::decode_transaction_body::<
978                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
979                fidl::encoding::DefaultFuchsiaResourceDialect,
980                0x49d3c2501cd2f635,
981            >(_buf?)?;
982            Ok(_response.map(|x| x))
983        }
984        self.client.send_query_and_decode::<
985            fidl::encoding::EmptyPayload,
986            ControllerStopHermeticNetworkRealmResult,
987        >(
988            (),
989            0x49d3c2501cd2f635,
990            fidl::encoding::DynamicFlags::empty(),
991            _decode,
992        )
993    }
994
995    type AddInterfaceResponseFut = fidl::client::QueryResponseFut<
996        ControllerAddInterfaceResult,
997        fidl::encoding::DefaultFuchsiaResourceDialect,
998    >;
999    fn r#add_interface(
1000        &self,
1001        mut mac_address: &fidl_fuchsia_net::MacAddress,
1002        mut name: &str,
1003        mut wait_any_ip_address: bool,
1004    ) -> Self::AddInterfaceResponseFut {
1005        fn _decode(
1006            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1007        ) -> Result<ControllerAddInterfaceResult, fidl::Error> {
1008            let _response = fidl::client::decode_transaction_body::<
1009                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1010                fidl::encoding::DefaultFuchsiaResourceDialect,
1011                0x668ded2d2b619c15,
1012            >(_buf?)?;
1013            Ok(_response.map(|x| x))
1014        }
1015        self.client
1016            .send_query_and_decode::<ControllerAddInterfaceRequest, ControllerAddInterfaceResult>(
1017                (mac_address, name, wait_any_ip_address),
1018                0x668ded2d2b619c15,
1019                fidl::encoding::DynamicFlags::empty(),
1020                _decode,
1021            )
1022    }
1023
1024    type StartStubResponseFut = fidl::client::QueryResponseFut<
1025        ControllerStartStubResult,
1026        fidl::encoding::DefaultFuchsiaResourceDialect,
1027    >;
1028    fn r#start_stub(&self, mut component_url: &str) -> Self::StartStubResponseFut {
1029        fn _decode(
1030            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1031        ) -> Result<ControllerStartStubResult, fidl::Error> {
1032            let _response = fidl::client::decode_transaction_body::<
1033                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1034                fidl::encoding::DefaultFuchsiaResourceDialect,
1035                0x6523a401f22bf664,
1036            >(_buf?)?;
1037            Ok(_response.map(|x| x))
1038        }
1039        self.client.send_query_and_decode::<ControllerStartStubRequest, ControllerStartStubResult>(
1040            (component_url,),
1041            0x6523a401f22bf664,
1042            fidl::encoding::DynamicFlags::empty(),
1043            _decode,
1044        )
1045    }
1046
1047    type StopStubResponseFut = fidl::client::QueryResponseFut<
1048        ControllerStopStubResult,
1049        fidl::encoding::DefaultFuchsiaResourceDialect,
1050    >;
1051    fn r#stop_stub(&self) -> Self::StopStubResponseFut {
1052        fn _decode(
1053            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1054        ) -> Result<ControllerStopStubResult, fidl::Error> {
1055            let _response = fidl::client::decode_transaction_body::<
1056                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1057                fidl::encoding::DefaultFuchsiaResourceDialect,
1058                0x582c32b564ff4bb4,
1059            >(_buf?)?;
1060            Ok(_response.map(|x| x))
1061        }
1062        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerStopStubResult>(
1063            (),
1064            0x582c32b564ff4bb4,
1065            fidl::encoding::DynamicFlags::empty(),
1066            _decode,
1067        )
1068    }
1069
1070    type PingResponseFut = fidl::client::QueryResponseFut<
1071        ControllerPingResult,
1072        fidl::encoding::DefaultFuchsiaResourceDialect,
1073    >;
1074    fn r#ping(
1075        &self,
1076        mut target: &fidl_fuchsia_net::IpAddress,
1077        mut payload_length: u16,
1078        mut interface_name: Option<&str>,
1079        mut timeout: i64,
1080    ) -> Self::PingResponseFut {
1081        fn _decode(
1082            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1083        ) -> Result<ControllerPingResult, fidl::Error> {
1084            let _response = fidl::client::decode_transaction_body::<
1085                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1086                fidl::encoding::DefaultFuchsiaResourceDialect,
1087                0x60c9b6cf952fa4d1,
1088            >(_buf?)?;
1089            Ok(_response.map(|x| x))
1090        }
1091        self.client.send_query_and_decode::<ControllerPingRequest, ControllerPingResult>(
1092            (target, payload_length, interface_name, timeout),
1093            0x60c9b6cf952fa4d1,
1094            fidl::encoding::DynamicFlags::empty(),
1095            _decode,
1096        )
1097    }
1098
1099    type PollUdpResponseFut = fidl::client::QueryResponseFut<
1100        ControllerPollUdpResult,
1101        fidl::encoding::DefaultFuchsiaResourceDialect,
1102    >;
1103    fn r#poll_udp(
1104        &self,
1105        mut target: &fidl_fuchsia_net::SocketAddress,
1106        mut payload: &[u8],
1107        mut timeout: i64,
1108        mut num_retries: u16,
1109    ) -> Self::PollUdpResponseFut {
1110        fn _decode(
1111            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1112        ) -> Result<ControllerPollUdpResult, fidl::Error> {
1113            let _response = fidl::client::decode_transaction_body::<
1114                fidl::encoding::ResultType<ControllerPollUdpResponse, Error>,
1115                fidl::encoding::DefaultFuchsiaResourceDialect,
1116                0x333fb354db30f664,
1117            >(_buf?)?;
1118            Ok(_response.map(|x| x.payload))
1119        }
1120        self.client.send_query_and_decode::<ControllerPollUdpRequest, ControllerPollUdpResult>(
1121            (target, payload, timeout, num_retries),
1122            0x333fb354db30f664,
1123            fidl::encoding::DynamicFlags::empty(),
1124            _decode,
1125        )
1126    }
1127
1128    type JoinMulticastGroupResponseFut = fidl::client::QueryResponseFut<
1129        ControllerJoinMulticastGroupResult,
1130        fidl::encoding::DefaultFuchsiaResourceDialect,
1131    >;
1132    fn r#join_multicast_group(
1133        &self,
1134        mut address: &fidl_fuchsia_net::IpAddress,
1135        mut interface_id: u64,
1136    ) -> Self::JoinMulticastGroupResponseFut {
1137        fn _decode(
1138            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1139        ) -> Result<ControllerJoinMulticastGroupResult, fidl::Error> {
1140            let _response = fidl::client::decode_transaction_body::<
1141                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1142                fidl::encoding::DefaultFuchsiaResourceDialect,
1143                0xbdbb4095640a3f4,
1144            >(_buf?)?;
1145            Ok(_response.map(|x| x))
1146        }
1147        self.client.send_query_and_decode::<
1148            ControllerJoinMulticastGroupRequest,
1149            ControllerJoinMulticastGroupResult,
1150        >(
1151            (address, interface_id,),
1152            0xbdbb4095640a3f4,
1153            fidl::encoding::DynamicFlags::empty(),
1154            _decode,
1155        )
1156    }
1157
1158    type LeaveMulticastGroupResponseFut = fidl::client::QueryResponseFut<
1159        ControllerLeaveMulticastGroupResult,
1160        fidl::encoding::DefaultFuchsiaResourceDialect,
1161    >;
1162    fn r#leave_multicast_group(
1163        &self,
1164        mut address: &fidl_fuchsia_net::IpAddress,
1165        mut interface_id: u64,
1166    ) -> Self::LeaveMulticastGroupResponseFut {
1167        fn _decode(
1168            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1169        ) -> Result<ControllerLeaveMulticastGroupResult, fidl::Error> {
1170            let _response = fidl::client::decode_transaction_body::<
1171                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1172                fidl::encoding::DefaultFuchsiaResourceDialect,
1173                0x32ecf4e40124a29a,
1174            >(_buf?)?;
1175            Ok(_response.map(|x| x))
1176        }
1177        self.client.send_query_and_decode::<
1178            ControllerLeaveMulticastGroupRequest,
1179            ControllerLeaveMulticastGroupResult,
1180        >(
1181            (address, interface_id,),
1182            0x32ecf4e40124a29a,
1183            fidl::encoding::DynamicFlags::empty(),
1184            _decode,
1185        )
1186    }
1187
1188    type StartDhcpv6ClientResponseFut = fidl::client::QueryResponseFut<
1189        ControllerStartDhcpv6ClientResult,
1190        fidl::encoding::DefaultFuchsiaResourceDialect,
1191    >;
1192    fn r#start_dhcpv6_client(
1193        &self,
1194        mut params: &fidl_fuchsia_net_dhcpv6::NewClientParams,
1195    ) -> Self::StartDhcpv6ClientResponseFut {
1196        fn _decode(
1197            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1198        ) -> Result<ControllerStartDhcpv6ClientResult, fidl::Error> {
1199            let _response = fidl::client::decode_transaction_body::<
1200                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1201                fidl::encoding::DefaultFuchsiaResourceDialect,
1202                0x756c9b70864b7744,
1203            >(_buf?)?;
1204            Ok(_response.map(|x| x))
1205        }
1206        self.client.send_query_and_decode::<
1207            ControllerStartDhcpv6ClientRequest,
1208            ControllerStartDhcpv6ClientResult,
1209        >(
1210            (params,),
1211            0x756c9b70864b7744,
1212            fidl::encoding::DynamicFlags::empty(),
1213            _decode,
1214        )
1215    }
1216
1217    type StopDhcpv6ClientResponseFut = fidl::client::QueryResponseFut<
1218        ControllerStopDhcpv6ClientResult,
1219        fidl::encoding::DefaultFuchsiaResourceDialect,
1220    >;
1221    fn r#stop_dhcpv6_client(&self) -> Self::StopDhcpv6ClientResponseFut {
1222        fn _decode(
1223            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1224        ) -> Result<ControllerStopDhcpv6ClientResult, fidl::Error> {
1225            let _response = fidl::client::decode_transaction_body::<
1226                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1227                fidl::encoding::DefaultFuchsiaResourceDialect,
1228                0x16e93478e663d523,
1229            >(_buf?)?;
1230            Ok(_response.map(|x| x))
1231        }
1232        self.client.send_query_and_decode::<
1233            fidl::encoding::EmptyPayload,
1234            ControllerStopDhcpv6ClientResult,
1235        >(
1236            (),
1237            0x16e93478e663d523,
1238            fidl::encoding::DynamicFlags::empty(),
1239            _decode,
1240        )
1241    }
1242
1243    type StartOutOfStackDhcpv4ClientResponseFut = fidl::client::QueryResponseFut<
1244        ControllerStartOutOfStackDhcpv4ClientResult,
1245        fidl::encoding::DefaultFuchsiaResourceDialect,
1246    >;
1247    fn r#start_out_of_stack_dhcpv4_client(
1248        &self,
1249        mut payload: &ControllerStartOutOfStackDhcpv4ClientRequest,
1250    ) -> Self::StartOutOfStackDhcpv4ClientResponseFut {
1251        fn _decode(
1252            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1253        ) -> Result<ControllerStartOutOfStackDhcpv4ClientResult, fidl::Error> {
1254            let _response = fidl::client::decode_transaction_body::<
1255                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1256                fidl::encoding::DefaultFuchsiaResourceDialect,
1257                0x37eeec41c0077625,
1258            >(_buf?)?;
1259            Ok(_response.map(|x| x))
1260        }
1261        self.client.send_query_and_decode::<
1262            ControllerStartOutOfStackDhcpv4ClientRequest,
1263            ControllerStartOutOfStackDhcpv4ClientResult,
1264        >(
1265            payload,
1266            0x37eeec41c0077625,
1267            fidl::encoding::DynamicFlags::empty(),
1268            _decode,
1269        )
1270    }
1271
1272    type StopOutOfStackDhcpv4ClientResponseFut = fidl::client::QueryResponseFut<
1273        ControllerStopOutOfStackDhcpv4ClientResult,
1274        fidl::encoding::DefaultFuchsiaResourceDialect,
1275    >;
1276    fn r#stop_out_of_stack_dhcpv4_client(
1277        &self,
1278        mut payload: &ControllerStopOutOfStackDhcpv4ClientRequest,
1279    ) -> Self::StopOutOfStackDhcpv4ClientResponseFut {
1280        fn _decode(
1281            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1282        ) -> Result<ControllerStopOutOfStackDhcpv4ClientResult, fidl::Error> {
1283            let _response = fidl::client::decode_transaction_body::<
1284                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1285                fidl::encoding::DefaultFuchsiaResourceDialect,
1286                0x5d47aa5213164364,
1287            >(_buf?)?;
1288            Ok(_response.map(|x| x))
1289        }
1290        self.client.send_query_and_decode::<
1291            ControllerStopOutOfStackDhcpv4ClientRequest,
1292            ControllerStopOutOfStackDhcpv4ClientResult,
1293        >(
1294            payload,
1295            0x5d47aa5213164364,
1296            fidl::encoding::DynamicFlags::empty(),
1297            _decode,
1298        )
1299    }
1300}
1301
1302pub struct ControllerEventStream {
1303    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1304}
1305
1306impl std::marker::Unpin for ControllerEventStream {}
1307
1308impl futures::stream::FusedStream for ControllerEventStream {
1309    fn is_terminated(&self) -> bool {
1310        self.event_receiver.is_terminated()
1311    }
1312}
1313
1314impl futures::Stream for ControllerEventStream {
1315    type Item = Result<ControllerEvent, fidl::Error>;
1316
1317    fn poll_next(
1318        mut self: std::pin::Pin<&mut Self>,
1319        cx: &mut std::task::Context<'_>,
1320    ) -> std::task::Poll<Option<Self::Item>> {
1321        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1322            &mut self.event_receiver,
1323            cx
1324        )?) {
1325            Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
1326            None => std::task::Poll::Ready(None),
1327        }
1328    }
1329}
1330
1331#[derive(Debug)]
1332pub enum ControllerEvent {}
1333
1334impl ControllerEvent {
1335    /// Decodes a message buffer as a [`ControllerEvent`].
1336    fn decode(
1337        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1338    ) -> Result<ControllerEvent, fidl::Error> {
1339        let (bytes, _handles) = buf.split_mut();
1340        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1341        debug_assert_eq!(tx_header.tx_id, 0);
1342        match tx_header.ordinal {
1343            _ => Err(fidl::Error::UnknownOrdinal {
1344                ordinal: tx_header.ordinal,
1345                protocol_name: <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1346            }),
1347        }
1348    }
1349}
1350
1351/// A Stream of incoming requests for fuchsia.net.test.realm/Controller.
1352pub struct ControllerRequestStream {
1353    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1354    is_terminated: bool,
1355}
1356
1357impl std::marker::Unpin for ControllerRequestStream {}
1358
1359impl futures::stream::FusedStream for ControllerRequestStream {
1360    fn is_terminated(&self) -> bool {
1361        self.is_terminated
1362    }
1363}
1364
1365impl fidl::endpoints::RequestStream for ControllerRequestStream {
1366    type Protocol = ControllerMarker;
1367    type ControlHandle = ControllerControlHandle;
1368
1369    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1370        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1371    }
1372
1373    fn control_handle(&self) -> Self::ControlHandle {
1374        ControllerControlHandle { inner: self.inner.clone() }
1375    }
1376
1377    fn into_inner(
1378        self,
1379    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1380    {
1381        (self.inner, self.is_terminated)
1382    }
1383
1384    fn from_inner(
1385        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1386        is_terminated: bool,
1387    ) -> Self {
1388        Self { inner, is_terminated }
1389    }
1390}
1391
1392impl futures::Stream for ControllerRequestStream {
1393    type Item = Result<ControllerRequest, fidl::Error>;
1394
1395    fn poll_next(
1396        mut self: std::pin::Pin<&mut Self>,
1397        cx: &mut std::task::Context<'_>,
1398    ) -> std::task::Poll<Option<Self::Item>> {
1399        let this = &mut *self;
1400        if this.inner.check_shutdown(cx) {
1401            this.is_terminated = true;
1402            return std::task::Poll::Ready(None);
1403        }
1404        if this.is_terminated {
1405            panic!("polled ControllerRequestStream after completion");
1406        }
1407        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1408            |bytes, handles| {
1409                match this.inner.channel().read_etc(cx, bytes, handles) {
1410                    std::task::Poll::Ready(Ok(())) => {}
1411                    std::task::Poll::Pending => return std::task::Poll::Pending,
1412                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1413                        this.is_terminated = true;
1414                        return std::task::Poll::Ready(None);
1415                    }
1416                    std::task::Poll::Ready(Err(e)) => {
1417                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1418                            e.into(),
1419                        ))));
1420                    }
1421                }
1422
1423                // A message has been received from the channel
1424                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1425
1426                std::task::Poll::Ready(Some(match header.ordinal {
1427                    0x58c1fa7335d4c5c2 => {
1428                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1429                        let mut req = fidl::new_empty!(
1430                            ControllerStartHermeticNetworkRealmRequest,
1431                            fidl::encoding::DefaultFuchsiaResourceDialect
1432                        );
1433                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStartHermeticNetworkRealmRequest>(&header, _body_bytes, handles, &mut req)?;
1434                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1435                        Ok(ControllerRequest::StartHermeticNetworkRealm {
1436                            netstack: req.netstack,
1437
1438                            responder: ControllerStartHermeticNetworkRealmResponder {
1439                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1440                                tx_id: header.tx_id,
1441                            },
1442                        })
1443                    }
1444                    0x49d3c2501cd2f635 => {
1445                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1446                        let mut req = fidl::new_empty!(
1447                            fidl::encoding::EmptyPayload,
1448                            fidl::encoding::DefaultFuchsiaResourceDialect
1449                        );
1450                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1451                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1452                        Ok(ControllerRequest::StopHermeticNetworkRealm {
1453                            responder: ControllerStopHermeticNetworkRealmResponder {
1454                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1455                                tx_id: header.tx_id,
1456                            },
1457                        })
1458                    }
1459                    0x668ded2d2b619c15 => {
1460                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1461                        let mut req = fidl::new_empty!(
1462                            ControllerAddInterfaceRequest,
1463                            fidl::encoding::DefaultFuchsiaResourceDialect
1464                        );
1465                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerAddInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1466                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1467                        Ok(ControllerRequest::AddInterface {
1468                            mac_address: req.mac_address,
1469                            name: req.name,
1470                            wait_any_ip_address: req.wait_any_ip_address,
1471
1472                            responder: ControllerAddInterfaceResponder {
1473                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1474                                tx_id: header.tx_id,
1475                            },
1476                        })
1477                    }
1478                    0x6523a401f22bf664 => {
1479                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1480                        let mut req = fidl::new_empty!(
1481                            ControllerStartStubRequest,
1482                            fidl::encoding::DefaultFuchsiaResourceDialect
1483                        );
1484                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStartStubRequest>(&header, _body_bytes, handles, &mut req)?;
1485                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1486                        Ok(ControllerRequest::StartStub {
1487                            component_url: req.component_url,
1488
1489                            responder: ControllerStartStubResponder {
1490                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1491                                tx_id: header.tx_id,
1492                            },
1493                        })
1494                    }
1495                    0x582c32b564ff4bb4 => {
1496                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1497                        let mut req = fidl::new_empty!(
1498                            fidl::encoding::EmptyPayload,
1499                            fidl::encoding::DefaultFuchsiaResourceDialect
1500                        );
1501                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1502                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1503                        Ok(ControllerRequest::StopStub {
1504                            responder: ControllerStopStubResponder {
1505                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1506                                tx_id: header.tx_id,
1507                            },
1508                        })
1509                    }
1510                    0x60c9b6cf952fa4d1 => {
1511                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1512                        let mut req = fidl::new_empty!(
1513                            ControllerPingRequest,
1514                            fidl::encoding::DefaultFuchsiaResourceDialect
1515                        );
1516                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerPingRequest>(&header, _body_bytes, handles, &mut req)?;
1517                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1518                        Ok(ControllerRequest::Ping {
1519                            target: req.target,
1520                            payload_length: req.payload_length,
1521                            interface_name: req.interface_name,
1522                            timeout: req.timeout,
1523
1524                            responder: ControllerPingResponder {
1525                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1526                                tx_id: header.tx_id,
1527                            },
1528                        })
1529                    }
1530                    0x333fb354db30f664 => {
1531                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1532                        let mut req = fidl::new_empty!(
1533                            ControllerPollUdpRequest,
1534                            fidl::encoding::DefaultFuchsiaResourceDialect
1535                        );
1536                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerPollUdpRequest>(&header, _body_bytes, handles, &mut req)?;
1537                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1538                        Ok(ControllerRequest::PollUdp {
1539                            target: req.target,
1540                            payload: req.payload,
1541                            timeout: req.timeout,
1542                            num_retries: req.num_retries,
1543
1544                            responder: ControllerPollUdpResponder {
1545                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1546                                tx_id: header.tx_id,
1547                            },
1548                        })
1549                    }
1550                    0xbdbb4095640a3f4 => {
1551                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1552                        let mut req = fidl::new_empty!(
1553                            ControllerJoinMulticastGroupRequest,
1554                            fidl::encoding::DefaultFuchsiaResourceDialect
1555                        );
1556                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerJoinMulticastGroupRequest>(&header, _body_bytes, handles, &mut req)?;
1557                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1558                        Ok(ControllerRequest::JoinMulticastGroup {
1559                            address: req.address,
1560                            interface_id: req.interface_id,
1561
1562                            responder: ControllerJoinMulticastGroupResponder {
1563                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1564                                tx_id: header.tx_id,
1565                            },
1566                        })
1567                    }
1568                    0x32ecf4e40124a29a => {
1569                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1570                        let mut req = fidl::new_empty!(
1571                            ControllerLeaveMulticastGroupRequest,
1572                            fidl::encoding::DefaultFuchsiaResourceDialect
1573                        );
1574                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerLeaveMulticastGroupRequest>(&header, _body_bytes, handles, &mut req)?;
1575                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1576                        Ok(ControllerRequest::LeaveMulticastGroup {
1577                            address: req.address,
1578                            interface_id: req.interface_id,
1579
1580                            responder: ControllerLeaveMulticastGroupResponder {
1581                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1582                                tx_id: header.tx_id,
1583                            },
1584                        })
1585                    }
1586                    0x756c9b70864b7744 => {
1587                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1588                        let mut req = fidl::new_empty!(
1589                            ControllerStartDhcpv6ClientRequest,
1590                            fidl::encoding::DefaultFuchsiaResourceDialect
1591                        );
1592                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStartDhcpv6ClientRequest>(&header, _body_bytes, handles, &mut req)?;
1593                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1594                        Ok(ControllerRequest::StartDhcpv6Client {
1595                            params: req.params,
1596
1597                            responder: ControllerStartDhcpv6ClientResponder {
1598                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1599                                tx_id: header.tx_id,
1600                            },
1601                        })
1602                    }
1603                    0x16e93478e663d523 => {
1604                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1605                        let mut req = fidl::new_empty!(
1606                            fidl::encoding::EmptyPayload,
1607                            fidl::encoding::DefaultFuchsiaResourceDialect
1608                        );
1609                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1610                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1611                        Ok(ControllerRequest::StopDhcpv6Client {
1612                            responder: ControllerStopDhcpv6ClientResponder {
1613                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1614                                tx_id: header.tx_id,
1615                            },
1616                        })
1617                    }
1618                    0x37eeec41c0077625 => {
1619                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1620                        let mut req = fidl::new_empty!(
1621                            ControllerStartOutOfStackDhcpv4ClientRequest,
1622                            fidl::encoding::DefaultFuchsiaResourceDialect
1623                        );
1624                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStartOutOfStackDhcpv4ClientRequest>(&header, _body_bytes, handles, &mut req)?;
1625                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1626                        Ok(ControllerRequest::StartOutOfStackDhcpv4Client {
1627                            payload: req,
1628                            responder: ControllerStartOutOfStackDhcpv4ClientResponder {
1629                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1630                                tx_id: header.tx_id,
1631                            },
1632                        })
1633                    }
1634                    0x5d47aa5213164364 => {
1635                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1636                        let mut req = fidl::new_empty!(
1637                            ControllerStopOutOfStackDhcpv4ClientRequest,
1638                            fidl::encoding::DefaultFuchsiaResourceDialect
1639                        );
1640                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStopOutOfStackDhcpv4ClientRequest>(&header, _body_bytes, handles, &mut req)?;
1641                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1642                        Ok(ControllerRequest::StopOutOfStackDhcpv4Client {
1643                            payload: req,
1644                            responder: ControllerStopOutOfStackDhcpv4ClientResponder {
1645                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1646                                tx_id: header.tx_id,
1647                            },
1648                        })
1649                    }
1650                    _ => Err(fidl::Error::UnknownOrdinal {
1651                        ordinal: header.ordinal,
1652                        protocol_name:
1653                            <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1654                    }),
1655                }))
1656            },
1657        )
1658    }
1659}
1660
1661/// A controller for creating and manipulating the Network Test Realm.
1662///
1663/// The Network Test Realm corresponds to a hermetic network realm with a
1664/// Netstack under test. The `Controller` protocol is responsible for:
1665///
1666///  * Configuring the Network Test Realm and its child components. This
1667///    includes the Netstack under test and the other relevant network
1668///    components (e.g. a DHCP server).
1669///  * Coordinating interactions with the system's Netstack. This includes
1670///    temporarily taking over and mutating system interfaces.
1671#[derive(Debug)]
1672pub enum ControllerRequest {
1673    /// Starts a hermetic network realm corresponding to `netstack`.
1674    ///
1675    /// Any previously running hermetic network realm will be terminated before
1676    /// the new realm is started. The configured realm will contain a subset of
1677    /// the components in the standard network realm. In particular, it will
1678    /// contain:
1679    ///
1680    ///  * A Netstack instance that corresponds to the provided `netstack`
1681    ///  * A DHCP server
1682    ///  * A DHCPv6 client
1683    ///  * A DNS resolver
1684    ///
1685    /// + request `netstack` the type of Netstack that will be run.
1686    /// * error `INTERNAL` for internal errors, including failure to start the
1687    ///     specified `netstack`.
1688    StartHermeticNetworkRealm {
1689        netstack: Netstack,
1690        responder: ControllerStartHermeticNetworkRealmResponder,
1691    },
1692    /// Stops any running hermetic network realm.
1693    ///
1694    /// All components in the hermetic network realm will be stopped. Similarly,
1695    /// any interfaces that were previously disabled on the system's Netstack
1696    /// will be re-enabled on a best-effort basis. That is, a failure to
1697    /// re-enable an interface will not result in this method returning an
1698    /// error.
1699    ///
1700    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if a hermetic network realm
1701    ///     is not running.
1702    /// * error `INTERNAL` for internal errors, including failure to destroy the
1703    ///     realm.
1704    StopHermeticNetworkRealm { responder: ControllerStopHermeticNetworkRealmResponder },
1705    /// Attaches an interface to the hermetic Netstack.
1706    ///
1707    /// The interface that corresponds to `mac_address` will disabled on the
1708    /// system's Netstack, but enabled on the hermetic Netstack.
1709    ///
1710    /// + request `mac_address` address of the interface to be added to the
1711    ///     hermetic Netstack.
1712    /// + request `name` the name to assign to the new interface.
1713    /// + request `wait_any_ip_address` whether to wait for any IP address to be
1714    ///     assigned to the interface before returning. This is helpful for
1715    ///     tests that want to ensure the autoconfigured IP address is assigned
1716    ///     and has completed duplicate address detection before proceeding.
1717    /// * error `ALREADY_EXISTS` if an interface with `name` already exists on
1718    ///     the hermetic Netstack.
1719    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
1720    ///     hermetic network realm.
1721    /// * error `INTERFACE_NOT_FOUND` if an interface with `mac_address` could
1722    ///     not be found on the system.
1723    /// * error `INTERNAL` for internal errors, including failure to read the
1724    ///     system's interfaces or configure an interface.
1725    AddInterface {
1726        mac_address: fidl_fuchsia_net::MacAddress,
1727        name: String,
1728        wait_any_ip_address: bool,
1729        responder: ControllerAddInterfaceResponder,
1730    },
1731    /// Starts a test stub.
1732    ///
1733    /// Any previously running stub will be terminated before the provided
1734    /// stub corresponding to `component_url` is started.
1735    ///
1736    /// + request `component_url` the URL of the component to run.
1737    /// * error `COMPONENT_NOT_FOUND` if a component correspodning to
1738    ///     `component_url` could not be resolved.
1739    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
1740    ///     hermetic network realm.
1741    /// * error `INTERNAL` for internal errors, including failure to add the
1742    ///     desired stub within the hermetic network realm.
1743    /// * error `INVALID_ARGUMENTS` if the `component_url` is malformed.
1744    StartStub { component_url: String, responder: ControllerStartStubResponder },
1745    /// Stops the currently running stub.
1746    ///
1747    /// Other existing hermetic network realm components will continue to be run
1748    /// after this is invoked.
1749    ///
1750    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
1751    ///     hermetic network realm.
1752    /// * error `STUB_NOT_RUNNING` if there is no running stub.
1753    /// * error `INTERNAL` for internal errors, including failure to destroy the
1754    ///     stub component.
1755    StopStub { responder: ControllerStopStubResponder },
1756    /// Sends an ICMP echo request to the `target` using a socket provided by
1757    /// the hermetic Netstack.
1758    ///
1759    /// + request `target` the address to ping.
1760    /// + request `payload_length` the body size of the ICMP packet.
1761    ///     Specifically, the packet body will be filled with zeros of
1762    ///     `payload_length`.
1763    /// + request `interface_name` an optional interface to bind the socket to.
1764    /// + request `timeout` a timeout in nanoseconds to wait for a reply. If
1765    ///     less than or equal to 0, then returns success immediately after the
1766    ///     ping is sent.
1767    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
1768    ///     hermetic network realm.
1769    /// * error `INTERFACE_NOT_FOUND` if `interface_name` does not exist in the
1770    ///     hermetic Netstack.
1771    /// * error `INTERNAL` for internal errors, including failure to create a
1772    ///     socket or generate the ping request and response.
1773    /// * error `INVALID_ARGUMENTS` if `target` corresponds to a link-local
1774    ///     address and an `interface_name` is not specified or the
1775    ///     `payload_length` exceeds the maximum allowable size.
1776    /// * error `PING_FAILED` if there was an error sending or receiving the
1777    ///     ping.
1778    /// * error `TIMEOUT_EXCEEDED` if the ping reply is not received before the
1779    ///     specifed `timeout`.
1780    Ping {
1781        target: fidl_fuchsia_net::IpAddress,
1782        payload_length: u16,
1783        interface_name: Option<String>,
1784        timeout: i64,
1785        responder: ControllerPingResponder,
1786    },
1787    /// Polls the specified socket address with UDP datagrams containing the specified payload
1788    /// using a socket provided by the hermetic Netstack.
1789    ///
1790    /// Waits for a single reply from the target address and returns it.
1791    ///
1792    /// + request `target` the socket address to poll.
1793    /// + request `payload` the content to place in the UDP datagram.
1794    /// + request `timeout` a timeout in nanoseconds to wait for a reply, per retry.
1795    /// + request `num_retries` the number of poll attempts to make before giving up and returning
1796    ///     an error.
1797    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
1798    ///     hermetic network realm.
1799    /// * error `ADDRESS_UNREACHABLE` if all poll attempts expire without successfully receiving
1800    ///     a reply from the target address, and no route was found to the target address.
1801    /// * error `TIMEOUT_EXCEEDED` if the target address was routable, but all of the retry
1802    ///     attempts expire without successfully receiving a reply from the target address.
1803    /// * error `INTERNAL` for internal errors, including failure to create a socket or other
1804    ///     failures to send/receive datagrams from the target address.
1805    PollUdp {
1806        target: fidl_fuchsia_net::SocketAddress,
1807        payload: Vec<u8>,
1808        timeout: i64,
1809        num_retries: u16,
1810        responder: ControllerPollUdpResponder,
1811    },
1812    /// Joins a multicast group.
1813    ///
1814    /// Membership will be maintained until `LeaveMulticastGroup` or
1815    /// `StopHermeticNetworkRealm` is invoked.
1816    ///
1817    /// + request `address` the group address to join.
1818    /// + request `interface_id` the interface that should be used to join the
1819    ///     group. A value of 0 indicates that any interface may be used.
1820    /// * error `ADDRESS_IN_USE` if the provided `address` was previously
1821    ///     joined.
1822    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
1823    ///     hermetic network realm.
1824    /// * error `INTERNAL` for internal errors.
1825    /// * error `INVALID_ARGUMENTS` if the specified `interface_id` does not
1826    ///     exist or the `address` does not correspond to a valid multicast
1827    ///     address.
1828    JoinMulticastGroup {
1829        address: fidl_fuchsia_net::IpAddress,
1830        interface_id: u64,
1831        responder: ControllerJoinMulticastGroupResponder,
1832    },
1833    /// Leaves a multicast group that was previously joined using the
1834    /// `JoinMulticastGroup` method.
1835    ///
1836    /// + request `address` the group address to leave.
1837    /// + request `interface_id` the interface that was previously used to join
1838    ///     the multicast group.
1839    /// * error `ADDRESS_NOT_AVAILABLE` if the provided `address` was not
1840    ///     previously joined.
1841    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
1842    ///     hermetic network realm.
1843    /// * error `INTERNAL` for internal errors, including failure to connect
1844    ///     to hermetic network realm services.
1845    /// * error `INVALID_ARGUMENTS` if the specified `interface_id` does not
1846    ///     exist or the `address` does not correspond to a valid multicast
1847    ///     address.
1848    LeaveMulticastGroup {
1849        address: fidl_fuchsia_net::IpAddress,
1850        interface_id: u64,
1851        responder: ControllerLeaveMulticastGroupResponder,
1852    },
1853    /// Starts a DHCPv6 client with the provided parameters.
1854    ///
1855    /// + request `params` parameters to start this DHCPv6 client with.
1856    ///     Required.
1857    /// * error `HERMETIC_NETWORK_REALM_NOT_RUNNING` if there is no running
1858    ///     hermetic network realm.
1859    /// * error `INTERNAL` for internal errors, including failure to connect
1860    ///     to hermetic network realm services.
1861    /// * error `INVALID_ARGUMENTS` if any required parameters are omitted.
1862    /// * error `ALREADY_EXISTS` if there is a client running on the interface
1863    ///     identified by `params.interface_id` already.
1864    StartDhcpv6Client {
1865        params: fidl_fuchsia_net_dhcpv6::NewClientParams,
1866        responder: ControllerStartDhcpv6ClientResponder,
1867    },
1868    /// Stops all DHCPv6 clients.
1869    ///
1870    /// * error `DHCPV6_CLIENT_NOT_RUNNING` if no DHCPv6 client is running.
1871    StopDhcpv6Client { responder: ControllerStopDhcpv6ClientResponder },
1872    /// Starts a DHCPv4 client on the provided interface.
1873    ///
1874    /// + request `interface_id` the interface to start a DHCPv4 client on.
1875    ///     Required.
1876    StartOutOfStackDhcpv4Client {
1877        payload: ControllerStartOutOfStackDhcpv4ClientRequest,
1878        responder: ControllerStartOutOfStackDhcpv4ClientResponder,
1879    },
1880    /// Stops the DHCPv4 client on the provided interface.
1881    ///
1882    /// + request `interface_id` the interface to stop a DHCPv4 client client on.
1883    ///     Required.
1884    /// * error `DHCPV4_CLIENT_NOT_RUNNING` if no DHCPv4 client is running.
1885    /// * error `DHCPV4_CLIENT_SHUTDOWN_FAILED` if shutting down the DHCPv4 client
1886    ///   failed.
1887    StopOutOfStackDhcpv4Client {
1888        payload: ControllerStopOutOfStackDhcpv4ClientRequest,
1889        responder: ControllerStopOutOfStackDhcpv4ClientResponder,
1890    },
1891}
1892
1893impl ControllerRequest {
1894    #[allow(irrefutable_let_patterns)]
1895    pub fn into_start_hermetic_network_realm(
1896        self,
1897    ) -> Option<(Netstack, ControllerStartHermeticNetworkRealmResponder)> {
1898        if let ControllerRequest::StartHermeticNetworkRealm { netstack, responder } = self {
1899            Some((netstack, responder))
1900        } else {
1901            None
1902        }
1903    }
1904
1905    #[allow(irrefutable_let_patterns)]
1906    pub fn into_stop_hermetic_network_realm(
1907        self,
1908    ) -> Option<(ControllerStopHermeticNetworkRealmResponder)> {
1909        if let ControllerRequest::StopHermeticNetworkRealm { responder } = self {
1910            Some((responder))
1911        } else {
1912            None
1913        }
1914    }
1915
1916    #[allow(irrefutable_let_patterns)]
1917    pub fn into_add_interface(
1918        self,
1919    ) -> Option<(fidl_fuchsia_net::MacAddress, String, bool, ControllerAddInterfaceResponder)> {
1920        if let ControllerRequest::AddInterface {
1921            mac_address,
1922            name,
1923            wait_any_ip_address,
1924            responder,
1925        } = self
1926        {
1927            Some((mac_address, name, wait_any_ip_address, responder))
1928        } else {
1929            None
1930        }
1931    }
1932
1933    #[allow(irrefutable_let_patterns)]
1934    pub fn into_start_stub(self) -> Option<(String, ControllerStartStubResponder)> {
1935        if let ControllerRequest::StartStub { component_url, responder } = self {
1936            Some((component_url, responder))
1937        } else {
1938            None
1939        }
1940    }
1941
1942    #[allow(irrefutable_let_patterns)]
1943    pub fn into_stop_stub(self) -> Option<(ControllerStopStubResponder)> {
1944        if let ControllerRequest::StopStub { responder } = self { Some((responder)) } else { None }
1945    }
1946
1947    #[allow(irrefutable_let_patterns)]
1948    pub fn into_ping(
1949        self,
1950    ) -> Option<(fidl_fuchsia_net::IpAddress, u16, Option<String>, i64, ControllerPingResponder)>
1951    {
1952        if let ControllerRequest::Ping {
1953            target,
1954            payload_length,
1955            interface_name,
1956            timeout,
1957            responder,
1958        } = self
1959        {
1960            Some((target, payload_length, interface_name, timeout, responder))
1961        } else {
1962            None
1963        }
1964    }
1965
1966    #[allow(irrefutable_let_patterns)]
1967    pub fn into_poll_udp(
1968        self,
1969    ) -> Option<(fidl_fuchsia_net::SocketAddress, Vec<u8>, i64, u16, ControllerPollUdpResponder)>
1970    {
1971        if let ControllerRequest::PollUdp { target, payload, timeout, num_retries, responder } =
1972            self
1973        {
1974            Some((target, payload, timeout, num_retries, responder))
1975        } else {
1976            None
1977        }
1978    }
1979
1980    #[allow(irrefutable_let_patterns)]
1981    pub fn into_join_multicast_group(
1982        self,
1983    ) -> Option<(fidl_fuchsia_net::IpAddress, u64, ControllerJoinMulticastGroupResponder)> {
1984        if let ControllerRequest::JoinMulticastGroup { address, interface_id, responder } = self {
1985            Some((address, interface_id, responder))
1986        } else {
1987            None
1988        }
1989    }
1990
1991    #[allow(irrefutable_let_patterns)]
1992    pub fn into_leave_multicast_group(
1993        self,
1994    ) -> Option<(fidl_fuchsia_net::IpAddress, u64, ControllerLeaveMulticastGroupResponder)> {
1995        if let ControllerRequest::LeaveMulticastGroup { address, interface_id, responder } = self {
1996            Some((address, interface_id, responder))
1997        } else {
1998            None
1999        }
2000    }
2001
2002    #[allow(irrefutable_let_patterns)]
2003    pub fn into_start_dhcpv6_client(
2004        self,
2005    ) -> Option<(fidl_fuchsia_net_dhcpv6::NewClientParams, ControllerStartDhcpv6ClientResponder)>
2006    {
2007        if let ControllerRequest::StartDhcpv6Client { params, responder } = self {
2008            Some((params, responder))
2009        } else {
2010            None
2011        }
2012    }
2013
2014    #[allow(irrefutable_let_patterns)]
2015    pub fn into_stop_dhcpv6_client(self) -> Option<(ControllerStopDhcpv6ClientResponder)> {
2016        if let ControllerRequest::StopDhcpv6Client { responder } = self {
2017            Some((responder))
2018        } else {
2019            None
2020        }
2021    }
2022
2023    #[allow(irrefutable_let_patterns)]
2024    pub fn into_start_out_of_stack_dhcpv4_client(
2025        self,
2026    ) -> Option<(
2027        ControllerStartOutOfStackDhcpv4ClientRequest,
2028        ControllerStartOutOfStackDhcpv4ClientResponder,
2029    )> {
2030        if let ControllerRequest::StartOutOfStackDhcpv4Client { payload, responder } = self {
2031            Some((payload, responder))
2032        } else {
2033            None
2034        }
2035    }
2036
2037    #[allow(irrefutable_let_patterns)]
2038    pub fn into_stop_out_of_stack_dhcpv4_client(
2039        self,
2040    ) -> Option<(
2041        ControllerStopOutOfStackDhcpv4ClientRequest,
2042        ControllerStopOutOfStackDhcpv4ClientResponder,
2043    )> {
2044        if let ControllerRequest::StopOutOfStackDhcpv4Client { payload, responder } = self {
2045            Some((payload, responder))
2046        } else {
2047            None
2048        }
2049    }
2050
2051    /// Name of the method defined in FIDL
2052    pub fn method_name(&self) -> &'static str {
2053        match *self {
2054            ControllerRequest::StartHermeticNetworkRealm { .. } => "start_hermetic_network_realm",
2055            ControllerRequest::StopHermeticNetworkRealm { .. } => "stop_hermetic_network_realm",
2056            ControllerRequest::AddInterface { .. } => "add_interface",
2057            ControllerRequest::StartStub { .. } => "start_stub",
2058            ControllerRequest::StopStub { .. } => "stop_stub",
2059            ControllerRequest::Ping { .. } => "ping",
2060            ControllerRequest::PollUdp { .. } => "poll_udp",
2061            ControllerRequest::JoinMulticastGroup { .. } => "join_multicast_group",
2062            ControllerRequest::LeaveMulticastGroup { .. } => "leave_multicast_group",
2063            ControllerRequest::StartDhcpv6Client { .. } => "start_dhcpv6_client",
2064            ControllerRequest::StopDhcpv6Client { .. } => "stop_dhcpv6_client",
2065            ControllerRequest::StartOutOfStackDhcpv4Client { .. } => {
2066                "start_out_of_stack_dhcpv4_client"
2067            }
2068            ControllerRequest::StopOutOfStackDhcpv4Client { .. } => {
2069                "stop_out_of_stack_dhcpv4_client"
2070            }
2071        }
2072    }
2073}
2074
2075#[derive(Debug, Clone)]
2076pub struct ControllerControlHandle {
2077    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2078}
2079
2080impl fidl::endpoints::ControlHandle for ControllerControlHandle {
2081    fn shutdown(&self) {
2082        self.inner.shutdown()
2083    }
2084
2085    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2086        self.inner.shutdown_with_epitaph(status)
2087    }
2088
2089    fn is_closed(&self) -> bool {
2090        self.inner.channel().is_closed()
2091    }
2092    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2093        self.inner.channel().on_closed()
2094    }
2095
2096    #[cfg(target_os = "fuchsia")]
2097    fn signal_peer(
2098        &self,
2099        clear_mask: zx::Signals,
2100        set_mask: zx::Signals,
2101    ) -> Result<(), zx_status::Status> {
2102        use fidl::Peered;
2103        self.inner.channel().signal_peer(clear_mask, set_mask)
2104    }
2105}
2106
2107impl ControllerControlHandle {}
2108
2109#[must_use = "FIDL methods require a response to be sent"]
2110#[derive(Debug)]
2111pub struct ControllerStartHermeticNetworkRealmResponder {
2112    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2113    tx_id: u32,
2114}
2115
2116/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2117/// if the responder is dropped without sending a response, so that the client
2118/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2119impl std::ops::Drop for ControllerStartHermeticNetworkRealmResponder {
2120    fn drop(&mut self) {
2121        self.control_handle.shutdown();
2122        // Safety: drops once, never accessed again
2123        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2124    }
2125}
2126
2127impl fidl::endpoints::Responder for ControllerStartHermeticNetworkRealmResponder {
2128    type ControlHandle = ControllerControlHandle;
2129
2130    fn control_handle(&self) -> &ControllerControlHandle {
2131        &self.control_handle
2132    }
2133
2134    fn drop_without_shutdown(mut self) {
2135        // Safety: drops once, never accessed again due to mem::forget
2136        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2137        // Prevent Drop from running (which would shut down the channel)
2138        std::mem::forget(self);
2139    }
2140}
2141
2142impl ControllerStartHermeticNetworkRealmResponder {
2143    /// Sends a response to the FIDL transaction.
2144    ///
2145    /// Sets the channel to shutdown if an error occurs.
2146    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2147        let _result = self.send_raw(result);
2148        if _result.is_err() {
2149            self.control_handle.shutdown();
2150        }
2151        self.drop_without_shutdown();
2152        _result
2153    }
2154
2155    /// Similar to "send" but does not shutdown the channel if an error occurs.
2156    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2157        let _result = self.send_raw(result);
2158        self.drop_without_shutdown();
2159        _result
2160    }
2161
2162    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2163        self.control_handle
2164            .inner
2165            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2166                result,
2167                self.tx_id,
2168                0x58c1fa7335d4c5c2,
2169                fidl::encoding::DynamicFlags::empty(),
2170            )
2171    }
2172}
2173
2174#[must_use = "FIDL methods require a response to be sent"]
2175#[derive(Debug)]
2176pub struct ControllerStopHermeticNetworkRealmResponder {
2177    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2178    tx_id: u32,
2179}
2180
2181/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2182/// if the responder is dropped without sending a response, so that the client
2183/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2184impl std::ops::Drop for ControllerStopHermeticNetworkRealmResponder {
2185    fn drop(&mut self) {
2186        self.control_handle.shutdown();
2187        // Safety: drops once, never accessed again
2188        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2189    }
2190}
2191
2192impl fidl::endpoints::Responder for ControllerStopHermeticNetworkRealmResponder {
2193    type ControlHandle = ControllerControlHandle;
2194
2195    fn control_handle(&self) -> &ControllerControlHandle {
2196        &self.control_handle
2197    }
2198
2199    fn drop_without_shutdown(mut self) {
2200        // Safety: drops once, never accessed again due to mem::forget
2201        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2202        // Prevent Drop from running (which would shut down the channel)
2203        std::mem::forget(self);
2204    }
2205}
2206
2207impl ControllerStopHermeticNetworkRealmResponder {
2208    /// Sends a response to the FIDL transaction.
2209    ///
2210    /// Sets the channel to shutdown if an error occurs.
2211    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2212        let _result = self.send_raw(result);
2213        if _result.is_err() {
2214            self.control_handle.shutdown();
2215        }
2216        self.drop_without_shutdown();
2217        _result
2218    }
2219
2220    /// Similar to "send" but does not shutdown the channel if an error occurs.
2221    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2222        let _result = self.send_raw(result);
2223        self.drop_without_shutdown();
2224        _result
2225    }
2226
2227    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2228        self.control_handle
2229            .inner
2230            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2231                result,
2232                self.tx_id,
2233                0x49d3c2501cd2f635,
2234                fidl::encoding::DynamicFlags::empty(),
2235            )
2236    }
2237}
2238
2239#[must_use = "FIDL methods require a response to be sent"]
2240#[derive(Debug)]
2241pub struct ControllerAddInterfaceResponder {
2242    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2243    tx_id: u32,
2244}
2245
2246/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2247/// if the responder is dropped without sending a response, so that the client
2248/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2249impl std::ops::Drop for ControllerAddInterfaceResponder {
2250    fn drop(&mut self) {
2251        self.control_handle.shutdown();
2252        // Safety: drops once, never accessed again
2253        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2254    }
2255}
2256
2257impl fidl::endpoints::Responder for ControllerAddInterfaceResponder {
2258    type ControlHandle = ControllerControlHandle;
2259
2260    fn control_handle(&self) -> &ControllerControlHandle {
2261        &self.control_handle
2262    }
2263
2264    fn drop_without_shutdown(mut self) {
2265        // Safety: drops once, never accessed again due to mem::forget
2266        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2267        // Prevent Drop from running (which would shut down the channel)
2268        std::mem::forget(self);
2269    }
2270}
2271
2272impl ControllerAddInterfaceResponder {
2273    /// Sends a response to the FIDL transaction.
2274    ///
2275    /// Sets the channel to shutdown if an error occurs.
2276    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2277        let _result = self.send_raw(result);
2278        if _result.is_err() {
2279            self.control_handle.shutdown();
2280        }
2281        self.drop_without_shutdown();
2282        _result
2283    }
2284
2285    /// Similar to "send" but does not shutdown the channel if an error occurs.
2286    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2287        let _result = self.send_raw(result);
2288        self.drop_without_shutdown();
2289        _result
2290    }
2291
2292    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2293        self.control_handle
2294            .inner
2295            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2296                result,
2297                self.tx_id,
2298                0x668ded2d2b619c15,
2299                fidl::encoding::DynamicFlags::empty(),
2300            )
2301    }
2302}
2303
2304#[must_use = "FIDL methods require a response to be sent"]
2305#[derive(Debug)]
2306pub struct ControllerStartStubResponder {
2307    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2308    tx_id: u32,
2309}
2310
2311/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2312/// if the responder is dropped without sending a response, so that the client
2313/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2314impl std::ops::Drop for ControllerStartStubResponder {
2315    fn drop(&mut self) {
2316        self.control_handle.shutdown();
2317        // Safety: drops once, never accessed again
2318        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2319    }
2320}
2321
2322impl fidl::endpoints::Responder for ControllerStartStubResponder {
2323    type ControlHandle = ControllerControlHandle;
2324
2325    fn control_handle(&self) -> &ControllerControlHandle {
2326        &self.control_handle
2327    }
2328
2329    fn drop_without_shutdown(mut self) {
2330        // Safety: drops once, never accessed again due to mem::forget
2331        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2332        // Prevent Drop from running (which would shut down the channel)
2333        std::mem::forget(self);
2334    }
2335}
2336
2337impl ControllerStartStubResponder {
2338    /// Sends a response to the FIDL transaction.
2339    ///
2340    /// Sets the channel to shutdown if an error occurs.
2341    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2342        let _result = self.send_raw(result);
2343        if _result.is_err() {
2344            self.control_handle.shutdown();
2345        }
2346        self.drop_without_shutdown();
2347        _result
2348    }
2349
2350    /// Similar to "send" but does not shutdown the channel if an error occurs.
2351    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2352        let _result = self.send_raw(result);
2353        self.drop_without_shutdown();
2354        _result
2355    }
2356
2357    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2358        self.control_handle
2359            .inner
2360            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2361                result,
2362                self.tx_id,
2363                0x6523a401f22bf664,
2364                fidl::encoding::DynamicFlags::empty(),
2365            )
2366    }
2367}
2368
2369#[must_use = "FIDL methods require a response to be sent"]
2370#[derive(Debug)]
2371pub struct ControllerStopStubResponder {
2372    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2373    tx_id: u32,
2374}
2375
2376/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2377/// if the responder is dropped without sending a response, so that the client
2378/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2379impl std::ops::Drop for ControllerStopStubResponder {
2380    fn drop(&mut self) {
2381        self.control_handle.shutdown();
2382        // Safety: drops once, never accessed again
2383        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2384    }
2385}
2386
2387impl fidl::endpoints::Responder for ControllerStopStubResponder {
2388    type ControlHandle = ControllerControlHandle;
2389
2390    fn control_handle(&self) -> &ControllerControlHandle {
2391        &self.control_handle
2392    }
2393
2394    fn drop_without_shutdown(mut self) {
2395        // Safety: drops once, never accessed again due to mem::forget
2396        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2397        // Prevent Drop from running (which would shut down the channel)
2398        std::mem::forget(self);
2399    }
2400}
2401
2402impl ControllerStopStubResponder {
2403    /// Sends a response to the FIDL transaction.
2404    ///
2405    /// Sets the channel to shutdown if an error occurs.
2406    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2407        let _result = self.send_raw(result);
2408        if _result.is_err() {
2409            self.control_handle.shutdown();
2410        }
2411        self.drop_without_shutdown();
2412        _result
2413    }
2414
2415    /// Similar to "send" but does not shutdown the channel if an error occurs.
2416    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2417        let _result = self.send_raw(result);
2418        self.drop_without_shutdown();
2419        _result
2420    }
2421
2422    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2423        self.control_handle
2424            .inner
2425            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2426                result,
2427                self.tx_id,
2428                0x582c32b564ff4bb4,
2429                fidl::encoding::DynamicFlags::empty(),
2430            )
2431    }
2432}
2433
2434#[must_use = "FIDL methods require a response to be sent"]
2435#[derive(Debug)]
2436pub struct ControllerPingResponder {
2437    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2438    tx_id: u32,
2439}
2440
2441/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2442/// if the responder is dropped without sending a response, so that the client
2443/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2444impl std::ops::Drop for ControllerPingResponder {
2445    fn drop(&mut self) {
2446        self.control_handle.shutdown();
2447        // Safety: drops once, never accessed again
2448        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2449    }
2450}
2451
2452impl fidl::endpoints::Responder for ControllerPingResponder {
2453    type ControlHandle = ControllerControlHandle;
2454
2455    fn control_handle(&self) -> &ControllerControlHandle {
2456        &self.control_handle
2457    }
2458
2459    fn drop_without_shutdown(mut self) {
2460        // Safety: drops once, never accessed again due to mem::forget
2461        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2462        // Prevent Drop from running (which would shut down the channel)
2463        std::mem::forget(self);
2464    }
2465}
2466
2467impl ControllerPingResponder {
2468    /// Sends a response to the FIDL transaction.
2469    ///
2470    /// Sets the channel to shutdown if an error occurs.
2471    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2472        let _result = self.send_raw(result);
2473        if _result.is_err() {
2474            self.control_handle.shutdown();
2475        }
2476        self.drop_without_shutdown();
2477        _result
2478    }
2479
2480    /// Similar to "send" but does not shutdown the channel if an error occurs.
2481    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2482        let _result = self.send_raw(result);
2483        self.drop_without_shutdown();
2484        _result
2485    }
2486
2487    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2488        self.control_handle
2489            .inner
2490            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2491                result,
2492                self.tx_id,
2493                0x60c9b6cf952fa4d1,
2494                fidl::encoding::DynamicFlags::empty(),
2495            )
2496    }
2497}
2498
2499#[must_use = "FIDL methods require a response to be sent"]
2500#[derive(Debug)]
2501pub struct ControllerPollUdpResponder {
2502    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2503    tx_id: u32,
2504}
2505
2506/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2507/// if the responder is dropped without sending a response, so that the client
2508/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2509impl std::ops::Drop for ControllerPollUdpResponder {
2510    fn drop(&mut self) {
2511        self.control_handle.shutdown();
2512        // Safety: drops once, never accessed again
2513        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2514    }
2515}
2516
2517impl fidl::endpoints::Responder for ControllerPollUdpResponder {
2518    type ControlHandle = ControllerControlHandle;
2519
2520    fn control_handle(&self) -> &ControllerControlHandle {
2521        &self.control_handle
2522    }
2523
2524    fn drop_without_shutdown(mut self) {
2525        // Safety: drops once, never accessed again due to mem::forget
2526        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2527        // Prevent Drop from running (which would shut down the channel)
2528        std::mem::forget(self);
2529    }
2530}
2531
2532impl ControllerPollUdpResponder {
2533    /// Sends a response to the FIDL transaction.
2534    ///
2535    /// Sets the channel to shutdown if an error occurs.
2536    pub fn send(self, mut result: Result<&[u8], Error>) -> Result<(), fidl::Error> {
2537        let _result = self.send_raw(result);
2538        if _result.is_err() {
2539            self.control_handle.shutdown();
2540        }
2541        self.drop_without_shutdown();
2542        _result
2543    }
2544
2545    /// Similar to "send" but does not shutdown the channel if an error occurs.
2546    pub fn send_no_shutdown_on_err(
2547        self,
2548        mut result: Result<&[u8], Error>,
2549    ) -> Result<(), fidl::Error> {
2550        let _result = self.send_raw(result);
2551        self.drop_without_shutdown();
2552        _result
2553    }
2554
2555    fn send_raw(&self, mut result: Result<&[u8], Error>) -> Result<(), fidl::Error> {
2556        self.control_handle
2557            .inner
2558            .send::<fidl::encoding::ResultType<ControllerPollUdpResponse, Error>>(
2559                result.map(|payload| (payload,)),
2560                self.tx_id,
2561                0x333fb354db30f664,
2562                fidl::encoding::DynamicFlags::empty(),
2563            )
2564    }
2565}
2566
2567#[must_use = "FIDL methods require a response to be sent"]
2568#[derive(Debug)]
2569pub struct ControllerJoinMulticastGroupResponder {
2570    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2571    tx_id: u32,
2572}
2573
2574/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2575/// if the responder is dropped without sending a response, so that the client
2576/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2577impl std::ops::Drop for ControllerJoinMulticastGroupResponder {
2578    fn drop(&mut self) {
2579        self.control_handle.shutdown();
2580        // Safety: drops once, never accessed again
2581        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2582    }
2583}
2584
2585impl fidl::endpoints::Responder for ControllerJoinMulticastGroupResponder {
2586    type ControlHandle = ControllerControlHandle;
2587
2588    fn control_handle(&self) -> &ControllerControlHandle {
2589        &self.control_handle
2590    }
2591
2592    fn drop_without_shutdown(mut self) {
2593        // Safety: drops once, never accessed again due to mem::forget
2594        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2595        // Prevent Drop from running (which would shut down the channel)
2596        std::mem::forget(self);
2597    }
2598}
2599
2600impl ControllerJoinMulticastGroupResponder {
2601    /// Sends a response to the FIDL transaction.
2602    ///
2603    /// Sets the channel to shutdown if an error occurs.
2604    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2605        let _result = self.send_raw(result);
2606        if _result.is_err() {
2607            self.control_handle.shutdown();
2608        }
2609        self.drop_without_shutdown();
2610        _result
2611    }
2612
2613    /// Similar to "send" but does not shutdown the channel if an error occurs.
2614    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2615        let _result = self.send_raw(result);
2616        self.drop_without_shutdown();
2617        _result
2618    }
2619
2620    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2621        self.control_handle
2622            .inner
2623            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2624                result,
2625                self.tx_id,
2626                0xbdbb4095640a3f4,
2627                fidl::encoding::DynamicFlags::empty(),
2628            )
2629    }
2630}
2631
2632#[must_use = "FIDL methods require a response to be sent"]
2633#[derive(Debug)]
2634pub struct ControllerLeaveMulticastGroupResponder {
2635    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2636    tx_id: u32,
2637}
2638
2639/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2640/// if the responder is dropped without sending a response, so that the client
2641/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2642impl std::ops::Drop for ControllerLeaveMulticastGroupResponder {
2643    fn drop(&mut self) {
2644        self.control_handle.shutdown();
2645        // Safety: drops once, never accessed again
2646        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2647    }
2648}
2649
2650impl fidl::endpoints::Responder for ControllerLeaveMulticastGroupResponder {
2651    type ControlHandle = ControllerControlHandle;
2652
2653    fn control_handle(&self) -> &ControllerControlHandle {
2654        &self.control_handle
2655    }
2656
2657    fn drop_without_shutdown(mut self) {
2658        // Safety: drops once, never accessed again due to mem::forget
2659        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2660        // Prevent Drop from running (which would shut down the channel)
2661        std::mem::forget(self);
2662    }
2663}
2664
2665impl ControllerLeaveMulticastGroupResponder {
2666    /// Sends a response to the FIDL transaction.
2667    ///
2668    /// Sets the channel to shutdown if an error occurs.
2669    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2670        let _result = self.send_raw(result);
2671        if _result.is_err() {
2672            self.control_handle.shutdown();
2673        }
2674        self.drop_without_shutdown();
2675        _result
2676    }
2677
2678    /// Similar to "send" but does not shutdown the channel if an error occurs.
2679    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2680        let _result = self.send_raw(result);
2681        self.drop_without_shutdown();
2682        _result
2683    }
2684
2685    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2686        self.control_handle
2687            .inner
2688            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2689                result,
2690                self.tx_id,
2691                0x32ecf4e40124a29a,
2692                fidl::encoding::DynamicFlags::empty(),
2693            )
2694    }
2695}
2696
2697#[must_use = "FIDL methods require a response to be sent"]
2698#[derive(Debug)]
2699pub struct ControllerStartDhcpv6ClientResponder {
2700    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2701    tx_id: u32,
2702}
2703
2704/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2705/// if the responder is dropped without sending a response, so that the client
2706/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2707impl std::ops::Drop for ControllerStartDhcpv6ClientResponder {
2708    fn drop(&mut self) {
2709        self.control_handle.shutdown();
2710        // Safety: drops once, never accessed again
2711        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2712    }
2713}
2714
2715impl fidl::endpoints::Responder for ControllerStartDhcpv6ClientResponder {
2716    type ControlHandle = ControllerControlHandle;
2717
2718    fn control_handle(&self) -> &ControllerControlHandle {
2719        &self.control_handle
2720    }
2721
2722    fn drop_without_shutdown(mut self) {
2723        // Safety: drops once, never accessed again due to mem::forget
2724        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2725        // Prevent Drop from running (which would shut down the channel)
2726        std::mem::forget(self);
2727    }
2728}
2729
2730impl ControllerStartDhcpv6ClientResponder {
2731    /// Sends a response to the FIDL transaction.
2732    ///
2733    /// Sets the channel to shutdown if an error occurs.
2734    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2735        let _result = self.send_raw(result);
2736        if _result.is_err() {
2737            self.control_handle.shutdown();
2738        }
2739        self.drop_without_shutdown();
2740        _result
2741    }
2742
2743    /// Similar to "send" but does not shutdown the channel if an error occurs.
2744    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2745        let _result = self.send_raw(result);
2746        self.drop_without_shutdown();
2747        _result
2748    }
2749
2750    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2751        self.control_handle
2752            .inner
2753            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2754                result,
2755                self.tx_id,
2756                0x756c9b70864b7744,
2757                fidl::encoding::DynamicFlags::empty(),
2758            )
2759    }
2760}
2761
2762#[must_use = "FIDL methods require a response to be sent"]
2763#[derive(Debug)]
2764pub struct ControllerStopDhcpv6ClientResponder {
2765    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2766    tx_id: u32,
2767}
2768
2769/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2770/// if the responder is dropped without sending a response, so that the client
2771/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2772impl std::ops::Drop for ControllerStopDhcpv6ClientResponder {
2773    fn drop(&mut self) {
2774        self.control_handle.shutdown();
2775        // Safety: drops once, never accessed again
2776        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2777    }
2778}
2779
2780impl fidl::endpoints::Responder for ControllerStopDhcpv6ClientResponder {
2781    type ControlHandle = ControllerControlHandle;
2782
2783    fn control_handle(&self) -> &ControllerControlHandle {
2784        &self.control_handle
2785    }
2786
2787    fn drop_without_shutdown(mut self) {
2788        // Safety: drops once, never accessed again due to mem::forget
2789        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2790        // Prevent Drop from running (which would shut down the channel)
2791        std::mem::forget(self);
2792    }
2793}
2794
2795impl ControllerStopDhcpv6ClientResponder {
2796    /// Sends a response to the FIDL transaction.
2797    ///
2798    /// Sets the channel to shutdown if an error occurs.
2799    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2800        let _result = self.send_raw(result);
2801        if _result.is_err() {
2802            self.control_handle.shutdown();
2803        }
2804        self.drop_without_shutdown();
2805        _result
2806    }
2807
2808    /// Similar to "send" but does not shutdown the channel if an error occurs.
2809    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2810        let _result = self.send_raw(result);
2811        self.drop_without_shutdown();
2812        _result
2813    }
2814
2815    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2816        self.control_handle
2817            .inner
2818            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2819                result,
2820                self.tx_id,
2821                0x16e93478e663d523,
2822                fidl::encoding::DynamicFlags::empty(),
2823            )
2824    }
2825}
2826
2827#[must_use = "FIDL methods require a response to be sent"]
2828#[derive(Debug)]
2829pub struct ControllerStartOutOfStackDhcpv4ClientResponder {
2830    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2831    tx_id: u32,
2832}
2833
2834/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2835/// if the responder is dropped without sending a response, so that the client
2836/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2837impl std::ops::Drop for ControllerStartOutOfStackDhcpv4ClientResponder {
2838    fn drop(&mut self) {
2839        self.control_handle.shutdown();
2840        // Safety: drops once, never accessed again
2841        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2842    }
2843}
2844
2845impl fidl::endpoints::Responder for ControllerStartOutOfStackDhcpv4ClientResponder {
2846    type ControlHandle = ControllerControlHandle;
2847
2848    fn control_handle(&self) -> &ControllerControlHandle {
2849        &self.control_handle
2850    }
2851
2852    fn drop_without_shutdown(mut self) {
2853        // Safety: drops once, never accessed again due to mem::forget
2854        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2855        // Prevent Drop from running (which would shut down the channel)
2856        std::mem::forget(self);
2857    }
2858}
2859
2860impl ControllerStartOutOfStackDhcpv4ClientResponder {
2861    /// Sends a response to the FIDL transaction.
2862    ///
2863    /// Sets the channel to shutdown if an error occurs.
2864    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2865        let _result = self.send_raw(result);
2866        if _result.is_err() {
2867            self.control_handle.shutdown();
2868        }
2869        self.drop_without_shutdown();
2870        _result
2871    }
2872
2873    /// Similar to "send" but does not shutdown the channel if an error occurs.
2874    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2875        let _result = self.send_raw(result);
2876        self.drop_without_shutdown();
2877        _result
2878    }
2879
2880    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2881        self.control_handle
2882            .inner
2883            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2884                result,
2885                self.tx_id,
2886                0x37eeec41c0077625,
2887                fidl::encoding::DynamicFlags::empty(),
2888            )
2889    }
2890}
2891
2892#[must_use = "FIDL methods require a response to be sent"]
2893#[derive(Debug)]
2894pub struct ControllerStopOutOfStackDhcpv4ClientResponder {
2895    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2896    tx_id: u32,
2897}
2898
2899/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2900/// if the responder is dropped without sending a response, so that the client
2901/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2902impl std::ops::Drop for ControllerStopOutOfStackDhcpv4ClientResponder {
2903    fn drop(&mut self) {
2904        self.control_handle.shutdown();
2905        // Safety: drops once, never accessed again
2906        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2907    }
2908}
2909
2910impl fidl::endpoints::Responder for ControllerStopOutOfStackDhcpv4ClientResponder {
2911    type ControlHandle = ControllerControlHandle;
2912
2913    fn control_handle(&self) -> &ControllerControlHandle {
2914        &self.control_handle
2915    }
2916
2917    fn drop_without_shutdown(mut self) {
2918        // Safety: drops once, never accessed again due to mem::forget
2919        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2920        // Prevent Drop from running (which would shut down the channel)
2921        std::mem::forget(self);
2922    }
2923}
2924
2925impl ControllerStopOutOfStackDhcpv4ClientResponder {
2926    /// Sends a response to the FIDL transaction.
2927    ///
2928    /// Sets the channel to shutdown if an error occurs.
2929    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2930        let _result = self.send_raw(result);
2931        if _result.is_err() {
2932            self.control_handle.shutdown();
2933        }
2934        self.drop_without_shutdown();
2935        _result
2936    }
2937
2938    /// Similar to "send" but does not shutdown the channel if an error occurs.
2939    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2940        let _result = self.send_raw(result);
2941        self.drop_without_shutdown();
2942        _result
2943    }
2944
2945    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2946        self.control_handle
2947            .inner
2948            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2949                result,
2950                self.tx_id,
2951                0x5d47aa5213164364,
2952                fidl::encoding::DynamicFlags::empty(),
2953            )
2954    }
2955}
2956
2957mod internal {
2958    use super::*;
2959}