1#![allow(unused_imports)]
5#![allow(deprecated)]
6#![allow(non_snake_case)]
7#![allow(non_camel_case_types)]
8#![allow(non_upper_case_globals)]
9#![allow(missing_docs)]
10#![allow(clippy::too_many_arguments)]
11#![allow(clippy::type_complexity)]
12#![allow(clippy::upper_case_acronyms)]
13#![allow(clippy::identity_op)]
14#![allow(clippy::missing_safety_doc)]
15#![allow(clippy::doc_lazy_continuation)]
16#![allow(rustdoc::broken_intra_doc_links)]
17#![allow(rustdoc::bare_urls)]
18#![allow(rustdoc::unportable_markdown)]
19#![allow(rustdoc::invalid_html_tags)]
20
21#[link(name = "NetworkExtension", kind = "framework")]
22extern "C" {}
23
24use core::ffi::*;
25use core::ptr::NonNull;
26#[cfg(feature = "dispatch2")]
27use dispatch2::*;
28use objc2::__framework_prelude::*;
29use objc2_foundation::*;
30#[cfg(feature = "objc2-security")]
31use objc2_security::*;
32
33use crate::*;
34
35#[repr(transparent)]
40#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
41pub struct NEAppProxyFlowError(pub NSInteger);
42impl NEAppProxyFlowError {
43 #[doc(alias = "NEAppProxyFlowErrorNotConnected")]
44 pub const NotConnected: Self = Self(1);
45 #[doc(alias = "NEAppProxyFlowErrorPeerReset")]
46 pub const PeerReset: Self = Self(2);
47 #[doc(alias = "NEAppProxyFlowErrorHostUnreachable")]
48 pub const HostUnreachable: Self = Self(3);
49 #[doc(alias = "NEAppProxyFlowErrorInvalidArgument")]
50 pub const InvalidArgument: Self = Self(4);
51 #[doc(alias = "NEAppProxyFlowErrorAborted")]
52 pub const Aborted: Self = Self(5);
53 #[doc(alias = "NEAppProxyFlowErrorRefused")]
54 pub const Refused: Self = Self(6);
55 #[doc(alias = "NEAppProxyFlowErrorTimedOut")]
56 pub const TimedOut: Self = Self(7);
57 #[doc(alias = "NEAppProxyFlowErrorInternal")]
58 pub const Internal: Self = Self(8);
59 #[doc(alias = "NEAppProxyFlowErrorDatagramTooLarge")]
60 pub const DatagramTooLarge: Self = Self(9);
61 #[doc(alias = "NEAppProxyFlowErrorReadAlreadyPending")]
62 pub const ReadAlreadyPending: Self = Self(10);
63}
64
65unsafe impl Encode for NEAppProxyFlowError {
66 const ENCODING: Encoding = NSInteger::ENCODING;
67}
68
69unsafe impl RefEncode for NEAppProxyFlowError {
70 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
71}
72
73extern "C" {
74 pub static NEAppProxyErrorDomain: &'static NSString;
76}
77
78extern_class!(
79 #[unsafe(super(NSObject))]
87 #[derive(Debug, PartialEq, Eq, Hash)]
88 pub struct NEAppProxyFlow;
89);
90
91extern_conformance!(
92 unsafe impl NSObjectProtocol for NEAppProxyFlow {}
93);
94
95impl NEAppProxyFlow {
96 extern_methods!(
97 #[cfg(feature = "block2")]
98 #[deprecated]
104 #[unsafe(method(openWithLocalEndpoint:completionHandler:))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn openWithLocalEndpoint_completionHandler(
107 &self,
108 local_endpoint: Option<&NWHostEndpoint>,
109 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
110 );
111
112 #[unsafe(method(closeReadWithError:))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn closeReadWithError(&self, error: Option<&NSError>);
118
119 #[unsafe(method(closeWriteWithError:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn closeWriteWithError(&self, error: Option<&NSError>);
125
126 #[unsafe(method(metaData))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn metaData(&self) -> Retained<NEFlowMetaData>;
130
131 #[unsafe(method(remoteHostname))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn remoteHostname(&self) -> Option<Retained<NSString>>;
136
137 #[unsafe(method(isBound))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn isBound(&self) -> bool;
141 );
142}
143
144impl NEAppProxyFlow {
146 extern_methods!(
147 #[unsafe(method(init))]
148 #[unsafe(method_family = init)]
149 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
150
151 #[unsafe(method(new))]
152 #[unsafe(method_family = new)]
153 pub unsafe fn new() -> Retained<Self>;
154 );
155}
156
157#[repr(transparent)]
162#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
163pub struct NEProviderStopReason(pub NSInteger);
164impl NEProviderStopReason {
165 #[doc(alias = "NEProviderStopReasonNone")]
166 pub const None: Self = Self(0);
167 #[doc(alias = "NEProviderStopReasonUserInitiated")]
168 pub const UserInitiated: Self = Self(1);
169 #[doc(alias = "NEProviderStopReasonProviderFailed")]
170 pub const ProviderFailed: Self = Self(2);
171 #[doc(alias = "NEProviderStopReasonNoNetworkAvailable")]
172 pub const NoNetworkAvailable: Self = Self(3);
173 #[doc(alias = "NEProviderStopReasonUnrecoverableNetworkChange")]
174 pub const UnrecoverableNetworkChange: Self = Self(4);
175 #[doc(alias = "NEProviderStopReasonProviderDisabled")]
176 pub const ProviderDisabled: Self = Self(5);
177 #[doc(alias = "NEProviderStopReasonAuthenticationCanceled")]
178 pub const AuthenticationCanceled: Self = Self(6);
179 #[doc(alias = "NEProviderStopReasonConfigurationFailed")]
180 pub const ConfigurationFailed: Self = Self(7);
181 #[doc(alias = "NEProviderStopReasonIdleTimeout")]
182 pub const IdleTimeout: Self = Self(8);
183 #[doc(alias = "NEProviderStopReasonConfigurationDisabled")]
184 pub const ConfigurationDisabled: Self = Self(9);
185 #[doc(alias = "NEProviderStopReasonConfigurationRemoved")]
186 pub const ConfigurationRemoved: Self = Self(10);
187 #[doc(alias = "NEProviderStopReasonSuperceded")]
188 pub const Superceded: Self = Self(11);
189 #[doc(alias = "NEProviderStopReasonUserLogout")]
190 pub const UserLogout: Self = Self(12);
191 #[doc(alias = "NEProviderStopReasonUserSwitch")]
192 pub const UserSwitch: Self = Self(13);
193 #[doc(alias = "NEProviderStopReasonConnectionFailed")]
194 pub const ConnectionFailed: Self = Self(14);
195 #[doc(alias = "NEProviderStopReasonSleep")]
196 pub const Sleep: Self = Self(15);
197 #[doc(alias = "NEProviderStopReasonAppUpdate")]
198 pub const AppUpdate: Self = Self(16);
199 #[doc(alias = "NEProviderStopReasonInternalError")]
200 pub const InternalError: Self = Self(17);
201}
202
203unsafe impl Encode for NEProviderStopReason {
204 const ENCODING: Encoding = NSInteger::ENCODING;
205}
206
207unsafe impl RefEncode for NEProviderStopReason {
208 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
209}
210
211extern_class!(
212 #[unsafe(super(NSObject))]
220 #[derive(Debug, PartialEq, Eq, Hash)]
221 pub struct NEProvider;
222);
223
224extern_conformance!(
225 unsafe impl NSObjectProtocol for NEProvider {}
226);
227
228impl NEProvider {
229 extern_methods!(
230 #[cfg(feature = "block2")]
231 #[unsafe(method(sleepWithCompletionHandler:))]
235 #[unsafe(method_family = none)]
236 pub unsafe fn sleepWithCompletionHandler(
237 &self,
238 completion_handler: &block2::DynBlock<dyn Fn()>,
239 );
240
241 #[unsafe(method(wake))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn wake(&self);
245
246 #[deprecated = "Use nw_connection_t in Network framework instead"]
258 #[unsafe(method(createTCPConnectionToEndpoint:enableTLS:TLSParameters:delegate:))]
259 #[unsafe(method_family = none)]
260 pub unsafe fn createTCPConnectionToEndpoint_enableTLS_TLSParameters_delegate(
261 &self,
262 remote_endpoint: &NWEndpoint,
263 enable_tls: bool,
264 tls_parameters: Option<&NWTLSParameters>,
265 delegate: Option<&AnyObject>,
266 ) -> Retained<NWTCPConnection>;
267
268 #[deprecated = "Use nw_connection_t in Network framework instead"]
276 #[unsafe(method(createUDPSessionToEndpoint:fromEndpoint:))]
277 #[unsafe(method_family = none)]
278 pub unsafe fn createUDPSessionToEndpoint_fromEndpoint(
279 &self,
280 remote_endpoint: &NWEndpoint,
281 local_endpoint: Option<&NWHostEndpoint>,
282 ) -> Retained<NWUDPSession>;
283
284 #[cfg(feature = "block2")]
285 #[deprecated]
291 #[unsafe(method(displayMessage:completionHandler:))]
292 #[unsafe(method_family = none)]
293 pub unsafe fn displayMessage_completionHandler(
294 &self,
295 message: &NSString,
296 completion_handler: &block2::DynBlock<dyn Fn(Bool)>,
297 );
298
299 #[unsafe(method(startSystemExtensionMode))]
345 #[unsafe(method_family = none)]
346 pub unsafe fn startSystemExtensionMode();
347
348 #[deprecated = "Use nw_path_monitor_t in Network framework instead"]
350 #[unsafe(method(defaultPath))]
351 #[unsafe(method_family = none)]
352 pub unsafe fn defaultPath(&self) -> Option<Retained<NWPath>>;
353 );
354}
355
356impl NEProvider {
358 extern_methods!(
359 #[unsafe(method(init))]
360 #[unsafe(method_family = init)]
361 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
362
363 #[unsafe(method(new))]
364 #[unsafe(method_family = new)]
365 pub unsafe fn new() -> Retained<Self>;
366 );
367}
368
369#[repr(transparent)]
374#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
375pub struct NETunnelProviderError(pub NSInteger);
376impl NETunnelProviderError {
377 #[doc(alias = "NETunnelProviderErrorNetworkSettingsInvalid")]
378 pub const NetworkSettingsInvalid: Self = Self(1);
379 #[doc(alias = "NETunnelProviderErrorNetworkSettingsCanceled")]
380 pub const NetworkSettingsCanceled: Self = Self(2);
381 #[doc(alias = "NETunnelProviderErrorNetworkSettingsFailed")]
382 pub const NetworkSettingsFailed: Self = Self(3);
383}
384
385unsafe impl Encode for NETunnelProviderError {
386 const ENCODING: Encoding = NSInteger::ENCODING;
387}
388
389unsafe impl RefEncode for NETunnelProviderError {
390 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
391}
392
393#[repr(transparent)]
398#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
399pub struct NETunnelProviderRoutingMethod(pub NSInteger);
400impl NETunnelProviderRoutingMethod {
401 #[doc(alias = "NETunnelProviderRoutingMethodDestinationIP")]
402 pub const DestinationIP: Self = Self(1);
403 #[doc(alias = "NETunnelProviderRoutingMethodSourceApplication")]
404 pub const SourceApplication: Self = Self(2);
405 #[doc(alias = "NETunnelProviderRoutingMethodNetworkRule")]
406 pub const NetworkRule: Self = Self(3);
407}
408
409unsafe impl Encode for NETunnelProviderRoutingMethod {
410 const ENCODING: Encoding = NSInteger::ENCODING;
411}
412
413unsafe impl RefEncode for NETunnelProviderRoutingMethod {
414 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
415}
416
417extern "C" {
418 pub static NETunnelProviderErrorDomain: &'static NSString;
420}
421
422extern_class!(
423 #[unsafe(super(NEProvider, NSObject))]
429 #[derive(Debug, PartialEq, Eq, Hash)]
430 pub struct NETunnelProvider;
431);
432
433extern_conformance!(
434 unsafe impl NSObjectProtocol for NETunnelProvider {}
435);
436
437impl NETunnelProvider {
438 extern_methods!(
439 #[cfg(feature = "block2")]
440 #[unsafe(method(handleAppMessage:completionHandler:))]
446 #[unsafe(method_family = none)]
447 pub unsafe fn handleAppMessage_completionHandler(
448 &self,
449 message_data: &NSData,
450 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSData)>>,
451 );
452
453 #[cfg(feature = "block2")]
454 #[unsafe(method(setTunnelNetworkSettings:completionHandler:))]
460 #[unsafe(method_family = none)]
461 pub unsafe fn setTunnelNetworkSettings_completionHandler(
462 &self,
463 tunnel_network_settings: Option<&NETunnelNetworkSettings>,
464 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
465 );
466
467 #[unsafe(method(protocolConfiguration))]
469 #[unsafe(method_family = none)]
470 pub unsafe fn protocolConfiguration(&self) -> Retained<NEVPNProtocol>;
471
472 #[unsafe(method(appRules))]
474 #[unsafe(method_family = none)]
475 pub unsafe fn appRules(&self) -> Option<Retained<NSArray<NEAppRule>>>;
476
477 #[unsafe(method(routingMethod))]
479 #[unsafe(method_family = none)]
480 pub unsafe fn routingMethod(&self) -> NETunnelProviderRoutingMethod;
481
482 #[unsafe(method(reasserting))]
484 #[unsafe(method_family = none)]
485 pub unsafe fn reasserting(&self) -> bool;
486
487 #[unsafe(method(setReasserting:))]
489 #[unsafe(method_family = none)]
490 pub unsafe fn setReasserting(&self, reasserting: bool);
491 );
492}
493
494impl NETunnelProvider {
496 extern_methods!(
497 #[unsafe(method(init))]
498 #[unsafe(method_family = init)]
499 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
500
501 #[unsafe(method(new))]
502 #[unsafe(method_family = new)]
503 pub unsafe fn new() -> Retained<Self>;
504 );
505}
506
507extern_class!(
508 #[unsafe(super(NETunnelProvider, NEProvider, NSObject))]
514 #[derive(Debug, PartialEq, Eq, Hash)]
515 pub struct NEAppProxyProvider;
516);
517
518extern_conformance!(
519 unsafe impl NSObjectProtocol for NEAppProxyProvider {}
520);
521
522impl NEAppProxyProvider {
523 extern_methods!(
524 #[cfg(feature = "block2")]
525 #[unsafe(method(startProxyWithOptions:completionHandler:))]
531 #[unsafe(method_family = none)]
532 pub unsafe fn startProxyWithOptions_completionHandler(
533 &self,
534 options: Option<&NSDictionary<NSString, AnyObject>>,
535 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
536 );
537
538 #[cfg(feature = "block2")]
539 #[unsafe(method(stopProxyWithReason:completionHandler:))]
545 #[unsafe(method_family = none)]
546 pub unsafe fn stopProxyWithReason_completionHandler(
547 &self,
548 reason: NEProviderStopReason,
549 completion_handler: &block2::DynBlock<dyn Fn()>,
550 );
551
552 #[unsafe(method(cancelProxyWithError:))]
556 #[unsafe(method_family = none)]
557 pub unsafe fn cancelProxyWithError(&self, error: Option<&NSError>);
558
559 #[unsafe(method(handleNewFlow:))]
565 #[unsafe(method_family = none)]
566 pub unsafe fn handleNewFlow(&self, flow: &NEAppProxyFlow) -> bool;
567
568 #[deprecated]
580 #[unsafe(method(handleNewUDPFlow:initialRemoteEndpoint:))]
581 #[unsafe(method_family = none)]
582 pub unsafe fn handleNewUDPFlow_initialRemoteEndpoint(
583 &self,
584 flow: &NEAppProxyUDPFlow,
585 remote_endpoint: &NWEndpoint,
586 ) -> bool;
587 );
588}
589
590impl NEAppProxyProvider {
592 extern_methods!(
593 #[unsafe(method(init))]
594 #[unsafe(method_family = init)]
595 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
596
597 #[unsafe(method(new))]
598 #[unsafe(method_family = new)]
599 pub unsafe fn new() -> Retained<Self>;
600 );
601}
602
603#[repr(transparent)]
608#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
609pub struct NEVPNError(pub NSInteger);
610impl NEVPNError {
611 #[doc(alias = "NEVPNErrorConfigurationInvalid")]
612 pub const ConfigurationInvalid: Self = Self(1);
613 #[doc(alias = "NEVPNErrorConfigurationDisabled")]
614 pub const ConfigurationDisabled: Self = Self(2);
615 #[doc(alias = "NEVPNErrorConnectionFailed")]
616 pub const ConnectionFailed: Self = Self(3);
617 #[doc(alias = "NEVPNErrorConfigurationStale")]
618 pub const ConfigurationStale: Self = Self(4);
619 #[doc(alias = "NEVPNErrorConfigurationReadWriteFailed")]
620 pub const ConfigurationReadWriteFailed: Self = Self(5);
621 #[doc(alias = "NEVPNErrorConfigurationUnknown")]
622 pub const ConfigurationUnknown: Self = Self(6);
623}
624
625unsafe impl Encode for NEVPNError {
626 const ENCODING: Encoding = NSInteger::ENCODING;
627}
628
629unsafe impl RefEncode for NEVPNError {
630 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
631}
632
633extern "C" {
634 pub static NEVPNErrorDomain: &'static NSString;
636}
637
638extern "C" {
639 pub static NEVPNConfigurationChangeNotification: &'static NSString;
641}
642
643extern_class!(
644 #[unsafe(super(NSObject))]
652 #[derive(Debug, PartialEq, Eq, Hash)]
653 pub struct NEVPNManager;
654);
655
656extern_conformance!(
657 unsafe impl NSObjectProtocol for NEVPNManager {}
658);
659
660impl NEVPNManager {
661 extern_methods!(
662 #[unsafe(method(sharedManager))]
664 #[unsafe(method_family = none)]
665 pub unsafe fn sharedManager() -> Retained<NEVPNManager>;
666
667 #[cfg(feature = "block2")]
668 #[unsafe(method(loadFromPreferencesWithCompletionHandler:))]
672 #[unsafe(method_family = none)]
673 pub unsafe fn loadFromPreferencesWithCompletionHandler(
674 &self,
675 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
676 );
677
678 #[cfg(feature = "block2")]
679 #[unsafe(method(removeFromPreferencesWithCompletionHandler:))]
683 #[unsafe(method_family = none)]
684 pub unsafe fn removeFromPreferencesWithCompletionHandler(
685 &self,
686 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
687 );
688
689 #[cfg(feature = "block2")]
690 #[unsafe(method(saveToPreferencesWithCompletionHandler:))]
695 #[unsafe(method_family = none)]
696 pub unsafe fn saveToPreferencesWithCompletionHandler(
697 &self,
698 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
699 );
700
701 #[cfg(feature = "objc2-security")]
702 #[unsafe(method(setAuthorization:))]
706 #[unsafe(method_family = none)]
707 pub unsafe fn setAuthorization(&self, authorization: AuthorizationRef);
708
709 #[unsafe(method(onDemandRules))]
711 #[unsafe(method_family = none)]
712 pub unsafe fn onDemandRules(&self) -> Option<Retained<NSArray<NEOnDemandRule>>>;
713
714 #[unsafe(method(setOnDemandRules:))]
716 #[unsafe(method_family = none)]
717 pub unsafe fn setOnDemandRules(&self, on_demand_rules: Option<&NSArray<NEOnDemandRule>>);
718
719 #[unsafe(method(isOnDemandEnabled))]
721 #[unsafe(method_family = none)]
722 pub unsafe fn isOnDemandEnabled(&self) -> bool;
723
724 #[unsafe(method(setOnDemandEnabled:))]
726 #[unsafe(method_family = none)]
727 pub unsafe fn setOnDemandEnabled(&self, on_demand_enabled: bool);
728
729 #[unsafe(method(localizedDescription))]
731 #[unsafe(method_family = none)]
732 pub unsafe fn localizedDescription(&self) -> Option<Retained<NSString>>;
733
734 #[unsafe(method(setLocalizedDescription:))]
736 #[unsafe(method_family = none)]
737 pub unsafe fn setLocalizedDescription(&self, localized_description: Option<&NSString>);
738
739 #[deprecated]
741 #[unsafe(method(protocol))]
742 #[unsafe(method_family = none)]
743 pub unsafe fn protocol(&self) -> Option<Retained<NEVPNProtocol>>;
744
745 #[deprecated]
747 #[unsafe(method(setProtocol:))]
748 #[unsafe(method_family = none)]
749 pub unsafe fn setProtocol(&self, protocol: Option<&NEVPNProtocol>);
750
751 #[unsafe(method(protocolConfiguration))]
753 #[unsafe(method_family = none)]
754 pub unsafe fn protocolConfiguration(&self) -> Option<Retained<NEVPNProtocol>>;
755
756 #[unsafe(method(setProtocolConfiguration:))]
758 #[unsafe(method_family = none)]
759 pub unsafe fn setProtocolConfiguration(
760 &self,
761 protocol_configuration: Option<&NEVPNProtocol>,
762 );
763
764 #[unsafe(method(connection))]
766 #[unsafe(method_family = none)]
767 pub unsafe fn connection(&self) -> Retained<NEVPNConnection>;
768
769 #[unsafe(method(isEnabled))]
771 #[unsafe(method_family = none)]
772 pub unsafe fn isEnabled(&self) -> bool;
773
774 #[unsafe(method(setEnabled:))]
776 #[unsafe(method_family = none)]
777 pub unsafe fn setEnabled(&self, enabled: bool);
778 );
779}
780
781impl NEVPNManager {
783 extern_methods!(
784 #[unsafe(method(init))]
785 #[unsafe(method_family = init)]
786 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
787
788 #[unsafe(method(new))]
789 #[unsafe(method_family = new)]
790 pub unsafe fn new() -> Retained<Self>;
791 );
792}
793
794extern_class!(
795 #[unsafe(super(NEVPNManager, NSObject))]
801 #[derive(Debug, PartialEq, Eq, Hash)]
802 pub struct NETunnelProviderManager;
803);
804
805extern_conformance!(
806 unsafe impl NSObjectProtocol for NETunnelProviderManager {}
807);
808
809impl NETunnelProviderManager {
810 extern_methods!(
811 #[cfg(feature = "block2")]
812 #[unsafe(method(loadAllFromPreferencesWithCompletionHandler:))]
816 #[unsafe(method_family = none)]
817 pub unsafe fn loadAllFromPreferencesWithCompletionHandler(
818 completion_handler: &block2::DynBlock<
819 dyn Fn(*mut NSArray<NETunnelProviderManager>, *mut NSError),
820 >,
821 );
822
823 #[unsafe(method(forPerAppVPN))]
825 #[unsafe(method_family = none)]
826 pub unsafe fn forPerAppVPN() -> Retained<Self>;
827
828 #[unsafe(method(copyAppRules))]
830 #[unsafe(method_family = copy)]
831 pub unsafe fn copyAppRules(&self) -> Option<Retained<NSArray<NEAppRule>>>;
832
833 #[unsafe(method(routingMethod))]
835 #[unsafe(method_family = none)]
836 pub unsafe fn routingMethod(&self) -> NETunnelProviderRoutingMethod;
837
838 #[unsafe(method(safariDomains))]
841 #[unsafe(method_family = none)]
842 pub unsafe fn safariDomains(&self) -> Retained<NSArray<NSString>>;
843
844 #[unsafe(method(setSafariDomains:))]
846 #[unsafe(method_family = none)]
847 pub unsafe fn setSafariDomains(&self, safari_domains: &NSArray<NSString>);
848
849 #[unsafe(method(mailDomains))]
852 #[unsafe(method_family = none)]
853 pub unsafe fn mailDomains(&self) -> Retained<NSArray<NSString>>;
854
855 #[unsafe(method(setMailDomains:))]
857 #[unsafe(method_family = none)]
858 pub unsafe fn setMailDomains(&self, mail_domains: &NSArray<NSString>);
859
860 #[unsafe(method(calendarDomains))]
863 #[unsafe(method_family = none)]
864 pub unsafe fn calendarDomains(&self) -> Retained<NSArray<NSString>>;
865
866 #[unsafe(method(setCalendarDomains:))]
868 #[unsafe(method_family = none)]
869 pub unsafe fn setCalendarDomains(&self, calendar_domains: &NSArray<NSString>);
870
871 #[unsafe(method(contactsDomains))]
874 #[unsafe(method_family = none)]
875 pub unsafe fn contactsDomains(&self) -> Retained<NSArray<NSString>>;
876
877 #[unsafe(method(setContactsDomains:))]
879 #[unsafe(method_family = none)]
880 pub unsafe fn setContactsDomains(&self, contacts_domains: &NSArray<NSString>);
881
882 #[unsafe(method(appRules))]
883 #[unsafe(method_family = none)]
884 pub unsafe fn appRules(&self) -> Retained<NSArray<NEAppRule>>;
885
886 #[unsafe(method(setAppRules:))]
888 #[unsafe(method_family = none)]
889 pub unsafe fn setAppRules(&self, app_rules: &NSArray<NEAppRule>);
890
891 #[unsafe(method(excludedDomains))]
893 #[unsafe(method_family = none)]
894 pub unsafe fn excludedDomains(&self) -> Retained<NSArray<NSString>>;
895
896 #[unsafe(method(setExcludedDomains:))]
898 #[unsafe(method_family = none)]
899 pub unsafe fn setExcludedDomains(&self, excluded_domains: &NSArray<NSString>);
900
901 #[unsafe(method(associatedDomains))]
902 #[unsafe(method_family = none)]
903 pub unsafe fn associatedDomains(&self) -> Retained<NSArray<NSString>>;
904
905 #[unsafe(method(setAssociatedDomains:))]
907 #[unsafe(method_family = none)]
908 pub unsafe fn setAssociatedDomains(&self, associated_domains: &NSArray<NSString>);
909 );
910}
911
912impl NETunnelProviderManager {
914 extern_methods!(
915 #[unsafe(method(init))]
916 #[unsafe(method_family = init)]
917 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
918
919 #[unsafe(method(new))]
920 #[unsafe(method_family = new)]
921 pub unsafe fn new() -> Retained<Self>;
922 );
923}
924
925extern_class!(
926 #[unsafe(super(NETunnelProviderManager, NEVPNManager, NSObject))]
932 #[derive(Debug, PartialEq, Eq, Hash)]
933 pub struct NEAppProxyProviderManager;
934);
935
936extern_conformance!(
937 unsafe impl NSObjectProtocol for NEAppProxyProviderManager {}
938);
939
940impl NEAppProxyProviderManager {
941 extern_methods!(
942 #[cfg(feature = "block2")]
943 #[unsafe(method(loadAllFromPreferencesWithCompletionHandler:))]
947 #[unsafe(method_family = none)]
948 pub unsafe fn loadAllFromPreferencesWithCompletionHandler(
949 completion_handler: &block2::DynBlock<
950 dyn Fn(*mut NSArray<NEAppProxyProviderManager>, *mut NSError),
951 >,
952 );
953 );
954}
955
956impl NEAppProxyProviderManager {
958 extern_methods!(
959 #[unsafe(method(forPerAppVPN))]
961 #[unsafe(method_family = none)]
962 pub unsafe fn forPerAppVPN() -> Retained<Self>;
963 );
964}
965
966impl NEAppProxyProviderManager {
968 extern_methods!(
969 #[unsafe(method(init))]
970 #[unsafe(method_family = init)]
971 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
972
973 #[unsafe(method(new))]
974 #[unsafe(method_family = new)]
975 pub unsafe fn new() -> Retained<Self>;
976 );
977}
978
979extern_class!(
980 #[unsafe(super(NEAppProxyFlow, NSObject))]
988 #[derive(Debug, PartialEq, Eq, Hash)]
989 pub struct NEAppProxyTCPFlow;
990);
991
992extern_conformance!(
993 unsafe impl NSObjectProtocol for NEAppProxyTCPFlow {}
994);
995
996impl NEAppProxyTCPFlow {
997 extern_methods!(
998 #[cfg(feature = "block2")]
999 #[unsafe(method(readDataWithCompletionHandler:))]
1003 #[unsafe(method_family = none)]
1004 pub unsafe fn readDataWithCompletionHandler(
1005 &self,
1006 completion_handler: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
1007 );
1008
1009 #[cfg(feature = "block2")]
1010 #[unsafe(method(writeData:withCompletionHandler:))]
1016 #[unsafe(method_family = none)]
1017 pub unsafe fn writeData_withCompletionHandler(
1018 &self,
1019 data: &NSData,
1020 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
1021 );
1022
1023 #[deprecated]
1025 #[unsafe(method(remoteEndpoint))]
1026 #[unsafe(method_family = none)]
1027 pub unsafe fn remoteEndpoint(&self) -> Retained<NWEndpoint>;
1028 );
1029}
1030
1031impl NEAppProxyTCPFlow {
1033 extern_methods!(
1034 #[unsafe(method(init))]
1035 #[unsafe(method_family = init)]
1036 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1037
1038 #[unsafe(method(new))]
1039 #[unsafe(method_family = new)]
1040 pub unsafe fn new() -> Retained<Self>;
1041 );
1042}
1043
1044extern_class!(
1045 #[unsafe(super(NEAppProxyFlow, NSObject))]
1053 #[derive(Debug, PartialEq, Eq, Hash)]
1054 pub struct NEAppProxyUDPFlow;
1055);
1056
1057extern_conformance!(
1058 unsafe impl NSObjectProtocol for NEAppProxyUDPFlow {}
1059);
1060
1061impl NEAppProxyUDPFlow {
1062 extern_methods!(
1063 #[cfg(feature = "block2")]
1064 #[deprecated]
1068 #[unsafe(method(readDatagramsWithCompletionHandler:))]
1069 #[unsafe(method_family = none)]
1070 pub unsafe fn readDatagramsWithCompletionHandler(
1071 &self,
1072 completion_handler: &block2::DynBlock<
1073 dyn Fn(*mut NSArray<NSData>, *mut NSArray<NWEndpoint>, *mut NSError),
1074 >,
1075 );
1076
1077 #[cfg(feature = "block2")]
1078 #[deprecated]
1086 #[unsafe(method(writeDatagrams:sentByEndpoints:completionHandler:))]
1087 #[unsafe(method_family = none)]
1088 pub unsafe fn writeDatagrams_sentByEndpoints_completionHandler(
1089 &self,
1090 datagrams: &NSArray<NSData>,
1091 remote_endpoints: &NSArray<NWEndpoint>,
1092 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
1093 );
1094
1095 #[deprecated]
1097 #[unsafe(method(localEndpoint))]
1098 #[unsafe(method_family = none)]
1099 pub unsafe fn localEndpoint(&self) -> Option<Retained<NWEndpoint>>;
1100 );
1101}
1102
1103impl NEAppProxyUDPFlow {
1105 extern_methods!(
1106 #[unsafe(method(init))]
1107 #[unsafe(method_family = init)]
1108 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1109
1110 #[unsafe(method(new))]
1111 #[unsafe(method_family = new)]
1112 pub unsafe fn new() -> Retained<Self>;
1113 );
1114}
1115
1116extern_class!(
1117 #[unsafe(super(NSObject))]
1125 #[derive(Debug, PartialEq, Eq, Hash)]
1126 pub struct NEAppRule;
1127);
1128
1129extern_conformance!(
1130 unsafe impl NSCoding for NEAppRule {}
1131);
1132
1133extern_conformance!(
1134 unsafe impl NSCopying for NEAppRule {}
1135);
1136
1137unsafe impl CopyingHelper for NEAppRule {
1138 type Result = Self;
1139}
1140
1141extern_conformance!(
1142 unsafe impl NSObjectProtocol for NEAppRule {}
1143);
1144
1145extern_conformance!(
1146 unsafe impl NSSecureCoding for NEAppRule {}
1147);
1148
1149impl NEAppRule {
1150 extern_methods!(
1151 #[unsafe(method(initWithSigningIdentifier:))]
1155 #[unsafe(method_family = init)]
1156 pub unsafe fn initWithSigningIdentifier(
1157 this: Allocated<Self>,
1158 signing_identifier: &NSString,
1159 ) -> Retained<Self>;
1160
1161 #[unsafe(method(initWithSigningIdentifier:designatedRequirement:))]
1167 #[unsafe(method_family = init)]
1168 pub unsafe fn initWithSigningIdentifier_designatedRequirement(
1169 this: Allocated<Self>,
1170 signing_identifier: &NSString,
1171 designated_requirement: &NSString,
1172 ) -> Retained<Self>;
1173
1174 #[unsafe(method(matchSigningIdentifier))]
1176 #[unsafe(method_family = none)]
1177 pub unsafe fn matchSigningIdentifier(&self) -> Retained<NSString>;
1178
1179 #[unsafe(method(matchDesignatedRequirement))]
1181 #[unsafe(method_family = none)]
1182 pub unsafe fn matchDesignatedRequirement(&self) -> Retained<NSString>;
1183
1184 #[unsafe(method(matchPath))]
1186 #[unsafe(method_family = none)]
1187 pub unsafe fn matchPath(&self) -> Option<Retained<NSString>>;
1188
1189 #[unsafe(method(setMatchPath:))]
1191 #[unsafe(method_family = none)]
1192 pub unsafe fn setMatchPath(&self, match_path: Option<&NSString>);
1193
1194 #[unsafe(method(matchDomains))]
1196 #[unsafe(method_family = none)]
1197 pub unsafe fn matchDomains(&self) -> Option<Retained<NSArray>>;
1198
1199 #[unsafe(method(setMatchDomains:))]
1201 #[unsafe(method_family = none)]
1202 pub unsafe fn setMatchDomains(&self, match_domains: Option<&NSArray>);
1203
1204 #[unsafe(method(matchTools))]
1209 #[unsafe(method_family = none)]
1210 pub unsafe fn matchTools(&self) -> Option<Retained<NSArray<NEAppRule>>>;
1211
1212 #[unsafe(method(setMatchTools:))]
1214 #[unsafe(method_family = none)]
1215 pub unsafe fn setMatchTools(&self, match_tools: Option<&NSArray<NEAppRule>>);
1216 );
1217}
1218
1219impl NEAppRule {
1221 extern_methods!(
1222 #[unsafe(method(init))]
1223 #[unsafe(method_family = init)]
1224 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1225
1226 #[unsafe(method(new))]
1227 #[unsafe(method_family = new)]
1228 pub unsafe fn new() -> Retained<Self>;
1229 );
1230}
1231
1232#[repr(transparent)]
1237#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1238pub struct NEDNSProxyManagerError(pub NSInteger);
1239impl NEDNSProxyManagerError {
1240 #[doc(alias = "NEDNSProxyManagerErrorConfigurationInvalid")]
1241 pub const ConfigurationInvalid: Self = Self(1);
1242 #[doc(alias = "NEDNSProxyManagerErrorConfigurationDisabled")]
1243 pub const ConfigurationDisabled: Self = Self(2);
1244 #[doc(alias = "NEDNSProxyManagerErrorConfigurationStale")]
1245 pub const ConfigurationStale: Self = Self(3);
1246 #[doc(alias = "NEDNSProxyManagerErrorConfigurationCannotBeRemoved")]
1247 pub const ConfigurationCannotBeRemoved: Self = Self(4);
1248}
1249
1250unsafe impl Encode for NEDNSProxyManagerError {
1251 const ENCODING: Encoding = NSInteger::ENCODING;
1252}
1253
1254unsafe impl RefEncode for NEDNSProxyManagerError {
1255 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1256}
1257
1258extern "C" {
1259 pub static NEDNSProxyErrorDomain: &'static NSString;
1261}
1262
1263extern "C" {
1264 pub static NEDNSProxyConfigurationDidChangeNotification: &'static NSString;
1266}
1267
1268extern_class!(
1269 #[unsafe(super(NSObject))]
1277 #[derive(Debug, PartialEq, Eq, Hash)]
1278 pub struct NEDNSProxyManager;
1279);
1280
1281extern_conformance!(
1282 unsafe impl NSObjectProtocol for NEDNSProxyManager {}
1283);
1284
1285impl NEDNSProxyManager {
1286 extern_methods!(
1287 #[unsafe(method(sharedManager))]
1289 #[unsafe(method_family = none)]
1290 pub unsafe fn sharedManager() -> Retained<NEDNSProxyManager>;
1291
1292 #[cfg(feature = "block2")]
1293 #[unsafe(method(loadFromPreferencesWithCompletionHandler:))]
1297 #[unsafe(method_family = none)]
1298 pub unsafe fn loadFromPreferencesWithCompletionHandler(
1299 &self,
1300 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
1301 );
1302
1303 #[cfg(feature = "block2")]
1304 #[unsafe(method(removeFromPreferencesWithCompletionHandler:))]
1308 #[unsafe(method_family = none)]
1309 pub unsafe fn removeFromPreferencesWithCompletionHandler(
1310 &self,
1311 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
1312 );
1313
1314 #[cfg(feature = "block2")]
1315 #[unsafe(method(saveToPreferencesWithCompletionHandler:))]
1319 #[unsafe(method_family = none)]
1320 pub unsafe fn saveToPreferencesWithCompletionHandler(
1321 &self,
1322 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
1323 );
1324
1325 #[unsafe(method(localizedDescription))]
1327 #[unsafe(method_family = none)]
1328 pub unsafe fn localizedDescription(&self) -> Option<Retained<NSString>>;
1329
1330 #[unsafe(method(setLocalizedDescription:))]
1332 #[unsafe(method_family = none)]
1333 pub unsafe fn setLocalizedDescription(&self, localized_description: Option<&NSString>);
1334
1335 #[unsafe(method(providerProtocol))]
1337 #[unsafe(method_family = none)]
1338 pub unsafe fn providerProtocol(&self) -> Option<Retained<NEDNSProxyProviderProtocol>>;
1339
1340 #[unsafe(method(setProviderProtocol:))]
1342 #[unsafe(method_family = none)]
1343 pub unsafe fn setProviderProtocol(
1344 &self,
1345 provider_protocol: Option<&NEDNSProxyProviderProtocol>,
1346 );
1347
1348 #[unsafe(method(isEnabled))]
1350 #[unsafe(method_family = none)]
1351 pub unsafe fn isEnabled(&self) -> bool;
1352
1353 #[unsafe(method(setEnabled:))]
1355 #[unsafe(method_family = none)]
1356 pub unsafe fn setEnabled(&self, enabled: bool);
1357 );
1358}
1359
1360impl NEDNSProxyManager {
1362 extern_methods!(
1363 #[unsafe(method(init))]
1364 #[unsafe(method_family = init)]
1365 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1366
1367 #[unsafe(method(new))]
1368 #[unsafe(method_family = new)]
1369 pub unsafe fn new() -> Retained<Self>;
1370 );
1371}
1372
1373extern_class!(
1374 #[unsafe(super(NEProvider, NSObject))]
1380 #[derive(Debug, PartialEq, Eq, Hash)]
1381 pub struct NEDNSProxyProvider;
1382);
1383
1384extern_conformance!(
1385 unsafe impl NSObjectProtocol for NEDNSProxyProvider {}
1386);
1387
1388impl NEDNSProxyProvider {
1389 extern_methods!(
1390 #[cfg(feature = "block2")]
1391 #[unsafe(method(startProxyWithOptions:completionHandler:))]
1397 #[unsafe(method_family = none)]
1398 pub unsafe fn startProxyWithOptions_completionHandler(
1399 &self,
1400 options: Option<&NSDictionary<NSString, AnyObject>>,
1401 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
1402 );
1403
1404 #[cfg(feature = "block2")]
1405 #[unsafe(method(stopProxyWithReason:completionHandler:))]
1411 #[unsafe(method_family = none)]
1412 pub unsafe fn stopProxyWithReason_completionHandler(
1413 &self,
1414 reason: NEProviderStopReason,
1415 completion_handler: &block2::DynBlock<dyn Fn()>,
1416 );
1417
1418 #[unsafe(method(cancelProxyWithError:))]
1422 #[unsafe(method_family = none)]
1423 pub unsafe fn cancelProxyWithError(&self, error: Option<&NSError>);
1424
1425 #[unsafe(method(handleNewFlow:))]
1431 #[unsafe(method_family = none)]
1432 pub unsafe fn handleNewFlow(&self, flow: &NEAppProxyFlow) -> bool;
1433
1434 #[deprecated]
1446 #[unsafe(method(handleNewUDPFlow:initialRemoteEndpoint:))]
1447 #[unsafe(method_family = none)]
1448 pub unsafe fn handleNewUDPFlow_initialRemoteEndpoint(
1449 &self,
1450 flow: &NEAppProxyUDPFlow,
1451 remote_endpoint: &NWEndpoint,
1452 ) -> bool;
1453
1454 #[unsafe(method(systemDNSSettings))]
1456 #[unsafe(method_family = none)]
1457 pub unsafe fn systemDNSSettings(&self) -> Option<Retained<NSArray<NEDNSSettings>>>;
1458 );
1459}
1460
1461impl NEDNSProxyProvider {
1463 extern_methods!(
1464 #[unsafe(method(init))]
1465 #[unsafe(method_family = init)]
1466 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1467
1468 #[unsafe(method(new))]
1469 #[unsafe(method_family = new)]
1470 pub unsafe fn new() -> Retained<Self>;
1471 );
1472}
1473
1474extern_class!(
1475 #[unsafe(super(NSObject))]
1481 #[derive(Debug, PartialEq, Eq, Hash)]
1482 pub struct NEProxyServer;
1483);
1484
1485extern_conformance!(
1486 unsafe impl NSCoding for NEProxyServer {}
1487);
1488
1489extern_conformance!(
1490 unsafe impl NSCopying for NEProxyServer {}
1491);
1492
1493unsafe impl CopyingHelper for NEProxyServer {
1494 type Result = Self;
1495}
1496
1497extern_conformance!(
1498 unsafe impl NSObjectProtocol for NEProxyServer {}
1499);
1500
1501extern_conformance!(
1502 unsafe impl NSSecureCoding for NEProxyServer {}
1503);
1504
1505impl NEProxyServer {
1506 extern_methods!(
1507 #[unsafe(method(initWithAddress:port:))]
1513 #[unsafe(method_family = init)]
1514 pub unsafe fn initWithAddress_port(
1515 this: Allocated<Self>,
1516 address: &NSString,
1517 port: NSInteger,
1518 ) -> Retained<Self>;
1519
1520 #[unsafe(method(address))]
1522 #[unsafe(method_family = none)]
1523 pub unsafe fn address(&self) -> Retained<NSString>;
1524
1525 #[unsafe(method(port))]
1527 #[unsafe(method_family = none)]
1528 pub unsafe fn port(&self) -> NSInteger;
1529
1530 #[unsafe(method(authenticationRequired))]
1532 #[unsafe(method_family = none)]
1533 pub unsafe fn authenticationRequired(&self) -> bool;
1534
1535 #[unsafe(method(setAuthenticationRequired:))]
1537 #[unsafe(method_family = none)]
1538 pub unsafe fn setAuthenticationRequired(&self, authentication_required: bool);
1539
1540 #[unsafe(method(username))]
1542 #[unsafe(method_family = none)]
1543 pub unsafe fn username(&self) -> Option<Retained<NSString>>;
1544
1545 #[unsafe(method(setUsername:))]
1547 #[unsafe(method_family = none)]
1548 pub unsafe fn setUsername(&self, username: Option<&NSString>);
1549
1550 #[unsafe(method(password))]
1552 #[unsafe(method_family = none)]
1553 pub unsafe fn password(&self) -> Option<Retained<NSString>>;
1554
1555 #[unsafe(method(setPassword:))]
1557 #[unsafe(method_family = none)]
1558 pub unsafe fn setPassword(&self, password: Option<&NSString>);
1559 );
1560}
1561
1562impl NEProxyServer {
1564 extern_methods!(
1565 #[unsafe(method(init))]
1566 #[unsafe(method_family = init)]
1567 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1568
1569 #[unsafe(method(new))]
1570 #[unsafe(method_family = new)]
1571 pub unsafe fn new() -> Retained<Self>;
1572 );
1573}
1574
1575extern_class!(
1576 #[unsafe(super(NSObject))]
1582 #[derive(Debug, PartialEq, Eq, Hash)]
1583 pub struct NEProxySettings;
1584);
1585
1586extern_conformance!(
1587 unsafe impl NSCoding for NEProxySettings {}
1588);
1589
1590extern_conformance!(
1591 unsafe impl NSCopying for NEProxySettings {}
1592);
1593
1594unsafe impl CopyingHelper for NEProxySettings {
1595 type Result = Self;
1596}
1597
1598extern_conformance!(
1599 unsafe impl NSObjectProtocol for NEProxySettings {}
1600);
1601
1602extern_conformance!(
1603 unsafe impl NSSecureCoding for NEProxySettings {}
1604);
1605
1606impl NEProxySettings {
1607 extern_methods!(
1608 #[unsafe(method(autoProxyConfigurationEnabled))]
1610 #[unsafe(method_family = none)]
1611 pub unsafe fn autoProxyConfigurationEnabled(&self) -> bool;
1612
1613 #[unsafe(method(setAutoProxyConfigurationEnabled:))]
1615 #[unsafe(method_family = none)]
1616 pub unsafe fn setAutoProxyConfigurationEnabled(
1617 &self,
1618 auto_proxy_configuration_enabled: bool,
1619 );
1620
1621 #[unsafe(method(proxyAutoConfigurationURL))]
1623 #[unsafe(method_family = none)]
1624 pub unsafe fn proxyAutoConfigurationURL(&self) -> Option<Retained<NSURL>>;
1625
1626 #[unsafe(method(setProxyAutoConfigurationURL:))]
1628 #[unsafe(method_family = none)]
1629 pub unsafe fn setProxyAutoConfigurationURL(
1630 &self,
1631 proxy_auto_configuration_url: Option<&NSURL>,
1632 );
1633
1634 #[unsafe(method(proxyAutoConfigurationJavaScript))]
1636 #[unsafe(method_family = none)]
1637 pub unsafe fn proxyAutoConfigurationJavaScript(&self) -> Option<Retained<NSString>>;
1638
1639 #[unsafe(method(setProxyAutoConfigurationJavaScript:))]
1641 #[unsafe(method_family = none)]
1642 pub unsafe fn setProxyAutoConfigurationJavaScript(
1643 &self,
1644 proxy_auto_configuration_java_script: Option<&NSString>,
1645 );
1646
1647 #[unsafe(method(HTTPEnabled))]
1649 #[unsafe(method_family = none)]
1650 pub unsafe fn HTTPEnabled(&self) -> bool;
1651
1652 #[unsafe(method(setHTTPEnabled:))]
1654 #[unsafe(method_family = none)]
1655 pub unsafe fn setHTTPEnabled(&self, http_enabled: bool);
1656
1657 #[unsafe(method(HTTPServer))]
1659 #[unsafe(method_family = none)]
1660 pub unsafe fn HTTPServer(&self) -> Option<Retained<NEProxyServer>>;
1661
1662 #[unsafe(method(setHTTPServer:))]
1664 #[unsafe(method_family = none)]
1665 pub unsafe fn setHTTPServer(&self, http_server: Option<&NEProxyServer>);
1666
1667 #[unsafe(method(HTTPSEnabled))]
1669 #[unsafe(method_family = none)]
1670 pub unsafe fn HTTPSEnabled(&self) -> bool;
1671
1672 #[unsafe(method(setHTTPSEnabled:))]
1674 #[unsafe(method_family = none)]
1675 pub unsafe fn setHTTPSEnabled(&self, https_enabled: bool);
1676
1677 #[unsafe(method(HTTPSServer))]
1679 #[unsafe(method_family = none)]
1680 pub unsafe fn HTTPSServer(&self) -> Option<Retained<NEProxyServer>>;
1681
1682 #[unsafe(method(setHTTPSServer:))]
1684 #[unsafe(method_family = none)]
1685 pub unsafe fn setHTTPSServer(&self, https_server: Option<&NEProxyServer>);
1686
1687 #[unsafe(method(excludeSimpleHostnames))]
1689 #[unsafe(method_family = none)]
1690 pub unsafe fn excludeSimpleHostnames(&self) -> bool;
1691
1692 #[unsafe(method(setExcludeSimpleHostnames:))]
1694 #[unsafe(method_family = none)]
1695 pub unsafe fn setExcludeSimpleHostnames(&self, exclude_simple_hostnames: bool);
1696
1697 #[unsafe(method(exceptionList))]
1699 #[unsafe(method_family = none)]
1700 pub unsafe fn exceptionList(&self) -> Option<Retained<NSArray<NSString>>>;
1701
1702 #[unsafe(method(setExceptionList:))]
1704 #[unsafe(method_family = none)]
1705 pub unsafe fn setExceptionList(&self, exception_list: Option<&NSArray<NSString>>);
1706
1707 #[unsafe(method(matchDomains))]
1709 #[unsafe(method_family = none)]
1710 pub unsafe fn matchDomains(&self) -> Option<Retained<NSArray<NSString>>>;
1711
1712 #[unsafe(method(setMatchDomains:))]
1714 #[unsafe(method_family = none)]
1715 pub unsafe fn setMatchDomains(&self, match_domains: Option<&NSArray<NSString>>);
1716 );
1717}
1718
1719impl NEProxySettings {
1721 extern_methods!(
1722 #[unsafe(method(init))]
1723 #[unsafe(method_family = init)]
1724 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1725
1726 #[unsafe(method(new))]
1727 #[unsafe(method_family = new)]
1728 pub unsafe fn new() -> Retained<Self>;
1729 );
1730}
1731
1732extern_class!(
1733 #[unsafe(super(NSObject))]
1741 #[derive(Debug, PartialEq, Eq, Hash)]
1742 pub struct NEVPNProtocol;
1743);
1744
1745extern_conformance!(
1746 unsafe impl NSCoding for NEVPNProtocol {}
1747);
1748
1749extern_conformance!(
1750 unsafe impl NSCopying for NEVPNProtocol {}
1751);
1752
1753unsafe impl CopyingHelper for NEVPNProtocol {
1754 type Result = Self;
1755}
1756
1757extern_conformance!(
1758 unsafe impl NSObjectProtocol for NEVPNProtocol {}
1759);
1760
1761extern_conformance!(
1762 unsafe impl NSSecureCoding for NEVPNProtocol {}
1763);
1764
1765impl NEVPNProtocol {
1766 extern_methods!(
1767 #[unsafe(method(serverAddress))]
1769 #[unsafe(method_family = none)]
1770 pub unsafe fn serverAddress(&self) -> Option<Retained<NSString>>;
1771
1772 #[unsafe(method(setServerAddress:))]
1774 #[unsafe(method_family = none)]
1775 pub unsafe fn setServerAddress(&self, server_address: Option<&NSString>);
1776
1777 #[unsafe(method(username))]
1779 #[unsafe(method_family = none)]
1780 pub unsafe fn username(&self) -> Option<Retained<NSString>>;
1781
1782 #[unsafe(method(setUsername:))]
1784 #[unsafe(method_family = none)]
1785 pub unsafe fn setUsername(&self, username: Option<&NSString>);
1786
1787 #[unsafe(method(passwordReference))]
1789 #[unsafe(method_family = none)]
1790 pub unsafe fn passwordReference(&self) -> Option<Retained<NSData>>;
1791
1792 #[unsafe(method(setPasswordReference:))]
1794 #[unsafe(method_family = none)]
1795 pub unsafe fn setPasswordReference(&self, password_reference: Option<&NSData>);
1796
1797 #[unsafe(method(identityReference))]
1799 #[unsafe(method_family = none)]
1800 pub unsafe fn identityReference(&self) -> Option<Retained<NSData>>;
1801
1802 #[unsafe(method(setIdentityReference:))]
1804 #[unsafe(method_family = none)]
1805 pub unsafe fn setIdentityReference(&self, identity_reference: Option<&NSData>);
1806
1807 #[unsafe(method(identityData))]
1809 #[unsafe(method_family = none)]
1810 pub unsafe fn identityData(&self) -> Option<Retained<NSData>>;
1811
1812 #[unsafe(method(setIdentityData:))]
1814 #[unsafe(method_family = none)]
1815 pub unsafe fn setIdentityData(&self, identity_data: Option<&NSData>);
1816
1817 #[unsafe(method(identityDataPassword))]
1819 #[unsafe(method_family = none)]
1820 pub unsafe fn identityDataPassword(&self) -> Option<Retained<NSString>>;
1821
1822 #[unsafe(method(setIdentityDataPassword:))]
1824 #[unsafe(method_family = none)]
1825 pub unsafe fn setIdentityDataPassword(&self, identity_data_password: Option<&NSString>);
1826
1827 #[unsafe(method(disconnectOnSleep))]
1829 #[unsafe(method_family = none)]
1830 pub unsafe fn disconnectOnSleep(&self) -> bool;
1831
1832 #[unsafe(method(setDisconnectOnSleep:))]
1834 #[unsafe(method_family = none)]
1835 pub unsafe fn setDisconnectOnSleep(&self, disconnect_on_sleep: bool);
1836
1837 #[unsafe(method(proxySettings))]
1839 #[unsafe(method_family = none)]
1840 pub unsafe fn proxySettings(&self) -> Option<Retained<NEProxySettings>>;
1841
1842 #[unsafe(method(setProxySettings:))]
1844 #[unsafe(method_family = none)]
1845 pub unsafe fn setProxySettings(&self, proxy_settings: Option<&NEProxySettings>);
1846
1847 #[unsafe(method(includeAllNetworks))]
1857 #[unsafe(method_family = none)]
1858 pub unsafe fn includeAllNetworks(&self) -> bool;
1859
1860 #[unsafe(method(setIncludeAllNetworks:))]
1862 #[unsafe(method_family = none)]
1863 pub unsafe fn setIncludeAllNetworks(&self, include_all_networks: bool);
1864
1865 #[unsafe(method(excludeLocalNetworks))]
1867 #[unsafe(method_family = none)]
1868 pub unsafe fn excludeLocalNetworks(&self) -> bool;
1869
1870 #[unsafe(method(setExcludeLocalNetworks:))]
1872 #[unsafe(method_family = none)]
1873 pub unsafe fn setExcludeLocalNetworks(&self, exclude_local_networks: bool);
1874
1875 #[unsafe(method(excludeCellularServices))]
1880 #[unsafe(method_family = none)]
1881 pub unsafe fn excludeCellularServices(&self) -> bool;
1882
1883 #[unsafe(method(setExcludeCellularServices:))]
1885 #[unsafe(method_family = none)]
1886 pub unsafe fn setExcludeCellularServices(&self, exclude_cellular_services: bool);
1887
1888 #[unsafe(method(excludeAPNs))]
1891 #[unsafe(method_family = none)]
1892 pub unsafe fn excludeAPNs(&self) -> bool;
1893
1894 #[unsafe(method(setExcludeAPNs:))]
1896 #[unsafe(method_family = none)]
1897 pub unsafe fn setExcludeAPNs(&self, exclude_ap_ns: bool);
1898
1899 #[unsafe(method(excludeDeviceCommunication))]
1903 #[unsafe(method_family = none)]
1904 pub unsafe fn excludeDeviceCommunication(&self) -> bool;
1905
1906 #[unsafe(method(setExcludeDeviceCommunication:))]
1908 #[unsafe(method_family = none)]
1909 pub unsafe fn setExcludeDeviceCommunication(&self, exclude_device_communication: bool);
1910
1911 #[unsafe(method(enforceRoutes))]
1913 #[unsafe(method_family = none)]
1914 pub unsafe fn enforceRoutes(&self) -> bool;
1915
1916 #[unsafe(method(setEnforceRoutes:))]
1918 #[unsafe(method_family = none)]
1919 pub unsafe fn setEnforceRoutes(&self, enforce_routes: bool);
1920
1921 #[unsafe(method(sliceUUID))]
1924 #[unsafe(method_family = none)]
1925 pub unsafe fn sliceUUID(&self) -> Option<Retained<NSString>>;
1926
1927 #[unsafe(method(setSliceUUID:))]
1929 #[unsafe(method_family = none)]
1930 pub unsafe fn setSliceUUID(&self, slice_uuid: Option<&NSString>);
1931 );
1932}
1933
1934impl NEVPNProtocol {
1936 extern_methods!(
1937 #[unsafe(method(init))]
1938 #[unsafe(method_family = init)]
1939 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1940
1941 #[unsafe(method(new))]
1942 #[unsafe(method_family = new)]
1943 pub unsafe fn new() -> Retained<Self>;
1944 );
1945}
1946
1947extern_class!(
1948 #[unsafe(super(NEVPNProtocol, NSObject))]
1954 #[derive(Debug, PartialEq, Eq, Hash)]
1955 pub struct NEDNSProxyProviderProtocol;
1956);
1957
1958extern_conformance!(
1959 unsafe impl NSCoding for NEDNSProxyProviderProtocol {}
1960);
1961
1962extern_conformance!(
1963 unsafe impl NSCopying for NEDNSProxyProviderProtocol {}
1964);
1965
1966unsafe impl CopyingHelper for NEDNSProxyProviderProtocol {
1967 type Result = Self;
1968}
1969
1970extern_conformance!(
1971 unsafe impl NSObjectProtocol for NEDNSProxyProviderProtocol {}
1972);
1973
1974extern_conformance!(
1975 unsafe impl NSSecureCoding for NEDNSProxyProviderProtocol {}
1976);
1977
1978impl NEDNSProxyProviderProtocol {
1979 extern_methods!(
1980 #[unsafe(method(providerConfiguration))]
1982 #[unsafe(method_family = none)]
1983 pub unsafe fn providerConfiguration(
1984 &self,
1985 ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
1986
1987 #[unsafe(method(setProviderConfiguration:))]
1989 #[unsafe(method_family = none)]
1990 pub unsafe fn setProviderConfiguration(
1991 &self,
1992 provider_configuration: Option<&NSDictionary<NSString, AnyObject>>,
1993 );
1994
1995 #[unsafe(method(providerBundleIdentifier))]
1997 #[unsafe(method_family = none)]
1998 pub unsafe fn providerBundleIdentifier(&self) -> Option<Retained<NSString>>;
1999
2000 #[unsafe(method(setProviderBundleIdentifier:))]
2002 #[unsafe(method_family = none)]
2003 pub unsafe fn setProviderBundleIdentifier(
2004 &self,
2005 provider_bundle_identifier: Option<&NSString>,
2006 );
2007 );
2008}
2009
2010impl NEDNSProxyProviderProtocol {
2012 extern_methods!(
2013 #[unsafe(method(init))]
2014 #[unsafe(method_family = init)]
2015 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2016
2017 #[unsafe(method(new))]
2018 #[unsafe(method_family = new)]
2019 pub unsafe fn new() -> Retained<Self>;
2020 );
2021}
2022
2023#[repr(transparent)]
2028#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2029pub struct NEDNSProtocol(pub NSInteger);
2030impl NEDNSProtocol {
2031 #[doc(alias = "NEDNSProtocolCleartext")]
2032 pub const Cleartext: Self = Self(1);
2033 #[doc(alias = "NEDNSProtocolTLS")]
2034 pub const TLS: Self = Self(2);
2035 #[doc(alias = "NEDNSProtocolHTTPS")]
2036 pub const HTTPS: Self = Self(3);
2037}
2038
2039unsafe impl Encode for NEDNSProtocol {
2040 const ENCODING: Encoding = NSInteger::ENCODING;
2041}
2042
2043unsafe impl RefEncode for NEDNSProtocol {
2044 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2045}
2046
2047extern_class!(
2048 #[unsafe(super(NSObject))]
2052 #[derive(Debug, PartialEq, Eq, Hash)]
2053 pub struct NEDNSSettings;
2054);
2055
2056extern_conformance!(
2057 unsafe impl NSCoding for NEDNSSettings {}
2058);
2059
2060extern_conformance!(
2061 unsafe impl NSCopying for NEDNSSettings {}
2062);
2063
2064unsafe impl CopyingHelper for NEDNSSettings {
2065 type Result = Self;
2066}
2067
2068extern_conformance!(
2069 unsafe impl NSObjectProtocol for NEDNSSettings {}
2070);
2071
2072extern_conformance!(
2073 unsafe impl NSSecureCoding for NEDNSSettings {}
2074);
2075
2076impl NEDNSSettings {
2077 extern_methods!(
2078 #[unsafe(method(dnsProtocol))]
2080 #[unsafe(method_family = none)]
2081 pub unsafe fn dnsProtocol(&self) -> NEDNSProtocol;
2082
2083 #[unsafe(method(initWithServers:))]
2087 #[unsafe(method_family = init)]
2088 pub unsafe fn initWithServers(
2089 this: Allocated<Self>,
2090 servers: &NSArray<NSString>,
2091 ) -> Retained<Self>;
2092
2093 #[unsafe(method(servers))]
2095 #[unsafe(method_family = none)]
2096 pub unsafe fn servers(&self) -> Retained<NSArray<NSString>>;
2097
2098 #[unsafe(method(searchDomains))]
2100 #[unsafe(method_family = none)]
2101 pub unsafe fn searchDomains(&self) -> Option<Retained<NSArray<NSString>>>;
2102
2103 #[unsafe(method(setSearchDomains:))]
2105 #[unsafe(method_family = none)]
2106 pub unsafe fn setSearchDomains(&self, search_domains: Option<&NSArray<NSString>>);
2107
2108 #[unsafe(method(domainName))]
2110 #[unsafe(method_family = none)]
2111 pub unsafe fn domainName(&self) -> Option<Retained<NSString>>;
2112
2113 #[unsafe(method(setDomainName:))]
2115 #[unsafe(method_family = none)]
2116 pub unsafe fn setDomainName(&self, domain_name: Option<&NSString>);
2117
2118 #[unsafe(method(matchDomains))]
2120 #[unsafe(method_family = none)]
2121 pub unsafe fn matchDomains(&self) -> Option<Retained<NSArray<NSString>>>;
2122
2123 #[unsafe(method(setMatchDomains:))]
2125 #[unsafe(method_family = none)]
2126 pub unsafe fn setMatchDomains(&self, match_domains: Option<&NSArray<NSString>>);
2127
2128 #[unsafe(method(matchDomainsNoSearch))]
2130 #[unsafe(method_family = none)]
2131 pub unsafe fn matchDomainsNoSearch(&self) -> bool;
2132
2133 #[unsafe(method(setMatchDomainsNoSearch:))]
2135 #[unsafe(method_family = none)]
2136 pub unsafe fn setMatchDomainsNoSearch(&self, match_domains_no_search: bool);
2137 );
2138}
2139
2140impl NEDNSSettings {
2142 extern_methods!(
2143 #[unsafe(method(init))]
2144 #[unsafe(method_family = init)]
2145 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2146
2147 #[unsafe(method(new))]
2148 #[unsafe(method_family = new)]
2149 pub unsafe fn new() -> Retained<Self>;
2150 );
2151}
2152
2153extern_class!(
2154 #[unsafe(super(NEDNSSettings, NSObject))]
2156 #[derive(Debug, PartialEq, Eq, Hash)]
2157 pub struct NEDNSOverTLSSettings;
2158);
2159
2160extern_conformance!(
2161 unsafe impl NSCoding for NEDNSOverTLSSettings {}
2162);
2163
2164extern_conformance!(
2165 unsafe impl NSCopying for NEDNSOverTLSSettings {}
2166);
2167
2168unsafe impl CopyingHelper for NEDNSOverTLSSettings {
2169 type Result = Self;
2170}
2171
2172extern_conformance!(
2173 unsafe impl NSObjectProtocol for NEDNSOverTLSSettings {}
2174);
2175
2176extern_conformance!(
2177 unsafe impl NSSecureCoding for NEDNSOverTLSSettings {}
2178);
2179
2180impl NEDNSOverTLSSettings {
2181 extern_methods!(
2182 #[unsafe(method(serverName))]
2184 #[unsafe(method_family = none)]
2185 pub unsafe fn serverName(&self) -> Option<Retained<NSString>>;
2186
2187 #[unsafe(method(setServerName:))]
2189 #[unsafe(method_family = none)]
2190 pub unsafe fn setServerName(&self, server_name: Option<&NSString>);
2191
2192 #[unsafe(method(identityReference))]
2194 #[unsafe(method_family = none)]
2195 pub unsafe fn identityReference(&self) -> Option<Retained<NSData>>;
2196
2197 #[unsafe(method(setIdentityReference:))]
2199 #[unsafe(method_family = none)]
2200 pub unsafe fn setIdentityReference(&self, identity_reference: Option<&NSData>);
2201 );
2202}
2203
2204impl NEDNSOverTLSSettings {
2206 extern_methods!(
2207 #[unsafe(method(initWithServers:))]
2211 #[unsafe(method_family = init)]
2212 pub unsafe fn initWithServers(
2213 this: Allocated<Self>,
2214 servers: &NSArray<NSString>,
2215 ) -> Retained<Self>;
2216 );
2217}
2218
2219impl NEDNSOverTLSSettings {
2221 extern_methods!(
2222 #[unsafe(method(init))]
2223 #[unsafe(method_family = init)]
2224 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2225
2226 #[unsafe(method(new))]
2227 #[unsafe(method_family = new)]
2228 pub unsafe fn new() -> Retained<Self>;
2229 );
2230}
2231
2232extern_class!(
2233 #[unsafe(super(NEDNSSettings, NSObject))]
2235 #[derive(Debug, PartialEq, Eq, Hash)]
2236 pub struct NEDNSOverHTTPSSettings;
2237);
2238
2239extern_conformance!(
2240 unsafe impl NSCoding for NEDNSOverHTTPSSettings {}
2241);
2242
2243extern_conformance!(
2244 unsafe impl NSCopying for NEDNSOverHTTPSSettings {}
2245);
2246
2247unsafe impl CopyingHelper for NEDNSOverHTTPSSettings {
2248 type Result = Self;
2249}
2250
2251extern_conformance!(
2252 unsafe impl NSObjectProtocol for NEDNSOverHTTPSSettings {}
2253);
2254
2255extern_conformance!(
2256 unsafe impl NSSecureCoding for NEDNSOverHTTPSSettings {}
2257);
2258
2259impl NEDNSOverHTTPSSettings {
2260 extern_methods!(
2261 #[unsafe(method(serverURL))]
2263 #[unsafe(method_family = none)]
2264 pub unsafe fn serverURL(&self) -> Option<Retained<NSURL>>;
2265
2266 #[unsafe(method(setServerURL:))]
2268 #[unsafe(method_family = none)]
2269 pub unsafe fn setServerURL(&self, server_url: Option<&NSURL>);
2270
2271 #[unsafe(method(identityReference))]
2273 #[unsafe(method_family = none)]
2274 pub unsafe fn identityReference(&self) -> Option<Retained<NSData>>;
2275
2276 #[unsafe(method(setIdentityReference:))]
2278 #[unsafe(method_family = none)]
2279 pub unsafe fn setIdentityReference(&self, identity_reference: Option<&NSData>);
2280 );
2281}
2282
2283impl NEDNSOverHTTPSSettings {
2285 extern_methods!(
2286 #[unsafe(method(initWithServers:))]
2290 #[unsafe(method_family = init)]
2291 pub unsafe fn initWithServers(
2292 this: Allocated<Self>,
2293 servers: &NSArray<NSString>,
2294 ) -> Retained<Self>;
2295 );
2296}
2297
2298impl NEDNSOverHTTPSSettings {
2300 extern_methods!(
2301 #[unsafe(method(init))]
2302 #[unsafe(method_family = init)]
2303 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2304
2305 #[unsafe(method(new))]
2306 #[unsafe(method_family = new)]
2307 pub unsafe fn new() -> Retained<Self>;
2308 );
2309}
2310
2311#[repr(transparent)]
2316#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2317pub struct NEDNSSettingsManagerError(pub NSInteger);
2318impl NEDNSSettingsManagerError {
2319 #[doc(alias = "NEDNSSettingsManagerErrorConfigurationInvalid")]
2320 pub const ConfigurationInvalid: Self = Self(1);
2321 #[doc(alias = "NEDNSSettingsManagerErrorConfigurationDisabled")]
2322 pub const ConfigurationDisabled: Self = Self(2);
2323 #[doc(alias = "NEDNSSettingsManagerErrorConfigurationStale")]
2324 pub const ConfigurationStale: Self = Self(3);
2325 #[doc(alias = "NEDNSSettingsManagerErrorConfigurationCannotBeRemoved")]
2326 pub const ConfigurationCannotBeRemoved: Self = Self(4);
2327}
2328
2329unsafe impl Encode for NEDNSSettingsManagerError {
2330 const ENCODING: Encoding = NSInteger::ENCODING;
2331}
2332
2333unsafe impl RefEncode for NEDNSSettingsManagerError {
2334 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2335}
2336
2337extern "C" {
2338 pub static NEDNSSettingsErrorDomain: &'static NSString;
2340}
2341
2342extern "C" {
2343 pub static NEDNSSettingsConfigurationDidChangeNotification: &'static NSString;
2345}
2346
2347extern_class!(
2348 #[unsafe(super(NSObject))]
2356 #[derive(Debug, PartialEq, Eq, Hash)]
2357 pub struct NEDNSSettingsManager;
2358);
2359
2360extern_conformance!(
2361 unsafe impl NSObjectProtocol for NEDNSSettingsManager {}
2362);
2363
2364impl NEDNSSettingsManager {
2365 extern_methods!(
2366 #[unsafe(method(sharedManager))]
2368 #[unsafe(method_family = none)]
2369 pub unsafe fn sharedManager() -> Retained<NEDNSSettingsManager>;
2370
2371 #[cfg(feature = "block2")]
2372 #[unsafe(method(loadFromPreferencesWithCompletionHandler:))]
2376 #[unsafe(method_family = none)]
2377 pub unsafe fn loadFromPreferencesWithCompletionHandler(
2378 &self,
2379 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
2380 );
2381
2382 #[cfg(feature = "block2")]
2383 #[unsafe(method(removeFromPreferencesWithCompletionHandler:))]
2387 #[unsafe(method_family = none)]
2388 pub unsafe fn removeFromPreferencesWithCompletionHandler(
2389 &self,
2390 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
2391 );
2392
2393 #[cfg(feature = "block2")]
2394 #[unsafe(method(saveToPreferencesWithCompletionHandler:))]
2398 #[unsafe(method_family = none)]
2399 pub unsafe fn saveToPreferencesWithCompletionHandler(
2400 &self,
2401 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
2402 );
2403
2404 #[unsafe(method(localizedDescription))]
2406 #[unsafe(method_family = none)]
2407 pub unsafe fn localizedDescription(&self) -> Option<Retained<NSString>>;
2408
2409 #[unsafe(method(setLocalizedDescription:))]
2411 #[unsafe(method_family = none)]
2412 pub unsafe fn setLocalizedDescription(&self, localized_description: Option<&NSString>);
2413
2414 #[unsafe(method(dnsSettings))]
2416 #[unsafe(method_family = none)]
2417 pub unsafe fn dnsSettings(&self) -> Option<Retained<NEDNSSettings>>;
2418
2419 #[unsafe(method(setDnsSettings:))]
2421 #[unsafe(method_family = none)]
2422 pub unsafe fn setDnsSettings(&self, dns_settings: Option<&NEDNSSettings>);
2423
2424 #[unsafe(method(onDemandRules))]
2426 #[unsafe(method_family = none)]
2427 pub unsafe fn onDemandRules(&self) -> Option<Retained<NSArray<NEOnDemandRule>>>;
2428
2429 #[unsafe(method(setOnDemandRules:))]
2431 #[unsafe(method_family = none)]
2432 pub unsafe fn setOnDemandRules(&self, on_demand_rules: Option<&NSArray<NEOnDemandRule>>);
2433
2434 #[unsafe(method(isEnabled))]
2436 #[unsafe(method_family = none)]
2437 pub unsafe fn isEnabled(&self) -> bool;
2438 );
2439}
2440
2441impl NEDNSSettingsManager {
2443 extern_methods!(
2444 #[unsafe(method(init))]
2445 #[unsafe(method_family = init)]
2446 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2447
2448 #[unsafe(method(new))]
2449 #[unsafe(method_family = new)]
2450 pub unsafe fn new() -> Retained<Self>;
2451 );
2452}
2453
2454#[repr(transparent)]
2459#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2460pub struct NENetworkRuleProtocol(pub NSInteger);
2461impl NENetworkRuleProtocol {
2462 #[doc(alias = "NENetworkRuleProtocolAny")]
2463 pub const Any: Self = Self(0);
2464 #[doc(alias = "NENetworkRuleProtocolTCP")]
2465 pub const TCP: Self = Self(1);
2466 #[doc(alias = "NENetworkRuleProtocolUDP")]
2467 pub const UDP: Self = Self(2);
2468}
2469
2470unsafe impl Encode for NENetworkRuleProtocol {
2471 const ENCODING: Encoding = NSInteger::ENCODING;
2472}
2473
2474unsafe impl RefEncode for NENetworkRuleProtocol {
2475 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2476}
2477
2478#[repr(transparent)]
2483#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2484pub struct NETrafficDirection(pub NSInteger);
2485impl NETrafficDirection {
2486 #[doc(alias = "NETrafficDirectionAny")]
2487 pub const Any: Self = Self(0);
2488 #[doc(alias = "NETrafficDirectionInbound")]
2489 pub const Inbound: Self = Self(1);
2490 #[doc(alias = "NETrafficDirectionOutbound")]
2491 pub const Outbound: Self = Self(2);
2492}
2493
2494unsafe impl Encode for NETrafficDirection {
2495 const ENCODING: Encoding = NSInteger::ENCODING;
2496}
2497
2498unsafe impl RefEncode for NETrafficDirection {
2499 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2500}
2501
2502extern_class!(
2503 #[unsafe(super(NSObject))]
2507 #[derive(Debug, PartialEq, Eq, Hash)]
2508 pub struct NENetworkRule;
2509);
2510
2511extern_conformance!(
2512 unsafe impl NSCoding for NENetworkRule {}
2513);
2514
2515extern_conformance!(
2516 unsafe impl NSCopying for NENetworkRule {}
2517);
2518
2519unsafe impl CopyingHelper for NENetworkRule {
2520 type Result = Self;
2521}
2522
2523extern_conformance!(
2524 unsafe impl NSObjectProtocol for NENetworkRule {}
2525);
2526
2527extern_conformance!(
2528 unsafe impl NSSecureCoding for NENetworkRule {}
2529);
2530
2531impl NENetworkRule {
2532 extern_methods!(
2533 #[deprecated]
2545 #[unsafe(method(initWithDestinationNetwork:prefix:protocol:))]
2546 #[unsafe(method_family = init)]
2547 pub unsafe fn initWithDestinationNetwork_prefix_protocol(
2548 this: Allocated<Self>,
2549 network_endpoint: &NWHostEndpoint,
2550 destination_prefix: NSUInteger,
2551 protocol: NENetworkRuleProtocol,
2552 ) -> Retained<Self>;
2553
2554 #[deprecated]
2578 #[unsafe(method(initWithDestinationHost:protocol:))]
2579 #[unsafe(method_family = init)]
2580 pub unsafe fn initWithDestinationHost_protocol(
2581 this: Allocated<Self>,
2582 host_endpoint: &NWHostEndpoint,
2583 protocol: NENetworkRuleProtocol,
2584 ) -> Retained<Self>;
2585
2586 #[deprecated]
2611 #[unsafe(method(initWithRemoteNetwork:remotePrefix:localNetwork:localPrefix:protocol:direction:))]
2612 #[unsafe(method_family = init)]
2613 pub unsafe fn initWithRemoteNetwork_remotePrefix_localNetwork_localPrefix_protocol_direction(
2614 this: Allocated<Self>,
2615 remote_network: Option<&NWHostEndpoint>,
2616 remote_prefix: NSUInteger,
2617 local_network: Option<&NWHostEndpoint>,
2618 local_prefix: NSUInteger,
2619 protocol: NENetworkRuleProtocol,
2620 direction: NETrafficDirection,
2621 ) -> Retained<Self>;
2622
2623 #[deprecated]
2625 #[unsafe(method(matchRemoteEndpoint))]
2626 #[unsafe(method_family = none)]
2627 pub unsafe fn matchRemoteEndpoint(&self) -> Option<Retained<NWHostEndpoint>>;
2628
2629 #[unsafe(method(matchRemotePrefix))]
2631 #[unsafe(method_family = none)]
2632 pub unsafe fn matchRemotePrefix(&self) -> NSUInteger;
2633
2634 #[deprecated]
2636 #[unsafe(method(matchLocalNetwork))]
2637 #[unsafe(method_family = none)]
2638 pub unsafe fn matchLocalNetwork(&self) -> Option<Retained<NWHostEndpoint>>;
2639
2640 #[unsafe(method(matchLocalPrefix))]
2642 #[unsafe(method_family = none)]
2643 pub unsafe fn matchLocalPrefix(&self) -> NSUInteger;
2644
2645 #[unsafe(method(matchProtocol))]
2647 #[unsafe(method_family = none)]
2648 pub unsafe fn matchProtocol(&self) -> NENetworkRuleProtocol;
2649
2650 #[unsafe(method(matchDirection))]
2652 #[unsafe(method_family = none)]
2653 pub unsafe fn matchDirection(&self) -> NETrafficDirection;
2654 );
2655}
2656
2657impl NENetworkRule {
2659 extern_methods!(
2660 #[unsafe(method(init))]
2661 #[unsafe(method_family = init)]
2662 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2663
2664 #[unsafe(method(new))]
2665 #[unsafe(method_family = new)]
2666 pub unsafe fn new() -> Retained<Self>;
2667 );
2668}
2669
2670extern_class!(
2671 #[unsafe(super(NSObject))]
2677 #[derive(Debug, PartialEq, Eq, Hash)]
2678 pub struct NEFilterFlow;
2679);
2680
2681extern_conformance!(
2682 unsafe impl NSCoding for NEFilterFlow {}
2683);
2684
2685extern_conformance!(
2686 unsafe impl NSCopying for NEFilterFlow {}
2687);
2688
2689unsafe impl CopyingHelper for NEFilterFlow {
2690 type Result = Self;
2691}
2692
2693extern_conformance!(
2694 unsafe impl NSObjectProtocol for NEFilterFlow {}
2695);
2696
2697extern_conformance!(
2698 unsafe impl NSSecureCoding for NEFilterFlow {}
2699);
2700
2701impl NEFilterFlow {
2702 extern_methods!(
2703 #[unsafe(method(URL))]
2705 #[unsafe(method_family = none)]
2706 pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;
2707
2708 #[unsafe(method(sourceAppUniqueIdentifier))]
2710 #[unsafe(method_family = none)]
2711 pub unsafe fn sourceAppUniqueIdentifier(&self) -> Option<Retained<NSData>>;
2712
2713 #[unsafe(method(sourceAppIdentifier))]
2715 #[unsafe(method_family = none)]
2716 pub unsafe fn sourceAppIdentifier(&self) -> Option<Retained<NSString>>;
2717
2718 #[unsafe(method(sourceAppVersion))]
2720 #[unsafe(method_family = none)]
2721 pub unsafe fn sourceAppVersion(&self) -> Option<Retained<NSString>>;
2722
2723 #[unsafe(method(direction))]
2725 #[unsafe(method_family = none)]
2726 pub unsafe fn direction(&self) -> NETrafficDirection;
2727
2728 #[unsafe(method(sourceAppAuditToken))]
2730 #[unsafe(method_family = none)]
2731 pub unsafe fn sourceAppAuditToken(&self) -> Option<Retained<NSData>>;
2732
2733 #[unsafe(method(sourceProcessAuditToken))]
2737 #[unsafe(method_family = none)]
2738 pub unsafe fn sourceProcessAuditToken(&self) -> Option<Retained<NSData>>;
2739
2740 #[unsafe(method(identifier))]
2742 #[unsafe(method_family = none)]
2743 pub unsafe fn identifier(&self) -> Retained<NSUUID>;
2744 );
2745}
2746
2747impl NEFilterFlow {
2749 extern_methods!(
2750 #[unsafe(method(init))]
2751 #[unsafe(method_family = init)]
2752 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2753
2754 #[unsafe(method(new))]
2755 #[unsafe(method_family = new)]
2756 pub unsafe fn new() -> Retained<Self>;
2757 );
2758}
2759
2760extern_class!(
2761 #[unsafe(super(NEFilterFlow, NSObject))]
2767 #[derive(Debug, PartialEq, Eq, Hash)]
2768 pub struct NEFilterBrowserFlow;
2769);
2770
2771extern_conformance!(
2772 unsafe impl NSCoding for NEFilterBrowserFlow {}
2773);
2774
2775extern_conformance!(
2776 unsafe impl NSCopying for NEFilterBrowserFlow {}
2777);
2778
2779unsafe impl CopyingHelper for NEFilterBrowserFlow {
2780 type Result = Self;
2781}
2782
2783extern_conformance!(
2784 unsafe impl NSObjectProtocol for NEFilterBrowserFlow {}
2785);
2786
2787extern_conformance!(
2788 unsafe impl NSSecureCoding for NEFilterBrowserFlow {}
2789);
2790
2791impl NEFilterBrowserFlow {
2792 extern_methods!(
2793 #[unsafe(method(request))]
2795 #[unsafe(method_family = none)]
2796 pub unsafe fn request(&self) -> Option<Retained<NSURLRequest>>;
2797
2798 #[unsafe(method(response))]
2800 #[unsafe(method_family = none)]
2801 pub unsafe fn response(&self) -> Option<Retained<NSURLResponse>>;
2802
2803 #[unsafe(method(parentURL))]
2805 #[unsafe(method_family = none)]
2806 pub unsafe fn parentURL(&self) -> Option<Retained<NSURL>>;
2807 );
2808}
2809
2810impl NEFilterBrowserFlow {
2812 extern_methods!(
2813 #[unsafe(method(init))]
2814 #[unsafe(method_family = init)]
2815 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2816
2817 #[unsafe(method(new))]
2818 #[unsafe(method_family = new)]
2819 pub unsafe fn new() -> Retained<Self>;
2820 );
2821}
2822
2823extern_class!(
2824 #[unsafe(super(NEFilterFlow, NSObject))]
2830 #[derive(Debug, PartialEq, Eq, Hash)]
2831 pub struct NEFilterSocketFlow;
2832);
2833
2834extern_conformance!(
2835 unsafe impl NSCoding for NEFilterSocketFlow {}
2836);
2837
2838extern_conformance!(
2839 unsafe impl NSCopying for NEFilterSocketFlow {}
2840);
2841
2842unsafe impl CopyingHelper for NEFilterSocketFlow {
2843 type Result = Self;
2844}
2845
2846extern_conformance!(
2847 unsafe impl NSObjectProtocol for NEFilterSocketFlow {}
2848);
2849
2850extern_conformance!(
2851 unsafe impl NSSecureCoding for NEFilterSocketFlow {}
2852);
2853
2854impl NEFilterSocketFlow {
2855 extern_methods!(
2856 #[deprecated]
2859 #[unsafe(method(remoteEndpoint))]
2860 #[unsafe(method_family = none)]
2861 pub unsafe fn remoteEndpoint(&self) -> Option<Retained<NWEndpoint>>;
2862
2863 #[unsafe(method(remoteHostname))]
2865 #[unsafe(method_family = none)]
2866 pub unsafe fn remoteHostname(&self) -> Option<Retained<NSString>>;
2867
2868 #[deprecated]
2871 #[unsafe(method(localEndpoint))]
2872 #[unsafe(method_family = none)]
2873 pub unsafe fn localEndpoint(&self) -> Option<Retained<NWEndpoint>>;
2874
2875 #[unsafe(method(socketFamily))]
2877 #[unsafe(method_family = none)]
2878 pub unsafe fn socketFamily(&self) -> c_int;
2879
2880 #[unsafe(method(socketType))]
2882 #[unsafe(method_family = none)]
2883 pub unsafe fn socketType(&self) -> c_int;
2884
2885 #[unsafe(method(socketProtocol))]
2887 #[unsafe(method_family = none)]
2888 pub unsafe fn socketProtocol(&self) -> c_int;
2889 );
2890}
2891
2892impl NEFilterSocketFlow {
2894 extern_methods!(
2895 #[unsafe(method(init))]
2896 #[unsafe(method_family = init)]
2897 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2898
2899 #[unsafe(method(new))]
2900 #[unsafe(method_family = new)]
2901 pub unsafe fn new() -> Retained<Self>;
2902 );
2903}
2904
2905extern_class!(
2906 #[unsafe(super(NEProvider, NSObject))]
2913 #[derive(Debug, PartialEq, Eq, Hash)]
2914 pub struct NEFilterProvider;
2915);
2916
2917extern_conformance!(
2918 unsafe impl NSObjectProtocol for NEFilterProvider {}
2919);
2920
2921impl NEFilterProvider {
2922 extern_methods!(
2923 #[cfg(feature = "block2")]
2924 #[unsafe(method(startFilterWithCompletionHandler:))]
2931 #[unsafe(method_family = none)]
2932 pub unsafe fn startFilterWithCompletionHandler(
2933 &self,
2934 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
2935 );
2936
2937 #[cfg(feature = "block2")]
2938 #[unsafe(method(stopFilterWithReason:completionHandler:))]
2945 #[unsafe(method_family = none)]
2946 pub unsafe fn stopFilterWithReason_completionHandler(
2947 &self,
2948 reason: NEProviderStopReason,
2949 completion_handler: &block2::DynBlock<dyn Fn()>,
2950 );
2951
2952 #[unsafe(method(filterConfiguration))]
2956 #[unsafe(method_family = none)]
2957 pub unsafe fn filterConfiguration(&self) -> Retained<NEFilterProviderConfiguration>;
2958
2959 #[unsafe(method(handleReport:))]
2964 #[unsafe(method_family = none)]
2965 pub unsafe fn handleReport(&self, report: &NEFilterReport);
2966 );
2967}
2968
2969impl NEFilterProvider {
2971 extern_methods!(
2972 #[unsafe(method(init))]
2973 #[unsafe(method_family = init)]
2974 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2975
2976 #[unsafe(method(new))]
2977 #[unsafe(method_family = new)]
2978 pub unsafe fn new() -> Retained<Self>;
2979 );
2980}
2981
2982#[repr(transparent)]
2987#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2988pub struct NEFilterReportFrequency(pub NSInteger);
2989impl NEFilterReportFrequency {
2990 #[doc(alias = "NEFilterReportFrequencyNone")]
2991 pub const None: Self = Self(0);
2992 #[doc(alias = "NEFilterReportFrequencyLow")]
2993 pub const Low: Self = Self(1);
2994 #[doc(alias = "NEFilterReportFrequencyMedium")]
2995 pub const Medium: Self = Self(2);
2996 #[doc(alias = "NEFilterReportFrequencyHigh")]
2997 pub const High: Self = Self(3);
2998}
2999
3000unsafe impl Encode for NEFilterReportFrequency {
3001 const ENCODING: Encoding = NSInteger::ENCODING;
3002}
3003
3004unsafe impl RefEncode for NEFilterReportFrequency {
3005 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3006}
3007
3008extern_class!(
3009 #[unsafe(super(NSObject))]
3016 #[derive(Debug, PartialEq, Eq, Hash)]
3017 pub struct NEFilterVerdict;
3018);
3019
3020extern_conformance!(
3021 unsafe impl NSCoding for NEFilterVerdict {}
3022);
3023
3024extern_conformance!(
3025 unsafe impl NSCopying for NEFilterVerdict {}
3026);
3027
3028unsafe impl CopyingHelper for NEFilterVerdict {
3029 type Result = Self;
3030}
3031
3032extern_conformance!(
3033 unsafe impl NSObjectProtocol for NEFilterVerdict {}
3034);
3035
3036extern_conformance!(
3037 unsafe impl NSSecureCoding for NEFilterVerdict {}
3038);
3039
3040impl NEFilterVerdict {
3041 extern_methods!(
3042 #[unsafe(method(shouldReport))]
3051 #[unsafe(method_family = none)]
3052 pub unsafe fn shouldReport(&self) -> bool;
3053
3054 #[unsafe(method(setShouldReport:))]
3056 #[unsafe(method_family = none)]
3057 pub unsafe fn setShouldReport(&self, should_report: bool);
3058 );
3059}
3060
3061impl NEFilterVerdict {
3063 extern_methods!(
3064 #[unsafe(method(init))]
3065 #[unsafe(method_family = init)]
3066 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3067
3068 #[unsafe(method(new))]
3069 #[unsafe(method_family = new)]
3070 pub unsafe fn new() -> Retained<Self>;
3071 );
3072}
3073
3074extern_class!(
3075 #[unsafe(super(NEFilterVerdict, NSObject))]
3082 #[derive(Debug, PartialEq, Eq, Hash)]
3083 pub struct NEFilterNewFlowVerdict;
3084);
3085
3086extern_conformance!(
3087 unsafe impl NSCoding for NEFilterNewFlowVerdict {}
3088);
3089
3090extern_conformance!(
3091 unsafe impl NSCopying for NEFilterNewFlowVerdict {}
3092);
3093
3094unsafe impl CopyingHelper for NEFilterNewFlowVerdict {
3095 type Result = Self;
3096}
3097
3098extern_conformance!(
3099 unsafe impl NSObjectProtocol for NEFilterNewFlowVerdict {}
3100);
3101
3102extern_conformance!(
3103 unsafe impl NSSecureCoding for NEFilterNewFlowVerdict {}
3104);
3105
3106impl NEFilterNewFlowVerdict {
3107 extern_methods!(
3108 #[unsafe(method(statisticsReportFrequency))]
3111 #[unsafe(method_family = none)]
3112 pub unsafe fn statisticsReportFrequency(&self) -> NEFilterReportFrequency;
3113
3114 #[unsafe(method(setStatisticsReportFrequency:))]
3116 #[unsafe(method_family = none)]
3117 pub unsafe fn setStatisticsReportFrequency(
3118 &self,
3119 statistics_report_frequency: NEFilterReportFrequency,
3120 );
3121
3122 #[unsafe(method(needRulesVerdict))]
3128 #[unsafe(method_family = none)]
3129 pub unsafe fn needRulesVerdict() -> Retained<NEFilterNewFlowVerdict>;
3130
3131 #[unsafe(method(allowVerdict))]
3135 #[unsafe(method_family = none)]
3136 pub unsafe fn allowVerdict() -> Retained<NEFilterNewFlowVerdict>;
3137
3138 #[unsafe(method(dropVerdict))]
3142 #[unsafe(method_family = none)]
3143 pub unsafe fn dropVerdict() -> Retained<NEFilterNewFlowVerdict>;
3144
3145 #[unsafe(method(remediateVerdictWithRemediationURLMapKey:remediationButtonTextMapKey:))]
3152 #[unsafe(method_family = none)]
3153 pub unsafe fn remediateVerdictWithRemediationURLMapKey_remediationButtonTextMapKey(
3154 remediation_url_map_key: &NSString,
3155 remediation_button_text_map_key: &NSString,
3156 ) -> Retained<NEFilterNewFlowVerdict>;
3157
3158 #[unsafe(method(URLAppendStringVerdictWithMapKey:))]
3164 #[unsafe(method_family = none)]
3165 pub unsafe fn URLAppendStringVerdictWithMapKey(
3166 url_append_map_key: &NSString,
3167 ) -> Retained<NEFilterNewFlowVerdict>;
3168
3169 #[unsafe(method(filterDataVerdictWithFilterInbound:peekInboundBytes:filterOutbound:peekOutboundBytes:))]
3184 #[unsafe(method_family = none)]
3185 pub unsafe fn filterDataVerdictWithFilterInbound_peekInboundBytes_filterOutbound_peekOutboundBytes(
3186 filter_inbound: bool,
3187 peek_inbound_bytes: NSUInteger,
3188 filter_outbound: bool,
3189 peek_outbound_bytes: NSUInteger,
3190 ) -> Retained<NEFilterNewFlowVerdict>;
3191
3192 #[unsafe(method(pauseVerdict))]
3198 #[unsafe(method_family = none)]
3199 pub unsafe fn pauseVerdict() -> Retained<NEFilterNewFlowVerdict>;
3200 );
3201}
3202
3203impl NEFilterNewFlowVerdict {
3205 extern_methods!(
3206 #[unsafe(method(init))]
3207 #[unsafe(method_family = init)]
3208 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3209
3210 #[unsafe(method(new))]
3211 #[unsafe(method_family = new)]
3212 pub unsafe fn new() -> Retained<Self>;
3213 );
3214}
3215
3216extern_class!(
3217 #[unsafe(super(NEFilterNewFlowVerdict, NEFilterVerdict, NSObject))]
3224 #[derive(Debug, PartialEq, Eq, Hash)]
3225 pub struct NEFilterControlVerdict;
3226);
3227
3228extern_conformance!(
3229 unsafe impl NSCoding for NEFilterControlVerdict {}
3230);
3231
3232extern_conformance!(
3233 unsafe impl NSCopying for NEFilterControlVerdict {}
3234);
3235
3236unsafe impl CopyingHelper for NEFilterControlVerdict {
3237 type Result = Self;
3238}
3239
3240extern_conformance!(
3241 unsafe impl NSObjectProtocol for NEFilterControlVerdict {}
3242);
3243
3244extern_conformance!(
3245 unsafe impl NSSecureCoding for NEFilterControlVerdict {}
3246);
3247
3248impl NEFilterControlVerdict {
3249 extern_methods!(
3250 #[unsafe(method(allowVerdictWithUpdateRules:))]
3257 #[unsafe(method_family = none)]
3258 pub unsafe fn allowVerdictWithUpdateRules(
3259 update_rules: bool,
3260 ) -> Retained<NEFilterControlVerdict>;
3261
3262 #[unsafe(method(dropVerdictWithUpdateRules:))]
3269 #[unsafe(method_family = none)]
3270 pub unsafe fn dropVerdictWithUpdateRules(
3271 update_rules: bool,
3272 ) -> Retained<NEFilterControlVerdict>;
3273
3274 #[unsafe(method(updateRules))]
3279 #[unsafe(method_family = none)]
3280 pub unsafe fn updateRules() -> Retained<NEFilterControlVerdict>;
3281 );
3282}
3283
3284impl NEFilterControlVerdict {
3286 extern_methods!(
3287 #[unsafe(method(init))]
3288 #[unsafe(method_family = init)]
3289 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3290
3291 #[unsafe(method(new))]
3292 #[unsafe(method_family = new)]
3293 pub unsafe fn new() -> Retained<Self>;
3294 );
3295}
3296
3297#[repr(transparent)]
3303#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3304pub struct NEFilterAction(pub NSInteger);
3305impl NEFilterAction {
3306 #[doc(alias = "NEFilterActionInvalid")]
3307 pub const Invalid: Self = Self(0);
3308 #[doc(alias = "NEFilterActionAllow")]
3309 pub const Allow: Self = Self(1);
3310 #[doc(alias = "NEFilterActionDrop")]
3311 pub const Drop: Self = Self(2);
3312 #[doc(alias = "NEFilterActionRemediate")]
3313 pub const Remediate: Self = Self(3);
3314 #[doc(alias = "NEFilterActionFilterData")]
3315 pub const FilterData: Self = Self(4);
3316}
3317
3318unsafe impl Encode for NEFilterAction {
3319 const ENCODING: Encoding = NSInteger::ENCODING;
3320}
3321
3322unsafe impl RefEncode for NEFilterAction {
3323 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3324}
3325
3326#[repr(transparent)]
3331#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3332pub struct NEFilterReportEvent(pub NSInteger);
3333impl NEFilterReportEvent {
3334 #[doc(alias = "NEFilterReportEventNewFlow")]
3335 pub const NewFlow: Self = Self(1);
3336 #[doc(alias = "NEFilterReportEventDataDecision")]
3337 pub const DataDecision: Self = Self(2);
3338 #[doc(alias = "NEFilterReportEventFlowClosed")]
3339 pub const FlowClosed: Self = Self(3);
3340 #[doc(alias = "NEFilterReportEventStatistics")]
3341 pub const Statistics: Self = Self(4);
3342}
3343
3344unsafe impl Encode for NEFilterReportEvent {
3345 const ENCODING: Encoding = NSInteger::ENCODING;
3346}
3347
3348unsafe impl RefEncode for NEFilterReportEvent {
3349 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3350}
3351
3352extern_class!(
3353 #[unsafe(super(NSObject))]
3360 #[derive(Debug, PartialEq, Eq, Hash)]
3361 pub struct NEFilterReport;
3362);
3363
3364extern_conformance!(
3365 unsafe impl NSCoding for NEFilterReport {}
3366);
3367
3368extern_conformance!(
3369 unsafe impl NSCopying for NEFilterReport {}
3370);
3371
3372unsafe impl CopyingHelper for NEFilterReport {
3373 type Result = Self;
3374}
3375
3376extern_conformance!(
3377 unsafe impl NSObjectProtocol for NEFilterReport {}
3378);
3379
3380extern_conformance!(
3381 unsafe impl NSSecureCoding for NEFilterReport {}
3382);
3383
3384impl NEFilterReport {
3385 extern_methods!(
3386 #[unsafe(method(flow))]
3388 #[unsafe(method_family = none)]
3389 pub unsafe fn flow(&self) -> Option<Retained<NEFilterFlow>>;
3390
3391 #[unsafe(method(action))]
3393 #[unsafe(method_family = none)]
3394 pub unsafe fn action(&self) -> NEFilterAction;
3395
3396 #[unsafe(method(event))]
3398 #[unsafe(method_family = none)]
3399 pub unsafe fn event(&self) -> NEFilterReportEvent;
3400
3401 #[unsafe(method(bytesInboundCount))]
3403 #[unsafe(method_family = none)]
3404 pub unsafe fn bytesInboundCount(&self) -> NSUInteger;
3405
3406 #[unsafe(method(bytesOutboundCount))]
3408 #[unsafe(method_family = none)]
3409 pub unsafe fn bytesOutboundCount(&self) -> NSUInteger;
3410 );
3411}
3412
3413impl NEFilterReport {
3415 extern_methods!(
3416 #[unsafe(method(init))]
3417 #[unsafe(method_family = init)]
3418 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3419
3420 #[unsafe(method(new))]
3421 #[unsafe(method_family = new)]
3422 pub unsafe fn new() -> Retained<Self>;
3423 );
3424}
3425
3426extern_class!(
3427 #[unsafe(super(NEFilterProvider, NEProvider, NSObject))]
3431 #[derive(Debug, PartialEq, Eq, Hash)]
3432 pub struct NEFilterControlProvider;
3433);
3434
3435extern_conformance!(
3436 unsafe impl NSObjectProtocol for NEFilterControlProvider {}
3437);
3438
3439impl NEFilterControlProvider {
3440 extern_methods!(
3441 #[unsafe(method(remediationMap))]
3463 #[unsafe(method_family = none)]
3464 pub unsafe fn remediationMap(
3465 &self,
3466 ) -> Option<Retained<NSDictionary<NSString, NSDictionary<NSString, NSObject>>>>;
3467
3468 #[unsafe(method(setRemediationMap:))]
3470 #[unsafe(method_family = none)]
3471 pub unsafe fn setRemediationMap(
3472 &self,
3473 remediation_map: Option<&NSDictionary<NSString, NSDictionary<NSString, NSObject>>>,
3474 );
3475
3476 #[unsafe(method(URLAppendStringMap))]
3478 #[unsafe(method_family = none)]
3479 pub unsafe fn URLAppendStringMap(
3480 &self,
3481 ) -> Option<Retained<NSDictionary<NSString, NSString>>>;
3482
3483 #[unsafe(method(setURLAppendStringMap:))]
3485 #[unsafe(method_family = none)]
3486 pub unsafe fn setURLAppendStringMap(
3487 &self,
3488 url_append_string_map: Option<&NSDictionary<NSString, NSString>>,
3489 );
3490
3491 #[cfg(feature = "block2")]
3492 #[unsafe(method(handleRemediationForFlow:completionHandler:))]
3498 #[unsafe(method_family = none)]
3499 pub unsafe fn handleRemediationForFlow_completionHandler(
3500 &self,
3501 flow: &NEFilterFlow,
3502 completion_handler: &block2::DynBlock<dyn Fn(NonNull<NEFilterControlVerdict>)>,
3503 );
3504
3505 #[cfg(feature = "block2")]
3506 #[unsafe(method(handleNewFlow:completionHandler:))]
3512 #[unsafe(method_family = none)]
3513 pub unsafe fn handleNewFlow_completionHandler(
3514 &self,
3515 flow: &NEFilterFlow,
3516 completion_handler: &block2::DynBlock<dyn Fn(NonNull<NEFilterControlVerdict>)>,
3517 );
3518
3519 #[unsafe(method(notifyRulesChanged))]
3521 #[unsafe(method_family = none)]
3522 pub unsafe fn notifyRulesChanged(&self);
3523 );
3524}
3525
3526impl NEFilterControlProvider {
3528 extern_methods!(
3529 #[unsafe(method(init))]
3530 #[unsafe(method_family = init)]
3531 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3532
3533 #[unsafe(method(new))]
3534 #[unsafe(method_family = new)]
3535 pub unsafe fn new() -> Retained<Self>;
3536 );
3537}
3538
3539#[repr(transparent)]
3544#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3545pub struct NEFilterDataAttribute(pub NSInteger);
3546impl NEFilterDataAttribute {
3547 #[doc(alias = "NEFilterDataAttributeHasIPHeader")]
3548 pub const HasIPHeader: Self = Self(0x00000001);
3549}
3550
3551unsafe impl Encode for NEFilterDataAttribute {
3552 const ENCODING: Encoding = NSInteger::ENCODING;
3553}
3554
3555unsafe impl RefEncode for NEFilterDataAttribute {
3556 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3557}
3558
3559extern_class!(
3560 #[unsafe(super(NEFilterProvider, NEProvider, NSObject))]
3564 #[derive(Debug, PartialEq, Eq, Hash)]
3565 pub struct NEFilterDataProvider;
3566);
3567
3568extern_conformance!(
3569 unsafe impl NSObjectProtocol for NEFilterDataProvider {}
3570);
3571
3572impl NEFilterDataProvider {
3573 extern_methods!(
3574 #[unsafe(method(handleNewFlow:))]
3580 #[unsafe(method_family = none)]
3581 pub unsafe fn handleNewFlow(&self, flow: &NEFilterFlow)
3582 -> Retained<NEFilterNewFlowVerdict>;
3583
3584 #[unsafe(method(handleInboundDataFromFlow:readBytesStartOffset:readBytes:))]
3594 #[unsafe(method_family = none)]
3595 pub unsafe fn handleInboundDataFromFlow_readBytesStartOffset_readBytes(
3596 &self,
3597 flow: &NEFilterFlow,
3598 offset: NSUInteger,
3599 read_bytes: &NSData,
3600 ) -> Retained<NEFilterDataVerdict>;
3601
3602 #[unsafe(method(handleOutboundDataFromFlow:readBytesStartOffset:readBytes:))]
3612 #[unsafe(method_family = none)]
3613 pub unsafe fn handleOutboundDataFromFlow_readBytesStartOffset_readBytes(
3614 &self,
3615 flow: &NEFilterFlow,
3616 offset: NSUInteger,
3617 read_bytes: &NSData,
3618 ) -> Retained<NEFilterDataVerdict>;
3619
3620 #[unsafe(method(handleInboundDataCompleteForFlow:))]
3626 #[unsafe(method_family = none)]
3627 pub unsafe fn handleInboundDataCompleteForFlow(
3628 &self,
3629 flow: &NEFilterFlow,
3630 ) -> Retained<NEFilterDataVerdict>;
3631
3632 #[unsafe(method(handleOutboundDataCompleteForFlow:))]
3638 #[unsafe(method_family = none)]
3639 pub unsafe fn handleOutboundDataCompleteForFlow(
3640 &self,
3641 flow: &NEFilterFlow,
3642 ) -> Retained<NEFilterDataVerdict>;
3643
3644 #[unsafe(method(handleRemediationForFlow:))]
3650 #[unsafe(method_family = none)]
3651 pub unsafe fn handleRemediationForFlow(
3652 &self,
3653 flow: &NEFilterFlow,
3654 ) -> Retained<NEFilterRemediationVerdict>;
3655
3656 #[unsafe(method(handleRulesChanged))]
3658 #[unsafe(method_family = none)]
3659 pub unsafe fn handleRulesChanged(&self);
3660
3661 #[cfg(feature = "block2")]
3662 #[unsafe(method(applySettings:completionHandler:))]
3669 #[unsafe(method_family = none)]
3670 pub unsafe fn applySettings_completionHandler(
3671 &self,
3672 settings: Option<&NEFilterSettings>,
3673 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
3674 );
3675
3676 #[unsafe(method(resumeFlow:withVerdict:))]
3685 #[unsafe(method_family = none)]
3686 pub unsafe fn resumeFlow_withVerdict(&self, flow: &NEFilterFlow, verdict: &NEFilterVerdict);
3687
3688 #[unsafe(method(updateFlow:usingVerdict:forDirection:))]
3696 #[unsafe(method_family = none)]
3697 pub unsafe fn updateFlow_usingVerdict_forDirection(
3698 &self,
3699 flow: &NEFilterSocketFlow,
3700 verdict: &NEFilterDataVerdict,
3701 direction: NETrafficDirection,
3702 );
3703 );
3704}
3705
3706impl NEFilterDataProvider {
3708 extern_methods!(
3709 #[unsafe(method(init))]
3710 #[unsafe(method_family = init)]
3711 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3712
3713 #[unsafe(method(new))]
3714 #[unsafe(method_family = new)]
3715 pub unsafe fn new() -> Retained<Self>;
3716 );
3717}
3718
3719extern_class!(
3720 #[unsafe(super(NEFilterVerdict, NSObject))]
3726 #[derive(Debug, PartialEq, Eq, Hash)]
3727 pub struct NEFilterDataVerdict;
3728);
3729
3730extern_conformance!(
3731 unsafe impl NSCoding for NEFilterDataVerdict {}
3732);
3733
3734extern_conformance!(
3735 unsafe impl NSCopying for NEFilterDataVerdict {}
3736);
3737
3738unsafe impl CopyingHelper for NEFilterDataVerdict {
3739 type Result = Self;
3740}
3741
3742extern_conformance!(
3743 unsafe impl NSObjectProtocol for NEFilterDataVerdict {}
3744);
3745
3746extern_conformance!(
3747 unsafe impl NSSecureCoding for NEFilterDataVerdict {}
3748);
3749
3750impl NEFilterDataVerdict {
3751 extern_methods!(
3752 #[unsafe(method(statisticsReportFrequency))]
3755 #[unsafe(method_family = none)]
3756 pub unsafe fn statisticsReportFrequency(&self) -> NEFilterReportFrequency;
3757
3758 #[unsafe(method(setStatisticsReportFrequency:))]
3760 #[unsafe(method_family = none)]
3761 pub unsafe fn setStatisticsReportFrequency(
3762 &self,
3763 statistics_report_frequency: NEFilterReportFrequency,
3764 );
3765
3766 #[unsafe(method(allowVerdict))]
3770 #[unsafe(method_family = none)]
3771 pub unsafe fn allowVerdict() -> Retained<NEFilterDataVerdict>;
3772
3773 #[unsafe(method(dropVerdict))]
3777 #[unsafe(method_family = none)]
3778 pub unsafe fn dropVerdict() -> Retained<NEFilterDataVerdict>;
3779
3780 #[unsafe(method(remediateVerdictWithRemediationURLMapKey:remediationButtonTextMapKey:))]
3788 #[unsafe(method_family = none)]
3789 pub unsafe fn remediateVerdictWithRemediationURLMapKey_remediationButtonTextMapKey(
3790 remediation_url_map_key: Option<&NSString>,
3791 remediation_button_text_map_key: Option<&NSString>,
3792 ) -> Retained<NEFilterDataVerdict>;
3793
3794 #[unsafe(method(dataVerdictWithPassBytes:peekBytes:))]
3802 #[unsafe(method_family = none)]
3803 pub unsafe fn dataVerdictWithPassBytes_peekBytes(
3804 pass_bytes: NSUInteger,
3805 peek_bytes: NSUInteger,
3806 ) -> Retained<NEFilterDataVerdict>;
3807
3808 #[unsafe(method(needRulesVerdict))]
3812 #[unsafe(method_family = none)]
3813 pub unsafe fn needRulesVerdict() -> Retained<NEFilterDataVerdict>;
3814
3815 #[unsafe(method(pauseVerdict))]
3821 #[unsafe(method_family = none)]
3822 pub unsafe fn pauseVerdict() -> Retained<NEFilterDataVerdict>;
3823 );
3824}
3825
3826impl NEFilterDataVerdict {
3828 extern_methods!(
3829 #[unsafe(method(init))]
3830 #[unsafe(method_family = init)]
3831 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3832
3833 #[unsafe(method(new))]
3834 #[unsafe(method_family = new)]
3835 pub unsafe fn new() -> Retained<Self>;
3836 );
3837}
3838
3839extern_class!(
3840 #[unsafe(super(NEFilterVerdict, NSObject))]
3846 #[derive(Debug, PartialEq, Eq, Hash)]
3847 pub struct NEFilterRemediationVerdict;
3848);
3849
3850extern_conformance!(
3851 unsafe impl NSCoding for NEFilterRemediationVerdict {}
3852);
3853
3854extern_conformance!(
3855 unsafe impl NSCopying for NEFilterRemediationVerdict {}
3856);
3857
3858unsafe impl CopyingHelper for NEFilterRemediationVerdict {
3859 type Result = Self;
3860}
3861
3862extern_conformance!(
3863 unsafe impl NSObjectProtocol for NEFilterRemediationVerdict {}
3864);
3865
3866extern_conformance!(
3867 unsafe impl NSSecureCoding for NEFilterRemediationVerdict {}
3868);
3869
3870impl NEFilterRemediationVerdict {
3871 extern_methods!(
3872 #[unsafe(method(allowVerdict))]
3876 #[unsafe(method_family = none)]
3877 pub unsafe fn allowVerdict() -> Retained<NEFilterRemediationVerdict>;
3878
3879 #[unsafe(method(dropVerdict))]
3883 #[unsafe(method_family = none)]
3884 pub unsafe fn dropVerdict() -> Retained<NEFilterRemediationVerdict>;
3885
3886 #[unsafe(method(needRulesVerdict))]
3890 #[unsafe(method_family = none)]
3891 pub unsafe fn needRulesVerdict() -> Retained<NEFilterRemediationVerdict>;
3892 );
3893}
3894
3895impl NEFilterRemediationVerdict {
3897 extern_methods!(
3898 #[unsafe(method(init))]
3899 #[unsafe(method_family = init)]
3900 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3901
3902 #[unsafe(method(new))]
3903 #[unsafe(method_family = new)]
3904 pub unsafe fn new() -> Retained<Self>;
3905 );
3906}
3907
3908#[repr(transparent)]
3913#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3914pub struct NEFilterManagerError(pub NSInteger);
3915impl NEFilterManagerError {
3916 #[doc(alias = "NEFilterManagerErrorConfigurationInvalid")]
3917 pub const ConfigurationInvalid: Self = Self(1);
3918 #[doc(alias = "NEFilterManagerErrorConfigurationDisabled")]
3919 pub const ConfigurationDisabled: Self = Self(2);
3920 #[doc(alias = "NEFilterManagerErrorConfigurationStale")]
3921 pub const ConfigurationStale: Self = Self(3);
3922 #[doc(alias = "NEFilterManagerErrorConfigurationCannotBeRemoved")]
3923 pub const ConfigurationCannotBeRemoved: Self = Self(4);
3924 #[doc(alias = "NEFilterManagerErrorConfigurationPermissionDenied")]
3925 pub const ConfigurationPermissionDenied: Self = Self(5);
3926 #[doc(alias = "NEFilterManagerErrorConfigurationInternalError")]
3927 pub const ConfigurationInternalError: Self = Self(6);
3928}
3929
3930unsafe impl Encode for NEFilterManagerError {
3931 const ENCODING: Encoding = NSInteger::ENCODING;
3932}
3933
3934unsafe impl RefEncode for NEFilterManagerError {
3935 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3936}
3937
3938extern "C" {
3939 pub static NEFilterErrorDomain: &'static NSString;
3941}
3942
3943extern "C" {
3944 pub static NEFilterConfigurationDidChangeNotification: &'static NSString;
3946}
3947
3948#[repr(transparent)]
3953#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3954pub struct NEFilterManagerGrade(pub NSInteger);
3955impl NEFilterManagerGrade {
3956 #[doc(alias = "NEFilterManagerGradeFirewall")]
3957 pub const Firewall: Self = Self(1);
3958 #[doc(alias = "NEFilterManagerGradeInspector")]
3959 pub const Inspector: Self = Self(2);
3960}
3961
3962unsafe impl Encode for NEFilterManagerGrade {
3963 const ENCODING: Encoding = NSInteger::ENCODING;
3964}
3965
3966unsafe impl RefEncode for NEFilterManagerGrade {
3967 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3968}
3969
3970extern_class!(
3971 #[unsafe(super(NSObject))]
3979 #[derive(Debug, PartialEq, Eq, Hash)]
3980 pub struct NEFilterManager;
3981);
3982
3983extern_conformance!(
3984 unsafe impl NSObjectProtocol for NEFilterManager {}
3985);
3986
3987impl NEFilterManager {
3988 extern_methods!(
3989 #[unsafe(method(sharedManager))]
3991 #[unsafe(method_family = none)]
3992 pub unsafe fn sharedManager() -> Retained<NEFilterManager>;
3993
3994 #[cfg(feature = "block2")]
3995 #[unsafe(method(loadFromPreferencesWithCompletionHandler:))]
3999 #[unsafe(method_family = none)]
4000 pub unsafe fn loadFromPreferencesWithCompletionHandler(
4001 &self,
4002 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
4003 );
4004
4005 #[cfg(feature = "block2")]
4006 #[unsafe(method(removeFromPreferencesWithCompletionHandler:))]
4010 #[unsafe(method_family = none)]
4011 pub unsafe fn removeFromPreferencesWithCompletionHandler(
4012 &self,
4013 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
4014 );
4015
4016 #[cfg(feature = "block2")]
4017 #[unsafe(method(saveToPreferencesWithCompletionHandler:))]
4021 #[unsafe(method_family = none)]
4022 pub unsafe fn saveToPreferencesWithCompletionHandler(
4023 &self,
4024 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
4025 );
4026
4027 #[unsafe(method(localizedDescription))]
4029 #[unsafe(method_family = none)]
4030 pub unsafe fn localizedDescription(&self) -> Option<Retained<NSString>>;
4031
4032 #[unsafe(method(setLocalizedDescription:))]
4034 #[unsafe(method_family = none)]
4035 pub unsafe fn setLocalizedDescription(&self, localized_description: Option<&NSString>);
4036
4037 #[unsafe(method(providerConfiguration))]
4039 #[unsafe(method_family = none)]
4040 pub unsafe fn providerConfiguration(
4041 &self,
4042 ) -> Option<Retained<NEFilterProviderConfiguration>>;
4043
4044 #[unsafe(method(setProviderConfiguration:))]
4046 #[unsafe(method_family = none)]
4047 pub unsafe fn setProviderConfiguration(
4048 &self,
4049 provider_configuration: Option<&NEFilterProviderConfiguration>,
4050 );
4051
4052 #[unsafe(method(isEnabled))]
4055 #[unsafe(method_family = none)]
4056 pub unsafe fn isEnabled(&self) -> bool;
4057
4058 #[unsafe(method(setEnabled:))]
4060 #[unsafe(method_family = none)]
4061 pub unsafe fn setEnabled(&self, enabled: bool);
4062
4063 #[unsafe(method(grade))]
4065 #[unsafe(method_family = none)]
4066 pub unsafe fn grade(&self) -> NEFilterManagerGrade;
4067
4068 #[unsafe(method(setGrade:))]
4070 #[unsafe(method_family = none)]
4071 pub unsafe fn setGrade(&self, grade: NEFilterManagerGrade);
4072
4073 #[unsafe(method(disableEncryptedDNSSettings))]
4076 #[unsafe(method_family = none)]
4077 pub unsafe fn disableEncryptedDNSSettings(&self) -> bool;
4078
4079 #[unsafe(method(setDisableEncryptedDNSSettings:))]
4081 #[unsafe(method_family = none)]
4082 pub unsafe fn setDisableEncryptedDNSSettings(&self, disable_encrypted_dns_settings: bool);
4083 );
4084}
4085
4086impl NEFilterManager {
4088 extern_methods!(
4089 #[unsafe(method(init))]
4090 #[unsafe(method_family = init)]
4091 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4092
4093 #[unsafe(method(new))]
4094 #[unsafe(method_family = new)]
4095 pub unsafe fn new() -> Retained<Self>;
4096 );
4097}
4098
4099extern_class!(
4100 #[unsafe(super(NSObject))]
4104 #[derive(Debug, PartialEq, Eq, Hash)]
4105 pub struct NEFilterPacketContext;
4106);
4107
4108extern_conformance!(
4109 unsafe impl NSObjectProtocol for NEFilterPacketContext {}
4110);
4111
4112impl NEFilterPacketContext {
4113 extern_methods!();
4114}
4115
4116impl NEFilterPacketContext {
4118 extern_methods!(
4119 #[unsafe(method(init))]
4120 #[unsafe(method_family = init)]
4121 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4122
4123 #[unsafe(method(new))]
4124 #[unsafe(method_family = new)]
4125 pub unsafe fn new() -> Retained<Self>;
4126 );
4127}
4128
4129#[repr(transparent)]
4134#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4135pub struct NEFilterPacketProviderVerdict(pub NSInteger);
4136impl NEFilterPacketProviderVerdict {
4137 #[doc(alias = "NEFilterPacketProviderVerdictAllow")]
4138 pub const Allow: Self = Self(0);
4139 #[doc(alias = "NEFilterPacketProviderVerdictDrop")]
4140 pub const Drop: Self = Self(1);
4141 #[doc(alias = "NEFilterPacketProviderVerdictDelay")]
4142 pub const Delay: Self = Self(2);
4143}
4144
4145unsafe impl Encode for NEFilterPacketProviderVerdict {
4146 const ENCODING: Encoding = NSInteger::ENCODING;
4147}
4148
4149unsafe impl RefEncode for NEFilterPacketProviderVerdict {
4150 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4151}
4152
4153extern_class!(
4154 #[unsafe(super(NEFilterProvider, NEProvider, NSObject))]
4158 #[derive(Debug, PartialEq, Eq, Hash)]
4159 pub struct NEFilterPacketProvider;
4160);
4161
4162extern_conformance!(
4163 unsafe impl NSObjectProtocol for NEFilterPacketProvider {}
4164);
4165
4166impl NEFilterPacketProvider {
4167 extern_methods!(
4168 #[unsafe(method(delayCurrentPacket:))]
4177 #[unsafe(method_family = none)]
4178 pub unsafe fn delayCurrentPacket(
4179 &self,
4180 context: &NEFilterPacketContext,
4181 ) -> Retained<NEPacket>;
4182
4183 #[unsafe(method(allowPacket:))]
4187 #[unsafe(method_family = none)]
4188 pub unsafe fn allowPacket(&self, packet: &NEPacket);
4189 );
4190}
4191
4192impl NEFilterPacketProvider {
4194 extern_methods!(
4195 #[unsafe(method(init))]
4196 #[unsafe(method_family = init)]
4197 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4198
4199 #[unsafe(method(new))]
4200 #[unsafe(method_family = new)]
4201 pub unsafe fn new() -> Retained<Self>;
4202 );
4203}
4204
4205extern_class!(
4206 #[unsafe(super(NSObject))]
4210 #[derive(Debug, PartialEq, Eq, Hash)]
4211 pub struct NEFilterProviderConfiguration;
4212);
4213
4214extern_conformance!(
4215 unsafe impl NSCoding for NEFilterProviderConfiguration {}
4216);
4217
4218extern_conformance!(
4219 unsafe impl NSCopying for NEFilterProviderConfiguration {}
4220);
4221
4222unsafe impl CopyingHelper for NEFilterProviderConfiguration {
4223 type Result = Self;
4224}
4225
4226extern_conformance!(
4227 unsafe impl NSObjectProtocol for NEFilterProviderConfiguration {}
4228);
4229
4230extern_conformance!(
4231 unsafe impl NSSecureCoding for NEFilterProviderConfiguration {}
4232);
4233
4234impl NEFilterProviderConfiguration {
4235 extern_methods!(
4236 #[deprecated = "filterBrowsers is not supported on macOS"]
4238 #[unsafe(method(filterBrowsers))]
4239 #[unsafe(method_family = none)]
4240 pub unsafe fn filterBrowsers(&self) -> bool;
4241
4242 #[deprecated = "filterBrowsers is not supported on macOS"]
4244 #[unsafe(method(setFilterBrowsers:))]
4245 #[unsafe(method_family = none)]
4246 pub unsafe fn setFilterBrowsers(&self, filter_browsers: bool);
4247
4248 #[unsafe(method(filterSockets))]
4250 #[unsafe(method_family = none)]
4251 pub unsafe fn filterSockets(&self) -> bool;
4252
4253 #[unsafe(method(setFilterSockets:))]
4255 #[unsafe(method_family = none)]
4256 pub unsafe fn setFilterSockets(&self, filter_sockets: bool);
4257
4258 #[unsafe(method(filterPackets))]
4260 #[unsafe(method_family = none)]
4261 pub unsafe fn filterPackets(&self) -> bool;
4262
4263 #[unsafe(method(setFilterPackets:))]
4265 #[unsafe(method_family = none)]
4266 pub unsafe fn setFilterPackets(&self, filter_packets: bool);
4267
4268 #[unsafe(method(vendorConfiguration))]
4270 #[unsafe(method_family = none)]
4271 pub unsafe fn vendorConfiguration(
4272 &self,
4273 ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
4274
4275 #[unsafe(method(setVendorConfiguration:))]
4277 #[unsafe(method_family = none)]
4278 pub unsafe fn setVendorConfiguration(
4279 &self,
4280 vendor_configuration: Option<&NSDictionary<NSString, AnyObject>>,
4281 );
4282
4283 #[unsafe(method(serverAddress))]
4285 #[unsafe(method_family = none)]
4286 pub unsafe fn serverAddress(&self) -> Option<Retained<NSString>>;
4287
4288 #[unsafe(method(setServerAddress:))]
4290 #[unsafe(method_family = none)]
4291 pub unsafe fn setServerAddress(&self, server_address: Option<&NSString>);
4292
4293 #[unsafe(method(username))]
4295 #[unsafe(method_family = none)]
4296 pub unsafe fn username(&self) -> Option<Retained<NSString>>;
4297
4298 #[unsafe(method(setUsername:))]
4300 #[unsafe(method_family = none)]
4301 pub unsafe fn setUsername(&self, username: Option<&NSString>);
4302
4303 #[unsafe(method(organization))]
4305 #[unsafe(method_family = none)]
4306 pub unsafe fn organization(&self) -> Option<Retained<NSString>>;
4307
4308 #[unsafe(method(setOrganization:))]
4310 #[unsafe(method_family = none)]
4311 pub unsafe fn setOrganization(&self, organization: Option<&NSString>);
4312
4313 #[unsafe(method(passwordReference))]
4315 #[unsafe(method_family = none)]
4316 pub unsafe fn passwordReference(&self) -> Option<Retained<NSData>>;
4317
4318 #[unsafe(method(setPasswordReference:))]
4320 #[unsafe(method_family = none)]
4321 pub unsafe fn setPasswordReference(&self, password_reference: Option<&NSData>);
4322
4323 #[unsafe(method(identityReference))]
4325 #[unsafe(method_family = none)]
4326 pub unsafe fn identityReference(&self) -> Option<Retained<NSData>>;
4327
4328 #[unsafe(method(setIdentityReference:))]
4330 #[unsafe(method_family = none)]
4331 pub unsafe fn setIdentityReference(&self, identity_reference: Option<&NSData>);
4332
4333 #[unsafe(method(filterDataProviderBundleIdentifier))]
4338 #[unsafe(method_family = none)]
4339 pub unsafe fn filterDataProviderBundleIdentifier(&self) -> Option<Retained<NSString>>;
4340
4341 #[unsafe(method(setFilterDataProviderBundleIdentifier:))]
4343 #[unsafe(method_family = none)]
4344 pub unsafe fn setFilterDataProviderBundleIdentifier(
4345 &self,
4346 filter_data_provider_bundle_identifier: Option<&NSString>,
4347 );
4348
4349 #[unsafe(method(filterPacketProviderBundleIdentifier))]
4354 #[unsafe(method_family = none)]
4355 pub unsafe fn filterPacketProviderBundleIdentifier(&self) -> Option<Retained<NSString>>;
4356
4357 #[unsafe(method(setFilterPacketProviderBundleIdentifier:))]
4359 #[unsafe(method_family = none)]
4360 pub unsafe fn setFilterPacketProviderBundleIdentifier(
4361 &self,
4362 filter_packet_provider_bundle_identifier: Option<&NSString>,
4363 );
4364 );
4365}
4366
4367impl NEFilterProviderConfiguration {
4369 extern_methods!(
4370 #[unsafe(method(init))]
4371 #[unsafe(method_family = init)]
4372 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4373
4374 #[unsafe(method(new))]
4375 #[unsafe(method_family = new)]
4376 pub unsafe fn new() -> Retained<Self>;
4377 );
4378}
4379
4380extern_class!(
4381 #[unsafe(super(NSObject))]
4385 #[derive(Debug, PartialEq, Eq, Hash)]
4386 pub struct NEFilterRule;
4387);
4388
4389extern_conformance!(
4390 unsafe impl NSCoding for NEFilterRule {}
4391);
4392
4393extern_conformance!(
4394 unsafe impl NSCopying for NEFilterRule {}
4395);
4396
4397unsafe impl CopyingHelper for NEFilterRule {
4398 type Result = Self;
4399}
4400
4401extern_conformance!(
4402 unsafe impl NSObjectProtocol for NEFilterRule {}
4403);
4404
4405extern_conformance!(
4406 unsafe impl NSSecureCoding for NEFilterRule {}
4407);
4408
4409impl NEFilterRule {
4410 extern_methods!(
4411 #[unsafe(method(initWithNetworkRule:action:))]
4417 #[unsafe(method_family = init)]
4418 pub unsafe fn initWithNetworkRule_action(
4419 this: Allocated<Self>,
4420 network_rule: &NENetworkRule,
4421 action: NEFilterAction,
4422 ) -> Retained<Self>;
4423
4424 #[unsafe(method(networkRule))]
4426 #[unsafe(method_family = none)]
4427 pub unsafe fn networkRule(&self) -> Retained<NENetworkRule>;
4428
4429 #[unsafe(method(action))]
4431 #[unsafe(method_family = none)]
4432 pub unsafe fn action(&self) -> NEFilterAction;
4433 );
4434}
4435
4436impl NEFilterRule {
4438 extern_methods!(
4439 #[unsafe(method(init))]
4440 #[unsafe(method_family = init)]
4441 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4442
4443 #[unsafe(method(new))]
4444 #[unsafe(method_family = new)]
4445 pub unsafe fn new() -> Retained<Self>;
4446 );
4447}
4448
4449extern_class!(
4450 #[unsafe(super(NSObject))]
4456 #[derive(Debug, PartialEq, Eq, Hash)]
4457 pub struct NEFilterSettings;
4458);
4459
4460extern_conformance!(
4461 unsafe impl NSCoding for NEFilterSettings {}
4462);
4463
4464extern_conformance!(
4465 unsafe impl NSCopying for NEFilterSettings {}
4466);
4467
4468unsafe impl CopyingHelper for NEFilterSettings {
4469 type Result = Self;
4470}
4471
4472extern_conformance!(
4473 unsafe impl NSObjectProtocol for NEFilterSettings {}
4474);
4475
4476extern_conformance!(
4477 unsafe impl NSSecureCoding for NEFilterSettings {}
4478);
4479
4480impl NEFilterSettings {
4481 extern_methods!(
4482 #[unsafe(method(initWithRules:defaultAction:))]
4494 #[unsafe(method_family = init)]
4495 pub unsafe fn initWithRules_defaultAction(
4496 this: Allocated<Self>,
4497 rules: &NSArray<NEFilterRule>,
4498 default_action: NEFilterAction,
4499 ) -> Retained<Self>;
4500
4501 #[unsafe(method(rules))]
4507 #[unsafe(method_family = none)]
4508 pub unsafe fn rules(&self) -> Retained<NSArray<NEFilterRule>>;
4509
4510 #[unsafe(method(defaultAction))]
4512 #[unsafe(method_family = none)]
4513 pub unsafe fn defaultAction(&self) -> NEFilterAction;
4514 );
4515}
4516
4517impl NEFilterSettings {
4519 extern_methods!(
4520 #[unsafe(method(init))]
4521 #[unsafe(method_family = init)]
4522 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4523
4524 #[unsafe(method(new))]
4525 #[unsafe(method_family = new)]
4526 pub unsafe fn new() -> Retained<Self>;
4527 );
4528}
4529
4530extern_class!(
4531 #[unsafe(super(NSObject))]
4535 #[derive(Debug, PartialEq, Eq, Hash)]
4536 pub struct NEFlowMetaData;
4537);
4538
4539extern_conformance!(
4540 unsafe impl NSCoding for NEFlowMetaData {}
4541);
4542
4543extern_conformance!(
4544 unsafe impl NSCopying for NEFlowMetaData {}
4545);
4546
4547unsafe impl CopyingHelper for NEFlowMetaData {
4548 type Result = Self;
4549}
4550
4551extern_conformance!(
4552 unsafe impl NSObjectProtocol for NEFlowMetaData {}
4553);
4554
4555extern_conformance!(
4556 unsafe impl NSSecureCoding for NEFlowMetaData {}
4557);
4558
4559impl NEFlowMetaData {
4560 extern_methods!(
4561 #[unsafe(method(sourceAppUniqueIdentifier))]
4563 #[unsafe(method_family = none)]
4564 pub unsafe fn sourceAppUniqueIdentifier(&self) -> Retained<NSData>;
4565
4566 #[unsafe(method(sourceAppSigningIdentifier))]
4568 #[unsafe(method_family = none)]
4569 pub unsafe fn sourceAppSigningIdentifier(&self) -> Retained<NSString>;
4570
4571 #[unsafe(method(sourceAppAuditToken))]
4573 #[unsafe(method_family = none)]
4574 pub unsafe fn sourceAppAuditToken(&self) -> Option<Retained<NSData>>;
4575
4576 #[unsafe(method(filterFlowIdentifier))]
4578 #[unsafe(method_family = none)]
4579 pub unsafe fn filterFlowIdentifier(&self) -> Option<Retained<NSUUID>>;
4580 );
4581}
4582
4583impl NEFlowMetaData {
4585 extern_methods!(
4586 #[unsafe(method(init))]
4587 #[unsafe(method_family = init)]
4588 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4589
4590 #[unsafe(method(new))]
4591 #[unsafe(method_family = new)]
4592 pub unsafe fn new() -> Retained<Self>;
4593 );
4594}
4595
4596#[repr(transparent)]
4601#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4602pub struct NEHotspotNetworkSecurityType(pub NSInteger);
4603impl NEHotspotNetworkSecurityType {
4604 #[doc(alias = "NEHotspotNetworkSecurityTypeOpen")]
4605 pub const Open: Self = Self(0);
4606 #[doc(alias = "NEHotspotNetworkSecurityTypeWEP")]
4607 pub const WEP: Self = Self(1);
4608 #[doc(alias = "NEHotspotNetworkSecurityTypePersonal")]
4609 pub const Personal: Self = Self(2);
4610 #[doc(alias = "NEHotspotNetworkSecurityTypeEnterprise")]
4611 pub const Enterprise: Self = Self(3);
4612 #[doc(alias = "NEHotspotNetworkSecurityTypeUnknown")]
4613 pub const Unknown: Self = Self(4);
4614}
4615
4616unsafe impl Encode for NEHotspotNetworkSecurityType {
4617 const ENCODING: Encoding = NSInteger::ENCODING;
4618}
4619
4620unsafe impl RefEncode for NEHotspotNetworkSecurityType {
4621 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4622}
4623
4624extern_class!(
4625 #[unsafe(super(NSObject))]
4632 #[derive(Debug, PartialEq, Eq, Hash)]
4633 pub struct NEHotspotNetwork;
4634);
4635
4636extern_conformance!(
4637 unsafe impl NSObjectProtocol for NEHotspotNetwork {}
4638);
4639
4640impl NEHotspotNetwork {
4641 extern_methods!(
4642 #[unsafe(method(SSID))]
4644 #[unsafe(method_family = none)]
4645 pub unsafe fn SSID(&self) -> Retained<NSString>;
4646
4647 #[unsafe(method(BSSID))]
4649 #[unsafe(method_family = none)]
4650 pub unsafe fn BSSID(&self) -> Retained<NSString>;
4651
4652 #[unsafe(method(securityType))]
4654 #[unsafe(method_family = none)]
4655 pub unsafe fn securityType(&self) -> NEHotspotNetworkSecurityType;
4656
4657 #[cfg(feature = "block2")]
4658 #[unsafe(method(fetchCurrentWithCompletionHandler:))]
4673 #[unsafe(method_family = none)]
4674 pub unsafe fn fetchCurrentWithCompletionHandler(
4675 completion_handler: &block2::DynBlock<dyn Fn(*mut NEHotspotNetwork)>,
4676 );
4677 );
4678}
4679
4680impl NEHotspotNetwork {
4682 extern_methods!(
4683 #[unsafe(method(init))]
4684 #[unsafe(method_family = init)]
4685 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4686
4687 #[unsafe(method(new))]
4688 #[unsafe(method_family = new)]
4689 pub unsafe fn new() -> Retained<Self>;
4690 );
4691}
4692
4693#[repr(transparent)]
4698#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4699pub struct NEHotspotHelperCommandType(pub NSInteger);
4700impl NEHotspotHelperCommandType {
4701 #[doc(alias = "kNEHotspotHelperCommandTypeNone")]
4702 pub const None: Self = Self(0);
4703 #[doc(alias = "kNEHotspotHelperCommandTypeFilterScanList")]
4704 pub const FilterScanList: Self = Self(1);
4705 #[doc(alias = "kNEHotspotHelperCommandTypeEvaluate")]
4706 pub const Evaluate: Self = Self(2);
4707 #[doc(alias = "kNEHotspotHelperCommandTypeAuthenticate")]
4708 pub const Authenticate: Self = Self(3);
4709 #[doc(alias = "kNEHotspotHelperCommandTypePresentUI")]
4710 pub const PresentUI: Self = Self(4);
4711 #[doc(alias = "kNEHotspotHelperCommandTypeMaintain")]
4712 pub const Maintain: Self = Self(5);
4713 #[doc(alias = "kNEHotspotHelperCommandTypeLogoff")]
4714 pub const Logoff: Self = Self(6);
4715}
4716
4717unsafe impl Encode for NEHotspotHelperCommandType {
4718 const ENCODING: Encoding = NSInteger::ENCODING;
4719}
4720
4721unsafe impl RefEncode for NEHotspotHelperCommandType {
4722 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4723}
4724
4725#[repr(transparent)]
4754#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4755pub struct NEHotspotHelperResult(pub NSInteger);
4756impl NEHotspotHelperResult {
4757 #[doc(alias = "kNEHotspotHelperResultSuccess")]
4758 pub const Success: Self = Self(0);
4759 #[doc(alias = "kNEHotspotHelperResultFailure")]
4760 pub const Failure: Self = Self(1);
4761 #[doc(alias = "kNEHotspotHelperResultUIRequired")]
4762 pub const UIRequired: Self = Self(2);
4763 #[doc(alias = "kNEHotspotHelperResultCommandNotRecognized")]
4764 pub const CommandNotRecognized: Self = Self(3);
4765 #[doc(alias = "kNEHotspotHelperResultAuthenticationRequired")]
4766 pub const AuthenticationRequired: Self = Self(4);
4767 #[doc(alias = "kNEHotspotHelperResultUnsupportedNetwork")]
4768 pub const UnsupportedNetwork: Self = Self(5);
4769 #[doc(alias = "kNEHotspotHelperResultTemporaryFailure")]
4770 pub const TemporaryFailure: Self = Self(6);
4771}
4772
4773unsafe impl Encode for NEHotspotHelperResult {
4774 const ENCODING: Encoding = NSInteger::ENCODING;
4775}
4776
4777unsafe impl RefEncode for NEHotspotHelperResult {
4778 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4779}
4780
4781#[repr(transparent)]
4795#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4796pub struct NEHotspotHelperConfidence(pub NSInteger);
4797impl NEHotspotHelperConfidence {
4798 #[doc(alias = "kNEHotspotHelperConfidenceNone")]
4799 pub const None: Self = Self(0);
4800 #[doc(alias = "kNEHotspotHelperConfidenceLow")]
4801 pub const Low: Self = Self(1);
4802 #[doc(alias = "kNEHotspotHelperConfidenceHigh")]
4803 pub const High: Self = Self(2);
4804}
4805
4806unsafe impl Encode for NEHotspotHelperConfidence {
4807 const ENCODING: Encoding = NSInteger::ENCODING;
4808}
4809
4810unsafe impl RefEncode for NEHotspotHelperConfidence {
4811 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4812}
4813
4814impl NEHotspotNetwork {
4820 extern_methods!(
4821 #[unsafe(method(signalStrength))]
4824 #[unsafe(method_family = none)]
4825 pub unsafe fn signalStrength(&self) -> c_double;
4826
4827 #[unsafe(method(isSecure))]
4829 #[unsafe(method_family = none)]
4830 pub unsafe fn isSecure(&self) -> bool;
4831
4832 #[unsafe(method(didAutoJoin))]
4835 #[unsafe(method_family = none)]
4836 pub unsafe fn didAutoJoin(&self) -> bool;
4837
4838 #[unsafe(method(didJustJoin))]
4842 #[unsafe(method_family = none)]
4843 pub unsafe fn didJustJoin(&self) -> bool;
4844
4845 #[unsafe(method(isChosenHelper))]
4851 #[unsafe(method_family = none)]
4852 pub unsafe fn isChosenHelper(&self) -> bool;
4853
4854 #[unsafe(method(setConfidence:))]
4861 #[unsafe(method_family = none)]
4862 pub unsafe fn setConfidence(&self, confidence: NEHotspotHelperConfidence);
4863
4864 #[unsafe(method(setPassword:))]
4873 #[unsafe(method_family = none)]
4874 pub unsafe fn setPassword(&self, password: &NSString);
4875 );
4876}
4877
4878extern_class!(
4879 #[unsafe(super(NSObject))]
4887 #[derive(Debug, PartialEq, Eq, Hash)]
4888 pub struct NEHotspotHelperCommand;
4889);
4890
4891extern_conformance!(
4892 unsafe impl NSObjectProtocol for NEHotspotHelperCommand {}
4893);
4894
4895impl NEHotspotHelperCommand {
4896 extern_methods!(
4897 #[unsafe(method(commandType))]
4899 #[unsafe(method_family = none)]
4900 pub unsafe fn commandType(&self) -> NEHotspotHelperCommandType;
4901
4902 #[unsafe(method(network))]
4904 #[unsafe(method_family = none)]
4905 pub unsafe fn network(&self) -> Option<Retained<NEHotspotNetwork>>;
4906
4907 #[unsafe(method(networkList))]
4911 #[unsafe(method_family = none)]
4912 pub unsafe fn networkList(&self) -> Option<Retained<NSArray<NEHotspotNetwork>>>;
4913
4914 #[unsafe(method(createResponse:))]
4920 #[unsafe(method_family = none)]
4921 pub unsafe fn createResponse(
4922 &self,
4923 result: NEHotspotHelperResult,
4924 ) -> Retained<NEHotspotHelperResponse>;
4925
4926 #[deprecated = "Use the `interface` property with `nw_parameters_require_interface`"]
4933 #[unsafe(method(createTCPConnection:))]
4934 #[unsafe(method_family = none)]
4935 pub unsafe fn createTCPConnection(
4936 &self,
4937 endpoint: &NWEndpoint,
4938 ) -> Retained<NWTCPConnection>;
4939
4940 #[deprecated = "Use the `interface` property with `nw_parameters_require_interface`"]
4947 #[unsafe(method(createUDPSession:))]
4948 #[unsafe(method_family = none)]
4949 pub unsafe fn createUDPSession(&self, endpoint: &NWEndpoint) -> Retained<NWUDPSession>;
4950 );
4951}
4952
4953impl NEHotspotHelperCommand {
4955 extern_methods!(
4956 #[unsafe(method(init))]
4957 #[unsafe(method_family = init)]
4958 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4959
4960 #[unsafe(method(new))]
4961 #[unsafe(method_family = new)]
4962 pub unsafe fn new() -> Retained<Self>;
4963 );
4964}
4965
4966extern_class!(
4967 #[unsafe(super(NSObject))]
4972 #[derive(Debug, PartialEq, Eq, Hash)]
4973 pub struct NEHotspotHelperResponse;
4974);
4975
4976extern_conformance!(
4977 unsafe impl NSObjectProtocol for NEHotspotHelperResponse {}
4978);
4979
4980impl NEHotspotHelperResponse {
4981 extern_methods!(
4982 #[unsafe(method(setNetwork:))]
4989 #[unsafe(method_family = none)]
4990 pub unsafe fn setNetwork(&self, network: &NEHotspotNetwork);
4991
4992 #[unsafe(method(setNetworkList:))]
5000 #[unsafe(method_family = none)]
5001 pub unsafe fn setNetworkList(&self, network_list: &NSArray<NEHotspotNetwork>);
5002
5003 #[unsafe(method(deliver))]
5007 #[unsafe(method_family = none)]
5008 pub unsafe fn deliver(&self);
5009 );
5010}
5011
5012impl NEHotspotHelperResponse {
5014 extern_methods!(
5015 #[unsafe(method(init))]
5016 #[unsafe(method_family = init)]
5017 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5018
5019 #[unsafe(method(new))]
5020 #[unsafe(method_family = new)]
5021 pub unsafe fn new() -> Retained<Self>;
5022 );
5023}
5024
5025#[cfg(feature = "block2")]
5033pub type NEHotspotHelperHandler = *mut block2::DynBlock<dyn Fn(NonNull<NEHotspotHelperCommand>)>;
5034
5035extern_class!(
5036 #[unsafe(super(NSObject))]
5041 #[derive(Debug, PartialEq, Eq, Hash)]
5042 pub struct NEHotspotHelper;
5043);
5044
5045extern_conformance!(
5046 unsafe impl NSObjectProtocol for NEHotspotHelper {}
5047);
5048
5049impl NEHotspotHelper {
5050 extern_methods!(
5051 #[cfg(all(feature = "block2", feature = "dispatch2"))]
5052 #[unsafe(method(registerWithOptions:queue:handler:))]
5087 #[unsafe(method_family = none)]
5088 pub unsafe fn registerWithOptions_queue_handler(
5089 options: Option<&NSDictionary<NSString, NSObject>>,
5090 queue: &DispatchQueue,
5091 handler: NEHotspotHelperHandler,
5092 ) -> bool;
5093
5094 #[unsafe(method(logoff:))]
5117 #[unsafe(method_family = none)]
5118 pub unsafe fn logoff(network: &NEHotspotNetwork) -> bool;
5119
5120 #[unsafe(method(supportedNetworkInterfaces))]
5136 #[unsafe(method_family = none)]
5137 pub unsafe fn supportedNetworkInterfaces() -> Option<Retained<NSArray>>;
5138 );
5139}
5140
5141impl NEHotspotHelper {
5143 extern_methods!(
5144 #[unsafe(method(init))]
5145 #[unsafe(method_family = init)]
5146 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5147
5148 #[unsafe(method(new))]
5149 #[unsafe(method_family = new)]
5150 pub unsafe fn new() -> Retained<Self>;
5151 );
5152}
5153
5154mod private_NSMutableURLRequestNEHotspotHelper {
5155 pub trait Sealed {}
5156}
5157
5158#[doc(alias = "NEHotspotHelper")]
5163pub unsafe trait NSMutableURLRequestNEHotspotHelper:
5164 ClassType + Sized + private_NSMutableURLRequestNEHotspotHelper::Sealed
5165{
5166 extern_methods!(
5167 #[unsafe(method(bindToHotspotHelperCommand:))]
5170 #[unsafe(method_family = none)]
5171 unsafe fn bindToHotspotHelperCommand(&self, command: &NEHotspotHelperCommand);
5172 );
5173}
5174
5175impl private_NSMutableURLRequestNEHotspotHelper::Sealed for NSMutableURLRequest {}
5176unsafe impl NSMutableURLRequestNEHotspotHelper for NSMutableURLRequest {}
5177
5178#[repr(transparent)]
5183#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
5184pub struct NEHotspotConfigurationEAPType(pub NSInteger);
5185impl NEHotspotConfigurationEAPType {
5186 #[doc(alias = "NEHotspotConfigurationEAPTypeEAPTLS")]
5187 pub const EAPTLS: Self = Self(13);
5188 #[doc(alias = "NEHotspotConfigurationEAPTypeEAPTTLS")]
5189 pub const EAPTTLS: Self = Self(21);
5190 #[doc(alias = "NEHotspotConfigurationEAPTypeEAPPEAP")]
5191 pub const EAPPEAP: Self = Self(25);
5192 #[doc(alias = "NEHotspotConfigurationEAPTypeEAPFAST")]
5193 pub const EAPFAST: Self = Self(43);
5194}
5195
5196unsafe impl Encode for NEHotspotConfigurationEAPType {
5197 const ENCODING: Encoding = NSInteger::ENCODING;
5198}
5199
5200unsafe impl RefEncode for NEHotspotConfigurationEAPType {
5201 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
5202}
5203
5204#[repr(transparent)]
5209#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
5210pub struct NEHotspotConfigurationTTLSInnerAuthenticationType(pub NSInteger);
5211impl NEHotspotConfigurationTTLSInnerAuthenticationType {
5212 #[doc(alias = "NEHotspotConfigurationEAPTTLSInnerAuthenticationPAP")]
5213 pub const EAPTTLSInnerAuthenticationPAP: Self = Self(0);
5214 #[doc(alias = "NEHotspotConfigurationEAPTTLSInnerAuthenticationCHAP")]
5215 pub const EAPTTLSInnerAuthenticationCHAP: Self = Self(1);
5216 #[doc(alias = "NEHotspotConfigurationEAPTTLSInnerAuthenticationMSCHAP")]
5217 pub const EAPTTLSInnerAuthenticationMSCHAP: Self = Self(2);
5218 #[doc(alias = "NEHotspotConfigurationEAPTTLSInnerAuthenticationMSCHAPv2")]
5219 pub const EAPTTLSInnerAuthenticationMSCHAPv2: Self = Self(3);
5220 #[doc(alias = "NEHotspotConfigurationEAPTTLSInnerAuthenticationEAP")]
5221 pub const EAPTTLSInnerAuthenticationEAP: Self = Self(4);
5222}
5223
5224unsafe impl Encode for NEHotspotConfigurationTTLSInnerAuthenticationType {
5225 const ENCODING: Encoding = NSInteger::ENCODING;
5226}
5227
5228unsafe impl RefEncode for NEHotspotConfigurationTTLSInnerAuthenticationType {
5229 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
5230}
5231
5232#[repr(transparent)]
5237#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
5238pub struct NEHotspotConfigurationEAPTLSVersion(pub NSInteger);
5239impl NEHotspotConfigurationEAPTLSVersion {
5240 #[doc(alias = "NEHotspotConfigurationEAPTLSVersion_1_0")]
5241 pub const Version_1_0: Self = Self(0);
5242 #[doc(alias = "NEHotspotConfigurationEAPTLSVersion_1_1")]
5243 pub const Version_1_1: Self = Self(1);
5244 #[doc(alias = "NEHotspotConfigurationEAPTLSVersion_1_2")]
5245 pub const Version_1_2: Self = Self(2);
5246}
5247
5248unsafe impl Encode for NEHotspotConfigurationEAPTLSVersion {
5249 const ENCODING: Encoding = NSInteger::ENCODING;
5250}
5251
5252unsafe impl RefEncode for NEHotspotConfigurationEAPTLSVersion {
5253 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
5254}
5255
5256extern_class!(
5257 #[unsafe(super(NSObject))]
5262 #[derive(Debug, PartialEq, Eq, Hash)]
5263 pub struct NEHotspotHS20Settings;
5264);
5265
5266extern_conformance!(
5267 unsafe impl NSCoding for NEHotspotHS20Settings {}
5268);
5269
5270extern_conformance!(
5271 unsafe impl NSCopying for NEHotspotHS20Settings {}
5272);
5273
5274unsafe impl CopyingHelper for NEHotspotHS20Settings {
5275 type Result = Self;
5276}
5277
5278extern_conformance!(
5279 unsafe impl NSObjectProtocol for NEHotspotHS20Settings {}
5280);
5281
5282extern_conformance!(
5283 unsafe impl NSSecureCoding for NEHotspotHS20Settings {}
5284);
5285
5286impl NEHotspotHS20Settings {
5287 extern_methods!(
5288 #[unsafe(method(domainName))]
5291 #[unsafe(method_family = none)]
5292 pub unsafe fn domainName(&self) -> Retained<NSString>;
5293
5294 #[unsafe(method(isRoamingEnabled))]
5297 #[unsafe(method_family = none)]
5298 pub unsafe fn isRoamingEnabled(&self) -> bool;
5299
5300 #[unsafe(method(setRoamingEnabled:))]
5302 #[unsafe(method_family = none)]
5303 pub unsafe fn setRoamingEnabled(&self, roaming_enabled: bool);
5304
5305 #[unsafe(method(roamingConsortiumOIs))]
5308 #[unsafe(method_family = none)]
5309 pub unsafe fn roamingConsortiumOIs(&self) -> Retained<NSArray<NSString>>;
5310
5311 #[unsafe(method(setRoamingConsortiumOIs:))]
5313 #[unsafe(method_family = none)]
5314 pub unsafe fn setRoamingConsortiumOIs(&self, roaming_consortium_o_is: &NSArray<NSString>);
5315
5316 #[unsafe(method(naiRealmNames))]
5319 #[unsafe(method_family = none)]
5320 pub unsafe fn naiRealmNames(&self) -> Retained<NSArray<NSString>>;
5321
5322 #[unsafe(method(setNaiRealmNames:))]
5324 #[unsafe(method_family = none)]
5325 pub unsafe fn setNaiRealmNames(&self, nai_realm_names: &NSArray<NSString>);
5326
5327 #[unsafe(method(MCCAndMNCs))]
5331 #[unsafe(method_family = none)]
5332 pub unsafe fn MCCAndMNCs(&self) -> Retained<NSArray<NSString>>;
5333
5334 #[unsafe(method(setMCCAndMNCs:))]
5336 #[unsafe(method_family = none)]
5337 pub unsafe fn setMCCAndMNCs(&self, mcc_and_mn_cs: &NSArray<NSString>);
5338
5339 #[unsafe(method(initWithDomainName:roamingEnabled:))]
5347 #[unsafe(method_family = init)]
5348 pub unsafe fn initWithDomainName_roamingEnabled(
5349 this: Allocated<Self>,
5350 domain_name: &NSString,
5351 roaming_enabled: bool,
5352 ) -> Retained<Self>;
5353 );
5354}
5355
5356impl NEHotspotHS20Settings {
5358 extern_methods!(
5359 #[unsafe(method(init))]
5360 #[unsafe(method_family = init)]
5361 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5362
5363 #[unsafe(method(new))]
5364 #[unsafe(method_family = new)]
5365 pub unsafe fn new() -> Retained<Self>;
5366 );
5367}
5368
5369extern_class!(
5370 #[unsafe(super(NSObject))]
5375 #[derive(Debug, PartialEq, Eq, Hash)]
5376 pub struct NEHotspotEAPSettings;
5377);
5378
5379extern_conformance!(
5380 unsafe impl NSCoding for NEHotspotEAPSettings {}
5381);
5382
5383extern_conformance!(
5384 unsafe impl NSCopying for NEHotspotEAPSettings {}
5385);
5386
5387unsafe impl CopyingHelper for NEHotspotEAPSettings {
5388 type Result = Self;
5389}
5390
5391extern_conformance!(
5392 unsafe impl NSObjectProtocol for NEHotspotEAPSettings {}
5393);
5394
5395extern_conformance!(
5396 unsafe impl NSSecureCoding for NEHotspotEAPSettings {}
5397);
5398
5399impl NEHotspotEAPSettings {
5400 extern_methods!(
5401 #[unsafe(method(supportedEAPTypes))]
5404 #[unsafe(method_family = none)]
5405 pub unsafe fn supportedEAPTypes(&self) -> Retained<NSArray<NSNumber>>;
5406
5407 #[unsafe(method(setSupportedEAPTypes:))]
5409 #[unsafe(method_family = none)]
5410 pub unsafe fn setSupportedEAPTypes(&self, supported_eap_types: &NSArray<NSNumber>);
5411
5412 #[unsafe(method(username))]
5415 #[unsafe(method_family = none)]
5416 pub unsafe fn username(&self) -> Retained<NSString>;
5417
5418 #[unsafe(method(setUsername:))]
5420 #[unsafe(method_family = none)]
5421 pub unsafe fn setUsername(&self, username: &NSString);
5422
5423 #[unsafe(method(outerIdentity))]
5426 #[unsafe(method_family = none)]
5427 pub unsafe fn outerIdentity(&self) -> Retained<NSString>;
5428
5429 #[unsafe(method(setOuterIdentity:))]
5431 #[unsafe(method_family = none)]
5432 pub unsafe fn setOuterIdentity(&self, outer_identity: &NSString);
5433
5434 #[unsafe(method(ttlsInnerAuthenticationType))]
5437 #[unsafe(method_family = none)]
5438 pub unsafe fn ttlsInnerAuthenticationType(
5439 &self,
5440 ) -> NEHotspotConfigurationTTLSInnerAuthenticationType;
5441
5442 #[unsafe(method(setTtlsInnerAuthenticationType:))]
5444 #[unsafe(method_family = none)]
5445 pub unsafe fn setTtlsInnerAuthenticationType(
5446 &self,
5447 ttls_inner_authentication_type: NEHotspotConfigurationTTLSInnerAuthenticationType,
5448 );
5449
5450 #[unsafe(method(password))]
5453 #[unsafe(method_family = none)]
5454 pub unsafe fn password(&self) -> Retained<NSString>;
5455
5456 #[unsafe(method(setPassword:))]
5458 #[unsafe(method_family = none)]
5459 pub unsafe fn setPassword(&self, password: &NSString);
5460
5461 #[unsafe(method(trustedServerNames))]
5465 #[unsafe(method_family = none)]
5466 pub unsafe fn trustedServerNames(&self) -> Retained<NSArray<NSString>>;
5467
5468 #[unsafe(method(setTrustedServerNames:))]
5470 #[unsafe(method_family = none)]
5471 pub unsafe fn setTrustedServerNames(&self, trusted_server_names: &NSArray<NSString>);
5472
5473 #[unsafe(method(isTLSClientCertificateRequired))]
5477 #[unsafe(method_family = none)]
5478 pub unsafe fn isTLSClientCertificateRequired(&self) -> bool;
5479
5480 #[unsafe(method(setTlsClientCertificateRequired:))]
5482 #[unsafe(method_family = none)]
5483 pub unsafe fn setTlsClientCertificateRequired(&self, tls_client_certificate_required: bool);
5484
5485 #[unsafe(method(preferredTLSVersion))]
5488 #[unsafe(method_family = none)]
5489 pub unsafe fn preferredTLSVersion(&self) -> NEHotspotConfigurationEAPTLSVersion;
5490
5491 #[unsafe(method(setPreferredTLSVersion:))]
5493 #[unsafe(method_family = none)]
5494 pub unsafe fn setPreferredTLSVersion(
5495 &self,
5496 preferred_tls_version: NEHotspotConfigurationEAPTLSVersion,
5497 );
5498
5499 #[cfg(feature = "objc2-security")]
5500 #[unsafe(method(setIdentity:))]
5513 #[unsafe(method_family = none)]
5514 pub unsafe fn setIdentity(&self, identity: &SecIdentity) -> bool;
5515
5516 #[unsafe(method(setTrustedServerCertificates:))]
5530 #[unsafe(method_family = none)]
5531 pub unsafe fn setTrustedServerCertificates(&self, certificates: &NSArray) -> bool;
5532 );
5533}
5534
5535impl NEHotspotEAPSettings {
5537 extern_methods!(
5538 #[unsafe(method(init))]
5539 #[unsafe(method_family = init)]
5540 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5541
5542 #[unsafe(method(new))]
5543 #[unsafe(method_family = new)]
5544 pub unsafe fn new() -> Retained<Self>;
5545 );
5546}
5547
5548extern_class!(
5549 #[unsafe(super(NSObject))]
5554 #[derive(Debug, PartialEq, Eq, Hash)]
5555 pub struct NEHotspotConfiguration;
5556);
5557
5558extern_conformance!(
5559 unsafe impl NSCoding for NEHotspotConfiguration {}
5560);
5561
5562extern_conformance!(
5563 unsafe impl NSCopying for NEHotspotConfiguration {}
5564);
5565
5566unsafe impl CopyingHelper for NEHotspotConfiguration {
5567 type Result = Self;
5568}
5569
5570extern_conformance!(
5571 unsafe impl NSObjectProtocol for NEHotspotConfiguration {}
5572);
5573
5574extern_conformance!(
5575 unsafe impl NSSecureCoding for NEHotspotConfiguration {}
5576);
5577
5578impl NEHotspotConfiguration {
5579 extern_methods!(
5580 #[unsafe(method(SSID))]
5582 #[unsafe(method_family = none)]
5583 pub unsafe fn SSID(&self) -> Retained<NSString>;
5584
5585 #[unsafe(method(SSIDPrefix))]
5587 #[unsafe(method_family = none)]
5588 pub unsafe fn SSIDPrefix(&self) -> Retained<NSString>;
5589
5590 #[unsafe(method(joinOnce))]
5592 #[unsafe(method_family = none)]
5593 pub unsafe fn joinOnce(&self) -> bool;
5594
5595 #[unsafe(method(setJoinOnce:))]
5597 #[unsafe(method_family = none)]
5598 pub unsafe fn setJoinOnce(&self, join_once: bool);
5599
5600 #[unsafe(method(lifeTimeInDays))]
5605 #[unsafe(method_family = none)]
5606 pub unsafe fn lifeTimeInDays(&self) -> Retained<NSNumber>;
5607
5608 #[unsafe(method(setLifeTimeInDays:))]
5610 #[unsafe(method_family = none)]
5611 pub unsafe fn setLifeTimeInDays(&self, life_time_in_days: &NSNumber);
5612
5613 #[unsafe(method(hidden))]
5615 #[unsafe(method_family = none)]
5616 pub unsafe fn hidden(&self) -> bool;
5617
5618 #[unsafe(method(setHidden:))]
5620 #[unsafe(method_family = none)]
5621 pub unsafe fn setHidden(&self, hidden: bool);
5622
5623 #[unsafe(method(initWithSSID:))]
5630 #[unsafe(method_family = init)]
5631 pub unsafe fn initWithSSID(this: Allocated<Self>, ssid: &NSString) -> Retained<Self>;
5632
5633 #[unsafe(method(initWithSSID:passphrase:isWEP:))]
5646 #[unsafe(method_family = init)]
5647 pub unsafe fn initWithSSID_passphrase_isWEP(
5648 this: Allocated<Self>,
5649 ssid: &NSString,
5650 passphrase: &NSString,
5651 is_wep: bool,
5652 ) -> Retained<Self>;
5653
5654 #[unsafe(method(initWithSSID:eapSettings:))]
5662 #[unsafe(method_family = init)]
5663 pub unsafe fn initWithSSID_eapSettings(
5664 this: Allocated<Self>,
5665 ssid: &NSString,
5666 eap_settings: &NEHotspotEAPSettings,
5667 ) -> Retained<Self>;
5668
5669 #[unsafe(method(initWithHS20Settings:eapSettings:))]
5677 #[unsafe(method_family = init)]
5678 pub unsafe fn initWithHS20Settings_eapSettings(
5679 this: Allocated<Self>,
5680 hs20_settings: &NEHotspotHS20Settings,
5681 eap_settings: &NEHotspotEAPSettings,
5682 ) -> Retained<Self>;
5683
5684 #[unsafe(method(initWithSSIDPrefix:))]
5691 #[unsafe(method_family = init)]
5692 pub unsafe fn initWithSSIDPrefix(
5693 this: Allocated<Self>,
5694 ssid_prefix: &NSString,
5695 ) -> Retained<Self>;
5696
5697 #[unsafe(method(initWithSSIDPrefix:passphrase:isWEP:))]
5711 #[unsafe(method_family = init)]
5712 pub unsafe fn initWithSSIDPrefix_passphrase_isWEP(
5713 this: Allocated<Self>,
5714 ssid_prefix: &NSString,
5715 passphrase: &NSString,
5716 is_wep: bool,
5717 ) -> Retained<Self>;
5718 );
5719}
5720
5721impl NEHotspotConfiguration {
5723 extern_methods!(
5724 #[unsafe(method(init))]
5725 #[unsafe(method_family = init)]
5726 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5727
5728 #[unsafe(method(new))]
5729 #[unsafe(method_family = new)]
5730 pub unsafe fn new() -> Retained<Self>;
5731 );
5732}
5733
5734extern "C" {
5735 pub static NEHotspotConfigurationErrorDomain: &'static NSString;
5737}
5738
5739#[repr(transparent)]
5744#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
5745pub struct NEHotspotConfigurationError(pub NSInteger);
5746impl NEHotspotConfigurationError {
5747 #[doc(alias = "NEHotspotConfigurationErrorInvalid")]
5748 pub const Invalid: Self = Self(0);
5749 #[doc(alias = "NEHotspotConfigurationErrorInvalidSSID")]
5750 pub const InvalidSSID: Self = Self(1);
5751 #[doc(alias = "NEHotspotConfigurationErrorInvalidWPAPassphrase")]
5752 pub const InvalidWPAPassphrase: Self = Self(2);
5753 #[doc(alias = "NEHotspotConfigurationErrorInvalidWEPPassphrase")]
5754 pub const InvalidWEPPassphrase: Self = Self(3);
5755 #[doc(alias = "NEHotspotConfigurationErrorInvalidEAPSettings")]
5756 pub const InvalidEAPSettings: Self = Self(4);
5757 #[doc(alias = "NEHotspotConfigurationErrorInvalidHS20Settings")]
5758 pub const InvalidHS20Settings: Self = Self(5);
5759 #[doc(alias = "NEHotspotConfigurationErrorInvalidHS20DomainName")]
5760 pub const InvalidHS20DomainName: Self = Self(6);
5761 #[doc(alias = "NEHotspotConfigurationErrorUserDenied")]
5762 pub const UserDenied: Self = Self(7);
5763 #[doc(alias = "NEHotspotConfigurationErrorInternal")]
5764 pub const Internal: Self = Self(8);
5765 #[doc(alias = "NEHotspotConfigurationErrorPending")]
5766 pub const Pending: Self = Self(9);
5767 #[doc(alias = "NEHotspotConfigurationErrorSystemConfiguration")]
5768 pub const SystemConfiguration: Self = Self(10);
5769 #[doc(alias = "NEHotspotConfigurationErrorUnknown")]
5770 pub const Unknown: Self = Self(11);
5771 #[doc(alias = "NEHotspotConfigurationErrorJoinOnceNotSupported")]
5772 pub const JoinOnceNotSupported: Self = Self(12);
5773 #[doc(alias = "NEHotspotConfigurationErrorAlreadyAssociated")]
5774 pub const AlreadyAssociated: Self = Self(13);
5775 #[doc(alias = "NEHotspotConfigurationErrorApplicationIsNotInForeground")]
5776 pub const ApplicationIsNotInForeground: Self = Self(14);
5777 #[doc(alias = "NEHotspotConfigurationErrorInvalidSSIDPrefix")]
5778 pub const InvalidSSIDPrefix: Self = Self(15);
5779 #[doc(alias = "NEHotspotConfigurationErrorUserUnauthorized")]
5780 pub const UserUnauthorized: Self = Self(16);
5781 #[doc(alias = "NEHotspotConfigurationErrorSystemDenied")]
5782 pub const SystemDenied: Self = Self(17);
5783}
5784
5785unsafe impl Encode for NEHotspotConfigurationError {
5786 const ENCODING: Encoding = NSInteger::ENCODING;
5787}
5788
5789unsafe impl RefEncode for NEHotspotConfigurationError {
5790 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
5791}
5792
5793extern_class!(
5794 #[unsafe(super(NSObject))]
5799 #[derive(Debug, PartialEq, Eq, Hash)]
5800 pub struct NEHotspotConfigurationManager;
5801);
5802
5803extern_conformance!(
5804 unsafe impl NSObjectProtocol for NEHotspotConfigurationManager {}
5805);
5806
5807impl NEHotspotConfigurationManager {
5808 extern_methods!(
5809 #[unsafe(method(sharedManager))]
5810 #[unsafe(method_family = none)]
5811 pub unsafe fn sharedManager() -> Retained<NEHotspotConfigurationManager>;
5812
5813 #[cfg(feature = "block2")]
5814 #[unsafe(method(applyConfiguration:completionHandler:))]
5825 #[unsafe(method_family = none)]
5826 pub unsafe fn applyConfiguration_completionHandler(
5827 &self,
5828 configuration: &NEHotspotConfiguration,
5829 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
5830 );
5831
5832 #[unsafe(method(removeConfigurationForSSID:))]
5838 #[unsafe(method_family = none)]
5839 pub unsafe fn removeConfigurationForSSID(&self, ssid: &NSString);
5840
5841 #[unsafe(method(removeConfigurationForHS20DomainName:))]
5845 #[unsafe(method_family = none)]
5846 pub unsafe fn removeConfigurationForHS20DomainName(&self, domain_name: &NSString);
5847
5848 #[cfg(feature = "block2")]
5849 #[unsafe(method(getConfiguredSSIDsWithCompletionHandler:))]
5852 #[unsafe(method_family = none)]
5853 pub unsafe fn getConfiguredSSIDsWithCompletionHandler(
5854 &self,
5855 completion_handler: &block2::DynBlock<dyn Fn(NonNull<NSArray<NSString>>)>,
5856 );
5857 );
5858}
5859
5860impl NEHotspotConfigurationManager {
5862 extern_methods!(
5863 #[unsafe(method(init))]
5864 #[unsafe(method_family = init)]
5865 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5866
5867 #[unsafe(method(new))]
5868 #[unsafe(method_family = new)]
5869 pub unsafe fn new() -> Retained<Self>;
5870 );
5871}
5872
5873extern_class!(
5874 #[unsafe(super(NSObject))]
5880 #[derive(Debug, PartialEq, Eq, Hash)]
5881 pub struct NEIPv4Settings;
5882);
5883
5884extern_conformance!(
5885 unsafe impl NSCoding for NEIPv4Settings {}
5886);
5887
5888extern_conformance!(
5889 unsafe impl NSCopying for NEIPv4Settings {}
5890);
5891
5892unsafe impl CopyingHelper for NEIPv4Settings {
5893 type Result = Self;
5894}
5895
5896extern_conformance!(
5897 unsafe impl NSObjectProtocol for NEIPv4Settings {}
5898);
5899
5900extern_conformance!(
5901 unsafe impl NSSecureCoding for NEIPv4Settings {}
5902);
5903
5904impl NEIPv4Settings {
5905 extern_methods!(
5906 #[unsafe(method(initWithAddresses:subnetMasks:))]
5914 #[unsafe(method_family = init)]
5915 pub unsafe fn initWithAddresses_subnetMasks(
5916 this: Allocated<Self>,
5917 addresses: &NSArray<NSString>,
5918 subnet_masks: &NSArray<NSString>,
5919 ) -> Retained<Self>;
5920
5921 #[unsafe(method(settingsWithAutomaticAddressing))]
5925 #[unsafe(method_family = none)]
5926 pub unsafe fn settingsWithAutomaticAddressing() -> Retained<Self>;
5927
5928 #[unsafe(method(addresses))]
5930 #[unsafe(method_family = none)]
5931 pub unsafe fn addresses(&self) -> Retained<NSArray<NSString>>;
5932
5933 #[unsafe(method(subnetMasks))]
5935 #[unsafe(method_family = none)]
5936 pub unsafe fn subnetMasks(&self) -> Retained<NSArray<NSString>>;
5937
5938 #[unsafe(method(router))]
5940 #[unsafe(method_family = none)]
5941 pub unsafe fn router(&self) -> Option<Retained<NSString>>;
5942
5943 #[unsafe(method(setRouter:))]
5945 #[unsafe(method_family = none)]
5946 pub unsafe fn setRouter(&self, router: Option<&NSString>);
5947
5948 #[unsafe(method(includedRoutes))]
5950 #[unsafe(method_family = none)]
5951 pub unsafe fn includedRoutes(&self) -> Option<Retained<NSArray<NEIPv4Route>>>;
5952
5953 #[unsafe(method(setIncludedRoutes:))]
5955 #[unsafe(method_family = none)]
5956 pub unsafe fn setIncludedRoutes(&self, included_routes: Option<&NSArray<NEIPv4Route>>);
5957
5958 #[unsafe(method(excludedRoutes))]
5960 #[unsafe(method_family = none)]
5961 pub unsafe fn excludedRoutes(&self) -> Option<Retained<NSArray<NEIPv4Route>>>;
5962
5963 #[unsafe(method(setExcludedRoutes:))]
5965 #[unsafe(method_family = none)]
5966 pub unsafe fn setExcludedRoutes(&self, excluded_routes: Option<&NSArray<NEIPv4Route>>);
5967 );
5968}
5969
5970impl NEIPv4Settings {
5972 extern_methods!(
5973 #[unsafe(method(init))]
5974 #[unsafe(method_family = init)]
5975 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5976
5977 #[unsafe(method(new))]
5978 #[unsafe(method_family = new)]
5979 pub unsafe fn new() -> Retained<Self>;
5980 );
5981}
5982
5983extern_class!(
5984 #[unsafe(super(NSObject))]
5990 #[derive(Debug, PartialEq, Eq, Hash)]
5991 pub struct NEIPv4Route;
5992);
5993
5994extern_conformance!(
5995 unsafe impl NSCoding for NEIPv4Route {}
5996);
5997
5998extern_conformance!(
5999 unsafe impl NSCopying for NEIPv4Route {}
6000);
6001
6002unsafe impl CopyingHelper for NEIPv4Route {
6003 type Result = Self;
6004}
6005
6006extern_conformance!(
6007 unsafe impl NSObjectProtocol for NEIPv4Route {}
6008);
6009
6010extern_conformance!(
6011 unsafe impl NSSecureCoding for NEIPv4Route {}
6012);
6013
6014impl NEIPv4Route {
6015 extern_methods!(
6016 #[unsafe(method(initWithDestinationAddress:subnetMask:))]
6024 #[unsafe(method_family = init)]
6025 pub unsafe fn initWithDestinationAddress_subnetMask(
6026 this: Allocated<Self>,
6027 address: &NSString,
6028 subnet_mask: &NSString,
6029 ) -> Retained<Self>;
6030
6031 #[unsafe(method(destinationAddress))]
6033 #[unsafe(method_family = none)]
6034 pub unsafe fn destinationAddress(&self) -> Retained<NSString>;
6035
6036 #[unsafe(method(destinationSubnetMask))]
6038 #[unsafe(method_family = none)]
6039 pub unsafe fn destinationSubnetMask(&self) -> Retained<NSString>;
6040
6041 #[unsafe(method(gatewayAddress))]
6043 #[unsafe(method_family = none)]
6044 pub unsafe fn gatewayAddress(&self) -> Option<Retained<NSString>>;
6045
6046 #[unsafe(method(setGatewayAddress:))]
6048 #[unsafe(method_family = none)]
6049 pub unsafe fn setGatewayAddress(&self, gateway_address: Option<&NSString>);
6050
6051 #[unsafe(method(defaultRoute))]
6053 #[unsafe(method_family = none)]
6054 pub unsafe fn defaultRoute() -> Retained<NEIPv4Route>;
6055 );
6056}
6057
6058impl NEIPv4Route {
6060 extern_methods!(
6061 #[unsafe(method(init))]
6062 #[unsafe(method_family = init)]
6063 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6064
6065 #[unsafe(method(new))]
6066 #[unsafe(method_family = new)]
6067 pub unsafe fn new() -> Retained<Self>;
6068 );
6069}
6070
6071extern_class!(
6072 #[unsafe(super(NSObject))]
6078 #[derive(Debug, PartialEq, Eq, Hash)]
6079 pub struct NEIPv6Settings;
6080);
6081
6082extern_conformance!(
6083 unsafe impl NSCoding for NEIPv6Settings {}
6084);
6085
6086extern_conformance!(
6087 unsafe impl NSCopying for NEIPv6Settings {}
6088);
6089
6090unsafe impl CopyingHelper for NEIPv6Settings {
6091 type Result = Self;
6092}
6093
6094extern_conformance!(
6095 unsafe impl NSObjectProtocol for NEIPv6Settings {}
6096);
6097
6098extern_conformance!(
6099 unsafe impl NSSecureCoding for NEIPv6Settings {}
6100);
6101
6102impl NEIPv6Settings {
6103 extern_methods!(
6104 #[unsafe(method(initWithAddresses:networkPrefixLengths:))]
6112 #[unsafe(method_family = init)]
6113 pub unsafe fn initWithAddresses_networkPrefixLengths(
6114 this: Allocated<Self>,
6115 addresses: &NSArray<NSString>,
6116 network_prefix_lengths: &NSArray<NSNumber>,
6117 ) -> Retained<Self>;
6118
6119 #[unsafe(method(settingsWithAutomaticAddressing))]
6121 #[unsafe(method_family = none)]
6122 pub unsafe fn settingsWithAutomaticAddressing() -> Retained<Self>;
6123
6124 #[unsafe(method(settingsWithLinkLocalAddressing))]
6126 #[unsafe(method_family = none)]
6127 pub unsafe fn settingsWithLinkLocalAddressing() -> Retained<Self>;
6128
6129 #[unsafe(method(addresses))]
6131 #[unsafe(method_family = none)]
6132 pub unsafe fn addresses(&self) -> Retained<NSArray<NSString>>;
6133
6134 #[unsafe(method(networkPrefixLengths))]
6136 #[unsafe(method_family = none)]
6137 pub unsafe fn networkPrefixLengths(&self) -> Retained<NSArray<NSNumber>>;
6138
6139 #[unsafe(method(includedRoutes))]
6141 #[unsafe(method_family = none)]
6142 pub unsafe fn includedRoutes(&self) -> Option<Retained<NSArray<NEIPv6Route>>>;
6143
6144 #[unsafe(method(setIncludedRoutes:))]
6146 #[unsafe(method_family = none)]
6147 pub unsafe fn setIncludedRoutes(&self, included_routes: Option<&NSArray<NEIPv6Route>>);
6148
6149 #[unsafe(method(excludedRoutes))]
6151 #[unsafe(method_family = none)]
6152 pub unsafe fn excludedRoutes(&self) -> Option<Retained<NSArray<NEIPv6Route>>>;
6153
6154 #[unsafe(method(setExcludedRoutes:))]
6156 #[unsafe(method_family = none)]
6157 pub unsafe fn setExcludedRoutes(&self, excluded_routes: Option<&NSArray<NEIPv6Route>>);
6158 );
6159}
6160
6161impl NEIPv6Settings {
6163 extern_methods!(
6164 #[unsafe(method(init))]
6165 #[unsafe(method_family = init)]
6166 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6167
6168 #[unsafe(method(new))]
6169 #[unsafe(method_family = new)]
6170 pub unsafe fn new() -> Retained<Self>;
6171 );
6172}
6173
6174extern_class!(
6175 #[unsafe(super(NSObject))]
6181 #[derive(Debug, PartialEq, Eq, Hash)]
6182 pub struct NEIPv6Route;
6183);
6184
6185extern_conformance!(
6186 unsafe impl NSCoding for NEIPv6Route {}
6187);
6188
6189extern_conformance!(
6190 unsafe impl NSCopying for NEIPv6Route {}
6191);
6192
6193unsafe impl CopyingHelper for NEIPv6Route {
6194 type Result = Self;
6195}
6196
6197extern_conformance!(
6198 unsafe impl NSObjectProtocol for NEIPv6Route {}
6199);
6200
6201extern_conformance!(
6202 unsafe impl NSSecureCoding for NEIPv6Route {}
6203);
6204
6205impl NEIPv6Route {
6206 extern_methods!(
6207 #[unsafe(method(initWithDestinationAddress:networkPrefixLength:))]
6215 #[unsafe(method_family = init)]
6216 pub unsafe fn initWithDestinationAddress_networkPrefixLength(
6217 this: Allocated<Self>,
6218 address: &NSString,
6219 network_prefix_length: &NSNumber,
6220 ) -> Retained<Self>;
6221
6222 #[unsafe(method(destinationAddress))]
6224 #[unsafe(method_family = none)]
6225 pub unsafe fn destinationAddress(&self) -> Retained<NSString>;
6226
6227 #[unsafe(method(destinationNetworkPrefixLength))]
6229 #[unsafe(method_family = none)]
6230 pub unsafe fn destinationNetworkPrefixLength(&self) -> Retained<NSNumber>;
6231
6232 #[unsafe(method(gatewayAddress))]
6234 #[unsafe(method_family = none)]
6235 pub unsafe fn gatewayAddress(&self) -> Option<Retained<NSString>>;
6236
6237 #[unsafe(method(setGatewayAddress:))]
6239 #[unsafe(method_family = none)]
6240 pub unsafe fn setGatewayAddress(&self, gateway_address: Option<&NSString>);
6241
6242 #[unsafe(method(defaultRoute))]
6244 #[unsafe(method_family = none)]
6245 pub unsafe fn defaultRoute() -> Retained<NEIPv6Route>;
6246 );
6247}
6248
6249impl NEIPv6Route {
6251 extern_methods!(
6252 #[unsafe(method(init))]
6253 #[unsafe(method_family = init)]
6254 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6255
6256 #[unsafe(method(new))]
6257 #[unsafe(method_family = new)]
6258 pub unsafe fn new() -> Retained<Self>;
6259 );
6260}
6261
6262extern_class!(
6263 #[unsafe(super(NSObject))]
6271 #[derive(Debug, PartialEq, Eq, Hash)]
6272 pub struct NETunnelNetworkSettings;
6273);
6274
6275extern_conformance!(
6276 unsafe impl NSCoding for NETunnelNetworkSettings {}
6277);
6278
6279extern_conformance!(
6280 unsafe impl NSCopying for NETunnelNetworkSettings {}
6281);
6282
6283unsafe impl CopyingHelper for NETunnelNetworkSettings {
6284 type Result = Self;
6285}
6286
6287extern_conformance!(
6288 unsafe impl NSObjectProtocol for NETunnelNetworkSettings {}
6289);
6290
6291extern_conformance!(
6292 unsafe impl NSSecureCoding for NETunnelNetworkSettings {}
6293);
6294
6295impl NETunnelNetworkSettings {
6296 extern_methods!(
6297 #[unsafe(method(initWithTunnelRemoteAddress:))]
6301 #[unsafe(method_family = init)]
6302 pub unsafe fn initWithTunnelRemoteAddress(
6303 this: Allocated<Self>,
6304 address: &NSString,
6305 ) -> Retained<Self>;
6306
6307 #[unsafe(method(tunnelRemoteAddress))]
6309 #[unsafe(method_family = none)]
6310 pub unsafe fn tunnelRemoteAddress(&self) -> Retained<NSString>;
6311
6312 #[unsafe(method(DNSSettings))]
6314 #[unsafe(method_family = none)]
6315 pub unsafe fn DNSSettings(&self) -> Option<Retained<NEDNSSettings>>;
6316
6317 #[unsafe(method(setDNSSettings:))]
6319 #[unsafe(method_family = none)]
6320 pub unsafe fn setDNSSettings(&self, dns_settings: Option<&NEDNSSettings>);
6321
6322 #[unsafe(method(proxySettings))]
6324 #[unsafe(method_family = none)]
6325 pub unsafe fn proxySettings(&self) -> Option<Retained<NEProxySettings>>;
6326
6327 #[unsafe(method(setProxySettings:))]
6329 #[unsafe(method_family = none)]
6330 pub unsafe fn setProxySettings(&self, proxy_settings: Option<&NEProxySettings>);
6331 );
6332}
6333
6334impl NETunnelNetworkSettings {
6336 extern_methods!(
6337 #[unsafe(method(init))]
6338 #[unsafe(method_family = init)]
6339 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6340
6341 #[unsafe(method(new))]
6342 #[unsafe(method_family = new)]
6343 pub unsafe fn new() -> Retained<Self>;
6344 );
6345}
6346
6347extern_class!(
6348 #[unsafe(super(NETunnelNetworkSettings, NSObject))]
6356 #[derive(Debug, PartialEq, Eq, Hash)]
6357 pub struct NEPacketTunnelNetworkSettings;
6358);
6359
6360extern_conformance!(
6361 unsafe impl NSCoding for NEPacketTunnelNetworkSettings {}
6362);
6363
6364extern_conformance!(
6365 unsafe impl NSCopying for NEPacketTunnelNetworkSettings {}
6366);
6367
6368unsafe impl CopyingHelper for NEPacketTunnelNetworkSettings {
6369 type Result = Self;
6370}
6371
6372extern_conformance!(
6373 unsafe impl NSObjectProtocol for NEPacketTunnelNetworkSettings {}
6374);
6375
6376extern_conformance!(
6377 unsafe impl NSSecureCoding for NEPacketTunnelNetworkSettings {}
6378);
6379
6380impl NEPacketTunnelNetworkSettings {
6381 extern_methods!(
6382 #[unsafe(method(IPv4Settings))]
6384 #[unsafe(method_family = none)]
6385 pub unsafe fn IPv4Settings(&self) -> Option<Retained<NEIPv4Settings>>;
6386
6387 #[unsafe(method(setIPv4Settings:))]
6389 #[unsafe(method_family = none)]
6390 pub unsafe fn setIPv4Settings(&self, i_pv4_settings: Option<&NEIPv4Settings>);
6391
6392 #[unsafe(method(IPv6Settings))]
6394 #[unsafe(method_family = none)]
6395 pub unsafe fn IPv6Settings(&self) -> Option<Retained<NEIPv6Settings>>;
6396
6397 #[unsafe(method(setIPv6Settings:))]
6399 #[unsafe(method_family = none)]
6400 pub unsafe fn setIPv6Settings(&self, i_pv6_settings: Option<&NEIPv6Settings>);
6401
6402 #[unsafe(method(tunnelOverheadBytes))]
6404 #[unsafe(method_family = none)]
6405 pub unsafe fn tunnelOverheadBytes(&self) -> Option<Retained<NSNumber>>;
6406
6407 #[unsafe(method(setTunnelOverheadBytes:))]
6409 #[unsafe(method_family = none)]
6410 pub unsafe fn setTunnelOverheadBytes(&self, tunnel_overhead_bytes: Option<&NSNumber>);
6411
6412 #[unsafe(method(MTU))]
6414 #[unsafe(method_family = none)]
6415 pub unsafe fn MTU(&self) -> Option<Retained<NSNumber>>;
6416
6417 #[unsafe(method(setMTU:))]
6419 #[unsafe(method_family = none)]
6420 pub unsafe fn setMTU(&self, mtu: Option<&NSNumber>);
6421 );
6422}
6423
6424impl NEPacketTunnelNetworkSettings {
6426 extern_methods!(
6427 #[unsafe(method(initWithTunnelRemoteAddress:))]
6431 #[unsafe(method_family = init)]
6432 pub unsafe fn initWithTunnelRemoteAddress(
6433 this: Allocated<Self>,
6434 address: &NSString,
6435 ) -> Retained<Self>;
6436 );
6437}
6438
6439impl NEPacketTunnelNetworkSettings {
6441 extern_methods!(
6442 #[unsafe(method(init))]
6443 #[unsafe(method_family = init)]
6444 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6445
6446 #[unsafe(method(new))]
6447 #[unsafe(method_family = new)]
6448 pub unsafe fn new() -> Retained<Self>;
6449 );
6450}
6451
6452extern_class!(
6453 #[unsafe(super(NEPacketTunnelNetworkSettings, NETunnelNetworkSettings, NSObject))]
6461 #[derive(Debug, PartialEq, Eq, Hash)]
6462 pub struct NEEthernetTunnelNetworkSettings;
6463);
6464
6465extern_conformance!(
6466 unsafe impl NSCoding for NEEthernetTunnelNetworkSettings {}
6467);
6468
6469extern_conformance!(
6470 unsafe impl NSCopying for NEEthernetTunnelNetworkSettings {}
6471);
6472
6473unsafe impl CopyingHelper for NEEthernetTunnelNetworkSettings {
6474 type Result = Self;
6475}
6476
6477extern_conformance!(
6478 unsafe impl NSObjectProtocol for NEEthernetTunnelNetworkSettings {}
6479);
6480
6481extern_conformance!(
6482 unsafe impl NSSecureCoding for NEEthernetTunnelNetworkSettings {}
6483);
6484
6485impl NEEthernetTunnelNetworkSettings {
6486 extern_methods!(
6487 #[unsafe(method(initWithTunnelRemoteAddress:ethernetAddress:mtu:))]
6495 #[unsafe(method_family = init)]
6496 pub unsafe fn initWithTunnelRemoteAddress_ethernetAddress_mtu(
6497 this: Allocated<Self>,
6498 address: &NSString,
6499 ethernet_address: &NSString,
6500 mtu: NSInteger,
6501 ) -> Retained<Self>;
6502
6503 #[unsafe(method(ethernetAddress))]
6505 #[unsafe(method_family = none)]
6506 pub unsafe fn ethernetAddress(&self) -> Retained<NSString>;
6507 );
6508}
6509
6510impl NEEthernetTunnelNetworkSettings {
6512 extern_methods!(
6513 #[unsafe(method(initWithTunnelRemoteAddress:))]
6517 #[unsafe(method_family = init)]
6518 pub unsafe fn initWithTunnelRemoteAddress(
6519 this: Allocated<Self>,
6520 address: &NSString,
6521 ) -> Retained<Self>;
6522 );
6523}
6524
6525impl NEEthernetTunnelNetworkSettings {
6527 extern_methods!(
6528 #[unsafe(method(init))]
6529 #[unsafe(method_family = init)]
6530 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6531
6532 #[unsafe(method(new))]
6533 #[unsafe(method_family = new)]
6534 pub unsafe fn new() -> Retained<Self>;
6535 );
6536}
6537
6538extern_class!(
6539 #[unsafe(super(NETunnelProvider, NEProvider, NSObject))]
6545 #[derive(Debug, PartialEq, Eq, Hash)]
6546 pub struct NEPacketTunnelProvider;
6547);
6548
6549extern_conformance!(
6550 unsafe impl NSObjectProtocol for NEPacketTunnelProvider {}
6551);
6552
6553impl NEPacketTunnelProvider {
6554 extern_methods!(
6555 #[cfg(feature = "block2")]
6556 #[unsafe(method(startTunnelWithOptions:completionHandler:))]
6562 #[unsafe(method_family = none)]
6563 pub unsafe fn startTunnelWithOptions_completionHandler(
6564 &self,
6565 options: Option<&NSDictionary<NSString, NSObject>>,
6566 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
6567 );
6568
6569 #[cfg(feature = "block2")]
6570 #[unsafe(method(stopTunnelWithReason:completionHandler:))]
6576 #[unsafe(method_family = none)]
6577 pub unsafe fn stopTunnelWithReason_completionHandler(
6578 &self,
6579 reason: NEProviderStopReason,
6580 completion_handler: &block2::DynBlock<dyn Fn()>,
6581 );
6582
6583 #[unsafe(method(cancelTunnelWithError:))]
6587 #[unsafe(method_family = none)]
6588 pub unsafe fn cancelTunnelWithError(&self, error: Option<&NSError>);
6589
6590 #[unsafe(method(packetFlow))]
6592 #[unsafe(method_family = none)]
6593 pub unsafe fn packetFlow(&self) -> Retained<NEPacketTunnelFlow>;
6594
6595 #[deprecated = "Use the `virtualInterface` property with `nw_parameters_require_interface`"]
6607 #[unsafe(method(createTCPConnectionThroughTunnelToEndpoint:enableTLS:TLSParameters:delegate:))]
6608 #[unsafe(method_family = none)]
6609 pub unsafe fn createTCPConnectionThroughTunnelToEndpoint_enableTLS_TLSParameters_delegate(
6610 &self,
6611 remote_endpoint: &NWEndpoint,
6612 enable_tls: bool,
6613 tls_parameters: Option<&NWTLSParameters>,
6614 delegate: Option<&AnyObject>,
6615 ) -> Retained<NWTCPConnection>;
6616
6617 #[deprecated = "Use the `virtualInterface` property with `nw_parameters_require_interface`"]
6625 #[unsafe(method(createUDPSessionThroughTunnelToEndpoint:fromEndpoint:))]
6626 #[unsafe(method_family = none)]
6627 pub unsafe fn createUDPSessionThroughTunnelToEndpoint_fromEndpoint(
6628 &self,
6629 remote_endpoint: &NWEndpoint,
6630 local_endpoint: Option<&NWHostEndpoint>,
6631 ) -> Retained<NWUDPSession>;
6632 );
6633}
6634
6635impl NEPacketTunnelProvider {
6637 extern_methods!(
6638 #[unsafe(method(init))]
6639 #[unsafe(method_family = init)]
6640 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6641
6642 #[unsafe(method(new))]
6643 #[unsafe(method_family = new)]
6644 pub unsafe fn new() -> Retained<Self>;
6645 );
6646}
6647
6648extern_class!(
6649 #[unsafe(super(NEPacketTunnelProvider, NETunnelProvider, NEProvider, NSObject))]
6655 #[derive(Debug, PartialEq, Eq, Hash)]
6656 pub struct NEEthernetTunnelProvider;
6657);
6658
6659extern_conformance!(
6660 unsafe impl NSObjectProtocol for NEEthernetTunnelProvider {}
6661);
6662
6663impl NEEthernetTunnelProvider {
6664 extern_methods!();
6665}
6666
6667impl NEEthernetTunnelProvider {
6669 extern_methods!(
6670 #[unsafe(method(init))]
6671 #[unsafe(method_family = init)]
6672 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6673
6674 #[unsafe(method(new))]
6675 #[unsafe(method_family = new)]
6676 pub unsafe fn new() -> Retained<Self>;
6677 );
6678}
6679
6680#[repr(transparent)]
6685#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
6686pub struct NEOnDemandRuleAction(pub NSInteger);
6687impl NEOnDemandRuleAction {
6688 #[doc(alias = "NEOnDemandRuleActionConnect")]
6689 pub const Connect: Self = Self(1);
6690 #[doc(alias = "NEOnDemandRuleActionDisconnect")]
6691 pub const Disconnect: Self = Self(2);
6692 #[doc(alias = "NEOnDemandRuleActionEvaluateConnection")]
6693 pub const EvaluateConnection: Self = Self(3);
6694 #[doc(alias = "NEOnDemandRuleActionIgnore")]
6695 pub const Ignore: Self = Self(4);
6696}
6697
6698unsafe impl Encode for NEOnDemandRuleAction {
6699 const ENCODING: Encoding = NSInteger::ENCODING;
6700}
6701
6702unsafe impl RefEncode for NEOnDemandRuleAction {
6703 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
6704}
6705
6706#[repr(transparent)]
6711#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
6712pub struct NEOnDemandRuleInterfaceType(pub NSInteger);
6713impl NEOnDemandRuleInterfaceType {
6714 #[doc(alias = "NEOnDemandRuleInterfaceTypeAny")]
6715 pub const Any: Self = Self(0);
6716 #[doc(alias = "NEOnDemandRuleInterfaceTypeEthernet")]
6717 pub const Ethernet: Self = Self(1);
6718 #[doc(alias = "NEOnDemandRuleInterfaceTypeWiFi")]
6719 pub const WiFi: Self = Self(2);
6720 #[doc(alias = "NEOnDemandRuleInterfaceTypeCellular")]
6721 pub const Cellular: Self = Self(3);
6722}
6723
6724unsafe impl Encode for NEOnDemandRuleInterfaceType {
6725 const ENCODING: Encoding = NSInteger::ENCODING;
6726}
6727
6728unsafe impl RefEncode for NEOnDemandRuleInterfaceType {
6729 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
6730}
6731
6732extern_class!(
6733 #[unsafe(super(NSObject))]
6741 #[derive(Debug, PartialEq, Eq, Hash)]
6742 pub struct NEOnDemandRule;
6743);
6744
6745extern_conformance!(
6746 unsafe impl NSCoding for NEOnDemandRule {}
6747);
6748
6749extern_conformance!(
6750 unsafe impl NSCopying for NEOnDemandRule {}
6751);
6752
6753unsafe impl CopyingHelper for NEOnDemandRule {
6754 type Result = Self;
6755}
6756
6757extern_conformance!(
6758 unsafe impl NSObjectProtocol for NEOnDemandRule {}
6759);
6760
6761extern_conformance!(
6762 unsafe impl NSSecureCoding for NEOnDemandRule {}
6763);
6764
6765impl NEOnDemandRule {
6766 extern_methods!(
6767 #[unsafe(method(action))]
6769 #[unsafe(method_family = none)]
6770 pub unsafe fn action(&self) -> NEOnDemandRuleAction;
6771
6772 #[unsafe(method(DNSSearchDomainMatch))]
6774 #[unsafe(method_family = none)]
6775 pub unsafe fn DNSSearchDomainMatch(&self) -> Option<Retained<NSArray<NSString>>>;
6776
6777 #[unsafe(method(setDNSSearchDomainMatch:))]
6779 #[unsafe(method_family = none)]
6780 pub unsafe fn setDNSSearchDomainMatch(
6781 &self,
6782 dns_search_domain_match: Option<&NSArray<NSString>>,
6783 );
6784
6785 #[unsafe(method(DNSServerAddressMatch))]
6787 #[unsafe(method_family = none)]
6788 pub unsafe fn DNSServerAddressMatch(&self) -> Option<Retained<NSArray<NSString>>>;
6789
6790 #[unsafe(method(setDNSServerAddressMatch:))]
6792 #[unsafe(method_family = none)]
6793 pub unsafe fn setDNSServerAddressMatch(
6794 &self,
6795 dns_server_address_match: Option<&NSArray<NSString>>,
6796 );
6797
6798 #[unsafe(method(interfaceTypeMatch))]
6800 #[unsafe(method_family = none)]
6801 pub unsafe fn interfaceTypeMatch(&self) -> NEOnDemandRuleInterfaceType;
6802
6803 #[unsafe(method(setInterfaceTypeMatch:))]
6805 #[unsafe(method_family = none)]
6806 pub unsafe fn setInterfaceTypeMatch(
6807 &self,
6808 interface_type_match: NEOnDemandRuleInterfaceType,
6809 );
6810
6811 #[unsafe(method(SSIDMatch))]
6813 #[unsafe(method_family = none)]
6814 pub unsafe fn SSIDMatch(&self) -> Option<Retained<NSArray<NSString>>>;
6815
6816 #[unsafe(method(setSSIDMatch:))]
6818 #[unsafe(method_family = none)]
6819 pub unsafe fn setSSIDMatch(&self, ssid_match: Option<&NSArray<NSString>>);
6820
6821 #[unsafe(method(probeURL))]
6823 #[unsafe(method_family = none)]
6824 pub unsafe fn probeURL(&self) -> Option<Retained<NSURL>>;
6825
6826 #[unsafe(method(setProbeURL:))]
6828 #[unsafe(method_family = none)]
6829 pub unsafe fn setProbeURL(&self, probe_url: Option<&NSURL>);
6830 );
6831}
6832
6833impl NEOnDemandRule {
6835 extern_methods!(
6836 #[unsafe(method(init))]
6837 #[unsafe(method_family = init)]
6838 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6839
6840 #[unsafe(method(new))]
6841 #[unsafe(method_family = new)]
6842 pub unsafe fn new() -> Retained<Self>;
6843 );
6844}
6845
6846extern_class!(
6847 #[unsafe(super(NEOnDemandRule, NSObject))]
6855 #[derive(Debug, PartialEq, Eq, Hash)]
6856 pub struct NEOnDemandRuleConnect;
6857);
6858
6859extern_conformance!(
6860 unsafe impl NSCoding for NEOnDemandRuleConnect {}
6861);
6862
6863extern_conformance!(
6864 unsafe impl NSCopying for NEOnDemandRuleConnect {}
6865);
6866
6867unsafe impl CopyingHelper for NEOnDemandRuleConnect {
6868 type Result = Self;
6869}
6870
6871extern_conformance!(
6872 unsafe impl NSObjectProtocol for NEOnDemandRuleConnect {}
6873);
6874
6875extern_conformance!(
6876 unsafe impl NSSecureCoding for NEOnDemandRuleConnect {}
6877);
6878
6879impl NEOnDemandRuleConnect {
6880 extern_methods!();
6881}
6882
6883impl NEOnDemandRuleConnect {
6885 extern_methods!(
6886 #[unsafe(method(init))]
6887 #[unsafe(method_family = init)]
6888 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6889
6890 #[unsafe(method(new))]
6891 #[unsafe(method_family = new)]
6892 pub unsafe fn new() -> Retained<Self>;
6893 );
6894}
6895
6896extern_class!(
6897 #[unsafe(super(NEOnDemandRule, NSObject))]
6905 #[derive(Debug, PartialEq, Eq, Hash)]
6906 pub struct NEOnDemandRuleDisconnect;
6907);
6908
6909extern_conformance!(
6910 unsafe impl NSCoding for NEOnDemandRuleDisconnect {}
6911);
6912
6913extern_conformance!(
6914 unsafe impl NSCopying for NEOnDemandRuleDisconnect {}
6915);
6916
6917unsafe impl CopyingHelper for NEOnDemandRuleDisconnect {
6918 type Result = Self;
6919}
6920
6921extern_conformance!(
6922 unsafe impl NSObjectProtocol for NEOnDemandRuleDisconnect {}
6923);
6924
6925extern_conformance!(
6926 unsafe impl NSSecureCoding for NEOnDemandRuleDisconnect {}
6927);
6928
6929impl NEOnDemandRuleDisconnect {
6930 extern_methods!();
6931}
6932
6933impl NEOnDemandRuleDisconnect {
6935 extern_methods!(
6936 #[unsafe(method(init))]
6937 #[unsafe(method_family = init)]
6938 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6939
6940 #[unsafe(method(new))]
6941 #[unsafe(method_family = new)]
6942 pub unsafe fn new() -> Retained<Self>;
6943 );
6944}
6945
6946extern_class!(
6947 #[unsafe(super(NEOnDemandRule, NSObject))]
6955 #[derive(Debug, PartialEq, Eq, Hash)]
6956 pub struct NEOnDemandRuleIgnore;
6957);
6958
6959extern_conformance!(
6960 unsafe impl NSCoding for NEOnDemandRuleIgnore {}
6961);
6962
6963extern_conformance!(
6964 unsafe impl NSCopying for NEOnDemandRuleIgnore {}
6965);
6966
6967unsafe impl CopyingHelper for NEOnDemandRuleIgnore {
6968 type Result = Self;
6969}
6970
6971extern_conformance!(
6972 unsafe impl NSObjectProtocol for NEOnDemandRuleIgnore {}
6973);
6974
6975extern_conformance!(
6976 unsafe impl NSSecureCoding for NEOnDemandRuleIgnore {}
6977);
6978
6979impl NEOnDemandRuleIgnore {
6980 extern_methods!();
6981}
6982
6983impl NEOnDemandRuleIgnore {
6985 extern_methods!(
6986 #[unsafe(method(init))]
6987 #[unsafe(method_family = init)]
6988 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6989
6990 #[unsafe(method(new))]
6991 #[unsafe(method_family = new)]
6992 pub unsafe fn new() -> Retained<Self>;
6993 );
6994}
6995
6996extern_class!(
6997 #[unsafe(super(NEOnDemandRule, NSObject))]
7005 #[derive(Debug, PartialEq, Eq, Hash)]
7006 pub struct NEOnDemandRuleEvaluateConnection;
7007);
7008
7009extern_conformance!(
7010 unsafe impl NSCoding for NEOnDemandRuleEvaluateConnection {}
7011);
7012
7013extern_conformance!(
7014 unsafe impl NSCopying for NEOnDemandRuleEvaluateConnection {}
7015);
7016
7017unsafe impl CopyingHelper for NEOnDemandRuleEvaluateConnection {
7018 type Result = Self;
7019}
7020
7021extern_conformance!(
7022 unsafe impl NSObjectProtocol for NEOnDemandRuleEvaluateConnection {}
7023);
7024
7025extern_conformance!(
7026 unsafe impl NSSecureCoding for NEOnDemandRuleEvaluateConnection {}
7027);
7028
7029impl NEOnDemandRuleEvaluateConnection {
7030 extern_methods!(
7031 #[unsafe(method(connectionRules))]
7033 #[unsafe(method_family = none)]
7034 pub unsafe fn connectionRules(&self)
7035 -> Option<Retained<NSArray<NEEvaluateConnectionRule>>>;
7036
7037 #[unsafe(method(setConnectionRules:))]
7039 #[unsafe(method_family = none)]
7040 pub unsafe fn setConnectionRules(
7041 &self,
7042 connection_rules: Option<&NSArray<NEEvaluateConnectionRule>>,
7043 );
7044 );
7045}
7046
7047impl NEOnDemandRuleEvaluateConnection {
7049 extern_methods!(
7050 #[unsafe(method(init))]
7051 #[unsafe(method_family = init)]
7052 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7053
7054 #[unsafe(method(new))]
7055 #[unsafe(method_family = new)]
7056 pub unsafe fn new() -> Retained<Self>;
7057 );
7058}
7059
7060#[repr(transparent)]
7065#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
7066pub struct NEEvaluateConnectionRuleAction(pub NSInteger);
7067impl NEEvaluateConnectionRuleAction {
7068 #[doc(alias = "NEEvaluateConnectionRuleActionConnectIfNeeded")]
7069 pub const ConnectIfNeeded: Self = Self(1);
7070 #[doc(alias = "NEEvaluateConnectionRuleActionNeverConnect")]
7071 pub const NeverConnect: Self = Self(2);
7072}
7073
7074unsafe impl Encode for NEEvaluateConnectionRuleAction {
7075 const ENCODING: Encoding = NSInteger::ENCODING;
7076}
7077
7078unsafe impl RefEncode for NEEvaluateConnectionRuleAction {
7079 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
7080}
7081
7082extern_class!(
7083 #[unsafe(super(NSObject))]
7089 #[derive(Debug, PartialEq, Eq, Hash)]
7090 pub struct NEEvaluateConnectionRule;
7091);
7092
7093extern_conformance!(
7094 unsafe impl NSCoding for NEEvaluateConnectionRule {}
7095);
7096
7097extern_conformance!(
7098 unsafe impl NSCopying for NEEvaluateConnectionRule {}
7099);
7100
7101unsafe impl CopyingHelper for NEEvaluateConnectionRule {
7102 type Result = Self;
7103}
7104
7105extern_conformance!(
7106 unsafe impl NSObjectProtocol for NEEvaluateConnectionRule {}
7107);
7108
7109extern_conformance!(
7110 unsafe impl NSSecureCoding for NEEvaluateConnectionRule {}
7111);
7112
7113impl NEEvaluateConnectionRule {
7114 extern_methods!(
7115 #[unsafe(method(initWithMatchDomains:andAction:))]
7117 #[unsafe(method_family = init)]
7118 pub unsafe fn initWithMatchDomains_andAction(
7119 this: Allocated<Self>,
7120 domains: &NSArray<NSString>,
7121 action: NEEvaluateConnectionRuleAction,
7122 ) -> Retained<Self>;
7123
7124 #[unsafe(method(action))]
7126 #[unsafe(method_family = none)]
7127 pub unsafe fn action(&self) -> NEEvaluateConnectionRuleAction;
7128
7129 #[unsafe(method(matchDomains))]
7131 #[unsafe(method_family = none)]
7132 pub unsafe fn matchDomains(&self) -> Retained<NSArray<NSString>>;
7133
7134 #[unsafe(method(useDNSServers))]
7136 #[unsafe(method_family = none)]
7137 pub unsafe fn useDNSServers(&self) -> Option<Retained<NSArray<NSString>>>;
7138
7139 #[unsafe(method(setUseDNSServers:))]
7141 #[unsafe(method_family = none)]
7142 pub unsafe fn setUseDNSServers(&self, use_dns_servers: Option<&NSArray<NSString>>);
7143
7144 #[unsafe(method(probeURL))]
7146 #[unsafe(method_family = none)]
7147 pub unsafe fn probeURL(&self) -> Option<Retained<NSURL>>;
7148
7149 #[unsafe(method(setProbeURL:))]
7151 #[unsafe(method_family = none)]
7152 pub unsafe fn setProbeURL(&self, probe_url: Option<&NSURL>);
7153 );
7154}
7155
7156impl NEEvaluateConnectionRule {
7158 extern_methods!(
7159 #[unsafe(method(init))]
7160 #[unsafe(method_family = init)]
7161 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7162
7163 #[unsafe(method(new))]
7164 #[unsafe(method_family = new)]
7165 pub unsafe fn new() -> Retained<Self>;
7166 );
7167}
7168
7169extern_class!(
7170 #[unsafe(super(NSObject))]
7179 #[derive(Debug, PartialEq, Eq, Hash)]
7180 pub struct NEPacket;
7181);
7182
7183extern_conformance!(
7184 unsafe impl NSCoding for NEPacket {}
7185);
7186
7187extern_conformance!(
7188 unsafe impl NSCopying for NEPacket {}
7189);
7190
7191unsafe impl CopyingHelper for NEPacket {
7192 type Result = Self;
7193}
7194
7195extern_conformance!(
7196 unsafe impl NSObjectProtocol for NEPacket {}
7197);
7198
7199extern_conformance!(
7200 unsafe impl NSSecureCoding for NEPacket {}
7201);
7202
7203impl NEPacket {
7204 extern_methods!(
7205 #[cfg(feature = "libc")]
7206 #[unsafe(method(initWithData:protocolFamily:))]
7212 #[unsafe(method_family = init)]
7213 pub unsafe fn initWithData_protocolFamily(
7214 this: Allocated<Self>,
7215 data: &NSData,
7216 protocol_family: libc::sa_family_t,
7217 ) -> Retained<Self>;
7218
7219 #[unsafe(method(data))]
7221 #[unsafe(method_family = none)]
7222 pub unsafe fn data(&self) -> Retained<NSData>;
7223
7224 #[cfg(feature = "libc")]
7225 #[unsafe(method(protocolFamily))]
7227 #[unsafe(method_family = none)]
7228 pub unsafe fn protocolFamily(&self) -> libc::sa_family_t;
7229
7230 #[unsafe(method(direction))]
7232 #[unsafe(method_family = none)]
7233 pub unsafe fn direction(&self) -> NETrafficDirection;
7234
7235 #[unsafe(method(metadata))]
7239 #[unsafe(method_family = none)]
7240 pub unsafe fn metadata(&self) -> Option<Retained<NEFlowMetaData>>;
7241 );
7242}
7243
7244impl NEPacket {
7246 extern_methods!(
7247 #[unsafe(method(init))]
7248 #[unsafe(method_family = init)]
7249 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7250
7251 #[unsafe(method(new))]
7252 #[unsafe(method_family = new)]
7253 pub unsafe fn new() -> Retained<Self>;
7254 );
7255}
7256
7257extern_class!(
7258 #[unsafe(super(NSObject))]
7266 #[derive(Debug, PartialEq, Eq, Hash)]
7267 pub struct NEPacketTunnelFlow;
7268);
7269
7270extern_conformance!(
7271 unsafe impl NSObjectProtocol for NEPacketTunnelFlow {}
7272);
7273
7274impl NEPacketTunnelFlow {
7275 extern_methods!(
7276 #[cfg(feature = "block2")]
7277 #[unsafe(method(readPacketsWithCompletionHandler:))]
7281 #[unsafe(method_family = none)]
7282 pub unsafe fn readPacketsWithCompletionHandler(
7283 &self,
7284 completion_handler: &block2::DynBlock<
7285 dyn Fn(NonNull<NSArray<NSData>>, NonNull<NSArray<NSNumber>>),
7286 >,
7287 );
7288
7289 #[unsafe(method(writePackets:withProtocols:))]
7295 #[unsafe(method_family = none)]
7296 pub unsafe fn writePackets_withProtocols(
7297 &self,
7298 packets: &NSArray<NSData>,
7299 protocols: &NSArray<NSNumber>,
7300 ) -> bool;
7301
7302 #[cfg(feature = "block2")]
7303 #[unsafe(method(readPacketObjectsWithCompletionHandler:))]
7307 #[unsafe(method_family = none)]
7308 pub unsafe fn readPacketObjectsWithCompletionHandler(
7309 &self,
7310 completion_handler: &block2::DynBlock<dyn Fn(NonNull<NSArray<NEPacket>>)>,
7311 );
7312
7313 #[unsafe(method(writePacketObjects:))]
7317 #[unsafe(method_family = none)]
7318 pub unsafe fn writePacketObjects(&self, packets: &NSArray<NEPacket>) -> bool;
7319 );
7320}
7321
7322impl NEPacketTunnelFlow {
7324 extern_methods!(
7325 #[unsafe(method(init))]
7326 #[unsafe(method_family = init)]
7327 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7328
7329 #[unsafe(method(new))]
7330 #[unsafe(method_family = new)]
7331 pub unsafe fn new() -> Retained<Self>;
7332 );
7333}
7334
7335extern_class!(
7336 #[unsafe(super(NSObject))]
7343 #[derive(Debug, PartialEq, Eq, Hash)]
7344 pub struct NERelay;
7345);
7346
7347extern_conformance!(
7348 unsafe impl NSCoding for NERelay {}
7349);
7350
7351extern_conformance!(
7352 unsafe impl NSCopying for NERelay {}
7353);
7354
7355unsafe impl CopyingHelper for NERelay {
7356 type Result = Self;
7357}
7358
7359extern_conformance!(
7360 unsafe impl NSObjectProtocol for NERelay {}
7361);
7362
7363extern_conformance!(
7364 unsafe impl NSSecureCoding for NERelay {}
7365);
7366
7367impl NERelay {
7368 extern_methods!(
7369 #[unsafe(method(HTTP3RelayURL))]
7371 #[unsafe(method_family = none)]
7372 pub unsafe fn HTTP3RelayURL(&self) -> Option<Retained<NSURL>>;
7373
7374 #[unsafe(method(setHTTP3RelayURL:))]
7376 #[unsafe(method_family = none)]
7377 pub unsafe fn setHTTP3RelayURL(&self, http3_relay_url: Option<&NSURL>);
7378
7379 #[unsafe(method(HTTP2RelayURL))]
7381 #[unsafe(method_family = none)]
7382 pub unsafe fn HTTP2RelayURL(&self) -> Option<Retained<NSURL>>;
7383
7384 #[unsafe(method(setHTTP2RelayURL:))]
7386 #[unsafe(method_family = none)]
7387 pub unsafe fn setHTTP2RelayURL(&self, http2_relay_url: Option<&NSURL>);
7388
7389 #[unsafe(method(dnsOverHTTPSURL))]
7391 #[unsafe(method_family = none)]
7392 pub unsafe fn dnsOverHTTPSURL(&self) -> Option<Retained<NSURL>>;
7393
7394 #[unsafe(method(setDnsOverHTTPSURL:))]
7396 #[unsafe(method_family = none)]
7397 pub unsafe fn setDnsOverHTTPSURL(&self, dns_over_httpsurl: Option<&NSURL>);
7398
7399 #[unsafe(method(syntheticDNSAnswerIPv4Prefix))]
7402 #[unsafe(method_family = none)]
7403 pub unsafe fn syntheticDNSAnswerIPv4Prefix(&self) -> Option<Retained<NSString>>;
7404
7405 #[unsafe(method(setSyntheticDNSAnswerIPv4Prefix:))]
7407 #[unsafe(method_family = none)]
7408 pub unsafe fn setSyntheticDNSAnswerIPv4Prefix(
7409 &self,
7410 synthetic_dns_answer_i_pv4_prefix: Option<&NSString>,
7411 );
7412
7413 #[unsafe(method(syntheticDNSAnswerIPv6Prefix))]
7416 #[unsafe(method_family = none)]
7417 pub unsafe fn syntheticDNSAnswerIPv6Prefix(&self) -> Option<Retained<NSString>>;
7418
7419 #[unsafe(method(setSyntheticDNSAnswerIPv6Prefix:))]
7421 #[unsafe(method_family = none)]
7422 pub unsafe fn setSyntheticDNSAnswerIPv6Prefix(
7423 &self,
7424 synthetic_dns_answer_i_pv6_prefix: Option<&NSString>,
7425 );
7426
7427 #[unsafe(method(additionalHTTPHeaderFields))]
7429 #[unsafe(method_family = none)]
7430 pub unsafe fn additionalHTTPHeaderFields(
7431 &self,
7432 ) -> Retained<NSDictionary<NSString, NSString>>;
7433
7434 #[unsafe(method(setAdditionalHTTPHeaderFields:))]
7436 #[unsafe(method_family = none)]
7437 pub unsafe fn setAdditionalHTTPHeaderFields(
7438 &self,
7439 additional_http_header_fields: &NSDictionary<NSString, NSString>,
7440 );
7441
7442 #[unsafe(method(rawPublicKeys))]
7444 #[unsafe(method_family = none)]
7445 pub unsafe fn rawPublicKeys(&self) -> Option<Retained<NSArray<NSData>>>;
7446
7447 #[unsafe(method(setRawPublicKeys:))]
7449 #[unsafe(method_family = none)]
7450 pub unsafe fn setRawPublicKeys(&self, raw_public_keys: Option<&NSArray<NSData>>);
7451
7452 #[unsafe(method(identityData))]
7454 #[unsafe(method_family = none)]
7455 pub unsafe fn identityData(&self) -> Option<Retained<NSData>>;
7456
7457 #[unsafe(method(setIdentityData:))]
7459 #[unsafe(method_family = none)]
7460 pub unsafe fn setIdentityData(&self, identity_data: Option<&NSData>);
7461
7462 #[unsafe(method(identityDataPassword))]
7464 #[unsafe(method_family = none)]
7465 pub unsafe fn identityDataPassword(&self) -> Option<Retained<NSString>>;
7466
7467 #[unsafe(method(setIdentityDataPassword:))]
7469 #[unsafe(method_family = none)]
7470 pub unsafe fn setIdentityDataPassword(&self, identity_data_password: Option<&NSString>);
7471 );
7472}
7473
7474impl NERelay {
7476 extern_methods!(
7477 #[unsafe(method(init))]
7478 #[unsafe(method_family = init)]
7479 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7480
7481 #[unsafe(method(new))]
7482 #[unsafe(method_family = new)]
7483 pub unsafe fn new() -> Retained<Self>;
7484 );
7485}
7486
7487#[repr(transparent)]
7492#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
7493pub struct NERelayManagerError(pub NSInteger);
7494impl NERelayManagerError {
7495 #[doc(alias = "NERelayManagerErrorConfigurationInvalid")]
7496 pub const ConfigurationInvalid: Self = Self(1);
7497 #[doc(alias = "NERelayManagerErrorConfigurationDisabled")]
7498 pub const ConfigurationDisabled: Self = Self(2);
7499 #[doc(alias = "NERelayManagerErrorConfigurationStale")]
7500 pub const ConfigurationStale: Self = Self(3);
7501 #[doc(alias = "NERelayManagerErrorConfigurationCannotBeRemoved")]
7502 pub const ConfigurationCannotBeRemoved: Self = Self(4);
7503}
7504
7505unsafe impl Encode for NERelayManagerError {
7506 const ENCODING: Encoding = NSInteger::ENCODING;
7507}
7508
7509unsafe impl RefEncode for NERelayManagerError {
7510 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
7511}
7512
7513extern "C" {
7514 pub static NERelayErrorDomain: &'static NSString;
7516}
7517
7518#[repr(transparent)]
7523#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
7524pub struct NERelayManagerClientError(pub NSInteger);
7525impl NERelayManagerClientError {
7526 #[doc(alias = "NERelayManagerClientErrorNone")]
7527 pub const None: Self = Self(1);
7528 #[doc(alias = "NERelayManagerClientErrorDNSFailed")]
7529 pub const DNSFailed: Self = Self(2);
7530 #[doc(alias = "NERelayManagerClientErrorServerUnreachable")]
7531 pub const ServerUnreachable: Self = Self(3);
7532 #[doc(alias = "NERelayManagerClientErrorServerDisconnected")]
7533 pub const ServerDisconnected: Self = Self(4);
7534 #[doc(alias = "NERelayManagerClientErrorCertificateMissing")]
7535 pub const CertificateMissing: Self = Self(5);
7536 #[doc(alias = "NERelayManagerClientErrorCertificateInvalid")]
7537 pub const CertificateInvalid: Self = Self(6);
7538 #[doc(alias = "NERelayManagerClientErrorCertificateExpired")]
7539 pub const CertificateExpired: Self = Self(7);
7540 #[doc(alias = "NERelayManagerClientErrorServerCertificateInvalid")]
7541 pub const ServerCertificateInvalid: Self = Self(8);
7542 #[doc(alias = "NERelayManagerClientErrorServerCertificateExpired")]
7543 pub const ServerCertificateExpired: Self = Self(9);
7544 #[doc(alias = "NERelayManagerClientErrorOther")]
7545 pub const Other: Self = Self(10);
7546}
7547
7548unsafe impl Encode for NERelayManagerClientError {
7549 const ENCODING: Encoding = NSInteger::ENCODING;
7550}
7551
7552unsafe impl RefEncode for NERelayManagerClientError {
7553 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
7554}
7555
7556extern "C" {
7557 pub static NERelayClientErrorDomain: &'static NSString;
7559}
7560
7561extern "C" {
7562 pub static NERelayConfigurationDidChangeNotification: &'static NSString;
7564}
7565
7566extern_class!(
7567 #[unsafe(super(NSObject))]
7575 #[derive(Debug, PartialEq, Eq, Hash)]
7576 pub struct NERelayManager;
7577);
7578
7579extern_conformance!(
7580 unsafe impl NSObjectProtocol for NERelayManager {}
7581);
7582
7583impl NERelayManager {
7584 extern_methods!(
7585 #[unsafe(method(sharedManager))]
7587 #[unsafe(method_family = none)]
7588 pub unsafe fn sharedManager() -> Retained<NERelayManager>;
7589
7590 #[cfg(feature = "block2")]
7591 #[unsafe(method(loadFromPreferencesWithCompletionHandler:))]
7595 #[unsafe(method_family = none)]
7596 pub unsafe fn loadFromPreferencesWithCompletionHandler(
7597 &self,
7598 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
7599 );
7600
7601 #[cfg(feature = "block2")]
7602 #[unsafe(method(removeFromPreferencesWithCompletionHandler:))]
7606 #[unsafe(method_family = none)]
7607 pub unsafe fn removeFromPreferencesWithCompletionHandler(
7608 &self,
7609 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
7610 );
7611
7612 #[cfg(feature = "block2")]
7613 #[unsafe(method(saveToPreferencesWithCompletionHandler:))]
7617 #[unsafe(method_family = none)]
7618 pub unsafe fn saveToPreferencesWithCompletionHandler(
7619 &self,
7620 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
7621 );
7622
7623 #[cfg(feature = "block2")]
7624 #[unsafe(method(getLastClientErrors:completionHandler:))]
7630 #[unsafe(method_family = none)]
7631 pub unsafe fn getLastClientErrors_completionHandler(
7632 &self,
7633 seconds: NSTimeInterval,
7634 completion_handler: &block2::DynBlock<dyn Fn(*mut NSArray<NSError>)>,
7635 );
7636
7637 #[unsafe(method(localizedDescription))]
7639 #[unsafe(method_family = none)]
7640 pub unsafe fn localizedDescription(&self) -> Option<Retained<NSString>>;
7641
7642 #[unsafe(method(setLocalizedDescription:))]
7644 #[unsafe(method_family = none)]
7645 pub unsafe fn setLocalizedDescription(&self, localized_description: Option<&NSString>);
7646
7647 #[unsafe(method(isEnabled))]
7649 #[unsafe(method_family = none)]
7650 pub unsafe fn isEnabled(&self) -> bool;
7651
7652 #[unsafe(method(setEnabled:))]
7654 #[unsafe(method_family = none)]
7655 pub unsafe fn setEnabled(&self, enabled: bool);
7656
7657 #[unsafe(method(isUIToggleEnabled))]
7659 #[unsafe(method_family = none)]
7660 pub unsafe fn isUIToggleEnabled(&self) -> bool;
7661
7662 #[unsafe(method(setUIToggleEnabled:))]
7664 #[unsafe(method_family = none)]
7665 pub unsafe fn setUIToggleEnabled(&self, ui_toggle_enabled: bool);
7666
7667 #[unsafe(method(relays))]
7669 #[unsafe(method_family = none)]
7670 pub unsafe fn relays(&self) -> Option<Retained<NSArray<NERelay>>>;
7671
7672 #[unsafe(method(setRelays:))]
7674 #[unsafe(method_family = none)]
7675 pub unsafe fn setRelays(&self, relays: Option<&NSArray<NERelay>>);
7676
7677 #[unsafe(method(matchDomains))]
7679 #[unsafe(method_family = none)]
7680 pub unsafe fn matchDomains(&self) -> Option<Retained<NSArray<NSString>>>;
7681
7682 #[unsafe(method(setMatchDomains:))]
7684 #[unsafe(method_family = none)]
7685 pub unsafe fn setMatchDomains(&self, match_domains: Option<&NSArray<NSString>>);
7686
7687 #[unsafe(method(matchFQDNs))]
7689 #[unsafe(method_family = none)]
7690 pub unsafe fn matchFQDNs(&self) -> Option<Retained<NSArray<NSString>>>;
7691
7692 #[unsafe(method(setMatchFQDNs:))]
7694 #[unsafe(method_family = none)]
7695 pub unsafe fn setMatchFQDNs(&self, match_fqd_ns: Option<&NSArray<NSString>>);
7696
7697 #[unsafe(method(excludedDomains))]
7699 #[unsafe(method_family = none)]
7700 pub unsafe fn excludedDomains(&self) -> Option<Retained<NSArray<NSString>>>;
7701
7702 #[unsafe(method(setExcludedDomains:))]
7704 #[unsafe(method_family = none)]
7705 pub unsafe fn setExcludedDomains(&self, excluded_domains: Option<&NSArray<NSString>>);
7706
7707 #[unsafe(method(excludedFQDNs))]
7709 #[unsafe(method_family = none)]
7710 pub unsafe fn excludedFQDNs(&self) -> Option<Retained<NSArray<NSString>>>;
7711
7712 #[unsafe(method(setExcludedFQDNs:))]
7714 #[unsafe(method_family = none)]
7715 pub unsafe fn setExcludedFQDNs(&self, excluded_fqd_ns: Option<&NSArray<NSString>>);
7716
7717 #[unsafe(method(onDemandRules))]
7719 #[unsafe(method_family = none)]
7720 pub unsafe fn onDemandRules(&self) -> Option<Retained<NSArray<NEOnDemandRule>>>;
7721
7722 #[unsafe(method(setOnDemandRules:))]
7724 #[unsafe(method_family = none)]
7725 pub unsafe fn setOnDemandRules(&self, on_demand_rules: Option<&NSArray<NEOnDemandRule>>);
7726
7727 #[cfg(feature = "block2")]
7728 #[unsafe(method(loadAllManagersFromPreferencesWithCompletionHandler:))]
7732 #[unsafe(method_family = none)]
7733 pub unsafe fn loadAllManagersFromPreferencesWithCompletionHandler(
7734 completion_handler: &block2::DynBlock<
7735 dyn Fn(NonNull<NSArray<NERelayManager>>, *mut NSError),
7736 >,
7737 );
7738 );
7739}
7740
7741impl NERelayManager {
7743 extern_methods!(
7744 #[unsafe(method(init))]
7745 #[unsafe(method_family = init)]
7746 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7747
7748 #[unsafe(method(new))]
7749 #[unsafe(method_family = new)]
7750 pub unsafe fn new() -> Retained<Self>;
7751 );
7752}
7753
7754extern_class!(
7755 #[unsafe(super(NEVPNManager, NSObject))]
7761 #[derive(Debug, PartialEq, Eq, Hash)]
7762 pub struct NETransparentProxyManager;
7763);
7764
7765extern_conformance!(
7766 unsafe impl NSObjectProtocol for NETransparentProxyManager {}
7767);
7768
7769impl NETransparentProxyManager {
7770 extern_methods!(
7771 #[cfg(feature = "block2")]
7772 #[unsafe(method(loadAllFromPreferencesWithCompletionHandler:))]
7776 #[unsafe(method_family = none)]
7777 pub unsafe fn loadAllFromPreferencesWithCompletionHandler(
7778 completion_handler: &block2::DynBlock<
7779 dyn Fn(*mut NSArray<NETransparentProxyManager>, *mut NSError),
7780 >,
7781 );
7782 );
7783}
7784
7785impl NETransparentProxyManager {
7787 extern_methods!(
7788 #[unsafe(method(init))]
7789 #[unsafe(method_family = init)]
7790 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7791
7792 #[unsafe(method(new))]
7793 #[unsafe(method_family = new)]
7794 pub unsafe fn new() -> Retained<Self>;
7795 );
7796}
7797
7798extern_class!(
7799 #[unsafe(super(NETunnelNetworkSettings, NSObject))]
7807 #[derive(Debug, PartialEq, Eq, Hash)]
7808 pub struct NETransparentProxyNetworkSettings;
7809);
7810
7811extern_conformance!(
7812 unsafe impl NSCoding for NETransparentProxyNetworkSettings {}
7813);
7814
7815extern_conformance!(
7816 unsafe impl NSCopying for NETransparentProxyNetworkSettings {}
7817);
7818
7819unsafe impl CopyingHelper for NETransparentProxyNetworkSettings {
7820 type Result = Self;
7821}
7822
7823extern_conformance!(
7824 unsafe impl NSObjectProtocol for NETransparentProxyNetworkSettings {}
7825);
7826
7827extern_conformance!(
7828 unsafe impl NSSecureCoding for NETransparentProxyNetworkSettings {}
7829);
7830
7831impl NETransparentProxyNetworkSettings {
7832 extern_methods!(
7833 #[unsafe(method(includedNetworkRules))]
7842 #[unsafe(method_family = none)]
7843 pub unsafe fn includedNetworkRules(&self) -> Option<Retained<NSArray<NENetworkRule>>>;
7844
7845 #[unsafe(method(setIncludedNetworkRules:))]
7847 #[unsafe(method_family = none)]
7848 pub unsafe fn setIncludedNetworkRules(
7849 &self,
7850 included_network_rules: Option<&NSArray<NENetworkRule>>,
7851 );
7852
7853 #[unsafe(method(excludedNetworkRules))]
7862 #[unsafe(method_family = none)]
7863 pub unsafe fn excludedNetworkRules(&self) -> Option<Retained<NSArray<NENetworkRule>>>;
7864
7865 #[unsafe(method(setExcludedNetworkRules:))]
7867 #[unsafe(method_family = none)]
7868 pub unsafe fn setExcludedNetworkRules(
7869 &self,
7870 excluded_network_rules: Option<&NSArray<NENetworkRule>>,
7871 );
7872 );
7873}
7874
7875impl NETransparentProxyNetworkSettings {
7877 extern_methods!(
7878 #[unsafe(method(initWithTunnelRemoteAddress:))]
7882 #[unsafe(method_family = init)]
7883 pub unsafe fn initWithTunnelRemoteAddress(
7884 this: Allocated<Self>,
7885 address: &NSString,
7886 ) -> Retained<Self>;
7887 );
7888}
7889
7890impl NETransparentProxyNetworkSettings {
7892 extern_methods!(
7893 #[unsafe(method(init))]
7894 #[unsafe(method_family = init)]
7895 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7896
7897 #[unsafe(method(new))]
7898 #[unsafe(method_family = new)]
7899 pub unsafe fn new() -> Retained<Self>;
7900 );
7901}
7902
7903extern_class!(
7904 #[unsafe(super(NEAppProxyProvider, NETunnelProvider, NEProvider, NSObject))]
7914 #[derive(Debug, PartialEq, Eq, Hash)]
7915 pub struct NETransparentProxyProvider;
7916);
7917
7918extern_conformance!(
7919 unsafe impl NSObjectProtocol for NETransparentProxyProvider {}
7920);
7921
7922impl NETransparentProxyProvider {
7923 extern_methods!();
7924}
7925
7926impl NETransparentProxyProvider {
7928 extern_methods!(
7929 #[unsafe(method(init))]
7930 #[unsafe(method_family = init)]
7931 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7932
7933 #[unsafe(method(new))]
7934 #[unsafe(method_family = new)]
7935 pub unsafe fn new() -> Retained<Self>;
7936 );
7937}
7938
7939#[repr(transparent)]
7944#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
7945pub struct NEVPNStatus(pub NSInteger);
7946impl NEVPNStatus {
7947 #[doc(alias = "NEVPNStatusInvalid")]
7948 pub const Invalid: Self = Self(0);
7949 #[doc(alias = "NEVPNStatusDisconnected")]
7950 pub const Disconnected: Self = Self(1);
7951 #[doc(alias = "NEVPNStatusConnecting")]
7952 pub const Connecting: Self = Self(2);
7953 #[doc(alias = "NEVPNStatusConnected")]
7954 pub const Connected: Self = Self(3);
7955 #[doc(alias = "NEVPNStatusReasserting")]
7956 pub const Reasserting: Self = Self(4);
7957 #[doc(alias = "NEVPNStatusDisconnecting")]
7958 pub const Disconnecting: Self = Self(5);
7959}
7960
7961unsafe impl Encode for NEVPNStatus {
7962 const ENCODING: Encoding = NSInteger::ENCODING;
7963}
7964
7965unsafe impl RefEncode for NEVPNStatus {
7966 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
7967}
7968
7969extern "C" {
7970 pub static NEVPNStatusDidChangeNotification: &'static NSString;
7972}
7973
7974extern "C" {
7975 pub static NEVPNConnectionStartOptionUsername: &'static NSString;
7977}
7978
7979extern "C" {
7980 pub static NEVPNConnectionStartOptionPassword: &'static NSString;
7982}
7983
7984#[repr(transparent)]
7989#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
7990pub struct NEVPNConnectionError(pub NSInteger);
7991impl NEVPNConnectionError {
7992 #[doc(alias = "NEVPNConnectionErrorOverslept")]
7993 pub const Overslept: Self = Self(1);
7994 #[doc(alias = "NEVPNConnectionErrorNoNetworkAvailable")]
7995 pub const NoNetworkAvailable: Self = Self(2);
7996 #[doc(alias = "NEVPNConnectionErrorUnrecoverableNetworkChange")]
7998 pub const UnrecoverableNetworkChange: Self = Self(3);
7999 #[doc(alias = "NEVPNConnectionErrorConfigurationFailed")]
8000 pub const ConfigurationFailed: Self = Self(4);
8001 #[doc(alias = "NEVPNConnectionErrorServerAddressResolutionFailed")]
8002 pub const ServerAddressResolutionFailed: Self = Self(5);
8003 #[doc(alias = "NEVPNConnectionErrorServerNotResponding")]
8004 pub const ServerNotResponding: Self = Self(6);
8005 #[doc(alias = "NEVPNConnectionErrorServerDead")]
8006 pub const ServerDead: Self = Self(7);
8007 #[doc(alias = "NEVPNConnectionErrorAuthenticationFailed")]
8008 pub const AuthenticationFailed: Self = Self(8);
8009 #[doc(alias = "NEVPNConnectionErrorClientCertificateInvalid")]
8010 pub const ClientCertificateInvalid: Self = Self(9);
8011 #[doc(alias = "NEVPNConnectionErrorClientCertificateNotYetValid")]
8012 pub const ClientCertificateNotYetValid: Self = Self(10);
8013 #[doc(alias = "NEVPNConnectionErrorClientCertificateExpired")]
8014 pub const ClientCertificateExpired: Self = Self(11);
8015 #[doc(alias = "NEVPNConnectionErrorPluginFailed")]
8016 pub const PluginFailed: Self = Self(12);
8017 #[doc(alias = "NEVPNConnectionErrorConfigurationNotFound")]
8018 pub const ConfigurationNotFound: Self = Self(13);
8019 #[doc(alias = "NEVPNConnectionErrorPluginDisabled")]
8020 pub const PluginDisabled: Self = Self(14);
8021 #[doc(alias = "NEVPNConnectionErrorNegotiationFailed")]
8022 pub const NegotiationFailed: Self = Self(15);
8023 #[doc(alias = "NEVPNConnectionErrorServerDisconnected")]
8024 pub const ServerDisconnected: Self = Self(16);
8025 #[doc(alias = "NEVPNConnectionErrorServerCertificateInvalid")]
8026 pub const ServerCertificateInvalid: Self = Self(17);
8027 #[doc(alias = "NEVPNConnectionErrorServerCertificateNotYetValid")]
8028 pub const ServerCertificateNotYetValid: Self = Self(18);
8029 #[doc(alias = "NEVPNConnectionErrorServerCertificateExpired")]
8030 pub const ServerCertificateExpired: Self = Self(19);
8031}
8032
8033unsafe impl Encode for NEVPNConnectionError {
8034 const ENCODING: Encoding = NSInteger::ENCODING;
8035}
8036
8037unsafe impl RefEncode for NEVPNConnectionError {
8038 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
8039}
8040
8041extern "C" {
8042 pub static NEVPNConnectionErrorDomain: &'static NSString;
8044}
8045
8046extern_class!(
8047 #[unsafe(super(NSObject))]
8053 #[derive(Debug, PartialEq, Eq, Hash)]
8054 pub struct NEVPNConnection;
8055);
8056
8057extern_conformance!(
8058 unsafe impl NSObjectProtocol for NEVPNConnection {}
8059);
8060
8061impl NEVPNConnection {
8062 extern_methods!(
8063 #[unsafe(method(startVPNTunnelAndReturnError:_))]
8071 #[unsafe(method_family = none)]
8072 pub unsafe fn startVPNTunnelAndReturnError(&self) -> Result<(), Retained<NSError>>;
8073
8074 #[unsafe(method(startVPNTunnelWithOptions:andReturnError:_))]
8087 #[unsafe(method_family = none)]
8088 pub unsafe fn startVPNTunnelWithOptions_andReturnError(
8089 &self,
8090 options: Option<&NSDictionary<NSString, NSObject>>,
8091 ) -> Result<(), Retained<NSError>>;
8092
8093 #[unsafe(method(stopVPNTunnel))]
8095 #[unsafe(method_family = none)]
8096 pub unsafe fn stopVPNTunnel(&self);
8097
8098 #[cfg(feature = "block2")]
8099 #[unsafe(method(fetchLastDisconnectErrorWithCompletionHandler:))]
8103 #[unsafe(method_family = none)]
8104 pub unsafe fn fetchLastDisconnectErrorWithCompletionHandler(
8105 &self,
8106 handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
8107 );
8108
8109 #[unsafe(method(status))]
8111 #[unsafe(method_family = none)]
8112 pub unsafe fn status(&self) -> NEVPNStatus;
8113
8114 #[unsafe(method(connectedDate))]
8116 #[unsafe(method_family = none)]
8117 pub unsafe fn connectedDate(&self) -> Option<Retained<NSDate>>;
8118
8119 #[unsafe(method(manager))]
8121 #[unsafe(method_family = none)]
8122 pub unsafe fn manager(&self) -> Retained<NEVPNManager>;
8123 );
8124}
8125
8126impl NEVPNConnection {
8128 extern_methods!(
8129 #[unsafe(method(init))]
8130 #[unsafe(method_family = init)]
8131 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
8132
8133 #[unsafe(method(new))]
8134 #[unsafe(method_family = new)]
8135 pub unsafe fn new() -> Retained<Self>;
8136 );
8137}
8138
8139extern_class!(
8140 #[unsafe(super(NEVPNConnection, NSObject))]
8146 #[derive(Debug, PartialEq, Eq, Hash)]
8147 pub struct NETunnelProviderSession;
8148);
8149
8150extern_conformance!(
8151 unsafe impl NSObjectProtocol for NETunnelProviderSession {}
8152);
8153
8154impl NETunnelProviderSession {
8155 extern_methods!(
8156 #[unsafe(method(startTunnelWithOptions:andReturnError:_))]
8166 #[unsafe(method_family = none)]
8167 pub unsafe fn startTunnelWithOptions_andReturnError(
8168 &self,
8169 options: Option<&NSDictionary<NSString, AnyObject>>,
8170 ) -> Result<(), Retained<NSError>>;
8171
8172 #[unsafe(method(stopTunnel))]
8174 #[unsafe(method_family = none)]
8175 pub unsafe fn stopTunnel(&self);
8176
8177 #[cfg(feature = "block2")]
8178 #[unsafe(method(sendProviderMessage:returnError:responseHandler:))]
8190 #[unsafe(method_family = none)]
8191 pub unsafe fn sendProviderMessage_returnError_responseHandler(
8192 &self,
8193 message_data: &NSData,
8194 error: Option<&mut Option<Retained<NSError>>>,
8195 response_handler: Option<&block2::DynBlock<dyn Fn(*mut NSData)>>,
8196 ) -> bool;
8197 );
8198}
8199
8200impl NETunnelProviderSession {
8202 extern_methods!(
8203 #[unsafe(method(init))]
8204 #[unsafe(method_family = init)]
8205 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
8206
8207 #[unsafe(method(new))]
8208 #[unsafe(method_family = new)]
8209 pub unsafe fn new() -> Retained<Self>;
8210 );
8211}
8212
8213extern_class!(
8214 #[unsafe(super(NEVPNProtocol, NSObject))]
8220 #[derive(Debug, PartialEq, Eq, Hash)]
8221 pub struct NETunnelProviderProtocol;
8222);
8223
8224extern_conformance!(
8225 unsafe impl NSCoding for NETunnelProviderProtocol {}
8226);
8227
8228extern_conformance!(
8229 unsafe impl NSCopying for NETunnelProviderProtocol {}
8230);
8231
8232unsafe impl CopyingHelper for NETunnelProviderProtocol {
8233 type Result = Self;
8234}
8235
8236extern_conformance!(
8237 unsafe impl NSObjectProtocol for NETunnelProviderProtocol {}
8238);
8239
8240extern_conformance!(
8241 unsafe impl NSSecureCoding for NETunnelProviderProtocol {}
8242);
8243
8244impl NETunnelProviderProtocol {
8245 extern_methods!(
8246 #[unsafe(method(providerConfiguration))]
8248 #[unsafe(method_family = none)]
8249 pub unsafe fn providerConfiguration(
8250 &self,
8251 ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
8252
8253 #[unsafe(method(setProviderConfiguration:))]
8255 #[unsafe(method_family = none)]
8256 pub unsafe fn setProviderConfiguration(
8257 &self,
8258 provider_configuration: Option<&NSDictionary<NSString, AnyObject>>,
8259 );
8260
8261 #[unsafe(method(providerBundleIdentifier))]
8263 #[unsafe(method_family = none)]
8264 pub unsafe fn providerBundleIdentifier(&self) -> Option<Retained<NSString>>;
8265
8266 #[unsafe(method(setProviderBundleIdentifier:))]
8268 #[unsafe(method_family = none)]
8269 pub unsafe fn setProviderBundleIdentifier(
8270 &self,
8271 provider_bundle_identifier: Option<&NSString>,
8272 );
8273 );
8274}
8275
8276impl NETunnelProviderProtocol {
8278 extern_methods!(
8279 #[unsafe(method(init))]
8280 #[unsafe(method_family = init)]
8281 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
8282
8283 #[unsafe(method(new))]
8284 #[unsafe(method_family = new)]
8285 pub unsafe fn new() -> Retained<Self>;
8286 );
8287}
8288
8289#[repr(transparent)]
8294#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
8295pub struct NEVPNIKEAuthenticationMethod(pub NSInteger);
8296impl NEVPNIKEAuthenticationMethod {
8297 #[doc(alias = "NEVPNIKEAuthenticationMethodNone")]
8298 pub const None: Self = Self(0);
8299 #[doc(alias = "NEVPNIKEAuthenticationMethodCertificate")]
8300 pub const Certificate: Self = Self(1);
8301 #[doc(alias = "NEVPNIKEAuthenticationMethodSharedSecret")]
8302 pub const SharedSecret: Self = Self(2);
8303}
8304
8305unsafe impl Encode for NEVPNIKEAuthenticationMethod {
8306 const ENCODING: Encoding = NSInteger::ENCODING;
8307}
8308
8309unsafe impl RefEncode for NEVPNIKEAuthenticationMethod {
8310 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
8311}
8312
8313extern_class!(
8314 #[unsafe(super(NEVPNProtocol, NSObject))]
8320 #[derive(Debug, PartialEq, Eq, Hash)]
8321 pub struct NEVPNProtocolIPSec;
8322);
8323
8324extern_conformance!(
8325 unsafe impl NSCoding for NEVPNProtocolIPSec {}
8326);
8327
8328extern_conformance!(
8329 unsafe impl NSCopying for NEVPNProtocolIPSec {}
8330);
8331
8332unsafe impl CopyingHelper for NEVPNProtocolIPSec {
8333 type Result = Self;
8334}
8335
8336extern_conformance!(
8337 unsafe impl NSObjectProtocol for NEVPNProtocolIPSec {}
8338);
8339
8340extern_conformance!(
8341 unsafe impl NSSecureCoding for NEVPNProtocolIPSec {}
8342);
8343
8344impl NEVPNProtocolIPSec {
8345 extern_methods!(
8346 #[unsafe(method(authenticationMethod))]
8348 #[unsafe(method_family = none)]
8349 pub unsafe fn authenticationMethod(&self) -> NEVPNIKEAuthenticationMethod;
8350
8351 #[unsafe(method(setAuthenticationMethod:))]
8353 #[unsafe(method_family = none)]
8354 pub unsafe fn setAuthenticationMethod(
8355 &self,
8356 authentication_method: NEVPNIKEAuthenticationMethod,
8357 );
8358
8359 #[unsafe(method(useExtendedAuthentication))]
8363 #[unsafe(method_family = none)]
8364 pub unsafe fn useExtendedAuthentication(&self) -> bool;
8365
8366 #[unsafe(method(setUseExtendedAuthentication:))]
8368 #[unsafe(method_family = none)]
8369 pub unsafe fn setUseExtendedAuthentication(&self, use_extended_authentication: bool);
8370
8371 #[unsafe(method(sharedSecretReference))]
8373 #[unsafe(method_family = none)]
8374 pub unsafe fn sharedSecretReference(&self) -> Option<Retained<NSData>>;
8375
8376 #[unsafe(method(setSharedSecretReference:))]
8378 #[unsafe(method_family = none)]
8379 pub unsafe fn setSharedSecretReference(&self, shared_secret_reference: Option<&NSData>);
8380
8381 #[unsafe(method(localIdentifier))]
8383 #[unsafe(method_family = none)]
8384 pub unsafe fn localIdentifier(&self) -> Option<Retained<NSString>>;
8385
8386 #[unsafe(method(setLocalIdentifier:))]
8388 #[unsafe(method_family = none)]
8389 pub unsafe fn setLocalIdentifier(&self, local_identifier: Option<&NSString>);
8390
8391 #[unsafe(method(remoteIdentifier))]
8393 #[unsafe(method_family = none)]
8394 pub unsafe fn remoteIdentifier(&self) -> Option<Retained<NSString>>;
8395
8396 #[unsafe(method(setRemoteIdentifier:))]
8398 #[unsafe(method_family = none)]
8399 pub unsafe fn setRemoteIdentifier(&self, remote_identifier: Option<&NSString>);
8400 );
8401}
8402
8403impl NEVPNProtocolIPSec {
8405 extern_methods!(
8406 #[unsafe(method(init))]
8407 #[unsafe(method_family = init)]
8408 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
8409
8410 #[unsafe(method(new))]
8411 #[unsafe(method_family = new)]
8412 pub unsafe fn new() -> Retained<Self>;
8413 );
8414}
8415
8416#[repr(transparent)]
8421#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
8422pub struct NEVPNIKEv2EncryptionAlgorithm(pub NSInteger);
8423impl NEVPNIKEv2EncryptionAlgorithm {
8424 #[doc(alias = "NEVPNIKEv2EncryptionAlgorithmDES")]
8425 #[deprecated = "Use an encryption algorithm with 256-bit keys instead"]
8426 pub const AlgorithmDES: Self = Self(1);
8427 #[doc(alias = "NEVPNIKEv2EncryptionAlgorithm3DES")]
8428 #[deprecated = "Use an encryption algorithm with 256-bit keys instead"]
8429 pub const Algorithm3DES: Self = Self(2);
8430 #[doc(alias = "NEVPNIKEv2EncryptionAlgorithmAES128")]
8431 #[deprecated = "Use an encryption algorithm with 256-bit keys instead"]
8432 pub const AlgorithmAES128: Self = Self(3);
8433 #[doc(alias = "NEVPNIKEv2EncryptionAlgorithmAES256")]
8434 pub const AlgorithmAES256: Self = Self(4);
8435 #[doc(alias = "NEVPNIKEv2EncryptionAlgorithmAES128GCM")]
8436 #[deprecated = "Use an encryption algorithm with 256-bit keys instead"]
8437 pub const AlgorithmAES128GCM: Self = Self(5);
8438 #[doc(alias = "NEVPNIKEv2EncryptionAlgorithmAES256GCM")]
8439 pub const AlgorithmAES256GCM: Self = Self(6);
8440 #[doc(alias = "NEVPNIKEv2EncryptionAlgorithmChaCha20Poly1305")]
8441 pub const AlgorithmChaCha20Poly1305: Self = Self(7);
8442}
8443
8444unsafe impl Encode for NEVPNIKEv2EncryptionAlgorithm {
8445 const ENCODING: Encoding = NSInteger::ENCODING;
8446}
8447
8448unsafe impl RefEncode for NEVPNIKEv2EncryptionAlgorithm {
8449 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
8450}
8451
8452#[repr(transparent)]
8457#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
8458pub struct NEVPNIKEv2IntegrityAlgorithm(pub NSInteger);
8459impl NEVPNIKEv2IntegrityAlgorithm {
8460 #[doc(alias = "NEVPNIKEv2IntegrityAlgorithmSHA96")]
8461 #[deprecated = "Use SHA-2 for integrity protection instead"]
8462 pub const SHA96: Self = Self(1);
8463 #[doc(alias = "NEVPNIKEv2IntegrityAlgorithmSHA160")]
8464 #[deprecated = "Use SHA-2 for integrity protection instead"]
8465 pub const SHA160: Self = Self(2);
8466 #[doc(alias = "NEVPNIKEv2IntegrityAlgorithmSHA256")]
8467 pub const SHA256: Self = Self(3);
8468 #[doc(alias = "NEVPNIKEv2IntegrityAlgorithmSHA384")]
8469 pub const SHA384: Self = Self(4);
8470 #[doc(alias = "NEVPNIKEv2IntegrityAlgorithmSHA512")]
8471 pub const SHA512: Self = Self(5);
8472}
8473
8474unsafe impl Encode for NEVPNIKEv2IntegrityAlgorithm {
8475 const ENCODING: Encoding = NSInteger::ENCODING;
8476}
8477
8478unsafe impl RefEncode for NEVPNIKEv2IntegrityAlgorithm {
8479 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
8480}
8481
8482#[repr(transparent)]
8487#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
8488pub struct NEVPNIKEv2DeadPeerDetectionRate(pub NSInteger);
8489impl NEVPNIKEv2DeadPeerDetectionRate {
8490 #[doc(alias = "NEVPNIKEv2DeadPeerDetectionRateNone")]
8491 pub const None: Self = Self(0);
8492 #[doc(alias = "NEVPNIKEv2DeadPeerDetectionRateLow")]
8493 pub const Low: Self = Self(1);
8494 #[doc(alias = "NEVPNIKEv2DeadPeerDetectionRateMedium")]
8495 pub const Medium: Self = Self(2);
8496 #[doc(alias = "NEVPNIKEv2DeadPeerDetectionRateHigh")]
8497 pub const High: Self = Self(3);
8498}
8499
8500unsafe impl Encode for NEVPNIKEv2DeadPeerDetectionRate {
8501 const ENCODING: Encoding = NSInteger::ENCODING;
8502}
8503
8504unsafe impl RefEncode for NEVPNIKEv2DeadPeerDetectionRate {
8505 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
8506}
8507
8508#[repr(transparent)]
8513#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
8514pub struct NEVPNIKEv2DiffieHellmanGroup(pub NSInteger);
8515impl NEVPNIKEv2DiffieHellmanGroup {
8516 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroupInvalid")]
8517 pub const GroupInvalid: Self = Self(0);
8518 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup1")]
8519 #[deprecated = "Use Diffie Hellman group 14 or greater instead"]
8520 pub const Group1: Self = Self(1);
8521 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup2")]
8522 #[deprecated = "Use Diffie Hellman group 14 or greater instead"]
8523 pub const Group2: Self = Self(2);
8524 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup5")]
8525 #[deprecated = "Use Diffie Hellman group 14 or greater instead"]
8526 pub const Group5: Self = Self(5);
8527 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup14")]
8528 pub const Group14: Self = Self(14);
8529 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup15")]
8530 pub const Group15: Self = Self(15);
8531 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup16")]
8532 pub const Group16: Self = Self(16);
8533 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup17")]
8534 pub const Group17: Self = Self(17);
8535 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup18")]
8536 pub const Group18: Self = Self(18);
8537 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup19")]
8538 pub const Group19: Self = Self(19);
8539 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup20")]
8540 pub const Group20: Self = Self(20);
8541 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup21")]
8542 pub const Group21: Self = Self(21);
8543 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup31")]
8544 pub const Group31: Self = Self(31);
8545 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup32")]
8546 pub const Group32: Self = Self(32);
8547}
8548
8549unsafe impl Encode for NEVPNIKEv2DiffieHellmanGroup {
8550 const ENCODING: Encoding = NSInteger::ENCODING;
8551}
8552
8553unsafe impl RefEncode for NEVPNIKEv2DiffieHellmanGroup {
8554 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
8555}
8556
8557#[repr(transparent)]
8562#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
8563pub struct NEVPNIKEv2CertificateType(pub NSInteger);
8564impl NEVPNIKEv2CertificateType {
8565 #[doc(alias = "NEVPNIKEv2CertificateTypeRSA")]
8566 pub const RSA: Self = Self(1);
8567 #[doc(alias = "NEVPNIKEv2CertificateTypeECDSA256")]
8568 pub const ECDSA256: Self = Self(2);
8569 #[doc(alias = "NEVPNIKEv2CertificateTypeECDSA384")]
8570 pub const ECDSA384: Self = Self(3);
8571 #[doc(alias = "NEVPNIKEv2CertificateTypeECDSA521")]
8572 pub const ECDSA521: Self = Self(4);
8573 #[doc(alias = "NEVPNIKEv2CertificateTypeEd25519")]
8574 pub const Ed25519: Self = Self(5);
8575 #[doc(alias = "NEVPNIKEv2CertificateTypeRSAPSS")]
8576 pub const RSAPSS: Self = Self(6);
8577}
8578
8579unsafe impl Encode for NEVPNIKEv2CertificateType {
8580 const ENCODING: Encoding = NSInteger::ENCODING;
8581}
8582
8583unsafe impl RefEncode for NEVPNIKEv2CertificateType {
8584 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
8585}
8586
8587#[repr(transparent)]
8592#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
8593pub struct NEVPNIKEv2TLSVersion(pub NSInteger);
8594impl NEVPNIKEv2TLSVersion {
8595 #[doc(alias = "NEVPNIKEv2TLSVersionDefault")]
8596 pub const VersionDefault: Self = Self(0);
8597 #[doc(alias = "NEVPNIKEv2TLSVersion1_0")]
8598 pub const Version1_0: Self = Self(1);
8599 #[doc(alias = "NEVPNIKEv2TLSVersion1_1")]
8600 pub const Version1_1: Self = Self(2);
8601 #[doc(alias = "NEVPNIKEv2TLSVersion1_2")]
8602 pub const Version1_2: Self = Self(3);
8603}
8604
8605unsafe impl Encode for NEVPNIKEv2TLSVersion {
8606 const ENCODING: Encoding = NSInteger::ENCODING;
8607}
8608
8609unsafe impl RefEncode for NEVPNIKEv2TLSVersion {
8610 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
8611}
8612
8613extern_class!(
8614 #[unsafe(super(NSObject))]
8620 #[derive(Debug, PartialEq, Eq, Hash)]
8621 pub struct NEVPNIKEv2SecurityAssociationParameters;
8622);
8623
8624extern_conformance!(
8625 unsafe impl NSCoding for NEVPNIKEv2SecurityAssociationParameters {}
8626);
8627
8628extern_conformance!(
8629 unsafe impl NSCopying for NEVPNIKEv2SecurityAssociationParameters {}
8630);
8631
8632unsafe impl CopyingHelper for NEVPNIKEv2SecurityAssociationParameters {
8633 type Result = Self;
8634}
8635
8636extern_conformance!(
8637 unsafe impl NSObjectProtocol for NEVPNIKEv2SecurityAssociationParameters {}
8638);
8639
8640extern_conformance!(
8641 unsafe impl NSSecureCoding for NEVPNIKEv2SecurityAssociationParameters {}
8642);
8643
8644impl NEVPNIKEv2SecurityAssociationParameters {
8645 extern_methods!(
8646 #[unsafe(method(encryptionAlgorithm))]
8649 #[unsafe(method_family = none)]
8650 pub unsafe fn encryptionAlgorithm(&self) -> NEVPNIKEv2EncryptionAlgorithm;
8651
8652 #[unsafe(method(setEncryptionAlgorithm:))]
8654 #[unsafe(method_family = none)]
8655 pub unsafe fn setEncryptionAlgorithm(
8656 &self,
8657 encryption_algorithm: NEVPNIKEv2EncryptionAlgorithm,
8658 );
8659
8660 #[unsafe(method(integrityAlgorithm))]
8663 #[unsafe(method_family = none)]
8664 pub unsafe fn integrityAlgorithm(&self) -> NEVPNIKEv2IntegrityAlgorithm;
8665
8666 #[unsafe(method(setIntegrityAlgorithm:))]
8668 #[unsafe(method_family = none)]
8669 pub unsafe fn setIntegrityAlgorithm(
8670 &self,
8671 integrity_algorithm: NEVPNIKEv2IntegrityAlgorithm,
8672 );
8673
8674 #[unsafe(method(diffieHellmanGroup))]
8676 #[unsafe(method_family = none)]
8677 pub unsafe fn diffieHellmanGroup(&self) -> NEVPNIKEv2DiffieHellmanGroup;
8678
8679 #[unsafe(method(setDiffieHellmanGroup:))]
8681 #[unsafe(method_family = none)]
8682 pub unsafe fn setDiffieHellmanGroup(
8683 &self,
8684 diffie_hellman_group: NEVPNIKEv2DiffieHellmanGroup,
8685 );
8686
8687 #[unsafe(method(lifetimeMinutes))]
8689 #[unsafe(method_family = none)]
8690 pub unsafe fn lifetimeMinutes(&self) -> i32;
8691
8692 #[unsafe(method(setLifetimeMinutes:))]
8694 #[unsafe(method_family = none)]
8695 pub unsafe fn setLifetimeMinutes(&self, lifetime_minutes: i32);
8696 );
8697}
8698
8699impl NEVPNIKEv2SecurityAssociationParameters {
8701 extern_methods!(
8702 #[unsafe(method(init))]
8703 #[unsafe(method_family = init)]
8704 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
8705
8706 #[unsafe(method(new))]
8707 #[unsafe(method_family = new)]
8708 pub unsafe fn new() -> Retained<Self>;
8709 );
8710}
8711
8712extern_class!(
8713 #[unsafe(super(NSObject))]
8720 #[derive(Debug, PartialEq, Eq, Hash)]
8721 pub struct NEVPNIKEv2PPKConfiguration;
8722);
8723
8724extern_conformance!(
8725 unsafe impl NSCopying for NEVPNIKEv2PPKConfiguration {}
8726);
8727
8728unsafe impl CopyingHelper for NEVPNIKEv2PPKConfiguration {
8729 type Result = Self;
8730}
8731
8732extern_conformance!(
8733 unsafe impl NSObjectProtocol for NEVPNIKEv2PPKConfiguration {}
8734);
8735
8736impl NEVPNIKEv2PPKConfiguration {
8737 extern_methods!(
8738 #[unsafe(method(initWithIdentifier:keychainReference:))]
8744 #[unsafe(method_family = init)]
8745 pub unsafe fn initWithIdentifier_keychainReference(
8746 this: Allocated<Self>,
8747 identifier: &NSString,
8748 keychain_reference: &NSData,
8749 ) -> Retained<Self>;
8750
8751 #[unsafe(method(identifier))]
8753 #[unsafe(method_family = none)]
8754 pub unsafe fn identifier(&self) -> Retained<NSString>;
8755
8756 #[unsafe(method(keychainReference))]
8758 #[unsafe(method_family = none)]
8759 pub unsafe fn keychainReference(&self) -> Retained<NSData>;
8760
8761 #[unsafe(method(isMandatory))]
8763 #[unsafe(method_family = none)]
8764 pub unsafe fn isMandatory(&self) -> bool;
8765
8766 #[unsafe(method(setIsMandatory:))]
8768 #[unsafe(method_family = none)]
8769 pub unsafe fn setIsMandatory(&self, is_mandatory: bool);
8770 );
8771}
8772
8773impl NEVPNIKEv2PPKConfiguration {
8775 extern_methods!(
8776 #[unsafe(method(init))]
8777 #[unsafe(method_family = init)]
8778 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
8779
8780 #[unsafe(method(new))]
8781 #[unsafe(method_family = new)]
8782 pub unsafe fn new() -> Retained<Self>;
8783 );
8784}
8785
8786extern_class!(
8787 #[unsafe(super(NEVPNProtocolIPSec, NEVPNProtocol, NSObject))]
8794 #[derive(Debug, PartialEq, Eq, Hash)]
8795 pub struct NEVPNProtocolIKEv2;
8796);
8797
8798extern_conformance!(
8799 unsafe impl NSCoding for NEVPNProtocolIKEv2 {}
8800);
8801
8802extern_conformance!(
8803 unsafe impl NSCopying for NEVPNProtocolIKEv2 {}
8804);
8805
8806unsafe impl CopyingHelper for NEVPNProtocolIKEv2 {
8807 type Result = Self;
8808}
8809
8810extern_conformance!(
8811 unsafe impl NSObjectProtocol for NEVPNProtocolIKEv2 {}
8812);
8813
8814extern_conformance!(
8815 unsafe impl NSSecureCoding for NEVPNProtocolIKEv2 {}
8816);
8817
8818impl NEVPNProtocolIKEv2 {
8819 extern_methods!(
8820 #[unsafe(method(deadPeerDetectionRate))]
8822 #[unsafe(method_family = none)]
8823 pub unsafe fn deadPeerDetectionRate(&self) -> NEVPNIKEv2DeadPeerDetectionRate;
8824
8825 #[unsafe(method(setDeadPeerDetectionRate:))]
8827 #[unsafe(method_family = none)]
8828 pub unsafe fn setDeadPeerDetectionRate(
8829 &self,
8830 dead_peer_detection_rate: NEVPNIKEv2DeadPeerDetectionRate,
8831 );
8832
8833 #[unsafe(method(serverCertificateIssuerCommonName))]
8835 #[unsafe(method_family = none)]
8836 pub unsafe fn serverCertificateIssuerCommonName(&self) -> Option<Retained<NSString>>;
8837
8838 #[unsafe(method(setServerCertificateIssuerCommonName:))]
8840 #[unsafe(method_family = none)]
8841 pub unsafe fn setServerCertificateIssuerCommonName(
8842 &self,
8843 server_certificate_issuer_common_name: Option<&NSString>,
8844 );
8845
8846 #[unsafe(method(serverCertificateCommonName))]
8848 #[unsafe(method_family = none)]
8849 pub unsafe fn serverCertificateCommonName(&self) -> Option<Retained<NSString>>;
8850
8851 #[unsafe(method(setServerCertificateCommonName:))]
8853 #[unsafe(method_family = none)]
8854 pub unsafe fn setServerCertificateCommonName(
8855 &self,
8856 server_certificate_common_name: Option<&NSString>,
8857 );
8858
8859 #[unsafe(method(certificateType))]
8861 #[unsafe(method_family = none)]
8862 pub unsafe fn certificateType(&self) -> NEVPNIKEv2CertificateType;
8863
8864 #[unsafe(method(setCertificateType:))]
8866 #[unsafe(method_family = none)]
8867 pub unsafe fn setCertificateType(&self, certificate_type: NEVPNIKEv2CertificateType);
8868
8869 #[unsafe(method(useConfigurationAttributeInternalIPSubnet))]
8871 #[unsafe(method_family = none)]
8872 pub unsafe fn useConfigurationAttributeInternalIPSubnet(&self) -> bool;
8873
8874 #[unsafe(method(setUseConfigurationAttributeInternalIPSubnet:))]
8876 #[unsafe(method_family = none)]
8877 pub unsafe fn setUseConfigurationAttributeInternalIPSubnet(
8878 &self,
8879 use_configuration_attribute_internal_ip_subnet: bool,
8880 );
8881
8882 #[unsafe(method(IKESecurityAssociationParameters))]
8884 #[unsafe(method_family = none)]
8885 pub unsafe fn IKESecurityAssociationParameters(
8886 &self,
8887 ) -> Retained<NEVPNIKEv2SecurityAssociationParameters>;
8888
8889 #[unsafe(method(childSecurityAssociationParameters))]
8891 #[unsafe(method_family = none)]
8892 pub unsafe fn childSecurityAssociationParameters(
8893 &self,
8894 ) -> Retained<NEVPNIKEv2SecurityAssociationParameters>;
8895
8896 #[unsafe(method(disableMOBIKE))]
8898 #[unsafe(method_family = none)]
8899 pub unsafe fn disableMOBIKE(&self) -> bool;
8900
8901 #[unsafe(method(setDisableMOBIKE:))]
8903 #[unsafe(method_family = none)]
8904 pub unsafe fn setDisableMOBIKE(&self, disable_mobike: bool);
8905
8906 #[unsafe(method(disableRedirect))]
8908 #[unsafe(method_family = none)]
8909 pub unsafe fn disableRedirect(&self) -> bool;
8910
8911 #[unsafe(method(setDisableRedirect:))]
8913 #[unsafe(method_family = none)]
8914 pub unsafe fn setDisableRedirect(&self, disable_redirect: bool);
8915
8916 #[unsafe(method(enablePFS))]
8918 #[unsafe(method_family = none)]
8919 pub unsafe fn enablePFS(&self) -> bool;
8920
8921 #[unsafe(method(setEnablePFS:))]
8923 #[unsafe(method_family = none)]
8924 pub unsafe fn setEnablePFS(&self, enable_pfs: bool);
8925
8926 #[unsafe(method(enableRevocationCheck))]
8928 #[unsafe(method_family = none)]
8929 pub unsafe fn enableRevocationCheck(&self) -> bool;
8930
8931 #[unsafe(method(setEnableRevocationCheck:))]
8933 #[unsafe(method_family = none)]
8934 pub unsafe fn setEnableRevocationCheck(&self, enable_revocation_check: bool);
8935
8936 #[unsafe(method(strictRevocationCheck))]
8938 #[unsafe(method_family = none)]
8939 pub unsafe fn strictRevocationCheck(&self) -> bool;
8940
8941 #[unsafe(method(setStrictRevocationCheck:))]
8943 #[unsafe(method_family = none)]
8944 pub unsafe fn setStrictRevocationCheck(&self, strict_revocation_check: bool);
8945
8946 #[unsafe(method(minimumTLSVersion))]
8948 #[unsafe(method_family = none)]
8949 pub unsafe fn minimumTLSVersion(&self) -> NEVPNIKEv2TLSVersion;
8950
8951 #[unsafe(method(setMinimumTLSVersion:))]
8953 #[unsafe(method_family = none)]
8954 pub unsafe fn setMinimumTLSVersion(&self, minimum_tls_version: NEVPNIKEv2TLSVersion);
8955
8956 #[unsafe(method(maximumTLSVersion))]
8958 #[unsafe(method_family = none)]
8959 pub unsafe fn maximumTLSVersion(&self) -> NEVPNIKEv2TLSVersion;
8960
8961 #[unsafe(method(setMaximumTLSVersion:))]
8963 #[unsafe(method_family = none)]
8964 pub unsafe fn setMaximumTLSVersion(&self, maximum_tls_version: NEVPNIKEv2TLSVersion);
8965
8966 #[unsafe(method(enableFallback))]
8971 #[unsafe(method_family = none)]
8972 pub unsafe fn enableFallback(&self) -> bool;
8973
8974 #[unsafe(method(setEnableFallback:))]
8976 #[unsafe(method_family = none)]
8977 pub unsafe fn setEnableFallback(&self, enable_fallback: bool);
8978
8979 #[unsafe(method(mtu))]
8981 #[unsafe(method_family = none)]
8982 pub unsafe fn mtu(&self) -> NSUInteger;
8983
8984 #[unsafe(method(setMtu:))]
8986 #[unsafe(method_family = none)]
8987 pub unsafe fn setMtu(&self, mtu: NSUInteger);
8988
8989 #[unsafe(method(ppkConfiguration))]
8991 #[unsafe(method_family = none)]
8992 pub unsafe fn ppkConfiguration(&self) -> Option<Retained<NEVPNIKEv2PPKConfiguration>>;
8993
8994 #[unsafe(method(setPpkConfiguration:))]
8996 #[unsafe(method_family = none)]
8997 pub unsafe fn setPpkConfiguration(
8998 &self,
8999 ppk_configuration: Option<&NEVPNIKEv2PPKConfiguration>,
9000 );
9001 );
9002}
9003
9004impl NEVPNProtocolIKEv2 {
9006 extern_methods!(
9007 #[unsafe(method(init))]
9008 #[unsafe(method_family = init)]
9009 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
9010
9011 #[unsafe(method(new))]
9012 #[unsafe(method_family = new)]
9013 pub unsafe fn new() -> Retained<Self>;
9014 );
9015}
9016
9017extern "C" {
9018 pub static NEAppPushErrorDomain: &'static NSErrorDomain;
9020}
9021
9022#[repr(transparent)]
9026#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
9027pub struct NEAppPushManagerError(pub NSInteger);
9028impl NEAppPushManagerError {
9029 #[doc(alias = "NEAppPushManagerErrorConfigurationInvalid")]
9030 pub const ConfigurationInvalid: Self = Self(1);
9031 #[doc(alias = "NEAppPushManagerErrorConfigurationNotLoaded")]
9032 pub const ConfigurationNotLoaded: Self = Self(2);
9033 #[doc(alias = "NEAppPushManagerErrorInternalError")]
9034 pub const InternalError: Self = Self(3);
9035 #[doc(alias = "NEAppPushManagerErrorInactiveSession")]
9036 pub const InactiveSession: Self = Self(4);
9037}
9038
9039unsafe impl Encode for NEAppPushManagerError {
9040 const ENCODING: Encoding = NSInteger::ENCODING;
9041}
9042
9043unsafe impl RefEncode for NEAppPushManagerError {
9044 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
9045}
9046
9047extern_class!(
9048 #[unsafe(super(NSObject))]
9052 #[derive(Debug, PartialEq, Eq, Hash)]
9053 pub struct NEPrivateLTENetwork;
9054);
9055
9056extern_conformance!(
9057 unsafe impl NSCoding for NEPrivateLTENetwork {}
9058);
9059
9060extern_conformance!(
9061 unsafe impl NSCopying for NEPrivateLTENetwork {}
9062);
9063
9064unsafe impl CopyingHelper for NEPrivateLTENetwork {
9065 type Result = Self;
9066}
9067
9068extern_conformance!(
9069 unsafe impl NSObjectProtocol for NEPrivateLTENetwork {}
9070);
9071
9072extern_conformance!(
9073 unsafe impl NSSecureCoding for NEPrivateLTENetwork {}
9074);
9075
9076impl NEPrivateLTENetwork {
9077 extern_methods!(
9078 #[unsafe(method(mobileCountryCode))]
9080 #[unsafe(method_family = none)]
9081 pub unsafe fn mobileCountryCode(&self) -> Retained<NSString>;
9082
9083 #[unsafe(method(setMobileCountryCode:))]
9085 #[unsafe(method_family = none)]
9086 pub unsafe fn setMobileCountryCode(&self, mobile_country_code: &NSString);
9087
9088 #[unsafe(method(mobileNetworkCode))]
9090 #[unsafe(method_family = none)]
9091 pub unsafe fn mobileNetworkCode(&self) -> Retained<NSString>;
9092
9093 #[unsafe(method(setMobileNetworkCode:))]
9095 #[unsafe(method_family = none)]
9096 pub unsafe fn setMobileNetworkCode(&self, mobile_network_code: &NSString);
9097
9098 #[unsafe(method(trackingAreaCode))]
9100 #[unsafe(method_family = none)]
9101 pub unsafe fn trackingAreaCode(&self) -> Option<Retained<NSString>>;
9102
9103 #[unsafe(method(setTrackingAreaCode:))]
9105 #[unsafe(method_family = none)]
9106 pub unsafe fn setTrackingAreaCode(&self, tracking_area_code: Option<&NSString>);
9107 );
9108}
9109
9110impl NEPrivateLTENetwork {
9112 extern_methods!(
9113 #[unsafe(method(init))]
9114 #[unsafe(method_family = init)]
9115 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
9116
9117 #[unsafe(method(new))]
9118 #[unsafe(method_family = new)]
9119 pub unsafe fn new() -> Retained<Self>;
9120 );
9121}
9122
9123extern_class!(
9124 #[unsafe(super(NSObject))]
9132 #[derive(Debug, PartialEq, Eq, Hash)]
9133 pub struct NEAppPushManager;
9134);
9135
9136extern_conformance!(
9137 unsafe impl NSObjectProtocol for NEAppPushManager {}
9138);
9139
9140impl NEAppPushManager {
9141 extern_methods!(
9142 #[unsafe(method(matchSSIDs))]
9145 #[unsafe(method_family = none)]
9146 pub unsafe fn matchSSIDs(&self) -> Retained<NSArray<NSString>>;
9147
9148 #[unsafe(method(setMatchSSIDs:))]
9150 #[unsafe(method_family = none)]
9151 pub unsafe fn setMatchSSIDs(&self, match_ssi_ds: &NSArray<NSString>);
9152
9153 #[unsafe(method(matchPrivateLTENetworks))]
9156 #[unsafe(method_family = none)]
9157 pub unsafe fn matchPrivateLTENetworks(&self) -> Retained<NSArray<NEPrivateLTENetwork>>;
9158
9159 #[unsafe(method(setMatchPrivateLTENetworks:))]
9161 #[unsafe(method_family = none)]
9162 pub unsafe fn setMatchPrivateLTENetworks(
9163 &self,
9164 match_private_lte_networks: &NSArray<NEPrivateLTENetwork>,
9165 );
9166
9167 #[unsafe(method(providerConfiguration))]
9170 #[unsafe(method_family = none)]
9171 pub unsafe fn providerConfiguration(&self) -> Retained<NSDictionary<NSString, AnyObject>>;
9172
9173 #[unsafe(method(setProviderConfiguration:))]
9175 #[unsafe(method_family = none)]
9176 pub unsafe fn setProviderConfiguration(
9177 &self,
9178 provider_configuration: &NSDictionary<NSString, AnyObject>,
9179 );
9180
9181 #[unsafe(method(providerBundleIdentifier))]
9183 #[unsafe(method_family = none)]
9184 pub unsafe fn providerBundleIdentifier(&self) -> Option<Retained<NSString>>;
9185
9186 #[unsafe(method(setProviderBundleIdentifier:))]
9188 #[unsafe(method_family = none)]
9189 pub unsafe fn setProviderBundleIdentifier(
9190 &self,
9191 provider_bundle_identifier: Option<&NSString>,
9192 );
9193
9194 #[unsafe(method(delegate))]
9196 #[unsafe(method_family = none)]
9197 pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NEAppPushDelegate>>>;
9198
9199 #[unsafe(method(setDelegate:))]
9202 #[unsafe(method_family = none)]
9203 pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NEAppPushDelegate>>);
9204
9205 #[cfg(feature = "block2")]
9206 #[unsafe(method(loadAllFromPreferencesWithCompletionHandler:))]
9211 #[unsafe(method_family = none)]
9212 pub unsafe fn loadAllFromPreferencesWithCompletionHandler(
9213 completion_handler: &block2::DynBlock<
9214 dyn Fn(*mut NSArray<NEAppPushManager>, *mut NSError),
9215 >,
9216 );
9217
9218 #[cfg(feature = "block2")]
9219 #[unsafe(method(loadFromPreferencesWithCompletionHandler:))]
9223 #[unsafe(method_family = none)]
9224 pub unsafe fn loadFromPreferencesWithCompletionHandler(
9225 &self,
9226 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
9227 );
9228
9229 #[cfg(feature = "block2")]
9230 #[unsafe(method(removeFromPreferencesWithCompletionHandler:))]
9234 #[unsafe(method_family = none)]
9235 pub unsafe fn removeFromPreferencesWithCompletionHandler(
9236 &self,
9237 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
9238 );
9239
9240 #[cfg(feature = "block2")]
9241 #[unsafe(method(saveToPreferencesWithCompletionHandler:))]
9245 #[unsafe(method_family = none)]
9246 pub unsafe fn saveToPreferencesWithCompletionHandler(
9247 &self,
9248 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
9249 );
9250
9251 #[unsafe(method(localizedDescription))]
9253 #[unsafe(method_family = none)]
9254 pub unsafe fn localizedDescription(&self) -> Option<Retained<NSString>>;
9255
9256 #[unsafe(method(setLocalizedDescription:))]
9258 #[unsafe(method_family = none)]
9259 pub unsafe fn setLocalizedDescription(&self, localized_description: Option<&NSString>);
9260
9261 #[unsafe(method(isEnabled))]
9263 #[unsafe(method_family = none)]
9264 pub unsafe fn isEnabled(&self) -> bool;
9265
9266 #[unsafe(method(setEnabled:))]
9268 #[unsafe(method_family = none)]
9269 pub unsafe fn setEnabled(&self, enabled: bool);
9270
9271 #[unsafe(method(isActive))]
9273 #[unsafe(method_family = none)]
9274 pub unsafe fn isActive(&self) -> bool;
9275 );
9276}
9277
9278impl NEAppPushManager {
9280 extern_methods!(
9281 #[unsafe(method(init))]
9282 #[unsafe(method_family = init)]
9283 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
9284
9285 #[unsafe(method(new))]
9286 #[unsafe(method_family = new)]
9287 pub unsafe fn new() -> Retained<Self>;
9288 );
9289}
9290
9291extern_protocol!(
9292 pub unsafe trait NEAppPushDelegate: NSObjectProtocol {
9296 #[unsafe(method(appPushManager:didReceiveIncomingCallWithUserInfo:))]
9300 #[unsafe(method_family = none)]
9301 unsafe fn appPushManager_didReceiveIncomingCallWithUserInfo(
9302 &self,
9303 manager: &NEAppPushManager,
9304 user_info: &NSDictionary,
9305 );
9306 }
9307);
9308
9309extern_class!(
9310 #[unsafe(super(NEProvider, NSObject))]
9316 #[derive(Debug, PartialEq, Eq, Hash)]
9317 pub struct NEAppPushProvider;
9318);
9319
9320extern_conformance!(
9321 unsafe impl NSObjectProtocol for NEAppPushProvider {}
9322);
9323
9324impl NEAppPushProvider {
9325 extern_methods!(
9326 #[unsafe(method(providerConfiguration))]
9328 #[unsafe(method_family = none)]
9329 pub unsafe fn providerConfiguration(
9330 &self,
9331 ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
9332
9333 #[cfg(feature = "block2")]
9334 #[deprecated]
9340 #[unsafe(method(startWithCompletionHandler:))]
9341 #[unsafe(method_family = none)]
9342 pub unsafe fn startWithCompletionHandler(
9343 &self,
9344 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
9345 );
9346
9347 #[unsafe(method(start))]
9349 #[unsafe(method_family = none)]
9350 pub unsafe fn start(&self);
9351
9352 #[cfg(feature = "block2")]
9353 #[unsafe(method(stopWithReason:completionHandler:))]
9359 #[unsafe(method_family = none)]
9360 pub unsafe fn stopWithReason_completionHandler(
9361 &self,
9362 reason: NEProviderStopReason,
9363 completion_handler: &block2::DynBlock<dyn Fn()>,
9364 );
9365
9366 #[unsafe(method(reportIncomingCallWithUserInfo:))]
9370 #[unsafe(method_family = none)]
9371 pub unsafe fn reportIncomingCallWithUserInfo(&self, user_info: &NSDictionary);
9372
9373 #[unsafe(method(reportPushToTalkMessageWithUserInfo:))]
9377 #[unsafe(method_family = none)]
9378 pub unsafe fn reportPushToTalkMessageWithUserInfo(&self, user_info: &NSDictionary);
9379
9380 #[unsafe(method(handleTimerEvent))]
9382 #[unsafe(method_family = none)]
9383 pub unsafe fn handleTimerEvent(&self);
9384 );
9385}
9386
9387impl NEAppPushProvider {
9389 extern_methods!(
9390 #[unsafe(method(init))]
9391 #[unsafe(method_family = init)]
9392 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
9393
9394 #[unsafe(method(new))]
9395 #[unsafe(method_family = new)]
9396 pub unsafe fn new() -> Retained<Self>;
9397 );
9398}
9399
9400extern_class!(
9401 #[unsafe(super(NSObject))]
9405 #[derive(Debug, PartialEq, Eq, Hash)]
9406 #[deprecated = "Use nw_endpoint_t in Network framework instead, see deprecation notice in <NetworkExtension/NWEndpoint.h>"]
9407 pub struct NWEndpoint;
9408);
9409
9410extern_conformance!(
9411 unsafe impl NSCoding for NWEndpoint {}
9412);
9413
9414extern_conformance!(
9415 unsafe impl NSCopying for NWEndpoint {}
9416);
9417
9418unsafe impl CopyingHelper for NWEndpoint {
9419 type Result = Self;
9420}
9421
9422extern_conformance!(
9423 unsafe impl NSObjectProtocol for NWEndpoint {}
9424);
9425
9426extern_conformance!(
9427 unsafe impl NSSecureCoding for NWEndpoint {}
9428);
9429
9430impl NWEndpoint {
9431 extern_methods!();
9432}
9433
9434impl NWEndpoint {
9436 extern_methods!(
9437 #[unsafe(method(init))]
9438 #[unsafe(method_family = init)]
9439 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
9440
9441 #[unsafe(method(new))]
9442 #[unsafe(method_family = new)]
9443 pub unsafe fn new() -> Retained<Self>;
9444 );
9445}
9446
9447extern_class!(
9448 #[unsafe(super(NWEndpoint, NSObject))]
9453 #[derive(Debug, PartialEq, Eq, Hash)]
9454 #[deprecated = "Use `nw_endpoint_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWHostEndpoint.h>"]
9455 pub struct NWHostEndpoint;
9456);
9457
9458extern_conformance!(
9459 unsafe impl NSCoding for NWHostEndpoint {}
9460);
9461
9462extern_conformance!(
9463 unsafe impl NSCopying for NWHostEndpoint {}
9464);
9465
9466unsafe impl CopyingHelper for NWHostEndpoint {
9467 type Result = Self;
9468}
9469
9470extern_conformance!(
9471 unsafe impl NSObjectProtocol for NWHostEndpoint {}
9472);
9473
9474extern_conformance!(
9475 unsafe impl NSSecureCoding for NWHostEndpoint {}
9476);
9477
9478impl NWHostEndpoint {
9479 extern_methods!(
9480 #[deprecated = "Use `nw_endpoint_create_host` in Network framework instead, see deprecation notice in <NetworkExtension/NWHostEndpoint.h>"]
9486 #[unsafe(method(endpointWithHostname:port:))]
9487 #[unsafe(method_family = none)]
9488 pub unsafe fn endpointWithHostname_port(
9489 hostname: &NSString,
9490 port: &NSString,
9491 ) -> Retained<Self>;
9492
9493 #[deprecated = "Use `nw_endpoint_get_hostname` in Network framework instead, see deprecation notice in <NetworkExtension/NWHostEndpoint.h>"]
9495 #[unsafe(method(hostname))]
9496 #[unsafe(method_family = none)]
9497 pub unsafe fn hostname(&self) -> Retained<NSString>;
9498
9499 #[deprecated = "Use `nw_endpoint_get_port` in Network framework instead, see deprecation notice in <NetworkExtension/NWHostEndpoint.h>"]
9501 #[unsafe(method(port))]
9502 #[unsafe(method_family = none)]
9503 pub unsafe fn port(&self) -> Retained<NSString>;
9504 );
9505}
9506
9507impl NWHostEndpoint {
9509 extern_methods!(
9510 #[unsafe(method(init))]
9511 #[unsafe(method_family = init)]
9512 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
9513
9514 #[unsafe(method(new))]
9515 #[unsafe(method_family = new)]
9516 pub unsafe fn new() -> Retained<Self>;
9517 );
9518}
9519
9520extern_class!(
9521 #[unsafe(super(NWEndpoint, NSObject))]
9528 #[derive(Debug, PartialEq, Eq, Hash)]
9529 #[deprecated = "Use `nw_endpoint_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWBonjourServiceEndpoint.h>"]
9530 pub struct NWBonjourServiceEndpoint;
9531);
9532
9533extern_conformance!(
9534 unsafe impl NSCoding for NWBonjourServiceEndpoint {}
9535);
9536
9537extern_conformance!(
9538 unsafe impl NSCopying for NWBonjourServiceEndpoint {}
9539);
9540
9541unsafe impl CopyingHelper for NWBonjourServiceEndpoint {
9542 type Result = Self;
9543}
9544
9545extern_conformance!(
9546 unsafe impl NSObjectProtocol for NWBonjourServiceEndpoint {}
9547);
9548
9549extern_conformance!(
9550 unsafe impl NSSecureCoding for NWBonjourServiceEndpoint {}
9551);
9552
9553impl NWBonjourServiceEndpoint {
9554 extern_methods!(
9555 #[deprecated = "Use `nw_endpoint_create_bonjour_service` in Network framework instead, see deprecation notice in <NetworkExtension/NWBonjourServiceEndpoint.h>"]
9563 #[unsafe(method(endpointWithName:type:domain:))]
9564 #[unsafe(method_family = none)]
9565 pub unsafe fn endpointWithName_type_domain(
9566 name: &NSString,
9567 r#type: &NSString,
9568 domain: &NSString,
9569 ) -> Retained<Self>;
9570
9571 #[deprecated = "Use `nw_endpoint_get_bonjour_service_name` in Network framework instead, see deprecation notice in <NetworkExtension/NWBonjourServiceEndpoint.h>"]
9573 #[unsafe(method(name))]
9574 #[unsafe(method_family = none)]
9575 pub unsafe fn name(&self) -> Retained<NSString>;
9576
9577 #[deprecated = "Use `nw_endpoint_get_bonjour_service_type` in Network framework instead, see deprecation notice in <NetworkExtension/NWBonjourServiceEndpoint.h>"]
9579 #[unsafe(method(type))]
9580 #[unsafe(method_family = none)]
9581 pub unsafe fn r#type(&self) -> Retained<NSString>;
9582
9583 #[deprecated = "Use `nw_endpoint_get_bonjour_service_domain` in Network framework instead, see deprecation notice in <NetworkExtension/NWBonjourServiceEndpoint.h>"]
9585 #[unsafe(method(domain))]
9586 #[unsafe(method_family = none)]
9587 pub unsafe fn domain(&self) -> Retained<NSString>;
9588 );
9589}
9590
9591impl NWBonjourServiceEndpoint {
9593 extern_methods!(
9594 #[unsafe(method(init))]
9595 #[unsafe(method_family = init)]
9596 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
9597
9598 #[unsafe(method(new))]
9599 #[unsafe(method_family = new)]
9600 pub unsafe fn new() -> Retained<Self>;
9601 );
9602}
9603
9604#[deprecated = "Use `nw_path_status_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9609#[repr(transparent)]
9610#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
9611pub struct NWPathStatus(pub NSInteger);
9612impl NWPathStatus {
9613 #[doc(alias = "NWPathStatusInvalid")]
9614 #[deprecated = "Use `nw_path_status_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9615 pub const Invalid: Self = Self(0);
9616 #[doc(alias = "NWPathStatusSatisfied")]
9617 #[deprecated = "Use `nw_path_status_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9618 pub const Satisfied: Self = Self(1);
9619 #[doc(alias = "NWPathStatusUnsatisfied")]
9620 #[deprecated = "Use `nw_path_status_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9621 pub const Unsatisfied: Self = Self(2);
9622 #[doc(alias = "NWPathStatusSatisfiable")]
9624 #[deprecated = "Use `nw_path_status_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9625 pub const Satisfiable: Self = Self(3);
9626}
9627
9628unsafe impl Encode for NWPathStatus {
9629 const ENCODING: Encoding = NSInteger::ENCODING;
9630}
9631
9632unsafe impl RefEncode for NWPathStatus {
9633 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
9634}
9635
9636extern_class!(
9637 #[unsafe(super(NSObject))]
9643 #[derive(Debug, PartialEq, Eq, Hash)]
9644 #[deprecated = "Use `nw_path_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9645 pub struct NWPath;
9646);
9647
9648extern_conformance!(
9649 unsafe impl NSObjectProtocol for NWPath {}
9650);
9651
9652impl NWPath {
9653 extern_methods!(
9654 #[deprecated = "Use `nw_path_get_status` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9656 #[unsafe(method(status))]
9657 #[unsafe(method_family = none)]
9658 pub unsafe fn status(&self) -> NWPathStatus;
9659
9660 #[deprecated = "Use `nw_path_is_expensive` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9662 #[unsafe(method(isExpensive))]
9663 #[unsafe(method_family = none)]
9664 pub unsafe fn isExpensive(&self) -> bool;
9665
9666 #[deprecated = "Use `nw_path_is_constrained` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9668 #[unsafe(method(isConstrained))]
9669 #[unsafe(method_family = none)]
9670 pub unsafe fn isConstrained(&self) -> bool;
9671
9672 #[deprecated = "Use `nw_path_is_equal` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9676 #[unsafe(method(isEqualToPath:))]
9677 #[unsafe(method_family = none)]
9678 pub unsafe fn isEqualToPath(&self, path: &NWPath) -> bool;
9679 );
9680}
9681
9682impl NWPath {
9684 extern_methods!(
9685 #[unsafe(method(init))]
9686 #[unsafe(method_family = init)]
9687 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
9688
9689 #[unsafe(method(new))]
9690 #[unsafe(method_family = new)]
9691 pub unsafe fn new() -> Retained<Self>;
9692 );
9693}
9694
9695#[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9700#[repr(transparent)]
9701#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
9702pub struct NWTCPConnectionState(pub NSInteger);
9703impl NWTCPConnectionState {
9704 #[doc(alias = "NWTCPConnectionStateInvalid")]
9705 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9706 pub const Invalid: Self = Self(0);
9707 #[doc(alias = "NWTCPConnectionStateConnecting")]
9708 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9709 pub const Connecting: Self = Self(1);
9710 #[doc(alias = "NWTCPConnectionStateWaiting")]
9712 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9713 pub const Waiting: Self = Self(2);
9714 #[doc(alias = "NWTCPConnectionStateConnected")]
9717 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9718 pub const Connected: Self = Self(3);
9719 #[doc(alias = "NWTCPConnectionStateDisconnected")]
9722 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9723 pub const Disconnected: Self = Self(4);
9724 #[doc(alias = "NWTCPConnectionStateCancelled")]
9726 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9727 pub const Cancelled: Self = Self(5);
9728}
9729
9730unsafe impl Encode for NWTCPConnectionState {
9731 const ENCODING: Encoding = NSInteger::ENCODING;
9732}
9733
9734unsafe impl RefEncode for NWTCPConnectionState {
9735 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
9736}
9737
9738extern_class!(
9739 #[unsafe(super(NSObject))]
9743 #[derive(Debug, PartialEq, Eq, Hash)]
9744 #[deprecated = "Use `nw_connection_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9745 pub struct NWTCPConnection;
9746);
9747
9748extern_conformance!(
9749 unsafe impl NSObjectProtocol for NWTCPConnection {}
9750);
9751
9752impl NWTCPConnection {
9753 extern_methods!(
9754 #[deprecated = "Use `nw_connection_create` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9775 #[unsafe(method(initWithUpgradeForConnection:))]
9776 #[unsafe(method_family = init)]
9777 pub unsafe fn initWithUpgradeForConnection(
9778 this: Allocated<Self>,
9779 connection: &NWTCPConnection,
9780 ) -> Retained<Self>;
9781
9782 #[deprecated = "Use `nw_connection_set_state_changed_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9784 #[unsafe(method(state))]
9785 #[unsafe(method_family = none)]
9786 pub unsafe fn state(&self) -> NWTCPConnectionState;
9787
9788 #[deprecated = "Use `nw_connection_set_viability_changed_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9790 #[unsafe(method(isViable))]
9791 #[unsafe(method_family = none)]
9792 pub unsafe fn isViable(&self) -> bool;
9793
9794 #[deprecated = "Use `nw_connection_set_better_path_available_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9799 #[unsafe(method(hasBetterPath))]
9800 #[unsafe(method_family = none)]
9801 pub unsafe fn hasBetterPath(&self) -> bool;
9802
9803 #[deprecated = "Use `nw_connection_copy_endpoint` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9805 #[unsafe(method(endpoint))]
9806 #[unsafe(method_family = none)]
9807 pub unsafe fn endpoint(&self) -> Retained<NWEndpoint>;
9808
9809 #[deprecated = "Use `nw_connection_copy_current_path` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9816 #[unsafe(method(connectedPath))]
9817 #[unsafe(method_family = none)]
9818 pub unsafe fn connectedPath(&self) -> Option<Retained<NWPath>>;
9819
9820 #[deprecated = "Use `nw_path_copy_effective_local_endpoint` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9822 #[unsafe(method(localAddress))]
9823 #[unsafe(method_family = none)]
9824 pub unsafe fn localAddress(&self) -> Option<Retained<NWEndpoint>>;
9825
9826 #[deprecated = "Use `nw_path_copy_effective_remote_endpoint` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9828 #[unsafe(method(remoteAddress))]
9829 #[unsafe(method_family = none)]
9830 pub unsafe fn remoteAddress(&self) -> Option<Retained<NWEndpoint>>;
9831
9832 #[deprecated = "Use `nw_endpoint_copy_txt_record` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9836 #[unsafe(method(txtRecord))]
9837 #[unsafe(method_family = none)]
9838 pub unsafe fn txtRecord(&self) -> Option<Retained<NSData>>;
9839
9840 #[deprecated = "Use `nw_connection_set_state_changed_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9843 #[unsafe(method(error))]
9844 #[unsafe(method_family = none)]
9845 pub unsafe fn error(&self) -> Option<Retained<NSError>>;
9846
9847 #[deprecated = "Use `nw_connection_cancel` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9850 #[unsafe(method(cancel))]
9851 #[unsafe(method_family = none)]
9852 pub unsafe fn cancel(&self);
9853
9854 #[cfg(feature = "block2")]
9855 #[deprecated = "Use `nw_connection_receive` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9862 #[unsafe(method(readLength:completionHandler:))]
9863 #[unsafe(method_family = none)]
9864 pub unsafe fn readLength_completionHandler(
9865 &self,
9866 length: NSUInteger,
9867 completion: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
9868 );
9869
9870 #[cfg(feature = "block2")]
9871 #[deprecated = "Use `nw_connection_receive` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9896 #[unsafe(method(readMinimumLength:maximumLength:completionHandler:))]
9897 #[unsafe(method_family = none)]
9898 pub unsafe fn readMinimumLength_maximumLength_completionHandler(
9899 &self,
9900 minimum: NSUInteger,
9901 maximum: NSUInteger,
9902 completion: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
9903 );
9904
9905 #[cfg(feature = "block2")]
9906 #[deprecated = "Use `nw_connection_send` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9914 #[unsafe(method(write:completionHandler:))]
9915 #[unsafe(method_family = none)]
9916 pub unsafe fn write_completionHandler(
9917 &self,
9918 data: &NSData,
9919 completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
9920 );
9921
9922 #[deprecated = "Use `nw_connection_send` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9927 #[unsafe(method(writeClose))]
9928 #[unsafe(method_family = none)]
9929 pub unsafe fn writeClose(&self);
9930 );
9931}
9932
9933impl NWTCPConnection {
9935 extern_methods!(
9936 #[unsafe(method(init))]
9937 #[unsafe(method_family = init)]
9938 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
9939
9940 #[unsafe(method(new))]
9941 #[unsafe(method_family = new)]
9942 pub unsafe fn new() -> Retained<Self>;
9943 );
9944}
9945
9946extern_protocol!(
9947 #[deprecated = "Use `sec_protocol_options_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9951 pub unsafe trait NWTCPConnectionAuthenticationDelegate: NSObjectProtocol {
9952 #[deprecated = "Use `sec_protocol_options_set_challenge_block` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9962 #[optional]
9963 #[unsafe(method(shouldProvideIdentityForConnection:))]
9964 #[unsafe(method_family = none)]
9965 unsafe fn shouldProvideIdentityForConnection(&self, connection: &NWTCPConnection) -> bool;
9966
9967 #[cfg(all(feature = "block2", feature = "objc2-security"))]
9968 #[deprecated = "Use `sec_protocol_options_set_challenge_block` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9982 #[optional]
9983 #[unsafe(method(provideIdentityForConnection:completionHandler:))]
9984 #[unsafe(method_family = none)]
9985 unsafe fn provideIdentityForConnection_completionHandler(
9986 &self,
9987 connection: &NWTCPConnection,
9988 completion: &block2::DynBlock<
9989 dyn Fn(NonNull<SecIdentity>, NonNull<NSArray<AnyObject>>),
9990 >,
9991 );
9992
9993 #[deprecated = "Use `sec_protocol_options_set_verify_block` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
10003 #[optional]
10004 #[unsafe(method(shouldEvaluateTrustForConnection:))]
10005 #[unsafe(method_family = none)]
10006 unsafe fn shouldEvaluateTrustForConnection(&self, connection: &NWTCPConnection) -> bool;
10007
10008 #[cfg(all(feature = "block2", feature = "objc2-security"))]
10009 #[deprecated = "Use `sec_protocol_options_set_verify_block` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
10023 #[optional]
10024 #[unsafe(method(evaluateTrustForConnection:peerCertificateChain:completionHandler:))]
10025 #[unsafe(method_family = none)]
10026 unsafe fn evaluateTrustForConnection_peerCertificateChain_completionHandler(
10027 &self,
10028 connection: &NWTCPConnection,
10029 peer_certificate_chain: &NSArray<AnyObject>,
10030 completion: &block2::DynBlock<dyn Fn(NonNull<SecTrust>)>,
10031 );
10032 }
10033);
10034
10035#[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10040#[repr(transparent)]
10041#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
10042pub struct NWUDPSessionState(pub NSInteger);
10043impl NWUDPSessionState {
10044 #[doc(alias = "NWUDPSessionStateInvalid")]
10045 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10046 pub const Invalid: Self = Self(0);
10047 #[doc(alias = "NWUDPSessionStateWaiting")]
10049 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10050 pub const Waiting: Self = Self(1);
10051 #[doc(alias = "NWUDPSessionStatePreparing")]
10052 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10053 pub const Preparing: Self = Self(2);
10054 #[doc(alias = "NWUDPSessionStateReady")]
10055 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10056 pub const Ready: Self = Self(3);
10057 #[doc(alias = "NWUDPSessionStateFailed")]
10060 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10061 pub const Failed: Self = Self(4);
10062 #[doc(alias = "NWUDPSessionStateCancelled")]
10063 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10064 pub const Cancelled: Self = Self(5);
10065}
10066
10067unsafe impl Encode for NWUDPSessionState {
10068 const ENCODING: Encoding = NSInteger::ENCODING;
10069}
10070
10071unsafe impl RefEncode for NWUDPSessionState {
10072 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
10073}
10074
10075extern_class!(
10076 #[unsafe(super(NSObject))]
10080 #[derive(Debug, PartialEq, Eq, Hash)]
10081 #[deprecated = "Use `nw_connection_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10082 pub struct NWUDPSession;
10083);
10084
10085extern_conformance!(
10086 unsafe impl NSObjectProtocol for NWUDPSession {}
10087);
10088
10089impl NWUDPSession {
10090 extern_methods!(
10091 #[deprecated = "Use `nw_connection_create` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10107 #[unsafe(method(initWithUpgradeForSession:))]
10108 #[unsafe(method_family = init)]
10109 pub unsafe fn initWithUpgradeForSession(
10110 this: Allocated<Self>,
10111 session: &NWUDPSession,
10112 ) -> Retained<Self>;
10113
10114 #[deprecated = "Use `nw_connection_set_state_changed_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10119 #[unsafe(method(state))]
10120 #[unsafe(method_family = none)]
10121 pub unsafe fn state(&self) -> NWUDPSessionState;
10122
10123 #[deprecated = "Use `nw_connection_copy_endpoint` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10125 #[unsafe(method(endpoint))]
10126 #[unsafe(method_family = none)]
10127 pub unsafe fn endpoint(&self) -> Retained<NWEndpoint>;
10128
10129 #[deprecated = "Use `nw_connection_copy_current_path` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10131 #[unsafe(method(resolvedEndpoint))]
10132 #[unsafe(method_family = none)]
10133 pub unsafe fn resolvedEndpoint(&self) -> Option<Retained<NWEndpoint>>;
10134
10135 #[deprecated = "Use `nw_connection_set_viability_changed_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10138 #[unsafe(method(isViable))]
10139 #[unsafe(method_family = none)]
10140 pub unsafe fn isViable(&self) -> bool;
10141
10142 #[deprecated = "Use `nw_connection_set_better_path_available_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10145 #[unsafe(method(hasBetterPath))]
10146 #[unsafe(method_family = none)]
10147 pub unsafe fn hasBetterPath(&self) -> bool;
10148
10149 #[deprecated = "Use `nw_connection_copy_current_path` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10151 #[unsafe(method(currentPath))]
10152 #[unsafe(method_family = none)]
10153 pub unsafe fn currentPath(&self) -> Option<Retained<NWPath>>;
10154
10155 #[deprecated = "Use `nw_connection_cancel_current_endpoint` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10160 #[unsafe(method(tryNextResolvedEndpoint))]
10161 #[unsafe(method_family = none)]
10162 pub unsafe fn tryNextResolvedEndpoint(&self);
10163
10164 #[deprecated = "Use `nw_connection_get_maximum_datagram_size` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10169 #[unsafe(method(maximumDatagramLength))]
10170 #[unsafe(method_family = none)]
10171 pub unsafe fn maximumDatagramLength(&self) -> NSUInteger;
10172
10173 #[cfg(feature = "block2")]
10174 #[deprecated = "Use `nw_connection_receive` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10181 #[unsafe(method(setReadHandler:maxDatagrams:))]
10182 #[unsafe(method_family = none)]
10183 pub unsafe fn setReadHandler_maxDatagrams(
10184 &self,
10185 handler: &block2::DynBlock<dyn Fn(*mut NSArray<NSData>, *mut NSError)>,
10186 max_datagrams: NSUInteger,
10187 );
10188
10189 #[cfg(feature = "block2")]
10190 #[deprecated = "Use `nw_connection_send` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10197 #[unsafe(method(writeMultipleDatagrams:completionHandler:))]
10198 #[unsafe(method_family = none)]
10199 pub unsafe fn writeMultipleDatagrams_completionHandler(
10200 &self,
10201 datagram_array: &NSArray<NSData>,
10202 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
10203 );
10204
10205 #[cfg(feature = "block2")]
10206 #[deprecated = "Use `nw_connection_send` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10213 #[unsafe(method(writeDatagram:completionHandler:))]
10214 #[unsafe(method_family = none)]
10215 pub unsafe fn writeDatagram_completionHandler(
10216 &self,
10217 datagram: &NSData,
10218 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
10219 );
10220
10221 #[deprecated = "Use `nw_connection_cancel` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
10224 #[unsafe(method(cancel))]
10225 #[unsafe(method_family = none)]
10226 pub unsafe fn cancel(&self);
10227 );
10228}
10229
10230impl NWUDPSession {
10232 extern_methods!(
10233 #[unsafe(method(init))]
10234 #[unsafe(method_family = init)]
10235 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
10236
10237 #[unsafe(method(new))]
10238 #[unsafe(method_family = new)]
10239 pub unsafe fn new() -> Retained<Self>;
10240 );
10241}
10242
10243extern_class!(
10244 #[unsafe(super(NSObject))]
10251 #[derive(Debug, PartialEq, Eq, Hash)]
10252 #[deprecated = "Use `sec_protocol_options_t` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
10253 pub struct NWTLSParameters;
10254);
10255
10256extern_conformance!(
10257 unsafe impl NSObjectProtocol for NWTLSParameters {}
10258);
10259
10260impl NWTLSParameters {
10261 extern_methods!(
10262 #[deprecated = "Use `sec_protocol_options_set_tls_resumption_enabled` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
10265 #[unsafe(method(TLSSessionID))]
10266 #[unsafe(method_family = none)]
10267 pub unsafe fn TLSSessionID(&self) -> Option<Retained<NSData>>;
10268
10269 #[deprecated = "Use `sec_protocol_options_set_tls_resumption_enabled` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
10271 #[unsafe(method(setTLSSessionID:))]
10272 #[unsafe(method_family = none)]
10273 pub unsafe fn setTLSSessionID(&self, tls_session_id: Option<&NSData>);
10274
10275 #[deprecated = "Use `sec_protocol_options_append_tls_ciphersuite` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
10280 #[unsafe(method(SSLCipherSuites))]
10281 #[unsafe(method_family = none)]
10282 pub unsafe fn SSLCipherSuites(&self) -> Option<Retained<NSSet<NSNumber>>>;
10283
10284 #[deprecated = "Use `sec_protocol_options_append_tls_ciphersuite` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
10286 #[unsafe(method(setSSLCipherSuites:))]
10287 #[unsafe(method_family = none)]
10288 pub unsafe fn setSSLCipherSuites(&self, ssl_cipher_suites: Option<&NSSet<NSNumber>>);
10289
10290 #[deprecated = "Use `sec_protocol_options_set_min_tls_protocol_version` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
10295 #[unsafe(method(minimumSSLProtocolVersion))]
10296 #[unsafe(method_family = none)]
10297 pub unsafe fn minimumSSLProtocolVersion(&self) -> NSUInteger;
10298
10299 #[deprecated = "Use `sec_protocol_options_set_min_tls_protocol_version` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
10301 #[unsafe(method(setMinimumSSLProtocolVersion:))]
10302 #[unsafe(method_family = none)]
10303 pub unsafe fn setMinimumSSLProtocolVersion(&self, minimum_ssl_protocol_version: NSUInteger);
10304
10305 #[deprecated = "Use `sec_protocol_options_set_max_tls_protocol_version` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
10312 #[unsafe(method(maximumSSLProtocolVersion))]
10313 #[unsafe(method_family = none)]
10314 pub unsafe fn maximumSSLProtocolVersion(&self) -> NSUInteger;
10315
10316 #[deprecated = "Use `sec_protocol_options_set_max_tls_protocol_version` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
10318 #[unsafe(method(setMaximumSSLProtocolVersion:))]
10319 #[unsafe(method_family = none)]
10320 pub unsafe fn setMaximumSSLProtocolVersion(&self, maximum_ssl_protocol_version: NSUInteger);
10321 );
10322}
10323
10324impl NWTLSParameters {
10326 extern_methods!(
10327 #[unsafe(method(init))]
10328 #[unsafe(method_family = init)]
10329 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
10330
10331 #[unsafe(method(new))]
10332 #[unsafe(method_family = new)]
10333 pub unsafe fn new() -> Retained<Self>;
10334 );
10335}