1#![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 let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
148 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
149 }
150
151 pub fn into_channel(self) -> fidl::Channel {
152 self.client.into_channel()
153 }
154
155 pub fn wait_for_event(
158 &self,
159 deadline: zx::MonotonicInstant,
160 ) -> Result<ControllerEvent, fidl::Error> {
161 ControllerEvent::decode(self.client.wait_for_event(deadline)?)
162 }
163
164 pub fn r#start_hermetic_network_realm(
180 &self,
181 mut netstack: Netstack,
182 ___deadline: zx::MonotonicInstant,
183 ) -> Result<ControllerStartHermeticNetworkRealmResult, fidl::Error> {
184 let _response = self.client.send_query::<
185 ControllerStartHermeticNetworkRealmRequest,
186 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
187 >(
188 (netstack,),
189 0x58c1fa7335d4c5c2,
190 fidl::encoding::DynamicFlags::empty(),
191 ___deadline,
192 )?;
193 Ok(_response.map(|x| x))
194 }
195
196 pub fn r#stop_hermetic_network_realm(
209 &self,
210 ___deadline: zx::MonotonicInstant,
211 ) -> Result<ControllerStopHermeticNetworkRealmResult, fidl::Error> {
212 let _response = self.client.send_query::<
213 fidl::encoding::EmptyPayload,
214 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
215 >(
216 (),
217 0x49d3c2501cd2f635,
218 fidl::encoding::DynamicFlags::empty(),
219 ___deadline,
220 )?;
221 Ok(_response.map(|x| x))
222 }
223
224 pub fn r#add_interface(
245 &self,
246 mut mac_address: &fidl_fuchsia_net::MacAddress,
247 mut name: &str,
248 mut wait_any_ip_address: bool,
249 ___deadline: zx::MonotonicInstant,
250 ) -> Result<ControllerAddInterfaceResult, fidl::Error> {
251 let _response = self.client.send_query::<
252 ControllerAddInterfaceRequest,
253 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
254 >(
255 (mac_address, name, wait_any_ip_address,),
256 0x668ded2d2b619c15,
257 fidl::encoding::DynamicFlags::empty(),
258 ___deadline,
259 )?;
260 Ok(_response.map(|x| x))
261 }
262
263 pub fn r#start_stub(
277 &self,
278 mut component_url: &str,
279 ___deadline: zx::MonotonicInstant,
280 ) -> Result<ControllerStartStubResult, fidl::Error> {
281 let _response = self.client.send_query::<
282 ControllerStartStubRequest,
283 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
284 >(
285 (component_url,),
286 0x6523a401f22bf664,
287 fidl::encoding::DynamicFlags::empty(),
288 ___deadline,
289 )?;
290 Ok(_response.map(|x| x))
291 }
292
293 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 >(
311 (),
312 0x582c32b564ff4bb4,
313 fidl::encoding::DynamicFlags::empty(),
314 ___deadline,
315 )?;
316 Ok(_response.map(|x| x))
317 }
318
319 pub fn r#ping(
344 &self,
345 mut target: &fidl_fuchsia_net::IpAddress,
346 mut payload_length: u16,
347 mut interface_name: Option<&str>,
348 mut timeout: i64,
349 ___deadline: zx::MonotonicInstant,
350 ) -> Result<ControllerPingResult, fidl::Error> {
351 let _response = self.client.send_query::<
352 ControllerPingRequest,
353 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
354 >(
355 (target, payload_length, interface_name, timeout,),
356 0x60c9b6cf952fa4d1,
357 fidl::encoding::DynamicFlags::empty(),
358 ___deadline,
359 )?;
360 Ok(_response.map(|x| x))
361 }
362
363 pub fn r#poll_udp(
382 &self,
383 mut target: &fidl_fuchsia_net::SocketAddress,
384 mut payload: &[u8],
385 mut timeout: i64,
386 mut num_retries: u16,
387 ___deadline: zx::MonotonicInstant,
388 ) -> Result<ControllerPollUdpResult, fidl::Error> {
389 let _response = self.client.send_query::<
390 ControllerPollUdpRequest,
391 fidl::encoding::ResultType<ControllerPollUdpResponse, Error>,
392 >(
393 (target, payload, timeout, num_retries,),
394 0x333fb354db30f664,
395 fidl::encoding::DynamicFlags::empty(),
396 ___deadline,
397 )?;
398 Ok(_response.map(|x| x.payload))
399 }
400
401 pub fn r#join_multicast_group(
418 &self,
419 mut address: &fidl_fuchsia_net::IpAddress,
420 mut interface_id: u64,
421 ___deadline: zx::MonotonicInstant,
422 ) -> Result<ControllerJoinMulticastGroupResult, fidl::Error> {
423 let _response = self.client.send_query::<
424 ControllerJoinMulticastGroupRequest,
425 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
426 >(
427 (address, interface_id,),
428 0xbdbb4095640a3f4,
429 fidl::encoding::DynamicFlags::empty(),
430 ___deadline,
431 )?;
432 Ok(_response.map(|x| x))
433 }
434
435 pub fn r#leave_multicast_group(
451 &self,
452 mut address: &fidl_fuchsia_net::IpAddress,
453 mut interface_id: u64,
454 ___deadline: zx::MonotonicInstant,
455 ) -> Result<ControllerLeaveMulticastGroupResult, fidl::Error> {
456 let _response = self.client.send_query::<
457 ControllerLeaveMulticastGroupRequest,
458 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
459 >(
460 (address, interface_id,),
461 0x32ecf4e40124a29a,
462 fidl::encoding::DynamicFlags::empty(),
463 ___deadline,
464 )?;
465 Ok(_response.map(|x| x))
466 }
467
468 pub fn r#start_dhcpv6_client(
480 &self,
481 mut params: &fidl_fuchsia_net_dhcpv6::NewClientParams,
482 ___deadline: zx::MonotonicInstant,
483 ) -> Result<ControllerStartDhcpv6ClientResult, fidl::Error> {
484 let _response = self.client.send_query::<
485 ControllerStartDhcpv6ClientRequest,
486 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
487 >(
488 (params,),
489 0x756c9b70864b7744,
490 fidl::encoding::DynamicFlags::empty(),
491 ___deadline,
492 )?;
493 Ok(_response.map(|x| x))
494 }
495
496 pub fn r#stop_dhcpv6_client(
500 &self,
501 ___deadline: zx::MonotonicInstant,
502 ) -> Result<ControllerStopDhcpv6ClientResult, fidl::Error> {
503 let _response = self.client.send_query::<
504 fidl::encoding::EmptyPayload,
505 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
506 >(
507 (),
508 0x16e93478e663d523,
509 fidl::encoding::DynamicFlags::empty(),
510 ___deadline,
511 )?;
512 Ok(_response.map(|x| x))
513 }
514
515 pub fn r#start_out_of_stack_dhcpv4_client(
520 &self,
521 mut payload: &ControllerStartOutOfStackDhcpv4ClientRequest,
522 ___deadline: zx::MonotonicInstant,
523 ) -> Result<ControllerStartOutOfStackDhcpv4ClientResult, fidl::Error> {
524 let _response = self.client.send_query::<
525 ControllerStartOutOfStackDhcpv4ClientRequest,
526 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
527 >(
528 payload,
529 0x37eeec41c0077625,
530 fidl::encoding::DynamicFlags::empty(),
531 ___deadline,
532 )?;
533 Ok(_response.map(|x| x))
534 }
535
536 pub fn r#stop_out_of_stack_dhcpv4_client(
544 &self,
545 mut payload: &ControllerStopOutOfStackDhcpv4ClientRequest,
546 ___deadline: zx::MonotonicInstant,
547 ) -> Result<ControllerStopOutOfStackDhcpv4ClientResult, fidl::Error> {
548 let _response = self.client.send_query::<
549 ControllerStopOutOfStackDhcpv4ClientRequest,
550 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
551 >(
552 payload,
553 0x5d47aa5213164364,
554 fidl::encoding::DynamicFlags::empty(),
555 ___deadline,
556 )?;
557 Ok(_response.map(|x| x))
558 }
559}
560
561#[cfg(target_os = "fuchsia")]
562impl From<ControllerSynchronousProxy> for zx::NullableHandle {
563 fn from(value: ControllerSynchronousProxy) -> Self {
564 value.into_channel().into()
565 }
566}
567
568#[cfg(target_os = "fuchsia")]
569impl From<fidl::Channel> for ControllerSynchronousProxy {
570 fn from(value: fidl::Channel) -> Self {
571 Self::new(value)
572 }
573}
574
575#[cfg(target_os = "fuchsia")]
576impl fidl::endpoints::FromClient for ControllerSynchronousProxy {
577 type Protocol = ControllerMarker;
578
579 fn from_client(value: fidl::endpoints::ClientEnd<ControllerMarker>) -> Self {
580 Self::new(value.into_channel())
581 }
582}
583
584#[derive(Debug, Clone)]
585pub struct ControllerProxy {
586 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
587}
588
589impl fidl::endpoints::Proxy for ControllerProxy {
590 type Protocol = ControllerMarker;
591
592 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
593 Self::new(inner)
594 }
595
596 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
597 self.client.into_channel().map_err(|client| Self { client })
598 }
599
600 fn as_channel(&self) -> &::fidl::AsyncChannel {
601 self.client.as_channel()
602 }
603}
604
605impl ControllerProxy {
606 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
608 let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
609 Self { client: fidl::client::Client::new(channel, protocol_name) }
610 }
611
612 pub fn take_event_stream(&self) -> ControllerEventStream {
618 ControllerEventStream { event_receiver: self.client.take_event_receiver() }
619 }
620
621 pub fn r#start_hermetic_network_realm(
637 &self,
638 mut netstack: Netstack,
639 ) -> fidl::client::QueryResponseFut<
640 ControllerStartHermeticNetworkRealmResult,
641 fidl::encoding::DefaultFuchsiaResourceDialect,
642 > {
643 ControllerProxyInterface::r#start_hermetic_network_realm(self, netstack)
644 }
645
646 pub fn r#stop_hermetic_network_realm(
659 &self,
660 ) -> fidl::client::QueryResponseFut<
661 ControllerStopHermeticNetworkRealmResult,
662 fidl::encoding::DefaultFuchsiaResourceDialect,
663 > {
664 ControllerProxyInterface::r#stop_hermetic_network_realm(self)
665 }
666
667 pub fn r#add_interface(
688 &self,
689 mut mac_address: &fidl_fuchsia_net::MacAddress,
690 mut name: &str,
691 mut wait_any_ip_address: bool,
692 ) -> fidl::client::QueryResponseFut<
693 ControllerAddInterfaceResult,
694 fidl::encoding::DefaultFuchsiaResourceDialect,
695 > {
696 ControllerProxyInterface::r#add_interface(self, mac_address, name, wait_any_ip_address)
697 }
698
699 pub fn r#start_stub(
713 &self,
714 mut component_url: &str,
715 ) -> fidl::client::QueryResponseFut<
716 ControllerStartStubResult,
717 fidl::encoding::DefaultFuchsiaResourceDialect,
718 > {
719 ControllerProxyInterface::r#start_stub(self, component_url)
720 }
721
722 pub fn r#stop_stub(
733 &self,
734 ) -> fidl::client::QueryResponseFut<
735 ControllerStopStubResult,
736 fidl::encoding::DefaultFuchsiaResourceDialect,
737 > {
738 ControllerProxyInterface::r#stop_stub(self)
739 }
740
741 pub fn r#ping(
766 &self,
767 mut target: &fidl_fuchsia_net::IpAddress,
768 mut payload_length: u16,
769 mut interface_name: Option<&str>,
770 mut timeout: i64,
771 ) -> fidl::client::QueryResponseFut<
772 ControllerPingResult,
773 fidl::encoding::DefaultFuchsiaResourceDialect,
774 > {
775 ControllerProxyInterface::r#ping(self, target, payload_length, interface_name, timeout)
776 }
777
778 pub fn r#poll_udp(
797 &self,
798 mut target: &fidl_fuchsia_net::SocketAddress,
799 mut payload: &[u8],
800 mut timeout: i64,
801 mut num_retries: u16,
802 ) -> fidl::client::QueryResponseFut<
803 ControllerPollUdpResult,
804 fidl::encoding::DefaultFuchsiaResourceDialect,
805 > {
806 ControllerProxyInterface::r#poll_udp(self, target, payload, timeout, num_retries)
807 }
808
809 pub fn r#join_multicast_group(
826 &self,
827 mut address: &fidl_fuchsia_net::IpAddress,
828 mut interface_id: u64,
829 ) -> fidl::client::QueryResponseFut<
830 ControllerJoinMulticastGroupResult,
831 fidl::encoding::DefaultFuchsiaResourceDialect,
832 > {
833 ControllerProxyInterface::r#join_multicast_group(self, address, interface_id)
834 }
835
836 pub fn r#leave_multicast_group(
852 &self,
853 mut address: &fidl_fuchsia_net::IpAddress,
854 mut interface_id: u64,
855 ) -> fidl::client::QueryResponseFut<
856 ControllerLeaveMulticastGroupResult,
857 fidl::encoding::DefaultFuchsiaResourceDialect,
858 > {
859 ControllerProxyInterface::r#leave_multicast_group(self, address, interface_id)
860 }
861
862 pub fn r#start_dhcpv6_client(
874 &self,
875 mut params: &fidl_fuchsia_net_dhcpv6::NewClientParams,
876 ) -> fidl::client::QueryResponseFut<
877 ControllerStartDhcpv6ClientResult,
878 fidl::encoding::DefaultFuchsiaResourceDialect,
879 > {
880 ControllerProxyInterface::r#start_dhcpv6_client(self, params)
881 }
882
883 pub fn r#stop_dhcpv6_client(
887 &self,
888 ) -> fidl::client::QueryResponseFut<
889 ControllerStopDhcpv6ClientResult,
890 fidl::encoding::DefaultFuchsiaResourceDialect,
891 > {
892 ControllerProxyInterface::r#stop_dhcpv6_client(self)
893 }
894
895 pub fn r#start_out_of_stack_dhcpv4_client(
900 &self,
901 mut payload: &ControllerStartOutOfStackDhcpv4ClientRequest,
902 ) -> fidl::client::QueryResponseFut<
903 ControllerStartOutOfStackDhcpv4ClientResult,
904 fidl::encoding::DefaultFuchsiaResourceDialect,
905 > {
906 ControllerProxyInterface::r#start_out_of_stack_dhcpv4_client(self, payload)
907 }
908
909 pub fn r#stop_out_of_stack_dhcpv4_client(
917 &self,
918 mut payload: &ControllerStopOutOfStackDhcpv4ClientRequest,
919 ) -> fidl::client::QueryResponseFut<
920 ControllerStopOutOfStackDhcpv4ClientResult,
921 fidl::encoding::DefaultFuchsiaResourceDialect,
922 > {
923 ControllerProxyInterface::r#stop_out_of_stack_dhcpv4_client(self, payload)
924 }
925}
926
927impl ControllerProxyInterface for ControllerProxy {
928 type StartHermeticNetworkRealmResponseFut = fidl::client::QueryResponseFut<
929 ControllerStartHermeticNetworkRealmResult,
930 fidl::encoding::DefaultFuchsiaResourceDialect,
931 >;
932 fn r#start_hermetic_network_realm(
933 &self,
934 mut netstack: Netstack,
935 ) -> Self::StartHermeticNetworkRealmResponseFut {
936 fn _decode(
937 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
938 ) -> Result<ControllerStartHermeticNetworkRealmResult, fidl::Error> {
939 let _response = fidl::client::decode_transaction_body::<
940 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
941 fidl::encoding::DefaultFuchsiaResourceDialect,
942 0x58c1fa7335d4c5c2,
943 >(_buf?)?;
944 Ok(_response.map(|x| x))
945 }
946 self.client.send_query_and_decode::<
947 ControllerStartHermeticNetworkRealmRequest,
948 ControllerStartHermeticNetworkRealmResult,
949 >(
950 (netstack,),
951 0x58c1fa7335d4c5c2,
952 fidl::encoding::DynamicFlags::empty(),
953 _decode,
954 )
955 }
956
957 type StopHermeticNetworkRealmResponseFut = fidl::client::QueryResponseFut<
958 ControllerStopHermeticNetworkRealmResult,
959 fidl::encoding::DefaultFuchsiaResourceDialect,
960 >;
961 fn r#stop_hermetic_network_realm(&self) -> Self::StopHermeticNetworkRealmResponseFut {
962 fn _decode(
963 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
964 ) -> Result<ControllerStopHermeticNetworkRealmResult, fidl::Error> {
965 let _response = fidl::client::decode_transaction_body::<
966 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
967 fidl::encoding::DefaultFuchsiaResourceDialect,
968 0x49d3c2501cd2f635,
969 >(_buf?)?;
970 Ok(_response.map(|x| x))
971 }
972 self.client.send_query_and_decode::<
973 fidl::encoding::EmptyPayload,
974 ControllerStopHermeticNetworkRealmResult,
975 >(
976 (),
977 0x49d3c2501cd2f635,
978 fidl::encoding::DynamicFlags::empty(),
979 _decode,
980 )
981 }
982
983 type AddInterfaceResponseFut = fidl::client::QueryResponseFut<
984 ControllerAddInterfaceResult,
985 fidl::encoding::DefaultFuchsiaResourceDialect,
986 >;
987 fn r#add_interface(
988 &self,
989 mut mac_address: &fidl_fuchsia_net::MacAddress,
990 mut name: &str,
991 mut wait_any_ip_address: bool,
992 ) -> Self::AddInterfaceResponseFut {
993 fn _decode(
994 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
995 ) -> Result<ControllerAddInterfaceResult, fidl::Error> {
996 let _response = fidl::client::decode_transaction_body::<
997 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
998 fidl::encoding::DefaultFuchsiaResourceDialect,
999 0x668ded2d2b619c15,
1000 >(_buf?)?;
1001 Ok(_response.map(|x| x))
1002 }
1003 self.client
1004 .send_query_and_decode::<ControllerAddInterfaceRequest, ControllerAddInterfaceResult>(
1005 (mac_address, name, wait_any_ip_address),
1006 0x668ded2d2b619c15,
1007 fidl::encoding::DynamicFlags::empty(),
1008 _decode,
1009 )
1010 }
1011
1012 type StartStubResponseFut = fidl::client::QueryResponseFut<
1013 ControllerStartStubResult,
1014 fidl::encoding::DefaultFuchsiaResourceDialect,
1015 >;
1016 fn r#start_stub(&self, mut component_url: &str) -> Self::StartStubResponseFut {
1017 fn _decode(
1018 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1019 ) -> Result<ControllerStartStubResult, fidl::Error> {
1020 let _response = fidl::client::decode_transaction_body::<
1021 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1022 fidl::encoding::DefaultFuchsiaResourceDialect,
1023 0x6523a401f22bf664,
1024 >(_buf?)?;
1025 Ok(_response.map(|x| x))
1026 }
1027 self.client.send_query_and_decode::<ControllerStartStubRequest, ControllerStartStubResult>(
1028 (component_url,),
1029 0x6523a401f22bf664,
1030 fidl::encoding::DynamicFlags::empty(),
1031 _decode,
1032 )
1033 }
1034
1035 type StopStubResponseFut = fidl::client::QueryResponseFut<
1036 ControllerStopStubResult,
1037 fidl::encoding::DefaultFuchsiaResourceDialect,
1038 >;
1039 fn r#stop_stub(&self) -> Self::StopStubResponseFut {
1040 fn _decode(
1041 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1042 ) -> Result<ControllerStopStubResult, fidl::Error> {
1043 let _response = fidl::client::decode_transaction_body::<
1044 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1045 fidl::encoding::DefaultFuchsiaResourceDialect,
1046 0x582c32b564ff4bb4,
1047 >(_buf?)?;
1048 Ok(_response.map(|x| x))
1049 }
1050 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerStopStubResult>(
1051 (),
1052 0x582c32b564ff4bb4,
1053 fidl::encoding::DynamicFlags::empty(),
1054 _decode,
1055 )
1056 }
1057
1058 type PingResponseFut = fidl::client::QueryResponseFut<
1059 ControllerPingResult,
1060 fidl::encoding::DefaultFuchsiaResourceDialect,
1061 >;
1062 fn r#ping(
1063 &self,
1064 mut target: &fidl_fuchsia_net::IpAddress,
1065 mut payload_length: u16,
1066 mut interface_name: Option<&str>,
1067 mut timeout: i64,
1068 ) -> Self::PingResponseFut {
1069 fn _decode(
1070 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1071 ) -> Result<ControllerPingResult, fidl::Error> {
1072 let _response = fidl::client::decode_transaction_body::<
1073 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1074 fidl::encoding::DefaultFuchsiaResourceDialect,
1075 0x60c9b6cf952fa4d1,
1076 >(_buf?)?;
1077 Ok(_response.map(|x| x))
1078 }
1079 self.client.send_query_and_decode::<ControllerPingRequest, ControllerPingResult>(
1080 (target, payload_length, interface_name, timeout),
1081 0x60c9b6cf952fa4d1,
1082 fidl::encoding::DynamicFlags::empty(),
1083 _decode,
1084 )
1085 }
1086
1087 type PollUdpResponseFut = fidl::client::QueryResponseFut<
1088 ControllerPollUdpResult,
1089 fidl::encoding::DefaultFuchsiaResourceDialect,
1090 >;
1091 fn r#poll_udp(
1092 &self,
1093 mut target: &fidl_fuchsia_net::SocketAddress,
1094 mut payload: &[u8],
1095 mut timeout: i64,
1096 mut num_retries: u16,
1097 ) -> Self::PollUdpResponseFut {
1098 fn _decode(
1099 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1100 ) -> Result<ControllerPollUdpResult, fidl::Error> {
1101 let _response = fidl::client::decode_transaction_body::<
1102 fidl::encoding::ResultType<ControllerPollUdpResponse, Error>,
1103 fidl::encoding::DefaultFuchsiaResourceDialect,
1104 0x333fb354db30f664,
1105 >(_buf?)?;
1106 Ok(_response.map(|x| x.payload))
1107 }
1108 self.client.send_query_and_decode::<ControllerPollUdpRequest, ControllerPollUdpResult>(
1109 (target, payload, timeout, num_retries),
1110 0x333fb354db30f664,
1111 fidl::encoding::DynamicFlags::empty(),
1112 _decode,
1113 )
1114 }
1115
1116 type JoinMulticastGroupResponseFut = fidl::client::QueryResponseFut<
1117 ControllerJoinMulticastGroupResult,
1118 fidl::encoding::DefaultFuchsiaResourceDialect,
1119 >;
1120 fn r#join_multicast_group(
1121 &self,
1122 mut address: &fidl_fuchsia_net::IpAddress,
1123 mut interface_id: u64,
1124 ) -> Self::JoinMulticastGroupResponseFut {
1125 fn _decode(
1126 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1127 ) -> Result<ControllerJoinMulticastGroupResult, fidl::Error> {
1128 let _response = fidl::client::decode_transaction_body::<
1129 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1130 fidl::encoding::DefaultFuchsiaResourceDialect,
1131 0xbdbb4095640a3f4,
1132 >(_buf?)?;
1133 Ok(_response.map(|x| x))
1134 }
1135 self.client.send_query_and_decode::<
1136 ControllerJoinMulticastGroupRequest,
1137 ControllerJoinMulticastGroupResult,
1138 >(
1139 (address, interface_id,),
1140 0xbdbb4095640a3f4,
1141 fidl::encoding::DynamicFlags::empty(),
1142 _decode,
1143 )
1144 }
1145
1146 type LeaveMulticastGroupResponseFut = fidl::client::QueryResponseFut<
1147 ControllerLeaveMulticastGroupResult,
1148 fidl::encoding::DefaultFuchsiaResourceDialect,
1149 >;
1150 fn r#leave_multicast_group(
1151 &self,
1152 mut address: &fidl_fuchsia_net::IpAddress,
1153 mut interface_id: u64,
1154 ) -> Self::LeaveMulticastGroupResponseFut {
1155 fn _decode(
1156 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1157 ) -> Result<ControllerLeaveMulticastGroupResult, fidl::Error> {
1158 let _response = fidl::client::decode_transaction_body::<
1159 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1160 fidl::encoding::DefaultFuchsiaResourceDialect,
1161 0x32ecf4e40124a29a,
1162 >(_buf?)?;
1163 Ok(_response.map(|x| x))
1164 }
1165 self.client.send_query_and_decode::<
1166 ControllerLeaveMulticastGroupRequest,
1167 ControllerLeaveMulticastGroupResult,
1168 >(
1169 (address, interface_id,),
1170 0x32ecf4e40124a29a,
1171 fidl::encoding::DynamicFlags::empty(),
1172 _decode,
1173 )
1174 }
1175
1176 type StartDhcpv6ClientResponseFut = fidl::client::QueryResponseFut<
1177 ControllerStartDhcpv6ClientResult,
1178 fidl::encoding::DefaultFuchsiaResourceDialect,
1179 >;
1180 fn r#start_dhcpv6_client(
1181 &self,
1182 mut params: &fidl_fuchsia_net_dhcpv6::NewClientParams,
1183 ) -> Self::StartDhcpv6ClientResponseFut {
1184 fn _decode(
1185 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1186 ) -> Result<ControllerStartDhcpv6ClientResult, fidl::Error> {
1187 let _response = fidl::client::decode_transaction_body::<
1188 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1189 fidl::encoding::DefaultFuchsiaResourceDialect,
1190 0x756c9b70864b7744,
1191 >(_buf?)?;
1192 Ok(_response.map(|x| x))
1193 }
1194 self.client.send_query_and_decode::<
1195 ControllerStartDhcpv6ClientRequest,
1196 ControllerStartDhcpv6ClientResult,
1197 >(
1198 (params,),
1199 0x756c9b70864b7744,
1200 fidl::encoding::DynamicFlags::empty(),
1201 _decode,
1202 )
1203 }
1204
1205 type StopDhcpv6ClientResponseFut = fidl::client::QueryResponseFut<
1206 ControllerStopDhcpv6ClientResult,
1207 fidl::encoding::DefaultFuchsiaResourceDialect,
1208 >;
1209 fn r#stop_dhcpv6_client(&self) -> Self::StopDhcpv6ClientResponseFut {
1210 fn _decode(
1211 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1212 ) -> Result<ControllerStopDhcpv6ClientResult, fidl::Error> {
1213 let _response = fidl::client::decode_transaction_body::<
1214 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1215 fidl::encoding::DefaultFuchsiaResourceDialect,
1216 0x16e93478e663d523,
1217 >(_buf?)?;
1218 Ok(_response.map(|x| x))
1219 }
1220 self.client.send_query_and_decode::<
1221 fidl::encoding::EmptyPayload,
1222 ControllerStopDhcpv6ClientResult,
1223 >(
1224 (),
1225 0x16e93478e663d523,
1226 fidl::encoding::DynamicFlags::empty(),
1227 _decode,
1228 )
1229 }
1230
1231 type StartOutOfStackDhcpv4ClientResponseFut = fidl::client::QueryResponseFut<
1232 ControllerStartOutOfStackDhcpv4ClientResult,
1233 fidl::encoding::DefaultFuchsiaResourceDialect,
1234 >;
1235 fn r#start_out_of_stack_dhcpv4_client(
1236 &self,
1237 mut payload: &ControllerStartOutOfStackDhcpv4ClientRequest,
1238 ) -> Self::StartOutOfStackDhcpv4ClientResponseFut {
1239 fn _decode(
1240 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1241 ) -> Result<ControllerStartOutOfStackDhcpv4ClientResult, fidl::Error> {
1242 let _response = fidl::client::decode_transaction_body::<
1243 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1244 fidl::encoding::DefaultFuchsiaResourceDialect,
1245 0x37eeec41c0077625,
1246 >(_buf?)?;
1247 Ok(_response.map(|x| x))
1248 }
1249 self.client.send_query_and_decode::<
1250 ControllerStartOutOfStackDhcpv4ClientRequest,
1251 ControllerStartOutOfStackDhcpv4ClientResult,
1252 >(
1253 payload,
1254 0x37eeec41c0077625,
1255 fidl::encoding::DynamicFlags::empty(),
1256 _decode,
1257 )
1258 }
1259
1260 type StopOutOfStackDhcpv4ClientResponseFut = fidl::client::QueryResponseFut<
1261 ControllerStopOutOfStackDhcpv4ClientResult,
1262 fidl::encoding::DefaultFuchsiaResourceDialect,
1263 >;
1264 fn r#stop_out_of_stack_dhcpv4_client(
1265 &self,
1266 mut payload: &ControllerStopOutOfStackDhcpv4ClientRequest,
1267 ) -> Self::StopOutOfStackDhcpv4ClientResponseFut {
1268 fn _decode(
1269 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1270 ) -> Result<ControllerStopOutOfStackDhcpv4ClientResult, fidl::Error> {
1271 let _response = fidl::client::decode_transaction_body::<
1272 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1273 fidl::encoding::DefaultFuchsiaResourceDialect,
1274 0x5d47aa5213164364,
1275 >(_buf?)?;
1276 Ok(_response.map(|x| x))
1277 }
1278 self.client.send_query_and_decode::<
1279 ControllerStopOutOfStackDhcpv4ClientRequest,
1280 ControllerStopOutOfStackDhcpv4ClientResult,
1281 >(
1282 payload,
1283 0x5d47aa5213164364,
1284 fidl::encoding::DynamicFlags::empty(),
1285 _decode,
1286 )
1287 }
1288}
1289
1290pub struct ControllerEventStream {
1291 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1292}
1293
1294impl std::marker::Unpin for ControllerEventStream {}
1295
1296impl futures::stream::FusedStream for ControllerEventStream {
1297 fn is_terminated(&self) -> bool {
1298 self.event_receiver.is_terminated()
1299 }
1300}
1301
1302impl futures::Stream for ControllerEventStream {
1303 type Item = Result<ControllerEvent, fidl::Error>;
1304
1305 fn poll_next(
1306 mut self: std::pin::Pin<&mut Self>,
1307 cx: &mut std::task::Context<'_>,
1308 ) -> std::task::Poll<Option<Self::Item>> {
1309 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1310 &mut self.event_receiver,
1311 cx
1312 )?) {
1313 Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
1314 None => std::task::Poll::Ready(None),
1315 }
1316 }
1317}
1318
1319#[derive(Debug)]
1320pub enum ControllerEvent {}
1321
1322impl ControllerEvent {
1323 fn decode(
1325 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1326 ) -> Result<ControllerEvent, fidl::Error> {
1327 let (bytes, _handles) = buf.split_mut();
1328 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1329 debug_assert_eq!(tx_header.tx_id, 0);
1330 match tx_header.ordinal {
1331 _ => Err(fidl::Error::UnknownOrdinal {
1332 ordinal: tx_header.ordinal,
1333 protocol_name: <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1334 }),
1335 }
1336 }
1337}
1338
1339pub struct ControllerRequestStream {
1341 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1342 is_terminated: bool,
1343}
1344
1345impl std::marker::Unpin for ControllerRequestStream {}
1346
1347impl futures::stream::FusedStream for ControllerRequestStream {
1348 fn is_terminated(&self) -> bool {
1349 self.is_terminated
1350 }
1351}
1352
1353impl fidl::endpoints::RequestStream for ControllerRequestStream {
1354 type Protocol = ControllerMarker;
1355 type ControlHandle = ControllerControlHandle;
1356
1357 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1358 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1359 }
1360
1361 fn control_handle(&self) -> Self::ControlHandle {
1362 ControllerControlHandle { inner: self.inner.clone() }
1363 }
1364
1365 fn into_inner(
1366 self,
1367 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1368 {
1369 (self.inner, self.is_terminated)
1370 }
1371
1372 fn from_inner(
1373 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1374 is_terminated: bool,
1375 ) -> Self {
1376 Self { inner, is_terminated }
1377 }
1378}
1379
1380impl futures::Stream for ControllerRequestStream {
1381 type Item = Result<ControllerRequest, fidl::Error>;
1382
1383 fn poll_next(
1384 mut self: std::pin::Pin<&mut Self>,
1385 cx: &mut std::task::Context<'_>,
1386 ) -> std::task::Poll<Option<Self::Item>> {
1387 let this = &mut *self;
1388 if this.inner.check_shutdown(cx) {
1389 this.is_terminated = true;
1390 return std::task::Poll::Ready(None);
1391 }
1392 if this.is_terminated {
1393 panic!("polled ControllerRequestStream after completion");
1394 }
1395 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1396 |bytes, handles| {
1397 match this.inner.channel().read_etc(cx, bytes, handles) {
1398 std::task::Poll::Ready(Ok(())) => {}
1399 std::task::Poll::Pending => return std::task::Poll::Pending,
1400 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1401 this.is_terminated = true;
1402 return std::task::Poll::Ready(None);
1403 }
1404 std::task::Poll::Ready(Err(e)) => {
1405 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1406 e.into(),
1407 ))));
1408 }
1409 }
1410
1411 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1413
1414 std::task::Poll::Ready(Some(match header.ordinal {
1415 0x58c1fa7335d4c5c2 => {
1416 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1417 let mut req = fidl::new_empty!(
1418 ControllerStartHermeticNetworkRealmRequest,
1419 fidl::encoding::DefaultFuchsiaResourceDialect
1420 );
1421 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStartHermeticNetworkRealmRequest>(&header, _body_bytes, handles, &mut req)?;
1422 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1423 Ok(ControllerRequest::StartHermeticNetworkRealm {
1424 netstack: req.netstack,
1425
1426 responder: ControllerStartHermeticNetworkRealmResponder {
1427 control_handle: std::mem::ManuallyDrop::new(control_handle),
1428 tx_id: header.tx_id,
1429 },
1430 })
1431 }
1432 0x49d3c2501cd2f635 => {
1433 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1434 let mut req = fidl::new_empty!(
1435 fidl::encoding::EmptyPayload,
1436 fidl::encoding::DefaultFuchsiaResourceDialect
1437 );
1438 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1439 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1440 Ok(ControllerRequest::StopHermeticNetworkRealm {
1441 responder: ControllerStopHermeticNetworkRealmResponder {
1442 control_handle: std::mem::ManuallyDrop::new(control_handle),
1443 tx_id: header.tx_id,
1444 },
1445 })
1446 }
1447 0x668ded2d2b619c15 => {
1448 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1449 let mut req = fidl::new_empty!(
1450 ControllerAddInterfaceRequest,
1451 fidl::encoding::DefaultFuchsiaResourceDialect
1452 );
1453 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerAddInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1454 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1455 Ok(ControllerRequest::AddInterface {
1456 mac_address: req.mac_address,
1457 name: req.name,
1458 wait_any_ip_address: req.wait_any_ip_address,
1459
1460 responder: ControllerAddInterfaceResponder {
1461 control_handle: std::mem::ManuallyDrop::new(control_handle),
1462 tx_id: header.tx_id,
1463 },
1464 })
1465 }
1466 0x6523a401f22bf664 => {
1467 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1468 let mut req = fidl::new_empty!(
1469 ControllerStartStubRequest,
1470 fidl::encoding::DefaultFuchsiaResourceDialect
1471 );
1472 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStartStubRequest>(&header, _body_bytes, handles, &mut req)?;
1473 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1474 Ok(ControllerRequest::StartStub {
1475 component_url: req.component_url,
1476
1477 responder: ControllerStartStubResponder {
1478 control_handle: std::mem::ManuallyDrop::new(control_handle),
1479 tx_id: header.tx_id,
1480 },
1481 })
1482 }
1483 0x582c32b564ff4bb4 => {
1484 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1485 let mut req = fidl::new_empty!(
1486 fidl::encoding::EmptyPayload,
1487 fidl::encoding::DefaultFuchsiaResourceDialect
1488 );
1489 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1490 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1491 Ok(ControllerRequest::StopStub {
1492 responder: ControllerStopStubResponder {
1493 control_handle: std::mem::ManuallyDrop::new(control_handle),
1494 tx_id: header.tx_id,
1495 },
1496 })
1497 }
1498 0x60c9b6cf952fa4d1 => {
1499 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1500 let mut req = fidl::new_empty!(
1501 ControllerPingRequest,
1502 fidl::encoding::DefaultFuchsiaResourceDialect
1503 );
1504 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerPingRequest>(&header, _body_bytes, handles, &mut req)?;
1505 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1506 Ok(ControllerRequest::Ping {
1507 target: req.target,
1508 payload_length: req.payload_length,
1509 interface_name: req.interface_name,
1510 timeout: req.timeout,
1511
1512 responder: ControllerPingResponder {
1513 control_handle: std::mem::ManuallyDrop::new(control_handle),
1514 tx_id: header.tx_id,
1515 },
1516 })
1517 }
1518 0x333fb354db30f664 => {
1519 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1520 let mut req = fidl::new_empty!(
1521 ControllerPollUdpRequest,
1522 fidl::encoding::DefaultFuchsiaResourceDialect
1523 );
1524 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerPollUdpRequest>(&header, _body_bytes, handles, &mut req)?;
1525 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1526 Ok(ControllerRequest::PollUdp {
1527 target: req.target,
1528 payload: req.payload,
1529 timeout: req.timeout,
1530 num_retries: req.num_retries,
1531
1532 responder: ControllerPollUdpResponder {
1533 control_handle: std::mem::ManuallyDrop::new(control_handle),
1534 tx_id: header.tx_id,
1535 },
1536 })
1537 }
1538 0xbdbb4095640a3f4 => {
1539 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1540 let mut req = fidl::new_empty!(
1541 ControllerJoinMulticastGroupRequest,
1542 fidl::encoding::DefaultFuchsiaResourceDialect
1543 );
1544 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerJoinMulticastGroupRequest>(&header, _body_bytes, handles, &mut req)?;
1545 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1546 Ok(ControllerRequest::JoinMulticastGroup {
1547 address: req.address,
1548 interface_id: req.interface_id,
1549
1550 responder: ControllerJoinMulticastGroupResponder {
1551 control_handle: std::mem::ManuallyDrop::new(control_handle),
1552 tx_id: header.tx_id,
1553 },
1554 })
1555 }
1556 0x32ecf4e40124a29a => {
1557 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1558 let mut req = fidl::new_empty!(
1559 ControllerLeaveMulticastGroupRequest,
1560 fidl::encoding::DefaultFuchsiaResourceDialect
1561 );
1562 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerLeaveMulticastGroupRequest>(&header, _body_bytes, handles, &mut req)?;
1563 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1564 Ok(ControllerRequest::LeaveMulticastGroup {
1565 address: req.address,
1566 interface_id: req.interface_id,
1567
1568 responder: ControllerLeaveMulticastGroupResponder {
1569 control_handle: std::mem::ManuallyDrop::new(control_handle),
1570 tx_id: header.tx_id,
1571 },
1572 })
1573 }
1574 0x756c9b70864b7744 => {
1575 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1576 let mut req = fidl::new_empty!(
1577 ControllerStartDhcpv6ClientRequest,
1578 fidl::encoding::DefaultFuchsiaResourceDialect
1579 );
1580 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStartDhcpv6ClientRequest>(&header, _body_bytes, handles, &mut req)?;
1581 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1582 Ok(ControllerRequest::StartDhcpv6Client {
1583 params: req.params,
1584
1585 responder: ControllerStartDhcpv6ClientResponder {
1586 control_handle: std::mem::ManuallyDrop::new(control_handle),
1587 tx_id: header.tx_id,
1588 },
1589 })
1590 }
1591 0x16e93478e663d523 => {
1592 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1593 let mut req = fidl::new_empty!(
1594 fidl::encoding::EmptyPayload,
1595 fidl::encoding::DefaultFuchsiaResourceDialect
1596 );
1597 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1598 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1599 Ok(ControllerRequest::StopDhcpv6Client {
1600 responder: ControllerStopDhcpv6ClientResponder {
1601 control_handle: std::mem::ManuallyDrop::new(control_handle),
1602 tx_id: header.tx_id,
1603 },
1604 })
1605 }
1606 0x37eeec41c0077625 => {
1607 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1608 let mut req = fidl::new_empty!(
1609 ControllerStartOutOfStackDhcpv4ClientRequest,
1610 fidl::encoding::DefaultFuchsiaResourceDialect
1611 );
1612 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStartOutOfStackDhcpv4ClientRequest>(&header, _body_bytes, handles, &mut req)?;
1613 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1614 Ok(ControllerRequest::StartOutOfStackDhcpv4Client {
1615 payload: req,
1616 responder: ControllerStartOutOfStackDhcpv4ClientResponder {
1617 control_handle: std::mem::ManuallyDrop::new(control_handle),
1618 tx_id: header.tx_id,
1619 },
1620 })
1621 }
1622 0x5d47aa5213164364 => {
1623 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1624 let mut req = fidl::new_empty!(
1625 ControllerStopOutOfStackDhcpv4ClientRequest,
1626 fidl::encoding::DefaultFuchsiaResourceDialect
1627 );
1628 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStopOutOfStackDhcpv4ClientRequest>(&header, _body_bytes, handles, &mut req)?;
1629 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1630 Ok(ControllerRequest::StopOutOfStackDhcpv4Client {
1631 payload: req,
1632 responder: ControllerStopOutOfStackDhcpv4ClientResponder {
1633 control_handle: std::mem::ManuallyDrop::new(control_handle),
1634 tx_id: header.tx_id,
1635 },
1636 })
1637 }
1638 _ => Err(fidl::Error::UnknownOrdinal {
1639 ordinal: header.ordinal,
1640 protocol_name:
1641 <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1642 }),
1643 }))
1644 },
1645 )
1646 }
1647}
1648
1649#[derive(Debug)]
1660pub enum ControllerRequest {
1661 StartHermeticNetworkRealm {
1677 netstack: Netstack,
1678 responder: ControllerStartHermeticNetworkRealmResponder,
1679 },
1680 StopHermeticNetworkRealm { responder: ControllerStopHermeticNetworkRealmResponder },
1693 AddInterface {
1714 mac_address: fidl_fuchsia_net::MacAddress,
1715 name: String,
1716 wait_any_ip_address: bool,
1717 responder: ControllerAddInterfaceResponder,
1718 },
1719 StartStub { component_url: String, responder: ControllerStartStubResponder },
1733 StopStub { responder: ControllerStopStubResponder },
1744 Ping {
1769 target: fidl_fuchsia_net::IpAddress,
1770 payload_length: u16,
1771 interface_name: Option<String>,
1772 timeout: i64,
1773 responder: ControllerPingResponder,
1774 },
1775 PollUdp {
1794 target: fidl_fuchsia_net::SocketAddress,
1795 payload: Vec<u8>,
1796 timeout: i64,
1797 num_retries: u16,
1798 responder: ControllerPollUdpResponder,
1799 },
1800 JoinMulticastGroup {
1817 address: fidl_fuchsia_net::IpAddress,
1818 interface_id: u64,
1819 responder: ControllerJoinMulticastGroupResponder,
1820 },
1821 LeaveMulticastGroup {
1837 address: fidl_fuchsia_net::IpAddress,
1838 interface_id: u64,
1839 responder: ControllerLeaveMulticastGroupResponder,
1840 },
1841 StartDhcpv6Client {
1853 params: fidl_fuchsia_net_dhcpv6::NewClientParams,
1854 responder: ControllerStartDhcpv6ClientResponder,
1855 },
1856 StopDhcpv6Client { responder: ControllerStopDhcpv6ClientResponder },
1860 StartOutOfStackDhcpv4Client {
1865 payload: ControllerStartOutOfStackDhcpv4ClientRequest,
1866 responder: ControllerStartOutOfStackDhcpv4ClientResponder,
1867 },
1868 StopOutOfStackDhcpv4Client {
1876 payload: ControllerStopOutOfStackDhcpv4ClientRequest,
1877 responder: ControllerStopOutOfStackDhcpv4ClientResponder,
1878 },
1879}
1880
1881impl ControllerRequest {
1882 #[allow(irrefutable_let_patterns)]
1883 pub fn into_start_hermetic_network_realm(
1884 self,
1885 ) -> Option<(Netstack, ControllerStartHermeticNetworkRealmResponder)> {
1886 if let ControllerRequest::StartHermeticNetworkRealm { netstack, responder } = self {
1887 Some((netstack, responder))
1888 } else {
1889 None
1890 }
1891 }
1892
1893 #[allow(irrefutable_let_patterns)]
1894 pub fn into_stop_hermetic_network_realm(
1895 self,
1896 ) -> Option<(ControllerStopHermeticNetworkRealmResponder)> {
1897 if let ControllerRequest::StopHermeticNetworkRealm { responder } = self {
1898 Some((responder))
1899 } else {
1900 None
1901 }
1902 }
1903
1904 #[allow(irrefutable_let_patterns)]
1905 pub fn into_add_interface(
1906 self,
1907 ) -> Option<(fidl_fuchsia_net::MacAddress, String, bool, ControllerAddInterfaceResponder)> {
1908 if let ControllerRequest::AddInterface {
1909 mac_address,
1910 name,
1911 wait_any_ip_address,
1912 responder,
1913 } = self
1914 {
1915 Some((mac_address, name, wait_any_ip_address, responder))
1916 } else {
1917 None
1918 }
1919 }
1920
1921 #[allow(irrefutable_let_patterns)]
1922 pub fn into_start_stub(self) -> Option<(String, ControllerStartStubResponder)> {
1923 if let ControllerRequest::StartStub { component_url, responder } = self {
1924 Some((component_url, responder))
1925 } else {
1926 None
1927 }
1928 }
1929
1930 #[allow(irrefutable_let_patterns)]
1931 pub fn into_stop_stub(self) -> Option<(ControllerStopStubResponder)> {
1932 if let ControllerRequest::StopStub { responder } = self { Some((responder)) } else { None }
1933 }
1934
1935 #[allow(irrefutable_let_patterns)]
1936 pub fn into_ping(
1937 self,
1938 ) -> Option<(fidl_fuchsia_net::IpAddress, u16, Option<String>, i64, ControllerPingResponder)>
1939 {
1940 if let ControllerRequest::Ping {
1941 target,
1942 payload_length,
1943 interface_name,
1944 timeout,
1945 responder,
1946 } = self
1947 {
1948 Some((target, payload_length, interface_name, timeout, responder))
1949 } else {
1950 None
1951 }
1952 }
1953
1954 #[allow(irrefutable_let_patterns)]
1955 pub fn into_poll_udp(
1956 self,
1957 ) -> Option<(fidl_fuchsia_net::SocketAddress, Vec<u8>, i64, u16, ControllerPollUdpResponder)>
1958 {
1959 if let ControllerRequest::PollUdp { target, payload, timeout, num_retries, responder } =
1960 self
1961 {
1962 Some((target, payload, timeout, num_retries, responder))
1963 } else {
1964 None
1965 }
1966 }
1967
1968 #[allow(irrefutable_let_patterns)]
1969 pub fn into_join_multicast_group(
1970 self,
1971 ) -> Option<(fidl_fuchsia_net::IpAddress, u64, ControllerJoinMulticastGroupResponder)> {
1972 if let ControllerRequest::JoinMulticastGroup { address, interface_id, responder } = self {
1973 Some((address, interface_id, responder))
1974 } else {
1975 None
1976 }
1977 }
1978
1979 #[allow(irrefutable_let_patterns)]
1980 pub fn into_leave_multicast_group(
1981 self,
1982 ) -> Option<(fidl_fuchsia_net::IpAddress, u64, ControllerLeaveMulticastGroupResponder)> {
1983 if let ControllerRequest::LeaveMulticastGroup { address, interface_id, responder } = self {
1984 Some((address, interface_id, responder))
1985 } else {
1986 None
1987 }
1988 }
1989
1990 #[allow(irrefutable_let_patterns)]
1991 pub fn into_start_dhcpv6_client(
1992 self,
1993 ) -> Option<(fidl_fuchsia_net_dhcpv6::NewClientParams, ControllerStartDhcpv6ClientResponder)>
1994 {
1995 if let ControllerRequest::StartDhcpv6Client { params, responder } = self {
1996 Some((params, responder))
1997 } else {
1998 None
1999 }
2000 }
2001
2002 #[allow(irrefutable_let_patterns)]
2003 pub fn into_stop_dhcpv6_client(self) -> Option<(ControllerStopDhcpv6ClientResponder)> {
2004 if let ControllerRequest::StopDhcpv6Client { responder } = self {
2005 Some((responder))
2006 } else {
2007 None
2008 }
2009 }
2010
2011 #[allow(irrefutable_let_patterns)]
2012 pub fn into_start_out_of_stack_dhcpv4_client(
2013 self,
2014 ) -> Option<(
2015 ControllerStartOutOfStackDhcpv4ClientRequest,
2016 ControllerStartOutOfStackDhcpv4ClientResponder,
2017 )> {
2018 if let ControllerRequest::StartOutOfStackDhcpv4Client { payload, responder } = self {
2019 Some((payload, responder))
2020 } else {
2021 None
2022 }
2023 }
2024
2025 #[allow(irrefutable_let_patterns)]
2026 pub fn into_stop_out_of_stack_dhcpv4_client(
2027 self,
2028 ) -> Option<(
2029 ControllerStopOutOfStackDhcpv4ClientRequest,
2030 ControllerStopOutOfStackDhcpv4ClientResponder,
2031 )> {
2032 if let ControllerRequest::StopOutOfStackDhcpv4Client { payload, responder } = self {
2033 Some((payload, responder))
2034 } else {
2035 None
2036 }
2037 }
2038
2039 pub fn method_name(&self) -> &'static str {
2041 match *self {
2042 ControllerRequest::StartHermeticNetworkRealm { .. } => "start_hermetic_network_realm",
2043 ControllerRequest::StopHermeticNetworkRealm { .. } => "stop_hermetic_network_realm",
2044 ControllerRequest::AddInterface { .. } => "add_interface",
2045 ControllerRequest::StartStub { .. } => "start_stub",
2046 ControllerRequest::StopStub { .. } => "stop_stub",
2047 ControllerRequest::Ping { .. } => "ping",
2048 ControllerRequest::PollUdp { .. } => "poll_udp",
2049 ControllerRequest::JoinMulticastGroup { .. } => "join_multicast_group",
2050 ControllerRequest::LeaveMulticastGroup { .. } => "leave_multicast_group",
2051 ControllerRequest::StartDhcpv6Client { .. } => "start_dhcpv6_client",
2052 ControllerRequest::StopDhcpv6Client { .. } => "stop_dhcpv6_client",
2053 ControllerRequest::StartOutOfStackDhcpv4Client { .. } => {
2054 "start_out_of_stack_dhcpv4_client"
2055 }
2056 ControllerRequest::StopOutOfStackDhcpv4Client { .. } => {
2057 "stop_out_of_stack_dhcpv4_client"
2058 }
2059 }
2060 }
2061}
2062
2063#[derive(Debug, Clone)]
2064pub struct ControllerControlHandle {
2065 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2066}
2067
2068impl fidl::endpoints::ControlHandle for ControllerControlHandle {
2069 fn shutdown(&self) {
2070 self.inner.shutdown()
2071 }
2072
2073 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2074 self.inner.shutdown_with_epitaph(status)
2075 }
2076
2077 fn is_closed(&self) -> bool {
2078 self.inner.channel().is_closed()
2079 }
2080 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2081 self.inner.channel().on_closed()
2082 }
2083
2084 #[cfg(target_os = "fuchsia")]
2085 fn signal_peer(
2086 &self,
2087 clear_mask: zx::Signals,
2088 set_mask: zx::Signals,
2089 ) -> Result<(), zx_status::Status> {
2090 use fidl::Peered;
2091 self.inner.channel().signal_peer(clear_mask, set_mask)
2092 }
2093}
2094
2095impl ControllerControlHandle {}
2096
2097#[must_use = "FIDL methods require a response to be sent"]
2098#[derive(Debug)]
2099pub struct ControllerStartHermeticNetworkRealmResponder {
2100 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2101 tx_id: u32,
2102}
2103
2104impl std::ops::Drop for ControllerStartHermeticNetworkRealmResponder {
2108 fn drop(&mut self) {
2109 self.control_handle.shutdown();
2110 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2112 }
2113}
2114
2115impl fidl::endpoints::Responder for ControllerStartHermeticNetworkRealmResponder {
2116 type ControlHandle = ControllerControlHandle;
2117
2118 fn control_handle(&self) -> &ControllerControlHandle {
2119 &self.control_handle
2120 }
2121
2122 fn drop_without_shutdown(mut self) {
2123 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2125 std::mem::forget(self);
2127 }
2128}
2129
2130impl ControllerStartHermeticNetworkRealmResponder {
2131 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2135 let _result = self.send_raw(result);
2136 if _result.is_err() {
2137 self.control_handle.shutdown();
2138 }
2139 self.drop_without_shutdown();
2140 _result
2141 }
2142
2143 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2145 let _result = self.send_raw(result);
2146 self.drop_without_shutdown();
2147 _result
2148 }
2149
2150 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2151 self.control_handle
2152 .inner
2153 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2154 result,
2155 self.tx_id,
2156 0x58c1fa7335d4c5c2,
2157 fidl::encoding::DynamicFlags::empty(),
2158 )
2159 }
2160}
2161
2162#[must_use = "FIDL methods require a response to be sent"]
2163#[derive(Debug)]
2164pub struct ControllerStopHermeticNetworkRealmResponder {
2165 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2166 tx_id: u32,
2167}
2168
2169impl std::ops::Drop for ControllerStopHermeticNetworkRealmResponder {
2173 fn drop(&mut self) {
2174 self.control_handle.shutdown();
2175 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2177 }
2178}
2179
2180impl fidl::endpoints::Responder for ControllerStopHermeticNetworkRealmResponder {
2181 type ControlHandle = ControllerControlHandle;
2182
2183 fn control_handle(&self) -> &ControllerControlHandle {
2184 &self.control_handle
2185 }
2186
2187 fn drop_without_shutdown(mut self) {
2188 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2190 std::mem::forget(self);
2192 }
2193}
2194
2195impl ControllerStopHermeticNetworkRealmResponder {
2196 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2200 let _result = self.send_raw(result);
2201 if _result.is_err() {
2202 self.control_handle.shutdown();
2203 }
2204 self.drop_without_shutdown();
2205 _result
2206 }
2207
2208 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2210 let _result = self.send_raw(result);
2211 self.drop_without_shutdown();
2212 _result
2213 }
2214
2215 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2216 self.control_handle
2217 .inner
2218 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2219 result,
2220 self.tx_id,
2221 0x49d3c2501cd2f635,
2222 fidl::encoding::DynamicFlags::empty(),
2223 )
2224 }
2225}
2226
2227#[must_use = "FIDL methods require a response to be sent"]
2228#[derive(Debug)]
2229pub struct ControllerAddInterfaceResponder {
2230 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2231 tx_id: u32,
2232}
2233
2234impl std::ops::Drop for ControllerAddInterfaceResponder {
2238 fn drop(&mut self) {
2239 self.control_handle.shutdown();
2240 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2242 }
2243}
2244
2245impl fidl::endpoints::Responder for ControllerAddInterfaceResponder {
2246 type ControlHandle = ControllerControlHandle;
2247
2248 fn control_handle(&self) -> &ControllerControlHandle {
2249 &self.control_handle
2250 }
2251
2252 fn drop_without_shutdown(mut self) {
2253 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2255 std::mem::forget(self);
2257 }
2258}
2259
2260impl ControllerAddInterfaceResponder {
2261 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2265 let _result = self.send_raw(result);
2266 if _result.is_err() {
2267 self.control_handle.shutdown();
2268 }
2269 self.drop_without_shutdown();
2270 _result
2271 }
2272
2273 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2275 let _result = self.send_raw(result);
2276 self.drop_without_shutdown();
2277 _result
2278 }
2279
2280 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2281 self.control_handle
2282 .inner
2283 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2284 result,
2285 self.tx_id,
2286 0x668ded2d2b619c15,
2287 fidl::encoding::DynamicFlags::empty(),
2288 )
2289 }
2290}
2291
2292#[must_use = "FIDL methods require a response to be sent"]
2293#[derive(Debug)]
2294pub struct ControllerStartStubResponder {
2295 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2296 tx_id: u32,
2297}
2298
2299impl std::ops::Drop for ControllerStartStubResponder {
2303 fn drop(&mut self) {
2304 self.control_handle.shutdown();
2305 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2307 }
2308}
2309
2310impl fidl::endpoints::Responder for ControllerStartStubResponder {
2311 type ControlHandle = ControllerControlHandle;
2312
2313 fn control_handle(&self) -> &ControllerControlHandle {
2314 &self.control_handle
2315 }
2316
2317 fn drop_without_shutdown(mut self) {
2318 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2320 std::mem::forget(self);
2322 }
2323}
2324
2325impl ControllerStartStubResponder {
2326 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2330 let _result = self.send_raw(result);
2331 if _result.is_err() {
2332 self.control_handle.shutdown();
2333 }
2334 self.drop_without_shutdown();
2335 _result
2336 }
2337
2338 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2340 let _result = self.send_raw(result);
2341 self.drop_without_shutdown();
2342 _result
2343 }
2344
2345 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2346 self.control_handle
2347 .inner
2348 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2349 result,
2350 self.tx_id,
2351 0x6523a401f22bf664,
2352 fidl::encoding::DynamicFlags::empty(),
2353 )
2354 }
2355}
2356
2357#[must_use = "FIDL methods require a response to be sent"]
2358#[derive(Debug)]
2359pub struct ControllerStopStubResponder {
2360 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2361 tx_id: u32,
2362}
2363
2364impl std::ops::Drop for ControllerStopStubResponder {
2368 fn drop(&mut self) {
2369 self.control_handle.shutdown();
2370 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2372 }
2373}
2374
2375impl fidl::endpoints::Responder for ControllerStopStubResponder {
2376 type ControlHandle = ControllerControlHandle;
2377
2378 fn control_handle(&self) -> &ControllerControlHandle {
2379 &self.control_handle
2380 }
2381
2382 fn drop_without_shutdown(mut self) {
2383 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2385 std::mem::forget(self);
2387 }
2388}
2389
2390impl ControllerStopStubResponder {
2391 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2395 let _result = self.send_raw(result);
2396 if _result.is_err() {
2397 self.control_handle.shutdown();
2398 }
2399 self.drop_without_shutdown();
2400 _result
2401 }
2402
2403 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2405 let _result = self.send_raw(result);
2406 self.drop_without_shutdown();
2407 _result
2408 }
2409
2410 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2411 self.control_handle
2412 .inner
2413 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2414 result,
2415 self.tx_id,
2416 0x582c32b564ff4bb4,
2417 fidl::encoding::DynamicFlags::empty(),
2418 )
2419 }
2420}
2421
2422#[must_use = "FIDL methods require a response to be sent"]
2423#[derive(Debug)]
2424pub struct ControllerPingResponder {
2425 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2426 tx_id: u32,
2427}
2428
2429impl std::ops::Drop for ControllerPingResponder {
2433 fn drop(&mut self) {
2434 self.control_handle.shutdown();
2435 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2437 }
2438}
2439
2440impl fidl::endpoints::Responder for ControllerPingResponder {
2441 type ControlHandle = ControllerControlHandle;
2442
2443 fn control_handle(&self) -> &ControllerControlHandle {
2444 &self.control_handle
2445 }
2446
2447 fn drop_without_shutdown(mut self) {
2448 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2450 std::mem::forget(self);
2452 }
2453}
2454
2455impl ControllerPingResponder {
2456 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2460 let _result = self.send_raw(result);
2461 if _result.is_err() {
2462 self.control_handle.shutdown();
2463 }
2464 self.drop_without_shutdown();
2465 _result
2466 }
2467
2468 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2470 let _result = self.send_raw(result);
2471 self.drop_without_shutdown();
2472 _result
2473 }
2474
2475 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2476 self.control_handle
2477 .inner
2478 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2479 result,
2480 self.tx_id,
2481 0x60c9b6cf952fa4d1,
2482 fidl::encoding::DynamicFlags::empty(),
2483 )
2484 }
2485}
2486
2487#[must_use = "FIDL methods require a response to be sent"]
2488#[derive(Debug)]
2489pub struct ControllerPollUdpResponder {
2490 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2491 tx_id: u32,
2492}
2493
2494impl std::ops::Drop for ControllerPollUdpResponder {
2498 fn drop(&mut self) {
2499 self.control_handle.shutdown();
2500 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2502 }
2503}
2504
2505impl fidl::endpoints::Responder for ControllerPollUdpResponder {
2506 type ControlHandle = ControllerControlHandle;
2507
2508 fn control_handle(&self) -> &ControllerControlHandle {
2509 &self.control_handle
2510 }
2511
2512 fn drop_without_shutdown(mut self) {
2513 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2515 std::mem::forget(self);
2517 }
2518}
2519
2520impl ControllerPollUdpResponder {
2521 pub fn send(self, mut result: Result<&[u8], Error>) -> Result<(), fidl::Error> {
2525 let _result = self.send_raw(result);
2526 if _result.is_err() {
2527 self.control_handle.shutdown();
2528 }
2529 self.drop_without_shutdown();
2530 _result
2531 }
2532
2533 pub fn send_no_shutdown_on_err(
2535 self,
2536 mut result: Result<&[u8], Error>,
2537 ) -> Result<(), fidl::Error> {
2538 let _result = self.send_raw(result);
2539 self.drop_without_shutdown();
2540 _result
2541 }
2542
2543 fn send_raw(&self, mut result: Result<&[u8], Error>) -> Result<(), fidl::Error> {
2544 self.control_handle
2545 .inner
2546 .send::<fidl::encoding::ResultType<ControllerPollUdpResponse, Error>>(
2547 result.map(|payload| (payload,)),
2548 self.tx_id,
2549 0x333fb354db30f664,
2550 fidl::encoding::DynamicFlags::empty(),
2551 )
2552 }
2553}
2554
2555#[must_use = "FIDL methods require a response to be sent"]
2556#[derive(Debug)]
2557pub struct ControllerJoinMulticastGroupResponder {
2558 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2559 tx_id: u32,
2560}
2561
2562impl std::ops::Drop for ControllerJoinMulticastGroupResponder {
2566 fn drop(&mut self) {
2567 self.control_handle.shutdown();
2568 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2570 }
2571}
2572
2573impl fidl::endpoints::Responder for ControllerJoinMulticastGroupResponder {
2574 type ControlHandle = ControllerControlHandle;
2575
2576 fn control_handle(&self) -> &ControllerControlHandle {
2577 &self.control_handle
2578 }
2579
2580 fn drop_without_shutdown(mut self) {
2581 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2583 std::mem::forget(self);
2585 }
2586}
2587
2588impl ControllerJoinMulticastGroupResponder {
2589 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2593 let _result = self.send_raw(result);
2594 if _result.is_err() {
2595 self.control_handle.shutdown();
2596 }
2597 self.drop_without_shutdown();
2598 _result
2599 }
2600
2601 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2603 let _result = self.send_raw(result);
2604 self.drop_without_shutdown();
2605 _result
2606 }
2607
2608 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2609 self.control_handle
2610 .inner
2611 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2612 result,
2613 self.tx_id,
2614 0xbdbb4095640a3f4,
2615 fidl::encoding::DynamicFlags::empty(),
2616 )
2617 }
2618}
2619
2620#[must_use = "FIDL methods require a response to be sent"]
2621#[derive(Debug)]
2622pub struct ControllerLeaveMulticastGroupResponder {
2623 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2624 tx_id: u32,
2625}
2626
2627impl std::ops::Drop for ControllerLeaveMulticastGroupResponder {
2631 fn drop(&mut self) {
2632 self.control_handle.shutdown();
2633 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2635 }
2636}
2637
2638impl fidl::endpoints::Responder for ControllerLeaveMulticastGroupResponder {
2639 type ControlHandle = ControllerControlHandle;
2640
2641 fn control_handle(&self) -> &ControllerControlHandle {
2642 &self.control_handle
2643 }
2644
2645 fn drop_without_shutdown(mut self) {
2646 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2648 std::mem::forget(self);
2650 }
2651}
2652
2653impl ControllerLeaveMulticastGroupResponder {
2654 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2658 let _result = self.send_raw(result);
2659 if _result.is_err() {
2660 self.control_handle.shutdown();
2661 }
2662 self.drop_without_shutdown();
2663 _result
2664 }
2665
2666 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2668 let _result = self.send_raw(result);
2669 self.drop_without_shutdown();
2670 _result
2671 }
2672
2673 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2674 self.control_handle
2675 .inner
2676 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2677 result,
2678 self.tx_id,
2679 0x32ecf4e40124a29a,
2680 fidl::encoding::DynamicFlags::empty(),
2681 )
2682 }
2683}
2684
2685#[must_use = "FIDL methods require a response to be sent"]
2686#[derive(Debug)]
2687pub struct ControllerStartDhcpv6ClientResponder {
2688 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2689 tx_id: u32,
2690}
2691
2692impl std::ops::Drop for ControllerStartDhcpv6ClientResponder {
2696 fn drop(&mut self) {
2697 self.control_handle.shutdown();
2698 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2700 }
2701}
2702
2703impl fidl::endpoints::Responder for ControllerStartDhcpv6ClientResponder {
2704 type ControlHandle = ControllerControlHandle;
2705
2706 fn control_handle(&self) -> &ControllerControlHandle {
2707 &self.control_handle
2708 }
2709
2710 fn drop_without_shutdown(mut self) {
2711 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2713 std::mem::forget(self);
2715 }
2716}
2717
2718impl ControllerStartDhcpv6ClientResponder {
2719 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2723 let _result = self.send_raw(result);
2724 if _result.is_err() {
2725 self.control_handle.shutdown();
2726 }
2727 self.drop_without_shutdown();
2728 _result
2729 }
2730
2731 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2733 let _result = self.send_raw(result);
2734 self.drop_without_shutdown();
2735 _result
2736 }
2737
2738 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2739 self.control_handle
2740 .inner
2741 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2742 result,
2743 self.tx_id,
2744 0x756c9b70864b7744,
2745 fidl::encoding::DynamicFlags::empty(),
2746 )
2747 }
2748}
2749
2750#[must_use = "FIDL methods require a response to be sent"]
2751#[derive(Debug)]
2752pub struct ControllerStopDhcpv6ClientResponder {
2753 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2754 tx_id: u32,
2755}
2756
2757impl std::ops::Drop for ControllerStopDhcpv6ClientResponder {
2761 fn drop(&mut self) {
2762 self.control_handle.shutdown();
2763 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2765 }
2766}
2767
2768impl fidl::endpoints::Responder for ControllerStopDhcpv6ClientResponder {
2769 type ControlHandle = ControllerControlHandle;
2770
2771 fn control_handle(&self) -> &ControllerControlHandle {
2772 &self.control_handle
2773 }
2774
2775 fn drop_without_shutdown(mut self) {
2776 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2778 std::mem::forget(self);
2780 }
2781}
2782
2783impl ControllerStopDhcpv6ClientResponder {
2784 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2788 let _result = self.send_raw(result);
2789 if _result.is_err() {
2790 self.control_handle.shutdown();
2791 }
2792 self.drop_without_shutdown();
2793 _result
2794 }
2795
2796 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2798 let _result = self.send_raw(result);
2799 self.drop_without_shutdown();
2800 _result
2801 }
2802
2803 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2804 self.control_handle
2805 .inner
2806 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2807 result,
2808 self.tx_id,
2809 0x16e93478e663d523,
2810 fidl::encoding::DynamicFlags::empty(),
2811 )
2812 }
2813}
2814
2815#[must_use = "FIDL methods require a response to be sent"]
2816#[derive(Debug)]
2817pub struct ControllerStartOutOfStackDhcpv4ClientResponder {
2818 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2819 tx_id: u32,
2820}
2821
2822impl std::ops::Drop for ControllerStartOutOfStackDhcpv4ClientResponder {
2826 fn drop(&mut self) {
2827 self.control_handle.shutdown();
2828 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2830 }
2831}
2832
2833impl fidl::endpoints::Responder for ControllerStartOutOfStackDhcpv4ClientResponder {
2834 type ControlHandle = ControllerControlHandle;
2835
2836 fn control_handle(&self) -> &ControllerControlHandle {
2837 &self.control_handle
2838 }
2839
2840 fn drop_without_shutdown(mut self) {
2841 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2843 std::mem::forget(self);
2845 }
2846}
2847
2848impl ControllerStartOutOfStackDhcpv4ClientResponder {
2849 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2853 let _result = self.send_raw(result);
2854 if _result.is_err() {
2855 self.control_handle.shutdown();
2856 }
2857 self.drop_without_shutdown();
2858 _result
2859 }
2860
2861 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2863 let _result = self.send_raw(result);
2864 self.drop_without_shutdown();
2865 _result
2866 }
2867
2868 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2869 self.control_handle
2870 .inner
2871 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2872 result,
2873 self.tx_id,
2874 0x37eeec41c0077625,
2875 fidl::encoding::DynamicFlags::empty(),
2876 )
2877 }
2878}
2879
2880#[must_use = "FIDL methods require a response to be sent"]
2881#[derive(Debug)]
2882pub struct ControllerStopOutOfStackDhcpv4ClientResponder {
2883 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2884 tx_id: u32,
2885}
2886
2887impl std::ops::Drop for ControllerStopOutOfStackDhcpv4ClientResponder {
2891 fn drop(&mut self) {
2892 self.control_handle.shutdown();
2893 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2895 }
2896}
2897
2898impl fidl::endpoints::Responder for ControllerStopOutOfStackDhcpv4ClientResponder {
2899 type ControlHandle = ControllerControlHandle;
2900
2901 fn control_handle(&self) -> &ControllerControlHandle {
2902 &self.control_handle
2903 }
2904
2905 fn drop_without_shutdown(mut self) {
2906 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2908 std::mem::forget(self);
2910 }
2911}
2912
2913impl ControllerStopOutOfStackDhcpv4ClientResponder {
2914 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2918 let _result = self.send_raw(result);
2919 if _result.is_err() {
2920 self.control_handle.shutdown();
2921 }
2922 self.drop_without_shutdown();
2923 _result
2924 }
2925
2926 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2928 let _result = self.send_raw(result);
2929 self.drop_without_shutdown();
2930 _result
2931 }
2932
2933 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2934 self.control_handle
2935 .inner
2936 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2937 result,
2938 self.tx_id,
2939 0x5d47aa5213164364,
2940 fidl::encoding::DynamicFlags::empty(),
2941 )
2942 }
2943}
2944
2945mod internal {
2946 use super::*;
2947}