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