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;
26use objc2::__framework_prelude::*;
27use objc2_foundation::*;
28#[cfg(feature = "objc2-security")]
29use objc2_security::*;
30
31use crate::*;
32
33#[repr(transparent)]
38#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
39pub struct NEAppProxyFlowError(pub NSInteger);
40impl NEAppProxyFlowError {
41 #[doc(alias = "NEAppProxyFlowErrorNotConnected")]
42 pub const NotConnected: Self = Self(1);
43 #[doc(alias = "NEAppProxyFlowErrorPeerReset")]
44 pub const PeerReset: Self = Self(2);
45 #[doc(alias = "NEAppProxyFlowErrorHostUnreachable")]
46 pub const HostUnreachable: Self = Self(3);
47 #[doc(alias = "NEAppProxyFlowErrorInvalidArgument")]
48 pub const InvalidArgument: Self = Self(4);
49 #[doc(alias = "NEAppProxyFlowErrorAborted")]
50 pub const Aborted: Self = Self(5);
51 #[doc(alias = "NEAppProxyFlowErrorRefused")]
52 pub const Refused: Self = Self(6);
53 #[doc(alias = "NEAppProxyFlowErrorTimedOut")]
54 pub const TimedOut: Self = Self(7);
55 #[doc(alias = "NEAppProxyFlowErrorInternal")]
56 pub const Internal: Self = Self(8);
57 #[doc(alias = "NEAppProxyFlowErrorDatagramTooLarge")]
58 pub const DatagramTooLarge: Self = Self(9);
59 #[doc(alias = "NEAppProxyFlowErrorReadAlreadyPending")]
60 pub const ReadAlreadyPending: Self = Self(10);
61}
62
63unsafe impl Encode for NEAppProxyFlowError {
64 const ENCODING: Encoding = NSInteger::ENCODING;
65}
66
67unsafe impl RefEncode for NEAppProxyFlowError {
68 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
69}
70
71extern "C" {
72 pub static NEAppProxyErrorDomain: &'static NSString;
74}
75
76extern_class!(
77 #[unsafe(super(NSObject))]
85 #[derive(Debug, PartialEq, Eq, Hash)]
86 pub struct NEAppProxyFlow;
87);
88
89unsafe impl NSObjectProtocol for NEAppProxyFlow {}
90
91impl NEAppProxyFlow {
92 extern_methods!(
93 #[cfg(feature = "block2")]
94 #[deprecated]
100 #[unsafe(method(openWithLocalEndpoint:completionHandler:))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn openWithLocalEndpoint_completionHandler(
103 &self,
104 local_endpoint: Option<&NWHostEndpoint>,
105 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
106 );
107
108 #[unsafe(method(closeReadWithError:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn closeReadWithError(&self, error: Option<&NSError>);
114
115 #[unsafe(method(closeWriteWithError:))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn closeWriteWithError(&self, error: Option<&NSError>);
121
122 #[unsafe(method(metaData))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn metaData(&self) -> Retained<NEFlowMetaData>;
126
127 #[unsafe(method(remoteHostname))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn remoteHostname(&self) -> Option<Retained<NSString>>;
132
133 #[unsafe(method(isBound))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn isBound(&self) -> bool;
137 );
138}
139
140impl NEAppProxyFlow {
142 extern_methods!(
143 #[unsafe(method(init))]
144 #[unsafe(method_family = init)]
145 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
146
147 #[unsafe(method(new))]
148 #[unsafe(method_family = new)]
149 pub unsafe fn new() -> Retained<Self>;
150 );
151}
152
153#[repr(transparent)]
158#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
159pub struct NEProviderStopReason(pub NSInteger);
160impl NEProviderStopReason {
161 #[doc(alias = "NEProviderStopReasonNone")]
162 pub const None: Self = Self(0);
163 #[doc(alias = "NEProviderStopReasonUserInitiated")]
164 pub const UserInitiated: Self = Self(1);
165 #[doc(alias = "NEProviderStopReasonProviderFailed")]
166 pub const ProviderFailed: Self = Self(2);
167 #[doc(alias = "NEProviderStopReasonNoNetworkAvailable")]
168 pub const NoNetworkAvailable: Self = Self(3);
169 #[doc(alias = "NEProviderStopReasonUnrecoverableNetworkChange")]
170 pub const UnrecoverableNetworkChange: Self = Self(4);
171 #[doc(alias = "NEProviderStopReasonProviderDisabled")]
172 pub const ProviderDisabled: Self = Self(5);
173 #[doc(alias = "NEProviderStopReasonAuthenticationCanceled")]
174 pub const AuthenticationCanceled: Self = Self(6);
175 #[doc(alias = "NEProviderStopReasonConfigurationFailed")]
176 pub const ConfigurationFailed: Self = Self(7);
177 #[doc(alias = "NEProviderStopReasonIdleTimeout")]
178 pub const IdleTimeout: Self = Self(8);
179 #[doc(alias = "NEProviderStopReasonConfigurationDisabled")]
180 pub const ConfigurationDisabled: Self = Self(9);
181 #[doc(alias = "NEProviderStopReasonConfigurationRemoved")]
182 pub const ConfigurationRemoved: Self = Self(10);
183 #[doc(alias = "NEProviderStopReasonSuperceded")]
184 pub const Superceded: Self = Self(11);
185 #[doc(alias = "NEProviderStopReasonUserLogout")]
186 pub const UserLogout: Self = Self(12);
187 #[doc(alias = "NEProviderStopReasonUserSwitch")]
188 pub const UserSwitch: Self = Self(13);
189 #[doc(alias = "NEProviderStopReasonConnectionFailed")]
190 pub const ConnectionFailed: Self = Self(14);
191 #[doc(alias = "NEProviderStopReasonSleep")]
192 pub const Sleep: Self = Self(15);
193 #[doc(alias = "NEProviderStopReasonAppUpdate")]
194 pub const AppUpdate: Self = Self(16);
195 #[doc(alias = "NEProviderStopReasonInternalError")]
196 pub const InternalError: Self = Self(17);
197}
198
199unsafe impl Encode for NEProviderStopReason {
200 const ENCODING: Encoding = NSInteger::ENCODING;
201}
202
203unsafe impl RefEncode for NEProviderStopReason {
204 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
205}
206
207extern_class!(
208 #[unsafe(super(NSObject))]
216 #[derive(Debug, PartialEq, Eq, Hash)]
217 pub struct NEProvider;
218);
219
220unsafe impl NSObjectProtocol for NEProvider {}
221
222impl NEProvider {
223 extern_methods!(
224 #[cfg(feature = "block2")]
225 #[unsafe(method(sleepWithCompletionHandler:))]
229 #[unsafe(method_family = none)]
230 pub unsafe fn sleepWithCompletionHandler(
231 &self,
232 completion_handler: &block2::Block<dyn Fn()>,
233 );
234
235 #[unsafe(method(wake))]
237 #[unsafe(method_family = none)]
238 pub unsafe fn wake(&self);
239
240 #[deprecated = "Use nw_connection_t in Network framework instead"]
252 #[unsafe(method(createTCPConnectionToEndpoint:enableTLS:TLSParameters:delegate:))]
253 #[unsafe(method_family = none)]
254 pub unsafe fn createTCPConnectionToEndpoint_enableTLS_TLSParameters_delegate(
255 &self,
256 remote_endpoint: &NWEndpoint,
257 enable_tls: bool,
258 tls_parameters: Option<&NWTLSParameters>,
259 delegate: Option<&AnyObject>,
260 ) -> Retained<NWTCPConnection>;
261
262 #[deprecated = "Use nw_connection_t in Network framework instead"]
270 #[unsafe(method(createUDPSessionToEndpoint:fromEndpoint:))]
271 #[unsafe(method_family = none)]
272 pub unsafe fn createUDPSessionToEndpoint_fromEndpoint(
273 &self,
274 remote_endpoint: &NWEndpoint,
275 local_endpoint: Option<&NWHostEndpoint>,
276 ) -> Retained<NWUDPSession>;
277
278 #[cfg(feature = "block2")]
279 #[deprecated]
285 #[unsafe(method(displayMessage:completionHandler:))]
286 #[unsafe(method_family = none)]
287 pub unsafe fn displayMessage_completionHandler(
288 &self,
289 message: &NSString,
290 completion_handler: &block2::Block<dyn Fn(Bool)>,
291 );
292
293 #[unsafe(method(startSystemExtensionMode))]
339 #[unsafe(method_family = none)]
340 pub unsafe fn startSystemExtensionMode();
341
342 #[deprecated = "Use nw_path_monitor_t in Network framework instead"]
344 #[unsafe(method(defaultPath))]
345 #[unsafe(method_family = none)]
346 pub unsafe fn defaultPath(&self) -> Option<Retained<NWPath>>;
347 );
348}
349
350impl NEProvider {
352 extern_methods!(
353 #[unsafe(method(init))]
354 #[unsafe(method_family = init)]
355 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
356
357 #[unsafe(method(new))]
358 #[unsafe(method_family = new)]
359 pub unsafe fn new() -> Retained<Self>;
360 );
361}
362
363#[repr(transparent)]
368#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
369pub struct NETunnelProviderError(pub NSInteger);
370impl NETunnelProviderError {
371 #[doc(alias = "NETunnelProviderErrorNetworkSettingsInvalid")]
372 pub const NetworkSettingsInvalid: Self = Self(1);
373 #[doc(alias = "NETunnelProviderErrorNetworkSettingsCanceled")]
374 pub const NetworkSettingsCanceled: Self = Self(2);
375 #[doc(alias = "NETunnelProviderErrorNetworkSettingsFailed")]
376 pub const NetworkSettingsFailed: Self = Self(3);
377}
378
379unsafe impl Encode for NETunnelProviderError {
380 const ENCODING: Encoding = NSInteger::ENCODING;
381}
382
383unsafe impl RefEncode for NETunnelProviderError {
384 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
385}
386
387#[repr(transparent)]
392#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
393pub struct NETunnelProviderRoutingMethod(pub NSInteger);
394impl NETunnelProviderRoutingMethod {
395 #[doc(alias = "NETunnelProviderRoutingMethodDestinationIP")]
396 pub const DestinationIP: Self = Self(1);
397 #[doc(alias = "NETunnelProviderRoutingMethodSourceApplication")]
398 pub const SourceApplication: Self = Self(2);
399 #[doc(alias = "NETunnelProviderRoutingMethodNetworkRule")]
400 pub const NetworkRule: Self = Self(3);
401}
402
403unsafe impl Encode for NETunnelProviderRoutingMethod {
404 const ENCODING: Encoding = NSInteger::ENCODING;
405}
406
407unsafe impl RefEncode for NETunnelProviderRoutingMethod {
408 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
409}
410
411extern "C" {
412 pub static NETunnelProviderErrorDomain: &'static NSString;
414}
415
416extern_class!(
417 #[unsafe(super(NEProvider, NSObject))]
423 #[derive(Debug, PartialEq, Eq, Hash)]
424 pub struct NETunnelProvider;
425);
426
427unsafe impl NSObjectProtocol for NETunnelProvider {}
428
429impl NETunnelProvider {
430 extern_methods!(
431 #[cfg(feature = "block2")]
432 #[unsafe(method(handleAppMessage:completionHandler:))]
438 #[unsafe(method_family = none)]
439 pub unsafe fn handleAppMessage_completionHandler(
440 &self,
441 message_data: &NSData,
442 completion_handler: Option<&block2::Block<dyn Fn(*mut NSData)>>,
443 );
444
445 #[cfg(feature = "block2")]
446 #[unsafe(method(setTunnelNetworkSettings:completionHandler:))]
452 #[unsafe(method_family = none)]
453 pub unsafe fn setTunnelNetworkSettings_completionHandler(
454 &self,
455 tunnel_network_settings: Option<&NETunnelNetworkSettings>,
456 completion_handler: Option<&block2::Block<dyn Fn(*mut NSError)>>,
457 );
458
459 #[unsafe(method(protocolConfiguration))]
461 #[unsafe(method_family = none)]
462 pub unsafe fn protocolConfiguration(&self) -> Retained<NEVPNProtocol>;
463
464 #[unsafe(method(appRules))]
466 #[unsafe(method_family = none)]
467 pub unsafe fn appRules(&self) -> Option<Retained<NSArray<NEAppRule>>>;
468
469 #[unsafe(method(routingMethod))]
471 #[unsafe(method_family = none)]
472 pub unsafe fn routingMethod(&self) -> NETunnelProviderRoutingMethod;
473
474 #[unsafe(method(reasserting))]
476 #[unsafe(method_family = none)]
477 pub unsafe fn reasserting(&self) -> bool;
478
479 #[unsafe(method(setReasserting:))]
481 #[unsafe(method_family = none)]
482 pub unsafe fn setReasserting(&self, reasserting: bool);
483 );
484}
485
486impl NETunnelProvider {
488 extern_methods!(
489 #[unsafe(method(init))]
490 #[unsafe(method_family = init)]
491 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
492
493 #[unsafe(method(new))]
494 #[unsafe(method_family = new)]
495 pub unsafe fn new() -> Retained<Self>;
496 );
497}
498
499extern_class!(
500 #[unsafe(super(NETunnelProvider, NEProvider, NSObject))]
506 #[derive(Debug, PartialEq, Eq, Hash)]
507 pub struct NEAppProxyProvider;
508);
509
510unsafe impl NSObjectProtocol for NEAppProxyProvider {}
511
512impl NEAppProxyProvider {
513 extern_methods!(
514 #[cfg(feature = "block2")]
515 #[unsafe(method(startProxyWithOptions:completionHandler:))]
521 #[unsafe(method_family = none)]
522 pub unsafe fn startProxyWithOptions_completionHandler(
523 &self,
524 options: Option<&NSDictionary<NSString, AnyObject>>,
525 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
526 );
527
528 #[cfg(feature = "block2")]
529 #[unsafe(method(stopProxyWithReason:completionHandler:))]
535 #[unsafe(method_family = none)]
536 pub unsafe fn stopProxyWithReason_completionHandler(
537 &self,
538 reason: NEProviderStopReason,
539 completion_handler: &block2::Block<dyn Fn()>,
540 );
541
542 #[unsafe(method(cancelProxyWithError:))]
546 #[unsafe(method_family = none)]
547 pub unsafe fn cancelProxyWithError(&self, error: Option<&NSError>);
548
549 #[unsafe(method(handleNewFlow:))]
555 #[unsafe(method_family = none)]
556 pub unsafe fn handleNewFlow(&self, flow: &NEAppProxyFlow) -> bool;
557
558 #[deprecated]
570 #[unsafe(method(handleNewUDPFlow:initialRemoteEndpoint:))]
571 #[unsafe(method_family = none)]
572 pub unsafe fn handleNewUDPFlow_initialRemoteEndpoint(
573 &self,
574 flow: &NEAppProxyUDPFlow,
575 remote_endpoint: &NWEndpoint,
576 ) -> bool;
577 );
578}
579
580impl NEAppProxyProvider {
582 extern_methods!(
583 #[unsafe(method(init))]
584 #[unsafe(method_family = init)]
585 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
586
587 #[unsafe(method(new))]
588 #[unsafe(method_family = new)]
589 pub unsafe fn new() -> Retained<Self>;
590 );
591}
592
593#[repr(transparent)]
598#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
599pub struct NEVPNError(pub NSInteger);
600impl NEVPNError {
601 #[doc(alias = "NEVPNErrorConfigurationInvalid")]
602 pub const ConfigurationInvalid: Self = Self(1);
603 #[doc(alias = "NEVPNErrorConfigurationDisabled")]
604 pub const ConfigurationDisabled: Self = Self(2);
605 #[doc(alias = "NEVPNErrorConnectionFailed")]
606 pub const ConnectionFailed: Self = Self(3);
607 #[doc(alias = "NEVPNErrorConfigurationStale")]
608 pub const ConfigurationStale: Self = Self(4);
609 #[doc(alias = "NEVPNErrorConfigurationReadWriteFailed")]
610 pub const ConfigurationReadWriteFailed: Self = Self(5);
611 #[doc(alias = "NEVPNErrorConfigurationUnknown")]
612 pub const ConfigurationUnknown: Self = Self(6);
613}
614
615unsafe impl Encode for NEVPNError {
616 const ENCODING: Encoding = NSInteger::ENCODING;
617}
618
619unsafe impl RefEncode for NEVPNError {
620 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
621}
622
623extern "C" {
624 pub static NEVPNErrorDomain: &'static NSString;
626}
627
628extern "C" {
629 pub static NEVPNConfigurationChangeNotification: &'static NSString;
631}
632
633extern_class!(
634 #[unsafe(super(NSObject))]
642 #[derive(Debug, PartialEq, Eq, Hash)]
643 pub struct NEVPNManager;
644);
645
646unsafe impl NSObjectProtocol for NEVPNManager {}
647
648impl NEVPNManager {
649 extern_methods!(
650 #[unsafe(method(sharedManager))]
652 #[unsafe(method_family = none)]
653 pub unsafe fn sharedManager() -> Retained<NEVPNManager>;
654
655 #[cfg(feature = "block2")]
656 #[unsafe(method(loadFromPreferencesWithCompletionHandler:))]
660 #[unsafe(method_family = none)]
661 pub unsafe fn loadFromPreferencesWithCompletionHandler(
662 &self,
663 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
664 );
665
666 #[cfg(feature = "block2")]
667 #[unsafe(method(removeFromPreferencesWithCompletionHandler:))]
671 #[unsafe(method_family = none)]
672 pub unsafe fn removeFromPreferencesWithCompletionHandler(
673 &self,
674 completion_handler: Option<&block2::Block<dyn Fn(*mut NSError)>>,
675 );
676
677 #[cfg(feature = "block2")]
678 #[unsafe(method(saveToPreferencesWithCompletionHandler:))]
683 #[unsafe(method_family = none)]
684 pub unsafe fn saveToPreferencesWithCompletionHandler(
685 &self,
686 completion_handler: Option<&block2::Block<dyn Fn(*mut NSError)>>,
687 );
688
689 #[cfg(feature = "objc2-security")]
690 #[unsafe(method(setAuthorization:))]
694 #[unsafe(method_family = none)]
695 pub unsafe fn setAuthorization(&self, authorization: AuthorizationRef);
696
697 #[unsafe(method(onDemandRules))]
699 #[unsafe(method_family = none)]
700 pub unsafe fn onDemandRules(&self) -> Option<Retained<NSArray<NEOnDemandRule>>>;
701
702 #[unsafe(method(setOnDemandRules:))]
704 #[unsafe(method_family = none)]
705 pub unsafe fn setOnDemandRules(&self, on_demand_rules: Option<&NSArray<NEOnDemandRule>>);
706
707 #[unsafe(method(isOnDemandEnabled))]
709 #[unsafe(method_family = none)]
710 pub unsafe fn isOnDemandEnabled(&self) -> bool;
711
712 #[unsafe(method(setOnDemandEnabled:))]
714 #[unsafe(method_family = none)]
715 pub unsafe fn setOnDemandEnabled(&self, on_demand_enabled: bool);
716
717 #[unsafe(method(localizedDescription))]
719 #[unsafe(method_family = none)]
720 pub unsafe fn localizedDescription(&self) -> Option<Retained<NSString>>;
721
722 #[unsafe(method(setLocalizedDescription:))]
724 #[unsafe(method_family = none)]
725 pub unsafe fn setLocalizedDescription(&self, localized_description: Option<&NSString>);
726
727 #[deprecated]
729 #[unsafe(method(protocol))]
730 #[unsafe(method_family = none)]
731 pub unsafe fn protocol(&self) -> Option<Retained<NEVPNProtocol>>;
732
733 #[deprecated]
735 #[unsafe(method(setProtocol:))]
736 #[unsafe(method_family = none)]
737 pub unsafe fn setProtocol(&self, protocol: Option<&NEVPNProtocol>);
738
739 #[unsafe(method(protocolConfiguration))]
741 #[unsafe(method_family = none)]
742 pub unsafe fn protocolConfiguration(&self) -> Option<Retained<NEVPNProtocol>>;
743
744 #[unsafe(method(setProtocolConfiguration:))]
746 #[unsafe(method_family = none)]
747 pub unsafe fn setProtocolConfiguration(
748 &self,
749 protocol_configuration: Option<&NEVPNProtocol>,
750 );
751
752 #[unsafe(method(connection))]
754 #[unsafe(method_family = none)]
755 pub unsafe fn connection(&self) -> Retained<NEVPNConnection>;
756
757 #[unsafe(method(isEnabled))]
759 #[unsafe(method_family = none)]
760 pub unsafe fn isEnabled(&self) -> bool;
761
762 #[unsafe(method(setEnabled:))]
764 #[unsafe(method_family = none)]
765 pub unsafe fn setEnabled(&self, enabled: bool);
766 );
767}
768
769impl NEVPNManager {
771 extern_methods!(
772 #[unsafe(method(init))]
773 #[unsafe(method_family = init)]
774 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
775
776 #[unsafe(method(new))]
777 #[unsafe(method_family = new)]
778 pub unsafe fn new() -> Retained<Self>;
779 );
780}
781
782extern_class!(
783 #[unsafe(super(NEVPNManager, NSObject))]
789 #[derive(Debug, PartialEq, Eq, Hash)]
790 pub struct NETunnelProviderManager;
791);
792
793unsafe impl NSObjectProtocol for NETunnelProviderManager {}
794
795impl NETunnelProviderManager {
796 extern_methods!(
797 #[cfg(feature = "block2")]
798 #[unsafe(method(loadAllFromPreferencesWithCompletionHandler:))]
802 #[unsafe(method_family = none)]
803 pub unsafe fn loadAllFromPreferencesWithCompletionHandler(
804 completion_handler: &block2::Block<
805 dyn Fn(*mut NSArray<NETunnelProviderManager>, *mut NSError),
806 >,
807 );
808
809 #[unsafe(method(forPerAppVPN))]
811 #[unsafe(method_family = none)]
812 pub unsafe fn forPerAppVPN() -> Retained<Self>;
813
814 #[unsafe(method(copyAppRules))]
816 #[unsafe(method_family = copy)]
817 pub unsafe fn copyAppRules(&self) -> Option<Retained<NSArray<NEAppRule>>>;
818
819 #[unsafe(method(routingMethod))]
821 #[unsafe(method_family = none)]
822 pub unsafe fn routingMethod(&self) -> NETunnelProviderRoutingMethod;
823
824 #[unsafe(method(safariDomains))]
827 #[unsafe(method_family = none)]
828 pub unsafe fn safariDomains(&self) -> Retained<NSArray<NSString>>;
829
830 #[unsafe(method(setSafariDomains:))]
832 #[unsafe(method_family = none)]
833 pub unsafe fn setSafariDomains(&self, safari_domains: &NSArray<NSString>);
834
835 #[unsafe(method(mailDomains))]
838 #[unsafe(method_family = none)]
839 pub unsafe fn mailDomains(&self) -> Retained<NSArray<NSString>>;
840
841 #[unsafe(method(setMailDomains:))]
843 #[unsafe(method_family = none)]
844 pub unsafe fn setMailDomains(&self, mail_domains: &NSArray<NSString>);
845
846 #[unsafe(method(calendarDomains))]
849 #[unsafe(method_family = none)]
850 pub unsafe fn calendarDomains(&self) -> Retained<NSArray<NSString>>;
851
852 #[unsafe(method(setCalendarDomains:))]
854 #[unsafe(method_family = none)]
855 pub unsafe fn setCalendarDomains(&self, calendar_domains: &NSArray<NSString>);
856
857 #[unsafe(method(contactsDomains))]
860 #[unsafe(method_family = none)]
861 pub unsafe fn contactsDomains(&self) -> Retained<NSArray<NSString>>;
862
863 #[unsafe(method(setContactsDomains:))]
865 #[unsafe(method_family = none)]
866 pub unsafe fn setContactsDomains(&self, contacts_domains: &NSArray<NSString>);
867
868 #[unsafe(method(appRules))]
869 #[unsafe(method_family = none)]
870 pub unsafe fn appRules(&self) -> Retained<NSArray<NEAppRule>>;
871
872 #[unsafe(method(setAppRules:))]
874 #[unsafe(method_family = none)]
875 pub unsafe fn setAppRules(&self, app_rules: &NSArray<NEAppRule>);
876
877 #[unsafe(method(excludedDomains))]
879 #[unsafe(method_family = none)]
880 pub unsafe fn excludedDomains(&self) -> Retained<NSArray<NSString>>;
881
882 #[unsafe(method(setExcludedDomains:))]
884 #[unsafe(method_family = none)]
885 pub unsafe fn setExcludedDomains(&self, excluded_domains: &NSArray<NSString>);
886
887 #[unsafe(method(associatedDomains))]
888 #[unsafe(method_family = none)]
889 pub unsafe fn associatedDomains(&self) -> Retained<NSArray<NSString>>;
890
891 #[unsafe(method(setAssociatedDomains:))]
893 #[unsafe(method_family = none)]
894 pub unsafe fn setAssociatedDomains(&self, associated_domains: &NSArray<NSString>);
895 );
896}
897
898impl NETunnelProviderManager {
900 extern_methods!(
901 #[unsafe(method(init))]
902 #[unsafe(method_family = init)]
903 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
904
905 #[unsafe(method(new))]
906 #[unsafe(method_family = new)]
907 pub unsafe fn new() -> Retained<Self>;
908 );
909}
910
911extern_class!(
912 #[unsafe(super(NETunnelProviderManager, NEVPNManager, NSObject))]
918 #[derive(Debug, PartialEq, Eq, Hash)]
919 pub struct NEAppProxyProviderManager;
920);
921
922unsafe impl NSObjectProtocol for NEAppProxyProviderManager {}
923
924impl NEAppProxyProviderManager {
925 extern_methods!(
926 #[cfg(feature = "block2")]
927 #[unsafe(method(loadAllFromPreferencesWithCompletionHandler:))]
931 #[unsafe(method_family = none)]
932 pub unsafe fn loadAllFromPreferencesWithCompletionHandler(
933 completion_handler: &block2::Block<
934 dyn Fn(*mut NSArray<NEAppProxyProviderManager>, *mut NSError),
935 >,
936 );
937 );
938}
939
940impl NEAppProxyProviderManager {
942 extern_methods!(
943 #[unsafe(method(forPerAppVPN))]
945 #[unsafe(method_family = none)]
946 pub unsafe fn forPerAppVPN() -> Retained<Self>;
947 );
948}
949
950impl NEAppProxyProviderManager {
952 extern_methods!(
953 #[unsafe(method(init))]
954 #[unsafe(method_family = init)]
955 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
956
957 #[unsafe(method(new))]
958 #[unsafe(method_family = new)]
959 pub unsafe fn new() -> Retained<Self>;
960 );
961}
962
963extern_class!(
964 #[unsafe(super(NEAppProxyFlow, NSObject))]
972 #[derive(Debug, PartialEq, Eq, Hash)]
973 pub struct NEAppProxyTCPFlow;
974);
975
976unsafe impl NSObjectProtocol for NEAppProxyTCPFlow {}
977
978impl NEAppProxyTCPFlow {
979 extern_methods!(
980 #[cfg(feature = "block2")]
981 #[unsafe(method(readDataWithCompletionHandler:))]
985 #[unsafe(method_family = none)]
986 pub unsafe fn readDataWithCompletionHandler(
987 &self,
988 completion_handler: &block2::Block<dyn Fn(*mut NSData, *mut NSError)>,
989 );
990
991 #[cfg(feature = "block2")]
992 #[unsafe(method(writeData:withCompletionHandler:))]
998 #[unsafe(method_family = none)]
999 pub unsafe fn writeData_withCompletionHandler(
1000 &self,
1001 data: &NSData,
1002 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
1003 );
1004
1005 #[deprecated]
1007 #[unsafe(method(remoteEndpoint))]
1008 #[unsafe(method_family = none)]
1009 pub unsafe fn remoteEndpoint(&self) -> Retained<NWEndpoint>;
1010 );
1011}
1012
1013impl NEAppProxyTCPFlow {
1015 extern_methods!(
1016 #[unsafe(method(init))]
1017 #[unsafe(method_family = init)]
1018 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1019
1020 #[unsafe(method(new))]
1021 #[unsafe(method_family = new)]
1022 pub unsafe fn new() -> Retained<Self>;
1023 );
1024}
1025
1026extern_class!(
1027 #[unsafe(super(NEAppProxyFlow, NSObject))]
1035 #[derive(Debug, PartialEq, Eq, Hash)]
1036 pub struct NEAppProxyUDPFlow;
1037);
1038
1039unsafe impl NSObjectProtocol for NEAppProxyUDPFlow {}
1040
1041impl NEAppProxyUDPFlow {
1042 extern_methods!(
1043 #[cfg(feature = "block2")]
1044 #[deprecated]
1048 #[unsafe(method(readDatagramsWithCompletionHandler:))]
1049 #[unsafe(method_family = none)]
1050 pub unsafe fn readDatagramsWithCompletionHandler(
1051 &self,
1052 completion_handler: &block2::Block<
1053 dyn Fn(*mut NSArray<NSData>, *mut NSArray<NWEndpoint>, *mut NSError),
1054 >,
1055 );
1056
1057 #[cfg(feature = "block2")]
1058 #[deprecated]
1066 #[unsafe(method(writeDatagrams:sentByEndpoints:completionHandler:))]
1067 #[unsafe(method_family = none)]
1068 pub unsafe fn writeDatagrams_sentByEndpoints_completionHandler(
1069 &self,
1070 datagrams: &NSArray<NSData>,
1071 remote_endpoints: &NSArray<NWEndpoint>,
1072 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
1073 );
1074
1075 #[deprecated]
1077 #[unsafe(method(localEndpoint))]
1078 #[unsafe(method_family = none)]
1079 pub unsafe fn localEndpoint(&self) -> Option<Retained<NWEndpoint>>;
1080 );
1081}
1082
1083impl NEAppProxyUDPFlow {
1085 extern_methods!(
1086 #[unsafe(method(init))]
1087 #[unsafe(method_family = init)]
1088 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1089
1090 #[unsafe(method(new))]
1091 #[unsafe(method_family = new)]
1092 pub unsafe fn new() -> Retained<Self>;
1093 );
1094}
1095
1096extern_class!(
1097 #[unsafe(super(NSObject))]
1105 #[derive(Debug, PartialEq, Eq, Hash)]
1106 pub struct NEAppRule;
1107);
1108
1109unsafe impl NSCoding for NEAppRule {}
1110
1111unsafe impl NSCopying for NEAppRule {}
1112
1113unsafe impl CopyingHelper for NEAppRule {
1114 type Result = Self;
1115}
1116
1117unsafe impl NSObjectProtocol for NEAppRule {}
1118
1119unsafe impl NSSecureCoding for NEAppRule {}
1120
1121impl NEAppRule {
1122 extern_methods!(
1123 #[unsafe(method(initWithSigningIdentifier:))]
1127 #[unsafe(method_family = init)]
1128 pub unsafe fn initWithSigningIdentifier(
1129 this: Allocated<Self>,
1130 signing_identifier: &NSString,
1131 ) -> Retained<Self>;
1132
1133 #[unsafe(method(initWithSigningIdentifier:designatedRequirement:))]
1139 #[unsafe(method_family = init)]
1140 pub unsafe fn initWithSigningIdentifier_designatedRequirement(
1141 this: Allocated<Self>,
1142 signing_identifier: &NSString,
1143 designated_requirement: &NSString,
1144 ) -> Retained<Self>;
1145
1146 #[unsafe(method(matchSigningIdentifier))]
1148 #[unsafe(method_family = none)]
1149 pub unsafe fn matchSigningIdentifier(&self) -> Retained<NSString>;
1150
1151 #[unsafe(method(matchDesignatedRequirement))]
1153 #[unsafe(method_family = none)]
1154 pub unsafe fn matchDesignatedRequirement(&self) -> Retained<NSString>;
1155
1156 #[unsafe(method(matchPath))]
1158 #[unsafe(method_family = none)]
1159 pub unsafe fn matchPath(&self) -> Option<Retained<NSString>>;
1160
1161 #[unsafe(method(setMatchPath:))]
1163 #[unsafe(method_family = none)]
1164 pub unsafe fn setMatchPath(&self, match_path: Option<&NSString>);
1165
1166 #[unsafe(method(matchDomains))]
1168 #[unsafe(method_family = none)]
1169 pub unsafe fn matchDomains(&self) -> Option<Retained<NSArray>>;
1170
1171 #[unsafe(method(setMatchDomains:))]
1173 #[unsafe(method_family = none)]
1174 pub unsafe fn setMatchDomains(&self, match_domains: Option<&NSArray>);
1175
1176 #[unsafe(method(matchTools))]
1181 #[unsafe(method_family = none)]
1182 pub unsafe fn matchTools(&self) -> Option<Retained<NSArray<NEAppRule>>>;
1183
1184 #[unsafe(method(setMatchTools:))]
1186 #[unsafe(method_family = none)]
1187 pub unsafe fn setMatchTools(&self, match_tools: Option<&NSArray<NEAppRule>>);
1188 );
1189}
1190
1191impl NEAppRule {
1193 extern_methods!(
1194 #[unsafe(method(init))]
1195 #[unsafe(method_family = init)]
1196 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1197
1198 #[unsafe(method(new))]
1199 #[unsafe(method_family = new)]
1200 pub unsafe fn new() -> Retained<Self>;
1201 );
1202}
1203
1204#[repr(transparent)]
1209#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1210pub struct NEDNSProxyManagerError(pub NSInteger);
1211impl NEDNSProxyManagerError {
1212 #[doc(alias = "NEDNSProxyManagerErrorConfigurationInvalid")]
1213 pub const ConfigurationInvalid: Self = Self(1);
1214 #[doc(alias = "NEDNSProxyManagerErrorConfigurationDisabled")]
1215 pub const ConfigurationDisabled: Self = Self(2);
1216 #[doc(alias = "NEDNSProxyManagerErrorConfigurationStale")]
1217 pub const ConfigurationStale: Self = Self(3);
1218 #[doc(alias = "NEDNSProxyManagerErrorConfigurationCannotBeRemoved")]
1219 pub const ConfigurationCannotBeRemoved: Self = Self(4);
1220}
1221
1222unsafe impl Encode for NEDNSProxyManagerError {
1223 const ENCODING: Encoding = NSInteger::ENCODING;
1224}
1225
1226unsafe impl RefEncode for NEDNSProxyManagerError {
1227 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1228}
1229
1230extern "C" {
1231 pub static NEDNSProxyErrorDomain: &'static NSString;
1233}
1234
1235extern "C" {
1236 pub static NEDNSProxyConfigurationDidChangeNotification: &'static NSString;
1238}
1239
1240extern_class!(
1241 #[unsafe(super(NSObject))]
1249 #[derive(Debug, PartialEq, Eq, Hash)]
1250 pub struct NEDNSProxyManager;
1251);
1252
1253unsafe impl NSObjectProtocol for NEDNSProxyManager {}
1254
1255impl NEDNSProxyManager {
1256 extern_methods!(
1257 #[unsafe(method(sharedManager))]
1259 #[unsafe(method_family = none)]
1260 pub unsafe fn sharedManager() -> Retained<NEDNSProxyManager>;
1261
1262 #[cfg(feature = "block2")]
1263 #[unsafe(method(loadFromPreferencesWithCompletionHandler:))]
1267 #[unsafe(method_family = none)]
1268 pub unsafe fn loadFromPreferencesWithCompletionHandler(
1269 &self,
1270 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
1271 );
1272
1273 #[cfg(feature = "block2")]
1274 #[unsafe(method(removeFromPreferencesWithCompletionHandler:))]
1278 #[unsafe(method_family = none)]
1279 pub unsafe fn removeFromPreferencesWithCompletionHandler(
1280 &self,
1281 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
1282 );
1283
1284 #[cfg(feature = "block2")]
1285 #[unsafe(method(saveToPreferencesWithCompletionHandler:))]
1289 #[unsafe(method_family = none)]
1290 pub unsafe fn saveToPreferencesWithCompletionHandler(
1291 &self,
1292 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
1293 );
1294
1295 #[unsafe(method(localizedDescription))]
1297 #[unsafe(method_family = none)]
1298 pub unsafe fn localizedDescription(&self) -> Option<Retained<NSString>>;
1299
1300 #[unsafe(method(setLocalizedDescription:))]
1302 #[unsafe(method_family = none)]
1303 pub unsafe fn setLocalizedDescription(&self, localized_description: Option<&NSString>);
1304
1305 #[unsafe(method(providerProtocol))]
1307 #[unsafe(method_family = none)]
1308 pub unsafe fn providerProtocol(&self) -> Option<Retained<NEDNSProxyProviderProtocol>>;
1309
1310 #[unsafe(method(setProviderProtocol:))]
1312 #[unsafe(method_family = none)]
1313 pub unsafe fn setProviderProtocol(
1314 &self,
1315 provider_protocol: Option<&NEDNSProxyProviderProtocol>,
1316 );
1317
1318 #[unsafe(method(isEnabled))]
1320 #[unsafe(method_family = none)]
1321 pub unsafe fn isEnabled(&self) -> bool;
1322
1323 #[unsafe(method(setEnabled:))]
1325 #[unsafe(method_family = none)]
1326 pub unsafe fn setEnabled(&self, enabled: bool);
1327 );
1328}
1329
1330impl NEDNSProxyManager {
1332 extern_methods!(
1333 #[unsafe(method(init))]
1334 #[unsafe(method_family = init)]
1335 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1336
1337 #[unsafe(method(new))]
1338 #[unsafe(method_family = new)]
1339 pub unsafe fn new() -> Retained<Self>;
1340 );
1341}
1342
1343extern_class!(
1344 #[unsafe(super(NEProvider, NSObject))]
1350 #[derive(Debug, PartialEq, Eq, Hash)]
1351 pub struct NEDNSProxyProvider;
1352);
1353
1354unsafe impl NSObjectProtocol for NEDNSProxyProvider {}
1355
1356impl NEDNSProxyProvider {
1357 extern_methods!(
1358 #[cfg(feature = "block2")]
1359 #[unsafe(method(startProxyWithOptions:completionHandler:))]
1365 #[unsafe(method_family = none)]
1366 pub unsafe fn startProxyWithOptions_completionHandler(
1367 &self,
1368 options: Option<&NSDictionary<NSString, AnyObject>>,
1369 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
1370 );
1371
1372 #[cfg(feature = "block2")]
1373 #[unsafe(method(stopProxyWithReason:completionHandler:))]
1379 #[unsafe(method_family = none)]
1380 pub unsafe fn stopProxyWithReason_completionHandler(
1381 &self,
1382 reason: NEProviderStopReason,
1383 completion_handler: &block2::Block<dyn Fn()>,
1384 );
1385
1386 #[unsafe(method(cancelProxyWithError:))]
1390 #[unsafe(method_family = none)]
1391 pub unsafe fn cancelProxyWithError(&self, error: Option<&NSError>);
1392
1393 #[unsafe(method(handleNewFlow:))]
1399 #[unsafe(method_family = none)]
1400 pub unsafe fn handleNewFlow(&self, flow: &NEAppProxyFlow) -> bool;
1401
1402 #[deprecated]
1414 #[unsafe(method(handleNewUDPFlow:initialRemoteEndpoint:))]
1415 #[unsafe(method_family = none)]
1416 pub unsafe fn handleNewUDPFlow_initialRemoteEndpoint(
1417 &self,
1418 flow: &NEAppProxyUDPFlow,
1419 remote_endpoint: &NWEndpoint,
1420 ) -> bool;
1421
1422 #[unsafe(method(systemDNSSettings))]
1424 #[unsafe(method_family = none)]
1425 pub unsafe fn systemDNSSettings(&self) -> Option<Retained<NSArray<NEDNSSettings>>>;
1426 );
1427}
1428
1429impl NEDNSProxyProvider {
1431 extern_methods!(
1432 #[unsafe(method(init))]
1433 #[unsafe(method_family = init)]
1434 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1435
1436 #[unsafe(method(new))]
1437 #[unsafe(method_family = new)]
1438 pub unsafe fn new() -> Retained<Self>;
1439 );
1440}
1441
1442extern_class!(
1443 #[unsafe(super(NSObject))]
1449 #[derive(Debug, PartialEq, Eq, Hash)]
1450 pub struct NEProxyServer;
1451);
1452
1453unsafe impl NSCoding for NEProxyServer {}
1454
1455unsafe impl NSCopying for NEProxyServer {}
1456
1457unsafe impl CopyingHelper for NEProxyServer {
1458 type Result = Self;
1459}
1460
1461unsafe impl NSObjectProtocol for NEProxyServer {}
1462
1463unsafe impl NSSecureCoding for NEProxyServer {}
1464
1465impl NEProxyServer {
1466 extern_methods!(
1467 #[unsafe(method(initWithAddress:port:))]
1473 #[unsafe(method_family = init)]
1474 pub unsafe fn initWithAddress_port(
1475 this: Allocated<Self>,
1476 address: &NSString,
1477 port: NSInteger,
1478 ) -> Retained<Self>;
1479
1480 #[unsafe(method(address))]
1482 #[unsafe(method_family = none)]
1483 pub unsafe fn address(&self) -> Retained<NSString>;
1484
1485 #[unsafe(method(port))]
1487 #[unsafe(method_family = none)]
1488 pub unsafe fn port(&self) -> NSInteger;
1489
1490 #[unsafe(method(authenticationRequired))]
1492 #[unsafe(method_family = none)]
1493 pub unsafe fn authenticationRequired(&self) -> bool;
1494
1495 #[unsafe(method(setAuthenticationRequired:))]
1497 #[unsafe(method_family = none)]
1498 pub unsafe fn setAuthenticationRequired(&self, authentication_required: bool);
1499
1500 #[unsafe(method(username))]
1502 #[unsafe(method_family = none)]
1503 pub unsafe fn username(&self) -> Option<Retained<NSString>>;
1504
1505 #[unsafe(method(setUsername:))]
1507 #[unsafe(method_family = none)]
1508 pub unsafe fn setUsername(&self, username: Option<&NSString>);
1509
1510 #[unsafe(method(password))]
1512 #[unsafe(method_family = none)]
1513 pub unsafe fn password(&self) -> Option<Retained<NSString>>;
1514
1515 #[unsafe(method(setPassword:))]
1517 #[unsafe(method_family = none)]
1518 pub unsafe fn setPassword(&self, password: Option<&NSString>);
1519 );
1520}
1521
1522impl NEProxyServer {
1524 extern_methods!(
1525 #[unsafe(method(init))]
1526 #[unsafe(method_family = init)]
1527 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1528
1529 #[unsafe(method(new))]
1530 #[unsafe(method_family = new)]
1531 pub unsafe fn new() -> Retained<Self>;
1532 );
1533}
1534
1535extern_class!(
1536 #[unsafe(super(NSObject))]
1542 #[derive(Debug, PartialEq, Eq, Hash)]
1543 pub struct NEProxySettings;
1544);
1545
1546unsafe impl NSCoding for NEProxySettings {}
1547
1548unsafe impl NSCopying for NEProxySettings {}
1549
1550unsafe impl CopyingHelper for NEProxySettings {
1551 type Result = Self;
1552}
1553
1554unsafe impl NSObjectProtocol for NEProxySettings {}
1555
1556unsafe impl NSSecureCoding for NEProxySettings {}
1557
1558impl NEProxySettings {
1559 extern_methods!(
1560 #[unsafe(method(autoProxyConfigurationEnabled))]
1562 #[unsafe(method_family = none)]
1563 pub unsafe fn autoProxyConfigurationEnabled(&self) -> bool;
1564
1565 #[unsafe(method(setAutoProxyConfigurationEnabled:))]
1567 #[unsafe(method_family = none)]
1568 pub unsafe fn setAutoProxyConfigurationEnabled(
1569 &self,
1570 auto_proxy_configuration_enabled: bool,
1571 );
1572
1573 #[unsafe(method(proxyAutoConfigurationURL))]
1575 #[unsafe(method_family = none)]
1576 pub unsafe fn proxyAutoConfigurationURL(&self) -> Option<Retained<NSURL>>;
1577
1578 #[unsafe(method(setProxyAutoConfigurationURL:))]
1580 #[unsafe(method_family = none)]
1581 pub unsafe fn setProxyAutoConfigurationURL(
1582 &self,
1583 proxy_auto_configuration_url: Option<&NSURL>,
1584 );
1585
1586 #[unsafe(method(proxyAutoConfigurationJavaScript))]
1588 #[unsafe(method_family = none)]
1589 pub unsafe fn proxyAutoConfigurationJavaScript(&self) -> Option<Retained<NSString>>;
1590
1591 #[unsafe(method(setProxyAutoConfigurationJavaScript:))]
1593 #[unsafe(method_family = none)]
1594 pub unsafe fn setProxyAutoConfigurationJavaScript(
1595 &self,
1596 proxy_auto_configuration_java_script: Option<&NSString>,
1597 );
1598
1599 #[unsafe(method(HTTPEnabled))]
1601 #[unsafe(method_family = none)]
1602 pub unsafe fn HTTPEnabled(&self) -> bool;
1603
1604 #[unsafe(method(setHTTPEnabled:))]
1606 #[unsafe(method_family = none)]
1607 pub unsafe fn setHTTPEnabled(&self, http_enabled: bool);
1608
1609 #[unsafe(method(HTTPServer))]
1611 #[unsafe(method_family = none)]
1612 pub unsafe fn HTTPServer(&self) -> Option<Retained<NEProxyServer>>;
1613
1614 #[unsafe(method(setHTTPServer:))]
1616 #[unsafe(method_family = none)]
1617 pub unsafe fn setHTTPServer(&self, http_server: Option<&NEProxyServer>);
1618
1619 #[unsafe(method(HTTPSEnabled))]
1621 #[unsafe(method_family = none)]
1622 pub unsafe fn HTTPSEnabled(&self) -> bool;
1623
1624 #[unsafe(method(setHTTPSEnabled:))]
1626 #[unsafe(method_family = none)]
1627 pub unsafe fn setHTTPSEnabled(&self, https_enabled: bool);
1628
1629 #[unsafe(method(HTTPSServer))]
1631 #[unsafe(method_family = none)]
1632 pub unsafe fn HTTPSServer(&self) -> Option<Retained<NEProxyServer>>;
1633
1634 #[unsafe(method(setHTTPSServer:))]
1636 #[unsafe(method_family = none)]
1637 pub unsafe fn setHTTPSServer(&self, https_server: Option<&NEProxyServer>);
1638
1639 #[unsafe(method(excludeSimpleHostnames))]
1641 #[unsafe(method_family = none)]
1642 pub unsafe fn excludeSimpleHostnames(&self) -> bool;
1643
1644 #[unsafe(method(setExcludeSimpleHostnames:))]
1646 #[unsafe(method_family = none)]
1647 pub unsafe fn setExcludeSimpleHostnames(&self, exclude_simple_hostnames: bool);
1648
1649 #[unsafe(method(exceptionList))]
1651 #[unsafe(method_family = none)]
1652 pub unsafe fn exceptionList(&self) -> Option<Retained<NSArray<NSString>>>;
1653
1654 #[unsafe(method(setExceptionList:))]
1656 #[unsafe(method_family = none)]
1657 pub unsafe fn setExceptionList(&self, exception_list: Option<&NSArray<NSString>>);
1658
1659 #[unsafe(method(matchDomains))]
1661 #[unsafe(method_family = none)]
1662 pub unsafe fn matchDomains(&self) -> Option<Retained<NSArray<NSString>>>;
1663
1664 #[unsafe(method(setMatchDomains:))]
1666 #[unsafe(method_family = none)]
1667 pub unsafe fn setMatchDomains(&self, match_domains: Option<&NSArray<NSString>>);
1668 );
1669}
1670
1671impl NEProxySettings {
1673 extern_methods!(
1674 #[unsafe(method(init))]
1675 #[unsafe(method_family = init)]
1676 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1677
1678 #[unsafe(method(new))]
1679 #[unsafe(method_family = new)]
1680 pub unsafe fn new() -> Retained<Self>;
1681 );
1682}
1683
1684extern_class!(
1685 #[unsafe(super(NSObject))]
1693 #[derive(Debug, PartialEq, Eq, Hash)]
1694 pub struct NEVPNProtocol;
1695);
1696
1697unsafe impl NSCoding for NEVPNProtocol {}
1698
1699unsafe impl NSCopying for NEVPNProtocol {}
1700
1701unsafe impl CopyingHelper for NEVPNProtocol {
1702 type Result = Self;
1703}
1704
1705unsafe impl NSObjectProtocol for NEVPNProtocol {}
1706
1707unsafe impl NSSecureCoding for NEVPNProtocol {}
1708
1709impl NEVPNProtocol {
1710 extern_methods!(
1711 #[unsafe(method(serverAddress))]
1713 #[unsafe(method_family = none)]
1714 pub unsafe fn serverAddress(&self) -> Option<Retained<NSString>>;
1715
1716 #[unsafe(method(setServerAddress:))]
1718 #[unsafe(method_family = none)]
1719 pub unsafe fn setServerAddress(&self, server_address: Option<&NSString>);
1720
1721 #[unsafe(method(username))]
1723 #[unsafe(method_family = none)]
1724 pub unsafe fn username(&self) -> Option<Retained<NSString>>;
1725
1726 #[unsafe(method(setUsername:))]
1728 #[unsafe(method_family = none)]
1729 pub unsafe fn setUsername(&self, username: Option<&NSString>);
1730
1731 #[unsafe(method(passwordReference))]
1733 #[unsafe(method_family = none)]
1734 pub unsafe fn passwordReference(&self) -> Option<Retained<NSData>>;
1735
1736 #[unsafe(method(setPasswordReference:))]
1738 #[unsafe(method_family = none)]
1739 pub unsafe fn setPasswordReference(&self, password_reference: Option<&NSData>);
1740
1741 #[unsafe(method(identityReference))]
1743 #[unsafe(method_family = none)]
1744 pub unsafe fn identityReference(&self) -> Option<Retained<NSData>>;
1745
1746 #[unsafe(method(setIdentityReference:))]
1748 #[unsafe(method_family = none)]
1749 pub unsafe fn setIdentityReference(&self, identity_reference: Option<&NSData>);
1750
1751 #[unsafe(method(identityData))]
1753 #[unsafe(method_family = none)]
1754 pub unsafe fn identityData(&self) -> Option<Retained<NSData>>;
1755
1756 #[unsafe(method(setIdentityData:))]
1758 #[unsafe(method_family = none)]
1759 pub unsafe fn setIdentityData(&self, identity_data: Option<&NSData>);
1760
1761 #[unsafe(method(identityDataPassword))]
1763 #[unsafe(method_family = none)]
1764 pub unsafe fn identityDataPassword(&self) -> Option<Retained<NSString>>;
1765
1766 #[unsafe(method(setIdentityDataPassword:))]
1768 #[unsafe(method_family = none)]
1769 pub unsafe fn setIdentityDataPassword(&self, identity_data_password: Option<&NSString>);
1770
1771 #[unsafe(method(disconnectOnSleep))]
1773 #[unsafe(method_family = none)]
1774 pub unsafe fn disconnectOnSleep(&self) -> bool;
1775
1776 #[unsafe(method(setDisconnectOnSleep:))]
1778 #[unsafe(method_family = none)]
1779 pub unsafe fn setDisconnectOnSleep(&self, disconnect_on_sleep: bool);
1780
1781 #[unsafe(method(proxySettings))]
1783 #[unsafe(method_family = none)]
1784 pub unsafe fn proxySettings(&self) -> Option<Retained<NEProxySettings>>;
1785
1786 #[unsafe(method(setProxySettings:))]
1788 #[unsafe(method_family = none)]
1789 pub unsafe fn setProxySettings(&self, proxy_settings: Option<&NEProxySettings>);
1790
1791 #[unsafe(method(includeAllNetworks))]
1801 #[unsafe(method_family = none)]
1802 pub unsafe fn includeAllNetworks(&self) -> bool;
1803
1804 #[unsafe(method(setIncludeAllNetworks:))]
1806 #[unsafe(method_family = none)]
1807 pub unsafe fn setIncludeAllNetworks(&self, include_all_networks: bool);
1808
1809 #[unsafe(method(excludeLocalNetworks))]
1811 #[unsafe(method_family = none)]
1812 pub unsafe fn excludeLocalNetworks(&self) -> bool;
1813
1814 #[unsafe(method(setExcludeLocalNetworks:))]
1816 #[unsafe(method_family = none)]
1817 pub unsafe fn setExcludeLocalNetworks(&self, exclude_local_networks: bool);
1818
1819 #[unsafe(method(excludeCellularServices))]
1824 #[unsafe(method_family = none)]
1825 pub unsafe fn excludeCellularServices(&self) -> bool;
1826
1827 #[unsafe(method(setExcludeCellularServices:))]
1829 #[unsafe(method_family = none)]
1830 pub unsafe fn setExcludeCellularServices(&self, exclude_cellular_services: bool);
1831
1832 #[unsafe(method(excludeAPNs))]
1835 #[unsafe(method_family = none)]
1836 pub unsafe fn excludeAPNs(&self) -> bool;
1837
1838 #[unsafe(method(setExcludeAPNs:))]
1840 #[unsafe(method_family = none)]
1841 pub unsafe fn setExcludeAPNs(&self, exclude_ap_ns: bool);
1842
1843 #[unsafe(method(excludeDeviceCommunication))]
1847 #[unsafe(method_family = none)]
1848 pub unsafe fn excludeDeviceCommunication(&self) -> bool;
1849
1850 #[unsafe(method(setExcludeDeviceCommunication:))]
1852 #[unsafe(method_family = none)]
1853 pub unsafe fn setExcludeDeviceCommunication(&self, exclude_device_communication: bool);
1854
1855 #[unsafe(method(enforceRoutes))]
1857 #[unsafe(method_family = none)]
1858 pub unsafe fn enforceRoutes(&self) -> bool;
1859
1860 #[unsafe(method(setEnforceRoutes:))]
1862 #[unsafe(method_family = none)]
1863 pub unsafe fn setEnforceRoutes(&self, enforce_routes: bool);
1864
1865 #[unsafe(method(sliceUUID))]
1868 #[unsafe(method_family = none)]
1869 pub unsafe fn sliceUUID(&self) -> Option<Retained<NSString>>;
1870
1871 #[unsafe(method(setSliceUUID:))]
1873 #[unsafe(method_family = none)]
1874 pub unsafe fn setSliceUUID(&self, slice_uuid: Option<&NSString>);
1875 );
1876}
1877
1878impl NEVPNProtocol {
1880 extern_methods!(
1881 #[unsafe(method(init))]
1882 #[unsafe(method_family = init)]
1883 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1884
1885 #[unsafe(method(new))]
1886 #[unsafe(method_family = new)]
1887 pub unsafe fn new() -> Retained<Self>;
1888 );
1889}
1890
1891extern_class!(
1892 #[unsafe(super(NEVPNProtocol, NSObject))]
1898 #[derive(Debug, PartialEq, Eq, Hash)]
1899 pub struct NEDNSProxyProviderProtocol;
1900);
1901
1902unsafe impl NSCoding for NEDNSProxyProviderProtocol {}
1903
1904unsafe impl NSCopying for NEDNSProxyProviderProtocol {}
1905
1906unsafe impl CopyingHelper for NEDNSProxyProviderProtocol {
1907 type Result = Self;
1908}
1909
1910unsafe impl NSObjectProtocol for NEDNSProxyProviderProtocol {}
1911
1912unsafe impl NSSecureCoding for NEDNSProxyProviderProtocol {}
1913
1914impl NEDNSProxyProviderProtocol {
1915 extern_methods!(
1916 #[unsafe(method(providerConfiguration))]
1918 #[unsafe(method_family = none)]
1919 pub unsafe fn providerConfiguration(
1920 &self,
1921 ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
1922
1923 #[unsafe(method(setProviderConfiguration:))]
1925 #[unsafe(method_family = none)]
1926 pub unsafe fn setProviderConfiguration(
1927 &self,
1928 provider_configuration: Option<&NSDictionary<NSString, AnyObject>>,
1929 );
1930
1931 #[unsafe(method(providerBundleIdentifier))]
1933 #[unsafe(method_family = none)]
1934 pub unsafe fn providerBundleIdentifier(&self) -> Option<Retained<NSString>>;
1935
1936 #[unsafe(method(setProviderBundleIdentifier:))]
1938 #[unsafe(method_family = none)]
1939 pub unsafe fn setProviderBundleIdentifier(
1940 &self,
1941 provider_bundle_identifier: Option<&NSString>,
1942 );
1943 );
1944}
1945
1946impl NEDNSProxyProviderProtocol {
1948 extern_methods!(
1949 #[unsafe(method(init))]
1950 #[unsafe(method_family = init)]
1951 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1952
1953 #[unsafe(method(new))]
1954 #[unsafe(method_family = new)]
1955 pub unsafe fn new() -> Retained<Self>;
1956 );
1957}
1958
1959#[repr(transparent)]
1964#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1965pub struct NEDNSProtocol(pub NSInteger);
1966impl NEDNSProtocol {
1967 #[doc(alias = "NEDNSProtocolCleartext")]
1968 pub const Cleartext: Self = Self(1);
1969 #[doc(alias = "NEDNSProtocolTLS")]
1970 pub const TLS: Self = Self(2);
1971 #[doc(alias = "NEDNSProtocolHTTPS")]
1972 pub const HTTPS: Self = Self(3);
1973}
1974
1975unsafe impl Encode for NEDNSProtocol {
1976 const ENCODING: Encoding = NSInteger::ENCODING;
1977}
1978
1979unsafe impl RefEncode for NEDNSProtocol {
1980 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1981}
1982
1983extern_class!(
1984 #[unsafe(super(NSObject))]
1988 #[derive(Debug, PartialEq, Eq, Hash)]
1989 pub struct NEDNSSettings;
1990);
1991
1992unsafe impl NSCoding for NEDNSSettings {}
1993
1994unsafe impl NSCopying for NEDNSSettings {}
1995
1996unsafe impl CopyingHelper for NEDNSSettings {
1997 type Result = Self;
1998}
1999
2000unsafe impl NSObjectProtocol for NEDNSSettings {}
2001
2002unsafe impl NSSecureCoding for NEDNSSettings {}
2003
2004impl NEDNSSettings {
2005 extern_methods!(
2006 #[unsafe(method(dnsProtocol))]
2008 #[unsafe(method_family = none)]
2009 pub unsafe fn dnsProtocol(&self) -> NEDNSProtocol;
2010
2011 #[unsafe(method(initWithServers:))]
2015 #[unsafe(method_family = init)]
2016 pub unsafe fn initWithServers(
2017 this: Allocated<Self>,
2018 servers: &NSArray<NSString>,
2019 ) -> Retained<Self>;
2020
2021 #[unsafe(method(servers))]
2023 #[unsafe(method_family = none)]
2024 pub unsafe fn servers(&self) -> Retained<NSArray<NSString>>;
2025
2026 #[unsafe(method(searchDomains))]
2028 #[unsafe(method_family = none)]
2029 pub unsafe fn searchDomains(&self) -> Option<Retained<NSArray<NSString>>>;
2030
2031 #[unsafe(method(setSearchDomains:))]
2033 #[unsafe(method_family = none)]
2034 pub unsafe fn setSearchDomains(&self, search_domains: Option<&NSArray<NSString>>);
2035
2036 #[unsafe(method(domainName))]
2038 #[unsafe(method_family = none)]
2039 pub unsafe fn domainName(&self) -> Option<Retained<NSString>>;
2040
2041 #[unsafe(method(setDomainName:))]
2043 #[unsafe(method_family = none)]
2044 pub unsafe fn setDomainName(&self, domain_name: Option<&NSString>);
2045
2046 #[unsafe(method(matchDomains))]
2048 #[unsafe(method_family = none)]
2049 pub unsafe fn matchDomains(&self) -> Option<Retained<NSArray<NSString>>>;
2050
2051 #[unsafe(method(setMatchDomains:))]
2053 #[unsafe(method_family = none)]
2054 pub unsafe fn setMatchDomains(&self, match_domains: Option<&NSArray<NSString>>);
2055
2056 #[unsafe(method(matchDomainsNoSearch))]
2058 #[unsafe(method_family = none)]
2059 pub unsafe fn matchDomainsNoSearch(&self) -> bool;
2060
2061 #[unsafe(method(setMatchDomainsNoSearch:))]
2063 #[unsafe(method_family = none)]
2064 pub unsafe fn setMatchDomainsNoSearch(&self, match_domains_no_search: bool);
2065 );
2066}
2067
2068impl NEDNSSettings {
2070 extern_methods!(
2071 #[unsafe(method(init))]
2072 #[unsafe(method_family = init)]
2073 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2074
2075 #[unsafe(method(new))]
2076 #[unsafe(method_family = new)]
2077 pub unsafe fn new() -> Retained<Self>;
2078 );
2079}
2080
2081extern_class!(
2082 #[unsafe(super(NEDNSSettings, NSObject))]
2084 #[derive(Debug, PartialEq, Eq, Hash)]
2085 pub struct NEDNSOverTLSSettings;
2086);
2087
2088unsafe impl NSCoding for NEDNSOverTLSSettings {}
2089
2090unsafe impl NSCopying for NEDNSOverTLSSettings {}
2091
2092unsafe impl CopyingHelper for NEDNSOverTLSSettings {
2093 type Result = Self;
2094}
2095
2096unsafe impl NSObjectProtocol for NEDNSOverTLSSettings {}
2097
2098unsafe impl NSSecureCoding for NEDNSOverTLSSettings {}
2099
2100impl NEDNSOverTLSSettings {
2101 extern_methods!(
2102 #[unsafe(method(serverName))]
2104 #[unsafe(method_family = none)]
2105 pub unsafe fn serverName(&self) -> Option<Retained<NSString>>;
2106
2107 #[unsafe(method(setServerName:))]
2109 #[unsafe(method_family = none)]
2110 pub unsafe fn setServerName(&self, server_name: Option<&NSString>);
2111
2112 #[unsafe(method(identityReference))]
2114 #[unsafe(method_family = none)]
2115 pub unsafe fn identityReference(&self) -> Option<Retained<NSData>>;
2116
2117 #[unsafe(method(setIdentityReference:))]
2119 #[unsafe(method_family = none)]
2120 pub unsafe fn setIdentityReference(&self, identity_reference: Option<&NSData>);
2121 );
2122}
2123
2124impl NEDNSOverTLSSettings {
2126 extern_methods!(
2127 #[unsafe(method(initWithServers:))]
2131 #[unsafe(method_family = init)]
2132 pub unsafe fn initWithServers(
2133 this: Allocated<Self>,
2134 servers: &NSArray<NSString>,
2135 ) -> Retained<Self>;
2136 );
2137}
2138
2139impl NEDNSOverTLSSettings {
2141 extern_methods!(
2142 #[unsafe(method(init))]
2143 #[unsafe(method_family = init)]
2144 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2145
2146 #[unsafe(method(new))]
2147 #[unsafe(method_family = new)]
2148 pub unsafe fn new() -> Retained<Self>;
2149 );
2150}
2151
2152extern_class!(
2153 #[unsafe(super(NEDNSSettings, NSObject))]
2155 #[derive(Debug, PartialEq, Eq, Hash)]
2156 pub struct NEDNSOverHTTPSSettings;
2157);
2158
2159unsafe impl NSCoding for NEDNSOverHTTPSSettings {}
2160
2161unsafe impl NSCopying for NEDNSOverHTTPSSettings {}
2162
2163unsafe impl CopyingHelper for NEDNSOverHTTPSSettings {
2164 type Result = Self;
2165}
2166
2167unsafe impl NSObjectProtocol for NEDNSOverHTTPSSettings {}
2168
2169unsafe impl NSSecureCoding for NEDNSOverHTTPSSettings {}
2170
2171impl NEDNSOverHTTPSSettings {
2172 extern_methods!(
2173 #[unsafe(method(serverURL))]
2175 #[unsafe(method_family = none)]
2176 pub unsafe fn serverURL(&self) -> Option<Retained<NSURL>>;
2177
2178 #[unsafe(method(setServerURL:))]
2180 #[unsafe(method_family = none)]
2181 pub unsafe fn setServerURL(&self, server_url: Option<&NSURL>);
2182
2183 #[unsafe(method(identityReference))]
2185 #[unsafe(method_family = none)]
2186 pub unsafe fn identityReference(&self) -> Option<Retained<NSData>>;
2187
2188 #[unsafe(method(setIdentityReference:))]
2190 #[unsafe(method_family = none)]
2191 pub unsafe fn setIdentityReference(&self, identity_reference: Option<&NSData>);
2192 );
2193}
2194
2195impl NEDNSOverHTTPSSettings {
2197 extern_methods!(
2198 #[unsafe(method(initWithServers:))]
2202 #[unsafe(method_family = init)]
2203 pub unsafe fn initWithServers(
2204 this: Allocated<Self>,
2205 servers: &NSArray<NSString>,
2206 ) -> Retained<Self>;
2207 );
2208}
2209
2210impl NEDNSOverHTTPSSettings {
2212 extern_methods!(
2213 #[unsafe(method(init))]
2214 #[unsafe(method_family = init)]
2215 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2216
2217 #[unsafe(method(new))]
2218 #[unsafe(method_family = new)]
2219 pub unsafe fn new() -> Retained<Self>;
2220 );
2221}
2222
2223#[repr(transparent)]
2228#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2229pub struct NEDNSSettingsManagerError(pub NSInteger);
2230impl NEDNSSettingsManagerError {
2231 #[doc(alias = "NEDNSSettingsManagerErrorConfigurationInvalid")]
2232 pub const ConfigurationInvalid: Self = Self(1);
2233 #[doc(alias = "NEDNSSettingsManagerErrorConfigurationDisabled")]
2234 pub const ConfigurationDisabled: Self = Self(2);
2235 #[doc(alias = "NEDNSSettingsManagerErrorConfigurationStale")]
2236 pub const ConfigurationStale: Self = Self(3);
2237 #[doc(alias = "NEDNSSettingsManagerErrorConfigurationCannotBeRemoved")]
2238 pub const ConfigurationCannotBeRemoved: Self = Self(4);
2239}
2240
2241unsafe impl Encode for NEDNSSettingsManagerError {
2242 const ENCODING: Encoding = NSInteger::ENCODING;
2243}
2244
2245unsafe impl RefEncode for NEDNSSettingsManagerError {
2246 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2247}
2248
2249extern "C" {
2250 pub static NEDNSSettingsErrorDomain: &'static NSString;
2252}
2253
2254extern "C" {
2255 pub static NEDNSSettingsConfigurationDidChangeNotification: &'static NSString;
2257}
2258
2259extern_class!(
2260 #[unsafe(super(NSObject))]
2268 #[derive(Debug, PartialEq, Eq, Hash)]
2269 pub struct NEDNSSettingsManager;
2270);
2271
2272unsafe impl NSObjectProtocol for NEDNSSettingsManager {}
2273
2274impl NEDNSSettingsManager {
2275 extern_methods!(
2276 #[unsafe(method(sharedManager))]
2278 #[unsafe(method_family = none)]
2279 pub unsafe fn sharedManager() -> Retained<NEDNSSettingsManager>;
2280
2281 #[cfg(feature = "block2")]
2282 #[unsafe(method(loadFromPreferencesWithCompletionHandler:))]
2286 #[unsafe(method_family = none)]
2287 pub unsafe fn loadFromPreferencesWithCompletionHandler(
2288 &self,
2289 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
2290 );
2291
2292 #[cfg(feature = "block2")]
2293 #[unsafe(method(removeFromPreferencesWithCompletionHandler:))]
2297 #[unsafe(method_family = none)]
2298 pub unsafe fn removeFromPreferencesWithCompletionHandler(
2299 &self,
2300 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
2301 );
2302
2303 #[cfg(feature = "block2")]
2304 #[unsafe(method(saveToPreferencesWithCompletionHandler:))]
2308 #[unsafe(method_family = none)]
2309 pub unsafe fn saveToPreferencesWithCompletionHandler(
2310 &self,
2311 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
2312 );
2313
2314 #[unsafe(method(localizedDescription))]
2316 #[unsafe(method_family = none)]
2317 pub unsafe fn localizedDescription(&self) -> Option<Retained<NSString>>;
2318
2319 #[unsafe(method(setLocalizedDescription:))]
2321 #[unsafe(method_family = none)]
2322 pub unsafe fn setLocalizedDescription(&self, localized_description: Option<&NSString>);
2323
2324 #[unsafe(method(dnsSettings))]
2326 #[unsafe(method_family = none)]
2327 pub unsafe fn dnsSettings(&self) -> Option<Retained<NEDNSSettings>>;
2328
2329 #[unsafe(method(setDnsSettings:))]
2331 #[unsafe(method_family = none)]
2332 pub unsafe fn setDnsSettings(&self, dns_settings: Option<&NEDNSSettings>);
2333
2334 #[unsafe(method(onDemandRules))]
2336 #[unsafe(method_family = none)]
2337 pub unsafe fn onDemandRules(&self) -> Option<Retained<NSArray<NEOnDemandRule>>>;
2338
2339 #[unsafe(method(setOnDemandRules:))]
2341 #[unsafe(method_family = none)]
2342 pub unsafe fn setOnDemandRules(&self, on_demand_rules: Option<&NSArray<NEOnDemandRule>>);
2343
2344 #[unsafe(method(isEnabled))]
2346 #[unsafe(method_family = none)]
2347 pub unsafe fn isEnabled(&self) -> bool;
2348 );
2349}
2350
2351impl NEDNSSettingsManager {
2353 extern_methods!(
2354 #[unsafe(method(init))]
2355 #[unsafe(method_family = init)]
2356 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2357
2358 #[unsafe(method(new))]
2359 #[unsafe(method_family = new)]
2360 pub unsafe fn new() -> Retained<Self>;
2361 );
2362}
2363
2364#[repr(transparent)]
2369#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2370pub struct NENetworkRuleProtocol(pub NSInteger);
2371impl NENetworkRuleProtocol {
2372 #[doc(alias = "NENetworkRuleProtocolAny")]
2373 pub const Any: Self = Self(0);
2374 #[doc(alias = "NENetworkRuleProtocolTCP")]
2375 pub const TCP: Self = Self(1);
2376 #[doc(alias = "NENetworkRuleProtocolUDP")]
2377 pub const UDP: Self = Self(2);
2378}
2379
2380unsafe impl Encode for NENetworkRuleProtocol {
2381 const ENCODING: Encoding = NSInteger::ENCODING;
2382}
2383
2384unsafe impl RefEncode for NENetworkRuleProtocol {
2385 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2386}
2387
2388#[repr(transparent)]
2393#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2394pub struct NETrafficDirection(pub NSInteger);
2395impl NETrafficDirection {
2396 #[doc(alias = "NETrafficDirectionAny")]
2397 pub const Any: Self = Self(0);
2398 #[doc(alias = "NETrafficDirectionInbound")]
2399 pub const Inbound: Self = Self(1);
2400 #[doc(alias = "NETrafficDirectionOutbound")]
2401 pub const Outbound: Self = Self(2);
2402}
2403
2404unsafe impl Encode for NETrafficDirection {
2405 const ENCODING: Encoding = NSInteger::ENCODING;
2406}
2407
2408unsafe impl RefEncode for NETrafficDirection {
2409 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2410}
2411
2412extern_class!(
2413 #[unsafe(super(NSObject))]
2417 #[derive(Debug, PartialEq, Eq, Hash)]
2418 pub struct NENetworkRule;
2419);
2420
2421unsafe impl NSCoding for NENetworkRule {}
2422
2423unsafe impl NSCopying for NENetworkRule {}
2424
2425unsafe impl CopyingHelper for NENetworkRule {
2426 type Result = Self;
2427}
2428
2429unsafe impl NSObjectProtocol for NENetworkRule {}
2430
2431unsafe impl NSSecureCoding for NENetworkRule {}
2432
2433impl NENetworkRule {
2434 extern_methods!(
2435 #[deprecated]
2447 #[unsafe(method(initWithDestinationNetwork:prefix:protocol:))]
2448 #[unsafe(method_family = init)]
2449 pub unsafe fn initWithDestinationNetwork_prefix_protocol(
2450 this: Allocated<Self>,
2451 network_endpoint: &NWHostEndpoint,
2452 destination_prefix: NSUInteger,
2453 protocol: NENetworkRuleProtocol,
2454 ) -> Retained<Self>;
2455
2456 #[deprecated]
2480 #[unsafe(method(initWithDestinationHost:protocol:))]
2481 #[unsafe(method_family = init)]
2482 pub unsafe fn initWithDestinationHost_protocol(
2483 this: Allocated<Self>,
2484 host_endpoint: &NWHostEndpoint,
2485 protocol: NENetworkRuleProtocol,
2486 ) -> Retained<Self>;
2487
2488 #[deprecated]
2513 #[unsafe(method(initWithRemoteNetwork:remotePrefix:localNetwork:localPrefix:protocol:direction:))]
2514 #[unsafe(method_family = init)]
2515 pub unsafe fn initWithRemoteNetwork_remotePrefix_localNetwork_localPrefix_protocol_direction(
2516 this: Allocated<Self>,
2517 remote_network: Option<&NWHostEndpoint>,
2518 remote_prefix: NSUInteger,
2519 local_network: Option<&NWHostEndpoint>,
2520 local_prefix: NSUInteger,
2521 protocol: NENetworkRuleProtocol,
2522 direction: NETrafficDirection,
2523 ) -> Retained<Self>;
2524
2525 #[deprecated]
2527 #[unsafe(method(matchRemoteEndpoint))]
2528 #[unsafe(method_family = none)]
2529 pub unsafe fn matchRemoteEndpoint(&self) -> Option<Retained<NWHostEndpoint>>;
2530
2531 #[unsafe(method(matchRemotePrefix))]
2533 #[unsafe(method_family = none)]
2534 pub unsafe fn matchRemotePrefix(&self) -> NSUInteger;
2535
2536 #[deprecated]
2538 #[unsafe(method(matchLocalNetwork))]
2539 #[unsafe(method_family = none)]
2540 pub unsafe fn matchLocalNetwork(&self) -> Option<Retained<NWHostEndpoint>>;
2541
2542 #[unsafe(method(matchLocalPrefix))]
2544 #[unsafe(method_family = none)]
2545 pub unsafe fn matchLocalPrefix(&self) -> NSUInteger;
2546
2547 #[unsafe(method(matchProtocol))]
2549 #[unsafe(method_family = none)]
2550 pub unsafe fn matchProtocol(&self) -> NENetworkRuleProtocol;
2551
2552 #[unsafe(method(matchDirection))]
2554 #[unsafe(method_family = none)]
2555 pub unsafe fn matchDirection(&self) -> NETrafficDirection;
2556 );
2557}
2558
2559impl NENetworkRule {
2561 extern_methods!(
2562 #[unsafe(method(init))]
2563 #[unsafe(method_family = init)]
2564 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2565
2566 #[unsafe(method(new))]
2567 #[unsafe(method_family = new)]
2568 pub unsafe fn new() -> Retained<Self>;
2569 );
2570}
2571
2572extern_class!(
2573 #[unsafe(super(NSObject))]
2579 #[derive(Debug, PartialEq, Eq, Hash)]
2580 pub struct NEFilterFlow;
2581);
2582
2583unsafe impl NSCoding for NEFilterFlow {}
2584
2585unsafe impl NSCopying for NEFilterFlow {}
2586
2587unsafe impl CopyingHelper for NEFilterFlow {
2588 type Result = Self;
2589}
2590
2591unsafe impl NSObjectProtocol for NEFilterFlow {}
2592
2593unsafe impl NSSecureCoding for NEFilterFlow {}
2594
2595impl NEFilterFlow {
2596 extern_methods!(
2597 #[unsafe(method(URL))]
2599 #[unsafe(method_family = none)]
2600 pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;
2601
2602 #[unsafe(method(sourceAppUniqueIdentifier))]
2604 #[unsafe(method_family = none)]
2605 pub unsafe fn sourceAppUniqueIdentifier(&self) -> Option<Retained<NSData>>;
2606
2607 #[unsafe(method(sourceAppIdentifier))]
2609 #[unsafe(method_family = none)]
2610 pub unsafe fn sourceAppIdentifier(&self) -> Option<Retained<NSString>>;
2611
2612 #[unsafe(method(sourceAppVersion))]
2614 #[unsafe(method_family = none)]
2615 pub unsafe fn sourceAppVersion(&self) -> Option<Retained<NSString>>;
2616
2617 #[unsafe(method(direction))]
2619 #[unsafe(method_family = none)]
2620 pub unsafe fn direction(&self) -> NETrafficDirection;
2621
2622 #[unsafe(method(sourceAppAuditToken))]
2624 #[unsafe(method_family = none)]
2625 pub unsafe fn sourceAppAuditToken(&self) -> Option<Retained<NSData>>;
2626
2627 #[unsafe(method(sourceProcessAuditToken))]
2631 #[unsafe(method_family = none)]
2632 pub unsafe fn sourceProcessAuditToken(&self) -> Option<Retained<NSData>>;
2633
2634 #[unsafe(method(identifier))]
2636 #[unsafe(method_family = none)]
2637 pub unsafe fn identifier(&self) -> Retained<NSUUID>;
2638 );
2639}
2640
2641impl NEFilterFlow {
2643 extern_methods!(
2644 #[unsafe(method(init))]
2645 #[unsafe(method_family = init)]
2646 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2647
2648 #[unsafe(method(new))]
2649 #[unsafe(method_family = new)]
2650 pub unsafe fn new() -> Retained<Self>;
2651 );
2652}
2653
2654extern_class!(
2655 #[unsafe(super(NEFilterFlow, NSObject))]
2661 #[derive(Debug, PartialEq, Eq, Hash)]
2662 pub struct NEFilterBrowserFlow;
2663);
2664
2665unsafe impl NSCoding for NEFilterBrowserFlow {}
2666
2667unsafe impl NSCopying for NEFilterBrowserFlow {}
2668
2669unsafe impl CopyingHelper for NEFilterBrowserFlow {
2670 type Result = Self;
2671}
2672
2673unsafe impl NSObjectProtocol for NEFilterBrowserFlow {}
2674
2675unsafe impl NSSecureCoding for NEFilterBrowserFlow {}
2676
2677impl NEFilterBrowserFlow {
2678 extern_methods!(
2679 #[unsafe(method(request))]
2681 #[unsafe(method_family = none)]
2682 pub unsafe fn request(&self) -> Option<Retained<NSURLRequest>>;
2683
2684 #[unsafe(method(response))]
2686 #[unsafe(method_family = none)]
2687 pub unsafe fn response(&self) -> Option<Retained<NSURLResponse>>;
2688
2689 #[unsafe(method(parentURL))]
2691 #[unsafe(method_family = none)]
2692 pub unsafe fn parentURL(&self) -> Option<Retained<NSURL>>;
2693 );
2694}
2695
2696impl NEFilterBrowserFlow {
2698 extern_methods!(
2699 #[unsafe(method(init))]
2700 #[unsafe(method_family = init)]
2701 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2702
2703 #[unsafe(method(new))]
2704 #[unsafe(method_family = new)]
2705 pub unsafe fn new() -> Retained<Self>;
2706 );
2707}
2708
2709extern_class!(
2710 #[unsafe(super(NEFilterFlow, NSObject))]
2716 #[derive(Debug, PartialEq, Eq, Hash)]
2717 pub struct NEFilterSocketFlow;
2718);
2719
2720unsafe impl NSCoding for NEFilterSocketFlow {}
2721
2722unsafe impl NSCopying for NEFilterSocketFlow {}
2723
2724unsafe impl CopyingHelper for NEFilterSocketFlow {
2725 type Result = Self;
2726}
2727
2728unsafe impl NSObjectProtocol for NEFilterSocketFlow {}
2729
2730unsafe impl NSSecureCoding for NEFilterSocketFlow {}
2731
2732impl NEFilterSocketFlow {
2733 extern_methods!(
2734 #[deprecated]
2737 #[unsafe(method(remoteEndpoint))]
2738 #[unsafe(method_family = none)]
2739 pub unsafe fn remoteEndpoint(&self) -> Option<Retained<NWEndpoint>>;
2740
2741 #[unsafe(method(remoteHostname))]
2743 #[unsafe(method_family = none)]
2744 pub unsafe fn remoteHostname(&self) -> Option<Retained<NSString>>;
2745
2746 #[deprecated]
2749 #[unsafe(method(localEndpoint))]
2750 #[unsafe(method_family = none)]
2751 pub unsafe fn localEndpoint(&self) -> Option<Retained<NWEndpoint>>;
2752
2753 #[unsafe(method(socketFamily))]
2755 #[unsafe(method_family = none)]
2756 pub unsafe fn socketFamily(&self) -> c_int;
2757
2758 #[unsafe(method(socketType))]
2760 #[unsafe(method_family = none)]
2761 pub unsafe fn socketType(&self) -> c_int;
2762
2763 #[unsafe(method(socketProtocol))]
2765 #[unsafe(method_family = none)]
2766 pub unsafe fn socketProtocol(&self) -> c_int;
2767 );
2768}
2769
2770impl NEFilterSocketFlow {
2772 extern_methods!(
2773 #[unsafe(method(init))]
2774 #[unsafe(method_family = init)]
2775 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2776
2777 #[unsafe(method(new))]
2778 #[unsafe(method_family = new)]
2779 pub unsafe fn new() -> Retained<Self>;
2780 );
2781}
2782
2783extern_class!(
2784 #[unsafe(super(NEProvider, NSObject))]
2791 #[derive(Debug, PartialEq, Eq, Hash)]
2792 pub struct NEFilterProvider;
2793);
2794
2795unsafe impl NSObjectProtocol for NEFilterProvider {}
2796
2797impl NEFilterProvider {
2798 extern_methods!(
2799 #[cfg(feature = "block2")]
2800 #[unsafe(method(startFilterWithCompletionHandler:))]
2807 #[unsafe(method_family = none)]
2808 pub unsafe fn startFilterWithCompletionHandler(
2809 &self,
2810 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
2811 );
2812
2813 #[cfg(feature = "block2")]
2814 #[unsafe(method(stopFilterWithReason:completionHandler:))]
2821 #[unsafe(method_family = none)]
2822 pub unsafe fn stopFilterWithReason_completionHandler(
2823 &self,
2824 reason: NEProviderStopReason,
2825 completion_handler: &block2::Block<dyn Fn()>,
2826 );
2827
2828 #[unsafe(method(filterConfiguration))]
2832 #[unsafe(method_family = none)]
2833 pub unsafe fn filterConfiguration(&self) -> Retained<NEFilterProviderConfiguration>;
2834
2835 #[unsafe(method(handleReport:))]
2840 #[unsafe(method_family = none)]
2841 pub unsafe fn handleReport(&self, report: &NEFilterReport);
2842 );
2843}
2844
2845impl NEFilterProvider {
2847 extern_methods!(
2848 #[unsafe(method(init))]
2849 #[unsafe(method_family = init)]
2850 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2851
2852 #[unsafe(method(new))]
2853 #[unsafe(method_family = new)]
2854 pub unsafe fn new() -> Retained<Self>;
2855 );
2856}
2857
2858#[repr(transparent)]
2863#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2864pub struct NEFilterReportFrequency(pub NSInteger);
2865impl NEFilterReportFrequency {
2866 #[doc(alias = "NEFilterReportFrequencyNone")]
2867 pub const None: Self = Self(0);
2868 #[doc(alias = "NEFilterReportFrequencyLow")]
2869 pub const Low: Self = Self(1);
2870 #[doc(alias = "NEFilterReportFrequencyMedium")]
2871 pub const Medium: Self = Self(2);
2872 #[doc(alias = "NEFilterReportFrequencyHigh")]
2873 pub const High: Self = Self(3);
2874}
2875
2876unsafe impl Encode for NEFilterReportFrequency {
2877 const ENCODING: Encoding = NSInteger::ENCODING;
2878}
2879
2880unsafe impl RefEncode for NEFilterReportFrequency {
2881 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2882}
2883
2884extern_class!(
2885 #[unsafe(super(NSObject))]
2892 #[derive(Debug, PartialEq, Eq, Hash)]
2893 pub struct NEFilterVerdict;
2894);
2895
2896unsafe impl NSCoding for NEFilterVerdict {}
2897
2898unsafe impl NSCopying for NEFilterVerdict {}
2899
2900unsafe impl CopyingHelper for NEFilterVerdict {
2901 type Result = Self;
2902}
2903
2904unsafe impl NSObjectProtocol for NEFilterVerdict {}
2905
2906unsafe impl NSSecureCoding for NEFilterVerdict {}
2907
2908impl NEFilterVerdict {
2909 extern_methods!(
2910 #[unsafe(method(shouldReport))]
2919 #[unsafe(method_family = none)]
2920 pub unsafe fn shouldReport(&self) -> bool;
2921
2922 #[unsafe(method(setShouldReport:))]
2924 #[unsafe(method_family = none)]
2925 pub unsafe fn setShouldReport(&self, should_report: bool);
2926 );
2927}
2928
2929impl NEFilterVerdict {
2931 extern_methods!(
2932 #[unsafe(method(init))]
2933 #[unsafe(method_family = init)]
2934 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2935
2936 #[unsafe(method(new))]
2937 #[unsafe(method_family = new)]
2938 pub unsafe fn new() -> Retained<Self>;
2939 );
2940}
2941
2942extern_class!(
2943 #[unsafe(super(NEFilterVerdict, NSObject))]
2950 #[derive(Debug, PartialEq, Eq, Hash)]
2951 pub struct NEFilterNewFlowVerdict;
2952);
2953
2954unsafe impl NSCoding for NEFilterNewFlowVerdict {}
2955
2956unsafe impl NSCopying for NEFilterNewFlowVerdict {}
2957
2958unsafe impl CopyingHelper for NEFilterNewFlowVerdict {
2959 type Result = Self;
2960}
2961
2962unsafe impl NSObjectProtocol for NEFilterNewFlowVerdict {}
2963
2964unsafe impl NSSecureCoding for NEFilterNewFlowVerdict {}
2965
2966impl NEFilterNewFlowVerdict {
2967 extern_methods!(
2968 #[unsafe(method(statisticsReportFrequency))]
2971 #[unsafe(method_family = none)]
2972 pub unsafe fn statisticsReportFrequency(&self) -> NEFilterReportFrequency;
2973
2974 #[unsafe(method(setStatisticsReportFrequency:))]
2976 #[unsafe(method_family = none)]
2977 pub unsafe fn setStatisticsReportFrequency(
2978 &self,
2979 statistics_report_frequency: NEFilterReportFrequency,
2980 );
2981
2982 #[unsafe(method(needRulesVerdict))]
2988 #[unsafe(method_family = none)]
2989 pub unsafe fn needRulesVerdict() -> Retained<NEFilterNewFlowVerdict>;
2990
2991 #[unsafe(method(allowVerdict))]
2995 #[unsafe(method_family = none)]
2996 pub unsafe fn allowVerdict() -> Retained<NEFilterNewFlowVerdict>;
2997
2998 #[unsafe(method(dropVerdict))]
3002 #[unsafe(method_family = none)]
3003 pub unsafe fn dropVerdict() -> Retained<NEFilterNewFlowVerdict>;
3004
3005 #[unsafe(method(remediateVerdictWithRemediationURLMapKey:remediationButtonTextMapKey:))]
3012 #[unsafe(method_family = none)]
3013 pub unsafe fn remediateVerdictWithRemediationURLMapKey_remediationButtonTextMapKey(
3014 remediation_url_map_key: &NSString,
3015 remediation_button_text_map_key: &NSString,
3016 ) -> Retained<NEFilterNewFlowVerdict>;
3017
3018 #[unsafe(method(URLAppendStringVerdictWithMapKey:))]
3024 #[unsafe(method_family = none)]
3025 pub unsafe fn URLAppendStringVerdictWithMapKey(
3026 url_append_map_key: &NSString,
3027 ) -> Retained<NEFilterNewFlowVerdict>;
3028
3029 #[unsafe(method(filterDataVerdictWithFilterInbound:peekInboundBytes:filterOutbound:peekOutboundBytes:))]
3044 #[unsafe(method_family = none)]
3045 pub unsafe fn filterDataVerdictWithFilterInbound_peekInboundBytes_filterOutbound_peekOutboundBytes(
3046 filter_inbound: bool,
3047 peek_inbound_bytes: NSUInteger,
3048 filter_outbound: bool,
3049 peek_outbound_bytes: NSUInteger,
3050 ) -> Retained<NEFilterNewFlowVerdict>;
3051
3052 #[unsafe(method(pauseVerdict))]
3058 #[unsafe(method_family = none)]
3059 pub unsafe fn pauseVerdict() -> Retained<NEFilterNewFlowVerdict>;
3060 );
3061}
3062
3063impl NEFilterNewFlowVerdict {
3065 extern_methods!(
3066 #[unsafe(method(init))]
3067 #[unsafe(method_family = init)]
3068 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3069
3070 #[unsafe(method(new))]
3071 #[unsafe(method_family = new)]
3072 pub unsafe fn new() -> Retained<Self>;
3073 );
3074}
3075
3076extern_class!(
3077 #[unsafe(super(NEFilterNewFlowVerdict, NEFilterVerdict, NSObject))]
3084 #[derive(Debug, PartialEq, Eq, Hash)]
3085 pub struct NEFilterControlVerdict;
3086);
3087
3088unsafe impl NSCoding for NEFilterControlVerdict {}
3089
3090unsafe impl NSCopying for NEFilterControlVerdict {}
3091
3092unsafe impl CopyingHelper for NEFilterControlVerdict {
3093 type Result = Self;
3094}
3095
3096unsafe impl NSObjectProtocol for NEFilterControlVerdict {}
3097
3098unsafe impl NSSecureCoding for NEFilterControlVerdict {}
3099
3100impl NEFilterControlVerdict {
3101 extern_methods!(
3102 #[unsafe(method(allowVerdictWithUpdateRules:))]
3109 #[unsafe(method_family = none)]
3110 pub unsafe fn allowVerdictWithUpdateRules(
3111 update_rules: bool,
3112 ) -> Retained<NEFilterControlVerdict>;
3113
3114 #[unsafe(method(dropVerdictWithUpdateRules:))]
3121 #[unsafe(method_family = none)]
3122 pub unsafe fn dropVerdictWithUpdateRules(
3123 update_rules: bool,
3124 ) -> Retained<NEFilterControlVerdict>;
3125
3126 #[unsafe(method(updateRules))]
3131 #[unsafe(method_family = none)]
3132 pub unsafe fn updateRules() -> Retained<NEFilterControlVerdict>;
3133 );
3134}
3135
3136impl NEFilterControlVerdict {
3138 extern_methods!(
3139 #[unsafe(method(init))]
3140 #[unsafe(method_family = init)]
3141 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3142
3143 #[unsafe(method(new))]
3144 #[unsafe(method_family = new)]
3145 pub unsafe fn new() -> Retained<Self>;
3146 );
3147}
3148
3149#[repr(transparent)]
3155#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3156pub struct NEFilterAction(pub NSInteger);
3157impl NEFilterAction {
3158 #[doc(alias = "NEFilterActionInvalid")]
3159 pub const Invalid: Self = Self(0);
3160 #[doc(alias = "NEFilterActionAllow")]
3161 pub const Allow: Self = Self(1);
3162 #[doc(alias = "NEFilterActionDrop")]
3163 pub const Drop: Self = Self(2);
3164 #[doc(alias = "NEFilterActionRemediate")]
3165 pub const Remediate: Self = Self(3);
3166 #[doc(alias = "NEFilterActionFilterData")]
3167 pub const FilterData: Self = Self(4);
3168}
3169
3170unsafe impl Encode for NEFilterAction {
3171 const ENCODING: Encoding = NSInteger::ENCODING;
3172}
3173
3174unsafe impl RefEncode for NEFilterAction {
3175 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3176}
3177
3178#[repr(transparent)]
3183#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3184pub struct NEFilterReportEvent(pub NSInteger);
3185impl NEFilterReportEvent {
3186 #[doc(alias = "NEFilterReportEventNewFlow")]
3187 pub const NewFlow: Self = Self(1);
3188 #[doc(alias = "NEFilterReportEventDataDecision")]
3189 pub const DataDecision: Self = Self(2);
3190 #[doc(alias = "NEFilterReportEventFlowClosed")]
3191 pub const FlowClosed: Self = Self(3);
3192 #[doc(alias = "NEFilterReportEventStatistics")]
3193 pub const Statistics: Self = Self(4);
3194}
3195
3196unsafe impl Encode for NEFilterReportEvent {
3197 const ENCODING: Encoding = NSInteger::ENCODING;
3198}
3199
3200unsafe impl RefEncode for NEFilterReportEvent {
3201 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3202}
3203
3204extern_class!(
3205 #[unsafe(super(NSObject))]
3212 #[derive(Debug, PartialEq, Eq, Hash)]
3213 pub struct NEFilterReport;
3214);
3215
3216unsafe impl NSCoding for NEFilterReport {}
3217
3218unsafe impl NSCopying for NEFilterReport {}
3219
3220unsafe impl CopyingHelper for NEFilterReport {
3221 type Result = Self;
3222}
3223
3224unsafe impl NSObjectProtocol for NEFilterReport {}
3225
3226unsafe impl NSSecureCoding for NEFilterReport {}
3227
3228impl NEFilterReport {
3229 extern_methods!(
3230 #[unsafe(method(flow))]
3232 #[unsafe(method_family = none)]
3233 pub unsafe fn flow(&self) -> Option<Retained<NEFilterFlow>>;
3234
3235 #[unsafe(method(action))]
3237 #[unsafe(method_family = none)]
3238 pub unsafe fn action(&self) -> NEFilterAction;
3239
3240 #[unsafe(method(event))]
3242 #[unsafe(method_family = none)]
3243 pub unsafe fn event(&self) -> NEFilterReportEvent;
3244
3245 #[unsafe(method(bytesInboundCount))]
3247 #[unsafe(method_family = none)]
3248 pub unsafe fn bytesInboundCount(&self) -> NSUInteger;
3249
3250 #[unsafe(method(bytesOutboundCount))]
3252 #[unsafe(method_family = none)]
3253 pub unsafe fn bytesOutboundCount(&self) -> NSUInteger;
3254 );
3255}
3256
3257impl NEFilterReport {
3259 extern_methods!(
3260 #[unsafe(method(init))]
3261 #[unsafe(method_family = init)]
3262 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3263
3264 #[unsafe(method(new))]
3265 #[unsafe(method_family = new)]
3266 pub unsafe fn new() -> Retained<Self>;
3267 );
3268}
3269
3270extern_class!(
3271 #[unsafe(super(NEFilterProvider, NEProvider, NSObject))]
3275 #[derive(Debug, PartialEq, Eq, Hash)]
3276 pub struct NEFilterControlProvider;
3277);
3278
3279unsafe impl NSObjectProtocol for NEFilterControlProvider {}
3280
3281impl NEFilterControlProvider {
3282 extern_methods!(
3283 #[unsafe(method(remediationMap))]
3305 #[unsafe(method_family = none)]
3306 pub unsafe fn remediationMap(
3307 &self,
3308 ) -> Option<Retained<NSDictionary<NSString, NSDictionary<NSString, NSObject>>>>;
3309
3310 #[unsafe(method(setRemediationMap:))]
3312 #[unsafe(method_family = none)]
3313 pub unsafe fn setRemediationMap(
3314 &self,
3315 remediation_map: Option<&NSDictionary<NSString, NSDictionary<NSString, NSObject>>>,
3316 );
3317
3318 #[unsafe(method(URLAppendStringMap))]
3320 #[unsafe(method_family = none)]
3321 pub unsafe fn URLAppendStringMap(
3322 &self,
3323 ) -> Option<Retained<NSDictionary<NSString, NSString>>>;
3324
3325 #[unsafe(method(setURLAppendStringMap:))]
3327 #[unsafe(method_family = none)]
3328 pub unsafe fn setURLAppendStringMap(
3329 &self,
3330 url_append_string_map: Option<&NSDictionary<NSString, NSString>>,
3331 );
3332
3333 #[cfg(feature = "block2")]
3334 #[unsafe(method(handleRemediationForFlow:completionHandler:))]
3340 #[unsafe(method_family = none)]
3341 pub unsafe fn handleRemediationForFlow_completionHandler(
3342 &self,
3343 flow: &NEFilterFlow,
3344 completion_handler: &block2::Block<dyn Fn(NonNull<NEFilterControlVerdict>)>,
3345 );
3346
3347 #[cfg(feature = "block2")]
3348 #[unsafe(method(handleNewFlow:completionHandler:))]
3354 #[unsafe(method_family = none)]
3355 pub unsafe fn handleNewFlow_completionHandler(
3356 &self,
3357 flow: &NEFilterFlow,
3358 completion_handler: &block2::Block<dyn Fn(NonNull<NEFilterControlVerdict>)>,
3359 );
3360
3361 #[unsafe(method(notifyRulesChanged))]
3363 #[unsafe(method_family = none)]
3364 pub unsafe fn notifyRulesChanged(&self);
3365 );
3366}
3367
3368impl NEFilterControlProvider {
3370 extern_methods!(
3371 #[unsafe(method(init))]
3372 #[unsafe(method_family = init)]
3373 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3374
3375 #[unsafe(method(new))]
3376 #[unsafe(method_family = new)]
3377 pub unsafe fn new() -> Retained<Self>;
3378 );
3379}
3380
3381#[repr(transparent)]
3386#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3387pub struct NEFilterDataAttribute(pub NSInteger);
3388impl NEFilterDataAttribute {
3389 #[doc(alias = "NEFilterDataAttributeHasIPHeader")]
3390 pub const HasIPHeader: Self = Self(0x00000001);
3391}
3392
3393unsafe impl Encode for NEFilterDataAttribute {
3394 const ENCODING: Encoding = NSInteger::ENCODING;
3395}
3396
3397unsafe impl RefEncode for NEFilterDataAttribute {
3398 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3399}
3400
3401extern_class!(
3402 #[unsafe(super(NEFilterProvider, NEProvider, NSObject))]
3406 #[derive(Debug, PartialEq, Eq, Hash)]
3407 pub struct NEFilterDataProvider;
3408);
3409
3410unsafe impl NSObjectProtocol for NEFilterDataProvider {}
3411
3412impl NEFilterDataProvider {
3413 extern_methods!(
3414 #[unsafe(method(handleNewFlow:))]
3420 #[unsafe(method_family = none)]
3421 pub unsafe fn handleNewFlow(&self, flow: &NEFilterFlow)
3422 -> Retained<NEFilterNewFlowVerdict>;
3423
3424 #[unsafe(method(handleInboundDataFromFlow:readBytesStartOffset:readBytes:))]
3434 #[unsafe(method_family = none)]
3435 pub unsafe fn handleInboundDataFromFlow_readBytesStartOffset_readBytes(
3436 &self,
3437 flow: &NEFilterFlow,
3438 offset: NSUInteger,
3439 read_bytes: &NSData,
3440 ) -> Retained<NEFilterDataVerdict>;
3441
3442 #[unsafe(method(handleOutboundDataFromFlow:readBytesStartOffset:readBytes:))]
3452 #[unsafe(method_family = none)]
3453 pub unsafe fn handleOutboundDataFromFlow_readBytesStartOffset_readBytes(
3454 &self,
3455 flow: &NEFilterFlow,
3456 offset: NSUInteger,
3457 read_bytes: &NSData,
3458 ) -> Retained<NEFilterDataVerdict>;
3459
3460 #[unsafe(method(handleInboundDataCompleteForFlow:))]
3466 #[unsafe(method_family = none)]
3467 pub unsafe fn handleInboundDataCompleteForFlow(
3468 &self,
3469 flow: &NEFilterFlow,
3470 ) -> Retained<NEFilterDataVerdict>;
3471
3472 #[unsafe(method(handleOutboundDataCompleteForFlow:))]
3478 #[unsafe(method_family = none)]
3479 pub unsafe fn handleOutboundDataCompleteForFlow(
3480 &self,
3481 flow: &NEFilterFlow,
3482 ) -> Retained<NEFilterDataVerdict>;
3483
3484 #[unsafe(method(handleRemediationForFlow:))]
3490 #[unsafe(method_family = none)]
3491 pub unsafe fn handleRemediationForFlow(
3492 &self,
3493 flow: &NEFilterFlow,
3494 ) -> Retained<NEFilterRemediationVerdict>;
3495
3496 #[unsafe(method(handleRulesChanged))]
3498 #[unsafe(method_family = none)]
3499 pub unsafe fn handleRulesChanged(&self);
3500
3501 #[cfg(feature = "block2")]
3502 #[unsafe(method(applySettings:completionHandler:))]
3509 #[unsafe(method_family = none)]
3510 pub unsafe fn applySettings_completionHandler(
3511 &self,
3512 settings: Option<&NEFilterSettings>,
3513 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
3514 );
3515
3516 #[unsafe(method(resumeFlow:withVerdict:))]
3525 #[unsafe(method_family = none)]
3526 pub unsafe fn resumeFlow_withVerdict(&self, flow: &NEFilterFlow, verdict: &NEFilterVerdict);
3527
3528 #[unsafe(method(updateFlow:usingVerdict:forDirection:))]
3536 #[unsafe(method_family = none)]
3537 pub unsafe fn updateFlow_usingVerdict_forDirection(
3538 &self,
3539 flow: &NEFilterSocketFlow,
3540 verdict: &NEFilterDataVerdict,
3541 direction: NETrafficDirection,
3542 );
3543 );
3544}
3545
3546impl NEFilterDataProvider {
3548 extern_methods!(
3549 #[unsafe(method(init))]
3550 #[unsafe(method_family = init)]
3551 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3552
3553 #[unsafe(method(new))]
3554 #[unsafe(method_family = new)]
3555 pub unsafe fn new() -> Retained<Self>;
3556 );
3557}
3558
3559extern_class!(
3560 #[unsafe(super(NEFilterVerdict, NSObject))]
3566 #[derive(Debug, PartialEq, Eq, Hash)]
3567 pub struct NEFilterDataVerdict;
3568);
3569
3570unsafe impl NSCoding for NEFilterDataVerdict {}
3571
3572unsafe impl NSCopying for NEFilterDataVerdict {}
3573
3574unsafe impl CopyingHelper for NEFilterDataVerdict {
3575 type Result = Self;
3576}
3577
3578unsafe impl NSObjectProtocol for NEFilterDataVerdict {}
3579
3580unsafe impl NSSecureCoding for NEFilterDataVerdict {}
3581
3582impl NEFilterDataVerdict {
3583 extern_methods!(
3584 #[unsafe(method(statisticsReportFrequency))]
3587 #[unsafe(method_family = none)]
3588 pub unsafe fn statisticsReportFrequency(&self) -> NEFilterReportFrequency;
3589
3590 #[unsafe(method(setStatisticsReportFrequency:))]
3592 #[unsafe(method_family = none)]
3593 pub unsafe fn setStatisticsReportFrequency(
3594 &self,
3595 statistics_report_frequency: NEFilterReportFrequency,
3596 );
3597
3598 #[unsafe(method(allowVerdict))]
3602 #[unsafe(method_family = none)]
3603 pub unsafe fn allowVerdict() -> Retained<NEFilterDataVerdict>;
3604
3605 #[unsafe(method(dropVerdict))]
3609 #[unsafe(method_family = none)]
3610 pub unsafe fn dropVerdict() -> Retained<NEFilterDataVerdict>;
3611
3612 #[unsafe(method(remediateVerdictWithRemediationURLMapKey:remediationButtonTextMapKey:))]
3620 #[unsafe(method_family = none)]
3621 pub unsafe fn remediateVerdictWithRemediationURLMapKey_remediationButtonTextMapKey(
3622 remediation_url_map_key: Option<&NSString>,
3623 remediation_button_text_map_key: Option<&NSString>,
3624 ) -> Retained<NEFilterDataVerdict>;
3625
3626 #[unsafe(method(dataVerdictWithPassBytes:peekBytes:))]
3634 #[unsafe(method_family = none)]
3635 pub unsafe fn dataVerdictWithPassBytes_peekBytes(
3636 pass_bytes: NSUInteger,
3637 peek_bytes: NSUInteger,
3638 ) -> Retained<NEFilterDataVerdict>;
3639
3640 #[unsafe(method(needRulesVerdict))]
3644 #[unsafe(method_family = none)]
3645 pub unsafe fn needRulesVerdict() -> Retained<NEFilterDataVerdict>;
3646
3647 #[unsafe(method(pauseVerdict))]
3653 #[unsafe(method_family = none)]
3654 pub unsafe fn pauseVerdict() -> Retained<NEFilterDataVerdict>;
3655 );
3656}
3657
3658impl NEFilterDataVerdict {
3660 extern_methods!(
3661 #[unsafe(method(init))]
3662 #[unsafe(method_family = init)]
3663 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3664
3665 #[unsafe(method(new))]
3666 #[unsafe(method_family = new)]
3667 pub unsafe fn new() -> Retained<Self>;
3668 );
3669}
3670
3671extern_class!(
3672 #[unsafe(super(NEFilterVerdict, NSObject))]
3678 #[derive(Debug, PartialEq, Eq, Hash)]
3679 pub struct NEFilterRemediationVerdict;
3680);
3681
3682unsafe impl NSCoding for NEFilterRemediationVerdict {}
3683
3684unsafe impl NSCopying for NEFilterRemediationVerdict {}
3685
3686unsafe impl CopyingHelper for NEFilterRemediationVerdict {
3687 type Result = Self;
3688}
3689
3690unsafe impl NSObjectProtocol for NEFilterRemediationVerdict {}
3691
3692unsafe impl NSSecureCoding for NEFilterRemediationVerdict {}
3693
3694impl NEFilterRemediationVerdict {
3695 extern_methods!(
3696 #[unsafe(method(allowVerdict))]
3700 #[unsafe(method_family = none)]
3701 pub unsafe fn allowVerdict() -> Retained<NEFilterRemediationVerdict>;
3702
3703 #[unsafe(method(dropVerdict))]
3707 #[unsafe(method_family = none)]
3708 pub unsafe fn dropVerdict() -> Retained<NEFilterRemediationVerdict>;
3709
3710 #[unsafe(method(needRulesVerdict))]
3714 #[unsafe(method_family = none)]
3715 pub unsafe fn needRulesVerdict() -> Retained<NEFilterRemediationVerdict>;
3716 );
3717}
3718
3719impl NEFilterRemediationVerdict {
3721 extern_methods!(
3722 #[unsafe(method(init))]
3723 #[unsafe(method_family = init)]
3724 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3725
3726 #[unsafe(method(new))]
3727 #[unsafe(method_family = new)]
3728 pub unsafe fn new() -> Retained<Self>;
3729 );
3730}
3731
3732#[repr(transparent)]
3737#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3738pub struct NEFilterManagerError(pub NSInteger);
3739impl NEFilterManagerError {
3740 #[doc(alias = "NEFilterManagerErrorConfigurationInvalid")]
3741 pub const ConfigurationInvalid: Self = Self(1);
3742 #[doc(alias = "NEFilterManagerErrorConfigurationDisabled")]
3743 pub const ConfigurationDisabled: Self = Self(2);
3744 #[doc(alias = "NEFilterManagerErrorConfigurationStale")]
3745 pub const ConfigurationStale: Self = Self(3);
3746 #[doc(alias = "NEFilterManagerErrorConfigurationCannotBeRemoved")]
3747 pub const ConfigurationCannotBeRemoved: Self = Self(4);
3748 #[doc(alias = "NEFilterManagerErrorConfigurationPermissionDenied")]
3749 pub const ConfigurationPermissionDenied: Self = Self(5);
3750 #[doc(alias = "NEFilterManagerErrorConfigurationInternalError")]
3751 pub const ConfigurationInternalError: Self = Self(6);
3752}
3753
3754unsafe impl Encode for NEFilterManagerError {
3755 const ENCODING: Encoding = NSInteger::ENCODING;
3756}
3757
3758unsafe impl RefEncode for NEFilterManagerError {
3759 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3760}
3761
3762extern "C" {
3763 pub static NEFilterErrorDomain: &'static NSString;
3765}
3766
3767extern "C" {
3768 pub static NEFilterConfigurationDidChangeNotification: &'static NSString;
3770}
3771
3772#[repr(transparent)]
3777#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3778pub struct NEFilterManagerGrade(pub NSInteger);
3779impl NEFilterManagerGrade {
3780 #[doc(alias = "NEFilterManagerGradeFirewall")]
3781 pub const Firewall: Self = Self(1);
3782 #[doc(alias = "NEFilterManagerGradeInspector")]
3783 pub const Inspector: Self = Self(2);
3784}
3785
3786unsafe impl Encode for NEFilterManagerGrade {
3787 const ENCODING: Encoding = NSInteger::ENCODING;
3788}
3789
3790unsafe impl RefEncode for NEFilterManagerGrade {
3791 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3792}
3793
3794extern_class!(
3795 #[unsafe(super(NSObject))]
3803 #[derive(Debug, PartialEq, Eq, Hash)]
3804 pub struct NEFilterManager;
3805);
3806
3807unsafe impl NSObjectProtocol for NEFilterManager {}
3808
3809impl NEFilterManager {
3810 extern_methods!(
3811 #[unsafe(method(sharedManager))]
3813 #[unsafe(method_family = none)]
3814 pub unsafe fn sharedManager() -> Retained<NEFilterManager>;
3815
3816 #[cfg(feature = "block2")]
3817 #[unsafe(method(loadFromPreferencesWithCompletionHandler:))]
3821 #[unsafe(method_family = none)]
3822 pub unsafe fn loadFromPreferencesWithCompletionHandler(
3823 &self,
3824 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
3825 );
3826
3827 #[cfg(feature = "block2")]
3828 #[unsafe(method(removeFromPreferencesWithCompletionHandler:))]
3832 #[unsafe(method_family = none)]
3833 pub unsafe fn removeFromPreferencesWithCompletionHandler(
3834 &self,
3835 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
3836 );
3837
3838 #[cfg(feature = "block2")]
3839 #[unsafe(method(saveToPreferencesWithCompletionHandler:))]
3843 #[unsafe(method_family = none)]
3844 pub unsafe fn saveToPreferencesWithCompletionHandler(
3845 &self,
3846 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
3847 );
3848
3849 #[unsafe(method(localizedDescription))]
3851 #[unsafe(method_family = none)]
3852 pub unsafe fn localizedDescription(&self) -> Option<Retained<NSString>>;
3853
3854 #[unsafe(method(setLocalizedDescription:))]
3856 #[unsafe(method_family = none)]
3857 pub unsafe fn setLocalizedDescription(&self, localized_description: Option<&NSString>);
3858
3859 #[unsafe(method(providerConfiguration))]
3861 #[unsafe(method_family = none)]
3862 pub unsafe fn providerConfiguration(
3863 &self,
3864 ) -> Option<Retained<NEFilterProviderConfiguration>>;
3865
3866 #[unsafe(method(setProviderConfiguration:))]
3868 #[unsafe(method_family = none)]
3869 pub unsafe fn setProviderConfiguration(
3870 &self,
3871 provider_configuration: Option<&NEFilterProviderConfiguration>,
3872 );
3873
3874 #[unsafe(method(isEnabled))]
3877 #[unsafe(method_family = none)]
3878 pub unsafe fn isEnabled(&self) -> bool;
3879
3880 #[unsafe(method(setEnabled:))]
3882 #[unsafe(method_family = none)]
3883 pub unsafe fn setEnabled(&self, enabled: bool);
3884
3885 #[unsafe(method(grade))]
3887 #[unsafe(method_family = none)]
3888 pub unsafe fn grade(&self) -> NEFilterManagerGrade;
3889
3890 #[unsafe(method(setGrade:))]
3892 #[unsafe(method_family = none)]
3893 pub unsafe fn setGrade(&self, grade: NEFilterManagerGrade);
3894
3895 #[unsafe(method(disableEncryptedDNSSettings))]
3898 #[unsafe(method_family = none)]
3899 pub unsafe fn disableEncryptedDNSSettings(&self) -> bool;
3900
3901 #[unsafe(method(setDisableEncryptedDNSSettings:))]
3903 #[unsafe(method_family = none)]
3904 pub unsafe fn setDisableEncryptedDNSSettings(&self, disable_encrypted_dns_settings: bool);
3905 );
3906}
3907
3908impl NEFilterManager {
3910 extern_methods!(
3911 #[unsafe(method(init))]
3912 #[unsafe(method_family = init)]
3913 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3914
3915 #[unsafe(method(new))]
3916 #[unsafe(method_family = new)]
3917 pub unsafe fn new() -> Retained<Self>;
3918 );
3919}
3920
3921extern_class!(
3922 #[unsafe(super(NSObject))]
3926 #[derive(Debug, PartialEq, Eq, Hash)]
3927 pub struct NEFilterPacketContext;
3928);
3929
3930unsafe impl NSObjectProtocol for NEFilterPacketContext {}
3931
3932impl NEFilterPacketContext {
3933 extern_methods!();
3934}
3935
3936impl NEFilterPacketContext {
3938 extern_methods!(
3939 #[unsafe(method(init))]
3940 #[unsafe(method_family = init)]
3941 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3942
3943 #[unsafe(method(new))]
3944 #[unsafe(method_family = new)]
3945 pub unsafe fn new() -> Retained<Self>;
3946 );
3947}
3948
3949#[repr(transparent)]
3954#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3955pub struct NEFilterPacketProviderVerdict(pub NSInteger);
3956impl NEFilterPacketProviderVerdict {
3957 #[doc(alias = "NEFilterPacketProviderVerdictAllow")]
3958 pub const Allow: Self = Self(0);
3959 #[doc(alias = "NEFilterPacketProviderVerdictDrop")]
3960 pub const Drop: Self = Self(1);
3961 #[doc(alias = "NEFilterPacketProviderVerdictDelay")]
3962 pub const Delay: Self = Self(2);
3963}
3964
3965unsafe impl Encode for NEFilterPacketProviderVerdict {
3966 const ENCODING: Encoding = NSInteger::ENCODING;
3967}
3968
3969unsafe impl RefEncode for NEFilterPacketProviderVerdict {
3970 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3971}
3972
3973extern_class!(
3974 #[unsafe(super(NEFilterProvider, NEProvider, NSObject))]
3978 #[derive(Debug, PartialEq, Eq, Hash)]
3979 pub struct NEFilterPacketProvider;
3980);
3981
3982unsafe impl NSObjectProtocol for NEFilterPacketProvider {}
3983
3984impl NEFilterPacketProvider {
3985 extern_methods!(
3986 #[unsafe(method(delayCurrentPacket:))]
3995 #[unsafe(method_family = none)]
3996 pub unsafe fn delayCurrentPacket(
3997 &self,
3998 context: &NEFilterPacketContext,
3999 ) -> Retained<NEPacket>;
4000
4001 #[unsafe(method(allowPacket:))]
4005 #[unsafe(method_family = none)]
4006 pub unsafe fn allowPacket(&self, packet: &NEPacket);
4007 );
4008}
4009
4010impl NEFilterPacketProvider {
4012 extern_methods!(
4013 #[unsafe(method(init))]
4014 #[unsafe(method_family = init)]
4015 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4016
4017 #[unsafe(method(new))]
4018 #[unsafe(method_family = new)]
4019 pub unsafe fn new() -> Retained<Self>;
4020 );
4021}
4022
4023extern_class!(
4024 #[unsafe(super(NSObject))]
4028 #[derive(Debug, PartialEq, Eq, Hash)]
4029 pub struct NEFilterProviderConfiguration;
4030);
4031
4032unsafe impl NSCoding for NEFilterProviderConfiguration {}
4033
4034unsafe impl NSCopying for NEFilterProviderConfiguration {}
4035
4036unsafe impl CopyingHelper for NEFilterProviderConfiguration {
4037 type Result = Self;
4038}
4039
4040unsafe impl NSObjectProtocol for NEFilterProviderConfiguration {}
4041
4042unsafe impl NSSecureCoding for NEFilterProviderConfiguration {}
4043
4044impl NEFilterProviderConfiguration {
4045 extern_methods!(
4046 #[deprecated = "filterBrowsers is not supported on macOS"]
4048 #[unsafe(method(filterBrowsers))]
4049 #[unsafe(method_family = none)]
4050 pub unsafe fn filterBrowsers(&self) -> bool;
4051
4052 #[deprecated = "filterBrowsers is not supported on macOS"]
4054 #[unsafe(method(setFilterBrowsers:))]
4055 #[unsafe(method_family = none)]
4056 pub unsafe fn setFilterBrowsers(&self, filter_browsers: bool);
4057
4058 #[unsafe(method(filterSockets))]
4060 #[unsafe(method_family = none)]
4061 pub unsafe fn filterSockets(&self) -> bool;
4062
4063 #[unsafe(method(setFilterSockets:))]
4065 #[unsafe(method_family = none)]
4066 pub unsafe fn setFilterSockets(&self, filter_sockets: bool);
4067
4068 #[unsafe(method(filterPackets))]
4070 #[unsafe(method_family = none)]
4071 pub unsafe fn filterPackets(&self) -> bool;
4072
4073 #[unsafe(method(setFilterPackets:))]
4075 #[unsafe(method_family = none)]
4076 pub unsafe fn setFilterPackets(&self, filter_packets: bool);
4077
4078 #[unsafe(method(vendorConfiguration))]
4080 #[unsafe(method_family = none)]
4081 pub unsafe fn vendorConfiguration(
4082 &self,
4083 ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
4084
4085 #[unsafe(method(setVendorConfiguration:))]
4087 #[unsafe(method_family = none)]
4088 pub unsafe fn setVendorConfiguration(
4089 &self,
4090 vendor_configuration: Option<&NSDictionary<NSString, AnyObject>>,
4091 );
4092
4093 #[unsafe(method(serverAddress))]
4095 #[unsafe(method_family = none)]
4096 pub unsafe fn serverAddress(&self) -> Option<Retained<NSString>>;
4097
4098 #[unsafe(method(setServerAddress:))]
4100 #[unsafe(method_family = none)]
4101 pub unsafe fn setServerAddress(&self, server_address: Option<&NSString>);
4102
4103 #[unsafe(method(username))]
4105 #[unsafe(method_family = none)]
4106 pub unsafe fn username(&self) -> Option<Retained<NSString>>;
4107
4108 #[unsafe(method(setUsername:))]
4110 #[unsafe(method_family = none)]
4111 pub unsafe fn setUsername(&self, username: Option<&NSString>);
4112
4113 #[unsafe(method(organization))]
4115 #[unsafe(method_family = none)]
4116 pub unsafe fn organization(&self) -> Option<Retained<NSString>>;
4117
4118 #[unsafe(method(setOrganization:))]
4120 #[unsafe(method_family = none)]
4121 pub unsafe fn setOrganization(&self, organization: Option<&NSString>);
4122
4123 #[unsafe(method(passwordReference))]
4125 #[unsafe(method_family = none)]
4126 pub unsafe fn passwordReference(&self) -> Option<Retained<NSData>>;
4127
4128 #[unsafe(method(setPasswordReference:))]
4130 #[unsafe(method_family = none)]
4131 pub unsafe fn setPasswordReference(&self, password_reference: Option<&NSData>);
4132
4133 #[unsafe(method(identityReference))]
4135 #[unsafe(method_family = none)]
4136 pub unsafe fn identityReference(&self) -> Option<Retained<NSData>>;
4137
4138 #[unsafe(method(setIdentityReference:))]
4140 #[unsafe(method_family = none)]
4141 pub unsafe fn setIdentityReference(&self, identity_reference: Option<&NSData>);
4142
4143 #[unsafe(method(filterDataProviderBundleIdentifier))]
4148 #[unsafe(method_family = none)]
4149 pub unsafe fn filterDataProviderBundleIdentifier(&self) -> Option<Retained<NSString>>;
4150
4151 #[unsafe(method(setFilterDataProviderBundleIdentifier:))]
4153 #[unsafe(method_family = none)]
4154 pub unsafe fn setFilterDataProviderBundleIdentifier(
4155 &self,
4156 filter_data_provider_bundle_identifier: Option<&NSString>,
4157 );
4158
4159 #[unsafe(method(filterPacketProviderBundleIdentifier))]
4164 #[unsafe(method_family = none)]
4165 pub unsafe fn filterPacketProviderBundleIdentifier(&self) -> Option<Retained<NSString>>;
4166
4167 #[unsafe(method(setFilterPacketProviderBundleIdentifier:))]
4169 #[unsafe(method_family = none)]
4170 pub unsafe fn setFilterPacketProviderBundleIdentifier(
4171 &self,
4172 filter_packet_provider_bundle_identifier: Option<&NSString>,
4173 );
4174 );
4175}
4176
4177impl NEFilterProviderConfiguration {
4179 extern_methods!(
4180 #[unsafe(method(init))]
4181 #[unsafe(method_family = init)]
4182 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4183
4184 #[unsafe(method(new))]
4185 #[unsafe(method_family = new)]
4186 pub unsafe fn new() -> Retained<Self>;
4187 );
4188}
4189
4190extern_class!(
4191 #[unsafe(super(NSObject))]
4195 #[derive(Debug, PartialEq, Eq, Hash)]
4196 pub struct NEFilterRule;
4197);
4198
4199unsafe impl NSCoding for NEFilterRule {}
4200
4201unsafe impl NSCopying for NEFilterRule {}
4202
4203unsafe impl CopyingHelper for NEFilterRule {
4204 type Result = Self;
4205}
4206
4207unsafe impl NSObjectProtocol for NEFilterRule {}
4208
4209unsafe impl NSSecureCoding for NEFilterRule {}
4210
4211impl NEFilterRule {
4212 extern_methods!(
4213 #[unsafe(method(initWithNetworkRule:action:))]
4219 #[unsafe(method_family = init)]
4220 pub unsafe fn initWithNetworkRule_action(
4221 this: Allocated<Self>,
4222 network_rule: &NENetworkRule,
4223 action: NEFilterAction,
4224 ) -> Retained<Self>;
4225
4226 #[unsafe(method(networkRule))]
4228 #[unsafe(method_family = none)]
4229 pub unsafe fn networkRule(&self) -> Retained<NENetworkRule>;
4230
4231 #[unsafe(method(action))]
4233 #[unsafe(method_family = none)]
4234 pub unsafe fn action(&self) -> NEFilterAction;
4235 );
4236}
4237
4238impl NEFilterRule {
4240 extern_methods!(
4241 #[unsafe(method(init))]
4242 #[unsafe(method_family = init)]
4243 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4244
4245 #[unsafe(method(new))]
4246 #[unsafe(method_family = new)]
4247 pub unsafe fn new() -> Retained<Self>;
4248 );
4249}
4250
4251extern_class!(
4252 #[unsafe(super(NSObject))]
4258 #[derive(Debug, PartialEq, Eq, Hash)]
4259 pub struct NEFilterSettings;
4260);
4261
4262unsafe impl NSCoding for NEFilterSettings {}
4263
4264unsafe impl NSCopying for NEFilterSettings {}
4265
4266unsafe impl CopyingHelper for NEFilterSettings {
4267 type Result = Self;
4268}
4269
4270unsafe impl NSObjectProtocol for NEFilterSettings {}
4271
4272unsafe impl NSSecureCoding for NEFilterSettings {}
4273
4274impl NEFilterSettings {
4275 extern_methods!(
4276 #[unsafe(method(initWithRules:defaultAction:))]
4288 #[unsafe(method_family = init)]
4289 pub unsafe fn initWithRules_defaultAction(
4290 this: Allocated<Self>,
4291 rules: &NSArray<NEFilterRule>,
4292 default_action: NEFilterAction,
4293 ) -> Retained<Self>;
4294
4295 #[unsafe(method(rules))]
4301 #[unsafe(method_family = none)]
4302 pub unsafe fn rules(&self) -> Retained<NSArray<NEFilterRule>>;
4303
4304 #[unsafe(method(defaultAction))]
4306 #[unsafe(method_family = none)]
4307 pub unsafe fn defaultAction(&self) -> NEFilterAction;
4308 );
4309}
4310
4311impl NEFilterSettings {
4313 extern_methods!(
4314 #[unsafe(method(init))]
4315 #[unsafe(method_family = init)]
4316 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4317
4318 #[unsafe(method(new))]
4319 #[unsafe(method_family = new)]
4320 pub unsafe fn new() -> Retained<Self>;
4321 );
4322}
4323
4324extern_class!(
4325 #[unsafe(super(NSObject))]
4329 #[derive(Debug, PartialEq, Eq, Hash)]
4330 pub struct NEFlowMetaData;
4331);
4332
4333unsafe impl NSCoding for NEFlowMetaData {}
4334
4335unsafe impl NSCopying for NEFlowMetaData {}
4336
4337unsafe impl CopyingHelper for NEFlowMetaData {
4338 type Result = Self;
4339}
4340
4341unsafe impl NSObjectProtocol for NEFlowMetaData {}
4342
4343unsafe impl NSSecureCoding for NEFlowMetaData {}
4344
4345impl NEFlowMetaData {
4346 extern_methods!(
4347 #[unsafe(method(sourceAppUniqueIdentifier))]
4349 #[unsafe(method_family = none)]
4350 pub unsafe fn sourceAppUniqueIdentifier(&self) -> Retained<NSData>;
4351
4352 #[unsafe(method(sourceAppSigningIdentifier))]
4354 #[unsafe(method_family = none)]
4355 pub unsafe fn sourceAppSigningIdentifier(&self) -> Retained<NSString>;
4356
4357 #[unsafe(method(sourceAppAuditToken))]
4359 #[unsafe(method_family = none)]
4360 pub unsafe fn sourceAppAuditToken(&self) -> Option<Retained<NSData>>;
4361
4362 #[unsafe(method(filterFlowIdentifier))]
4364 #[unsafe(method_family = none)]
4365 pub unsafe fn filterFlowIdentifier(&self) -> Option<Retained<NSUUID>>;
4366 );
4367}
4368
4369impl NEFlowMetaData {
4371 extern_methods!(
4372 #[unsafe(method(init))]
4373 #[unsafe(method_family = init)]
4374 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4375
4376 #[unsafe(method(new))]
4377 #[unsafe(method_family = new)]
4378 pub unsafe fn new() -> Retained<Self>;
4379 );
4380}
4381
4382#[repr(transparent)]
4387#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4388pub struct NEHotspotNetworkSecurityType(pub NSInteger);
4389impl NEHotspotNetworkSecurityType {
4390 #[doc(alias = "NEHotspotNetworkSecurityTypeOpen")]
4391 pub const Open: Self = Self(0);
4392 #[doc(alias = "NEHotspotNetworkSecurityTypeWEP")]
4393 pub const WEP: Self = Self(1);
4394 #[doc(alias = "NEHotspotNetworkSecurityTypePersonal")]
4395 pub const Personal: Self = Self(2);
4396 #[doc(alias = "NEHotspotNetworkSecurityTypeEnterprise")]
4397 pub const Enterprise: Self = Self(3);
4398 #[doc(alias = "NEHotspotNetworkSecurityTypeUnknown")]
4399 pub const Unknown: Self = Self(4);
4400}
4401
4402unsafe impl Encode for NEHotspotNetworkSecurityType {
4403 const ENCODING: Encoding = NSInteger::ENCODING;
4404}
4405
4406unsafe impl RefEncode for NEHotspotNetworkSecurityType {
4407 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4408}
4409
4410extern_class!(
4411 #[unsafe(super(NSObject))]
4418 #[derive(Debug, PartialEq, Eq, Hash)]
4419 pub struct NEHotspotNetwork;
4420);
4421
4422unsafe impl NSObjectProtocol for NEHotspotNetwork {}
4423
4424impl NEHotspotNetwork {
4425 extern_methods!(
4426 #[unsafe(method(SSID))]
4428 #[unsafe(method_family = none)]
4429 pub unsafe fn SSID(&self) -> Retained<NSString>;
4430
4431 #[unsafe(method(BSSID))]
4433 #[unsafe(method_family = none)]
4434 pub unsafe fn BSSID(&self) -> Retained<NSString>;
4435
4436 #[unsafe(method(securityType))]
4438 #[unsafe(method_family = none)]
4439 pub unsafe fn securityType(&self) -> NEHotspotNetworkSecurityType;
4440
4441 #[cfg(feature = "block2")]
4442 #[unsafe(method(fetchCurrentWithCompletionHandler:))]
4457 #[unsafe(method_family = none)]
4458 pub unsafe fn fetchCurrentWithCompletionHandler(
4459 completion_handler: &block2::Block<dyn Fn(*mut NEHotspotNetwork)>,
4460 );
4461 );
4462}
4463
4464impl NEHotspotNetwork {
4466 extern_methods!(
4467 #[unsafe(method(init))]
4468 #[unsafe(method_family = init)]
4469 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4470
4471 #[unsafe(method(new))]
4472 #[unsafe(method_family = new)]
4473 pub unsafe fn new() -> Retained<Self>;
4474 );
4475}
4476
4477#[repr(transparent)]
4482#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4483pub struct NEHotspotHelperCommandType(pub NSInteger);
4484impl NEHotspotHelperCommandType {
4485 #[doc(alias = "kNEHotspotHelperCommandTypeNone")]
4486 pub const None: Self = Self(0);
4487 #[doc(alias = "kNEHotspotHelperCommandTypeFilterScanList")]
4488 pub const FilterScanList: Self = Self(1);
4489 #[doc(alias = "kNEHotspotHelperCommandTypeEvaluate")]
4490 pub const Evaluate: Self = Self(2);
4491 #[doc(alias = "kNEHotspotHelperCommandTypeAuthenticate")]
4492 pub const Authenticate: Self = Self(3);
4493 #[doc(alias = "kNEHotspotHelperCommandTypePresentUI")]
4494 pub const PresentUI: Self = Self(4);
4495 #[doc(alias = "kNEHotspotHelperCommandTypeMaintain")]
4496 pub const Maintain: Self = Self(5);
4497 #[doc(alias = "kNEHotspotHelperCommandTypeLogoff")]
4498 pub const Logoff: Self = Self(6);
4499}
4500
4501unsafe impl Encode for NEHotspotHelperCommandType {
4502 const ENCODING: Encoding = NSInteger::ENCODING;
4503}
4504
4505unsafe impl RefEncode for NEHotspotHelperCommandType {
4506 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4507}
4508
4509#[repr(transparent)]
4538#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4539pub struct NEHotspotHelperResult(pub NSInteger);
4540impl NEHotspotHelperResult {
4541 #[doc(alias = "kNEHotspotHelperResultSuccess")]
4542 pub const Success: Self = Self(0);
4543 #[doc(alias = "kNEHotspotHelperResultFailure")]
4544 pub const Failure: Self = Self(1);
4545 #[doc(alias = "kNEHotspotHelperResultUIRequired")]
4546 pub const UIRequired: Self = Self(2);
4547 #[doc(alias = "kNEHotspotHelperResultCommandNotRecognized")]
4548 pub const CommandNotRecognized: Self = Self(3);
4549 #[doc(alias = "kNEHotspotHelperResultAuthenticationRequired")]
4550 pub const AuthenticationRequired: Self = Self(4);
4551 #[doc(alias = "kNEHotspotHelperResultUnsupportedNetwork")]
4552 pub const UnsupportedNetwork: Self = Self(5);
4553 #[doc(alias = "kNEHotspotHelperResultTemporaryFailure")]
4554 pub const TemporaryFailure: Self = Self(6);
4555}
4556
4557unsafe impl Encode for NEHotspotHelperResult {
4558 const ENCODING: Encoding = NSInteger::ENCODING;
4559}
4560
4561unsafe impl RefEncode for NEHotspotHelperResult {
4562 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4563}
4564
4565#[repr(transparent)]
4579#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4580pub struct NEHotspotHelperConfidence(pub NSInteger);
4581impl NEHotspotHelperConfidence {
4582 #[doc(alias = "kNEHotspotHelperConfidenceNone")]
4583 pub const None: Self = Self(0);
4584 #[doc(alias = "kNEHotspotHelperConfidenceLow")]
4585 pub const Low: Self = Self(1);
4586 #[doc(alias = "kNEHotspotHelperConfidenceHigh")]
4587 pub const High: Self = Self(2);
4588}
4589
4590unsafe impl Encode for NEHotspotHelperConfidence {
4591 const ENCODING: Encoding = NSInteger::ENCODING;
4592}
4593
4594unsafe impl RefEncode for NEHotspotHelperConfidence {
4595 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4596}
4597
4598impl NEHotspotNetwork {
4604 extern_methods!(
4605 #[unsafe(method(signalStrength))]
4608 #[unsafe(method_family = none)]
4609 pub unsafe fn signalStrength(&self) -> c_double;
4610
4611 #[unsafe(method(isSecure))]
4613 #[unsafe(method_family = none)]
4614 pub unsafe fn isSecure(&self) -> bool;
4615
4616 #[unsafe(method(didAutoJoin))]
4619 #[unsafe(method_family = none)]
4620 pub unsafe fn didAutoJoin(&self) -> bool;
4621
4622 #[unsafe(method(didJustJoin))]
4626 #[unsafe(method_family = none)]
4627 pub unsafe fn didJustJoin(&self) -> bool;
4628
4629 #[unsafe(method(isChosenHelper))]
4635 #[unsafe(method_family = none)]
4636 pub unsafe fn isChosenHelper(&self) -> bool;
4637
4638 #[unsafe(method(setConfidence:))]
4645 #[unsafe(method_family = none)]
4646 pub unsafe fn setConfidence(&self, confidence: NEHotspotHelperConfidence);
4647
4648 #[unsafe(method(setPassword:))]
4657 #[unsafe(method_family = none)]
4658 pub unsafe fn setPassword(&self, password: &NSString);
4659 );
4660}
4661
4662extern_class!(
4663 #[unsafe(super(NSObject))]
4671 #[derive(Debug, PartialEq, Eq, Hash)]
4672 pub struct NEHotspotHelperCommand;
4673);
4674
4675unsafe impl NSObjectProtocol for NEHotspotHelperCommand {}
4676
4677impl NEHotspotHelperCommand {
4678 extern_methods!(
4679 #[unsafe(method(commandType))]
4681 #[unsafe(method_family = none)]
4682 pub unsafe fn commandType(&self) -> NEHotspotHelperCommandType;
4683
4684 #[unsafe(method(network))]
4686 #[unsafe(method_family = none)]
4687 pub unsafe fn network(&self) -> Option<Retained<NEHotspotNetwork>>;
4688
4689 #[unsafe(method(networkList))]
4693 #[unsafe(method_family = none)]
4694 pub unsafe fn networkList(&self) -> Option<Retained<NSArray<NEHotspotNetwork>>>;
4695
4696 #[unsafe(method(createResponse:))]
4702 #[unsafe(method_family = none)]
4703 pub unsafe fn createResponse(
4704 &self,
4705 result: NEHotspotHelperResult,
4706 ) -> Retained<NEHotspotHelperResponse>;
4707
4708 #[deprecated = "Use the `interface` property with `nw_parameters_require_interface`"]
4715 #[unsafe(method(createTCPConnection:))]
4716 #[unsafe(method_family = none)]
4717 pub unsafe fn createTCPConnection(
4718 &self,
4719 endpoint: &NWEndpoint,
4720 ) -> Retained<NWTCPConnection>;
4721
4722 #[deprecated = "Use the `interface` property with `nw_parameters_require_interface`"]
4729 #[unsafe(method(createUDPSession:))]
4730 #[unsafe(method_family = none)]
4731 pub unsafe fn createUDPSession(&self, endpoint: &NWEndpoint) -> Retained<NWUDPSession>;
4732 );
4733}
4734
4735impl NEHotspotHelperCommand {
4737 extern_methods!(
4738 #[unsafe(method(init))]
4739 #[unsafe(method_family = init)]
4740 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4741
4742 #[unsafe(method(new))]
4743 #[unsafe(method_family = new)]
4744 pub unsafe fn new() -> Retained<Self>;
4745 );
4746}
4747
4748extern_class!(
4749 #[unsafe(super(NSObject))]
4754 #[derive(Debug, PartialEq, Eq, Hash)]
4755 pub struct NEHotspotHelperResponse;
4756);
4757
4758unsafe impl NSObjectProtocol for NEHotspotHelperResponse {}
4759
4760impl NEHotspotHelperResponse {
4761 extern_methods!(
4762 #[unsafe(method(setNetwork:))]
4769 #[unsafe(method_family = none)]
4770 pub unsafe fn setNetwork(&self, network: &NEHotspotNetwork);
4771
4772 #[unsafe(method(setNetworkList:))]
4780 #[unsafe(method_family = none)]
4781 pub unsafe fn setNetworkList(&self, network_list: &NSArray<NEHotspotNetwork>);
4782
4783 #[unsafe(method(deliver))]
4787 #[unsafe(method_family = none)]
4788 pub unsafe fn deliver(&self);
4789 );
4790}
4791
4792impl NEHotspotHelperResponse {
4794 extern_methods!(
4795 #[unsafe(method(init))]
4796 #[unsafe(method_family = init)]
4797 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4798
4799 #[unsafe(method(new))]
4800 #[unsafe(method_family = new)]
4801 pub unsafe fn new() -> Retained<Self>;
4802 );
4803}
4804
4805#[cfg(feature = "block2")]
4813pub type NEHotspotHelperHandler = *mut block2::Block<dyn Fn(NonNull<NEHotspotHelperCommand>)>;
4814
4815extern_class!(
4816 #[unsafe(super(NSObject))]
4821 #[derive(Debug, PartialEq, Eq, Hash)]
4822 pub struct NEHotspotHelper;
4823);
4824
4825unsafe impl NSObjectProtocol for NEHotspotHelper {}
4826
4827impl NEHotspotHelper {
4828 extern_methods!(
4829 #[unsafe(method(logoff:))]
4852 #[unsafe(method_family = none)]
4853 pub unsafe fn logoff(network: &NEHotspotNetwork) -> bool;
4854
4855 #[unsafe(method(supportedNetworkInterfaces))]
4871 #[unsafe(method_family = none)]
4872 pub unsafe fn supportedNetworkInterfaces() -> Option<Retained<NSArray>>;
4873 );
4874}
4875
4876impl NEHotspotHelper {
4878 extern_methods!(
4879 #[unsafe(method(init))]
4880 #[unsafe(method_family = init)]
4881 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4882
4883 #[unsafe(method(new))]
4884 #[unsafe(method_family = new)]
4885 pub unsafe fn new() -> Retained<Self>;
4886 );
4887}
4888
4889mod private_NSMutableURLRequestNEHotspotHelper {
4890 pub trait Sealed {}
4891}
4892
4893#[doc(alias = "NEHotspotHelper")]
4895pub unsafe trait NSMutableURLRequestNEHotspotHelper:
4899 ClassType + Sized + private_NSMutableURLRequestNEHotspotHelper::Sealed
4900{
4901 extern_methods!(
4902 #[unsafe(method(bindToHotspotHelperCommand:))]
4905 #[unsafe(method_family = none)]
4906 unsafe fn bindToHotspotHelperCommand(&self, command: &NEHotspotHelperCommand);
4907 );
4908}
4909
4910impl private_NSMutableURLRequestNEHotspotHelper::Sealed for NSMutableURLRequest {}
4911unsafe impl NSMutableURLRequestNEHotspotHelper for NSMutableURLRequest {}
4912
4913#[repr(transparent)]
4918#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4919pub struct NEHotspotConfigurationEAPType(pub NSInteger);
4920impl NEHotspotConfigurationEAPType {
4921 #[doc(alias = "NEHotspotConfigurationEAPTypeEAPTLS")]
4922 pub const EAPTLS: Self = Self(13);
4923 #[doc(alias = "NEHotspotConfigurationEAPTypeEAPTTLS")]
4924 pub const EAPTTLS: Self = Self(21);
4925 #[doc(alias = "NEHotspotConfigurationEAPTypeEAPPEAP")]
4926 pub const EAPPEAP: Self = Self(25);
4927 #[doc(alias = "NEHotspotConfigurationEAPTypeEAPFAST")]
4928 pub const EAPFAST: Self = Self(43);
4929}
4930
4931unsafe impl Encode for NEHotspotConfigurationEAPType {
4932 const ENCODING: Encoding = NSInteger::ENCODING;
4933}
4934
4935unsafe impl RefEncode for NEHotspotConfigurationEAPType {
4936 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4937}
4938
4939#[repr(transparent)]
4944#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4945pub struct NEHotspotConfigurationTTLSInnerAuthenticationType(pub NSInteger);
4946impl NEHotspotConfigurationTTLSInnerAuthenticationType {
4947 #[doc(alias = "NEHotspotConfigurationEAPTTLSInnerAuthenticationPAP")]
4948 pub const EAPTTLSInnerAuthenticationPAP: Self = Self(0);
4949 #[doc(alias = "NEHotspotConfigurationEAPTTLSInnerAuthenticationCHAP")]
4950 pub const EAPTTLSInnerAuthenticationCHAP: Self = Self(1);
4951 #[doc(alias = "NEHotspotConfigurationEAPTTLSInnerAuthenticationMSCHAP")]
4952 pub const EAPTTLSInnerAuthenticationMSCHAP: Self = Self(2);
4953 #[doc(alias = "NEHotspotConfigurationEAPTTLSInnerAuthenticationMSCHAPv2")]
4954 pub const EAPTTLSInnerAuthenticationMSCHAPv2: Self = Self(3);
4955 #[doc(alias = "NEHotspotConfigurationEAPTTLSInnerAuthenticationEAP")]
4956 pub const EAPTTLSInnerAuthenticationEAP: Self = Self(4);
4957}
4958
4959unsafe impl Encode for NEHotspotConfigurationTTLSInnerAuthenticationType {
4960 const ENCODING: Encoding = NSInteger::ENCODING;
4961}
4962
4963unsafe impl RefEncode for NEHotspotConfigurationTTLSInnerAuthenticationType {
4964 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4965}
4966
4967extern_class!(
4968 #[unsafe(super(NSObject))]
4973 #[derive(Debug, PartialEq, Eq, Hash)]
4974 pub struct NEHotspotHS20Settings;
4975);
4976
4977unsafe impl NSCoding for NEHotspotHS20Settings {}
4978
4979unsafe impl NSCopying for NEHotspotHS20Settings {}
4980
4981unsafe impl CopyingHelper for NEHotspotHS20Settings {
4982 type Result = Self;
4983}
4984
4985unsafe impl NSObjectProtocol for NEHotspotHS20Settings {}
4986
4987unsafe impl NSSecureCoding for NEHotspotHS20Settings {}
4988
4989impl NEHotspotHS20Settings {
4990 extern_methods!(
4991 #[unsafe(method(domainName))]
4994 #[unsafe(method_family = none)]
4995 pub unsafe fn domainName(&self) -> Retained<NSString>;
4996
4997 #[unsafe(method(isRoamingEnabled))]
5000 #[unsafe(method_family = none)]
5001 pub unsafe fn isRoamingEnabled(&self) -> bool;
5002
5003 #[unsafe(method(setRoamingEnabled:))]
5005 #[unsafe(method_family = none)]
5006 pub unsafe fn setRoamingEnabled(&self, roaming_enabled: bool);
5007
5008 #[unsafe(method(roamingConsortiumOIs))]
5011 #[unsafe(method_family = none)]
5012 pub unsafe fn roamingConsortiumOIs(&self) -> Retained<NSArray<NSString>>;
5013
5014 #[unsafe(method(setRoamingConsortiumOIs:))]
5016 #[unsafe(method_family = none)]
5017 pub unsafe fn setRoamingConsortiumOIs(&self, roaming_consortium_o_is: &NSArray<NSString>);
5018
5019 #[unsafe(method(naiRealmNames))]
5022 #[unsafe(method_family = none)]
5023 pub unsafe fn naiRealmNames(&self) -> Retained<NSArray<NSString>>;
5024
5025 #[unsafe(method(setNaiRealmNames:))]
5027 #[unsafe(method_family = none)]
5028 pub unsafe fn setNaiRealmNames(&self, nai_realm_names: &NSArray<NSString>);
5029
5030 #[unsafe(method(MCCAndMNCs))]
5034 #[unsafe(method_family = none)]
5035 pub unsafe fn MCCAndMNCs(&self) -> Retained<NSArray<NSString>>;
5036
5037 #[unsafe(method(setMCCAndMNCs:))]
5039 #[unsafe(method_family = none)]
5040 pub unsafe fn setMCCAndMNCs(&self, mcc_and_mn_cs: &NSArray<NSString>);
5041
5042 #[unsafe(method(initWithDomainName:roamingEnabled:))]
5050 #[unsafe(method_family = init)]
5051 pub unsafe fn initWithDomainName_roamingEnabled(
5052 this: Allocated<Self>,
5053 domain_name: &NSString,
5054 roaming_enabled: bool,
5055 ) -> Retained<Self>;
5056 );
5057}
5058
5059impl NEHotspotHS20Settings {
5061 extern_methods!(
5062 #[unsafe(method(init))]
5063 #[unsafe(method_family = init)]
5064 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5065
5066 #[unsafe(method(new))]
5067 #[unsafe(method_family = new)]
5068 pub unsafe fn new() -> Retained<Self>;
5069 );
5070}
5071
5072extern_class!(
5073 #[unsafe(super(NSObject))]
5078 #[derive(Debug, PartialEq, Eq, Hash)]
5079 pub struct NEHotspotEAPSettings;
5080);
5081
5082unsafe impl NSCoding for NEHotspotEAPSettings {}
5083
5084unsafe impl NSCopying for NEHotspotEAPSettings {}
5085
5086unsafe impl CopyingHelper for NEHotspotEAPSettings {
5087 type Result = Self;
5088}
5089
5090unsafe impl NSObjectProtocol for NEHotspotEAPSettings {}
5091
5092unsafe impl NSSecureCoding for NEHotspotEAPSettings {}
5093
5094impl NEHotspotEAPSettings {
5095 extern_methods!(
5096 #[unsafe(method(supportedEAPTypes))]
5099 #[unsafe(method_family = none)]
5100 pub unsafe fn supportedEAPTypes(&self) -> Retained<NSArray<NSNumber>>;
5101
5102 #[unsafe(method(setSupportedEAPTypes:))]
5104 #[unsafe(method_family = none)]
5105 pub unsafe fn setSupportedEAPTypes(&self, supported_eap_types: &NSArray<NSNumber>);
5106
5107 #[unsafe(method(username))]
5110 #[unsafe(method_family = none)]
5111 pub unsafe fn username(&self) -> Retained<NSString>;
5112
5113 #[unsafe(method(setUsername:))]
5115 #[unsafe(method_family = none)]
5116 pub unsafe fn setUsername(&self, username: &NSString);
5117
5118 #[unsafe(method(outerIdentity))]
5121 #[unsafe(method_family = none)]
5122 pub unsafe fn outerIdentity(&self) -> Retained<NSString>;
5123
5124 #[unsafe(method(setOuterIdentity:))]
5126 #[unsafe(method_family = none)]
5127 pub unsafe fn setOuterIdentity(&self, outer_identity: &NSString);
5128
5129 #[unsafe(method(ttlsInnerAuthenticationType))]
5132 #[unsafe(method_family = none)]
5133 pub unsafe fn ttlsInnerAuthenticationType(
5134 &self,
5135 ) -> NEHotspotConfigurationTTLSInnerAuthenticationType;
5136
5137 #[unsafe(method(setTtlsInnerAuthenticationType:))]
5139 #[unsafe(method_family = none)]
5140 pub unsafe fn setTtlsInnerAuthenticationType(
5141 &self,
5142 ttls_inner_authentication_type: NEHotspotConfigurationTTLSInnerAuthenticationType,
5143 );
5144
5145 #[unsafe(method(password))]
5148 #[unsafe(method_family = none)]
5149 pub unsafe fn password(&self) -> Retained<NSString>;
5150
5151 #[unsafe(method(setPassword:))]
5153 #[unsafe(method_family = none)]
5154 pub unsafe fn setPassword(&self, password: &NSString);
5155
5156 #[unsafe(method(trustedServerNames))]
5160 #[unsafe(method_family = none)]
5161 pub unsafe fn trustedServerNames(&self) -> Retained<NSArray<NSString>>;
5162
5163 #[unsafe(method(setTrustedServerNames:))]
5165 #[unsafe(method_family = none)]
5166 pub unsafe fn setTrustedServerNames(&self, trusted_server_names: &NSArray<NSString>);
5167
5168 #[unsafe(method(isTLSClientCertificateRequired))]
5172 #[unsafe(method_family = none)]
5173 pub unsafe fn isTLSClientCertificateRequired(&self) -> bool;
5174
5175 #[unsafe(method(setTlsClientCertificateRequired:))]
5177 #[unsafe(method_family = none)]
5178 pub unsafe fn setTlsClientCertificateRequired(&self, tls_client_certificate_required: bool);
5179
5180 #[unsafe(method(preferredTLSVersion))]
5183 #[unsafe(method_family = none)]
5184 pub unsafe fn preferredTLSVersion(&self) -> NEHotspotConfigurationEAPTLSVersion;
5185
5186 #[unsafe(method(setPreferredTLSVersion:))]
5188 #[unsafe(method_family = none)]
5189 pub unsafe fn setPreferredTLSVersion(
5190 &self,
5191 preferred_tls_version: NEHotspotConfigurationEAPTLSVersion,
5192 );
5193
5194 #[cfg(feature = "objc2-security")]
5195 #[unsafe(method(setIdentity:))]
5208 #[unsafe(method_family = none)]
5209 pub unsafe fn setIdentity(&self, identity: &SecIdentity) -> bool;
5210
5211 #[unsafe(method(setTrustedServerCertificates:))]
5225 #[unsafe(method_family = none)]
5226 pub unsafe fn setTrustedServerCertificates(&self, certificates: &NSArray) -> bool;
5227 );
5228}
5229
5230impl NEHotspotEAPSettings {
5232 extern_methods!(
5233 #[unsafe(method(init))]
5234 #[unsafe(method_family = init)]
5235 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5236
5237 #[unsafe(method(new))]
5238 #[unsafe(method_family = new)]
5239 pub unsafe fn new() -> Retained<Self>;
5240 );
5241}
5242
5243extern_class!(
5244 #[unsafe(super(NSObject))]
5249 #[derive(Debug, PartialEq, Eq, Hash)]
5250 pub struct NEHotspotConfiguration;
5251);
5252
5253unsafe impl NSCoding for NEHotspotConfiguration {}
5254
5255unsafe impl NSCopying for NEHotspotConfiguration {}
5256
5257unsafe impl CopyingHelper for NEHotspotConfiguration {
5258 type Result = Self;
5259}
5260
5261unsafe impl NSObjectProtocol for NEHotspotConfiguration {}
5262
5263unsafe impl NSSecureCoding for NEHotspotConfiguration {}
5264
5265impl NEHotspotConfiguration {
5266 extern_methods!(
5267 #[unsafe(method(SSID))]
5269 #[unsafe(method_family = none)]
5270 pub unsafe fn SSID(&self) -> Retained<NSString>;
5271
5272 #[unsafe(method(SSIDPrefix))]
5274 #[unsafe(method_family = none)]
5275 pub unsafe fn SSIDPrefix(&self) -> Retained<NSString>;
5276
5277 #[unsafe(method(joinOnce))]
5279 #[unsafe(method_family = none)]
5280 pub unsafe fn joinOnce(&self) -> bool;
5281
5282 #[unsafe(method(setJoinOnce:))]
5284 #[unsafe(method_family = none)]
5285 pub unsafe fn setJoinOnce(&self, join_once: bool);
5286
5287 #[unsafe(method(lifeTimeInDays))]
5292 #[unsafe(method_family = none)]
5293 pub unsafe fn lifeTimeInDays(&self) -> Retained<NSNumber>;
5294
5295 #[unsafe(method(setLifeTimeInDays:))]
5297 #[unsafe(method_family = none)]
5298 pub unsafe fn setLifeTimeInDays(&self, life_time_in_days: &NSNumber);
5299
5300 #[unsafe(method(hidden))]
5302 #[unsafe(method_family = none)]
5303 pub unsafe fn hidden(&self) -> bool;
5304
5305 #[unsafe(method(setHidden:))]
5307 #[unsafe(method_family = none)]
5308 pub unsafe fn setHidden(&self, hidden: bool);
5309
5310 #[unsafe(method(initWithSSID:))]
5317 #[unsafe(method_family = init)]
5318 pub unsafe fn initWithSSID(this: Allocated<Self>, ssid: &NSString) -> Retained<Self>;
5319
5320 #[unsafe(method(initWithSSID:passphrase:isWEP:))]
5333 #[unsafe(method_family = init)]
5334 pub unsafe fn initWithSSID_passphrase_isWEP(
5335 this: Allocated<Self>,
5336 ssid: &NSString,
5337 passphrase: &NSString,
5338 is_wep: bool,
5339 ) -> Retained<Self>;
5340
5341 #[unsafe(method(initWithSSID:eapSettings:))]
5349 #[unsafe(method_family = init)]
5350 pub unsafe fn initWithSSID_eapSettings(
5351 this: Allocated<Self>,
5352 ssid: &NSString,
5353 eap_settings: &NEHotspotEAPSettings,
5354 ) -> Retained<Self>;
5355
5356 #[unsafe(method(initWithHS20Settings:eapSettings:))]
5364 #[unsafe(method_family = init)]
5365 pub unsafe fn initWithHS20Settings_eapSettings(
5366 this: Allocated<Self>,
5367 hs20_settings: &NEHotspotHS20Settings,
5368 eap_settings: &NEHotspotEAPSettings,
5369 ) -> Retained<Self>;
5370
5371 #[unsafe(method(initWithSSIDPrefix:))]
5378 #[unsafe(method_family = init)]
5379 pub unsafe fn initWithSSIDPrefix(
5380 this: Allocated<Self>,
5381 ssid_prefix: &NSString,
5382 ) -> Retained<Self>;
5383
5384 #[unsafe(method(initWithSSIDPrefix:passphrase:isWEP:))]
5398 #[unsafe(method_family = init)]
5399 pub unsafe fn initWithSSIDPrefix_passphrase_isWEP(
5400 this: Allocated<Self>,
5401 ssid_prefix: &NSString,
5402 passphrase: &NSString,
5403 is_wep: bool,
5404 ) -> Retained<Self>;
5405 );
5406}
5407
5408impl NEHotspotConfiguration {
5410 extern_methods!(
5411 #[unsafe(method(init))]
5412 #[unsafe(method_family = init)]
5413 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5414
5415 #[unsafe(method(new))]
5416 #[unsafe(method_family = new)]
5417 pub unsafe fn new() -> Retained<Self>;
5418 );
5419}
5420
5421extern "C" {
5422 pub static NEHotspotConfigurationErrorDomain: &'static NSString;
5424}
5425
5426#[repr(transparent)]
5431#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
5432pub struct NEHotspotConfigurationError(pub NSInteger);
5433impl NEHotspotConfigurationError {
5434 #[doc(alias = "NEHotspotConfigurationErrorInvalid")]
5435 pub const Invalid: Self = Self(0);
5436 #[doc(alias = "NEHotspotConfigurationErrorInvalidSSID")]
5437 pub const InvalidSSID: Self = Self(1);
5438 #[doc(alias = "NEHotspotConfigurationErrorInvalidWPAPassphrase")]
5439 pub const InvalidWPAPassphrase: Self = Self(2);
5440 #[doc(alias = "NEHotspotConfigurationErrorInvalidWEPPassphrase")]
5441 pub const InvalidWEPPassphrase: Self = Self(3);
5442 #[doc(alias = "NEHotspotConfigurationErrorInvalidEAPSettings")]
5443 pub const InvalidEAPSettings: Self = Self(4);
5444 #[doc(alias = "NEHotspotConfigurationErrorInvalidHS20Settings")]
5445 pub const InvalidHS20Settings: Self = Self(5);
5446 #[doc(alias = "NEHotspotConfigurationErrorInvalidHS20DomainName")]
5447 pub const InvalidHS20DomainName: Self = Self(6);
5448 #[doc(alias = "NEHotspotConfigurationErrorUserDenied")]
5449 pub const UserDenied: Self = Self(7);
5450 #[doc(alias = "NEHotspotConfigurationErrorInternal")]
5451 pub const Internal: Self = Self(8);
5452 #[doc(alias = "NEHotspotConfigurationErrorPending")]
5453 pub const Pending: Self = Self(9);
5454 #[doc(alias = "NEHotspotConfigurationErrorSystemConfiguration")]
5455 pub const SystemConfiguration: Self = Self(10);
5456 #[doc(alias = "NEHotspotConfigurationErrorUnknown")]
5457 pub const Unknown: Self = Self(11);
5458 #[doc(alias = "NEHotspotConfigurationErrorJoinOnceNotSupported")]
5459 pub const JoinOnceNotSupported: Self = Self(12);
5460 #[doc(alias = "NEHotspotConfigurationErrorAlreadyAssociated")]
5461 pub const AlreadyAssociated: Self = Self(13);
5462 #[doc(alias = "NEHotspotConfigurationErrorApplicationIsNotInForeground")]
5463 pub const ApplicationIsNotInForeground: Self = Self(14);
5464 #[doc(alias = "NEHotspotConfigurationErrorInvalidSSIDPrefix")]
5465 pub const InvalidSSIDPrefix: Self = Self(15);
5466 #[doc(alias = "NEHotspotConfigurationErrorUserUnauthorized")]
5467 pub const UserUnauthorized: Self = Self(16);
5468 #[doc(alias = "NEHotspotConfigurationErrorSystemDenied")]
5469 pub const SystemDenied: Self = Self(17);
5470}
5471
5472unsafe impl Encode for NEHotspotConfigurationError {
5473 const ENCODING: Encoding = NSInteger::ENCODING;
5474}
5475
5476unsafe impl RefEncode for NEHotspotConfigurationError {
5477 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
5478}
5479
5480extern_class!(
5481 #[unsafe(super(NSObject))]
5486 #[derive(Debug, PartialEq, Eq, Hash)]
5487 pub struct NEHotspotConfigurationManager;
5488);
5489
5490unsafe impl NSObjectProtocol for NEHotspotConfigurationManager {}
5491
5492impl NEHotspotConfigurationManager {
5493 extern_methods!(
5494 #[unsafe(method(sharedManager))]
5495 #[unsafe(method_family = none)]
5496 pub unsafe fn sharedManager() -> Retained<NEHotspotConfigurationManager>;
5497
5498 #[cfg(feature = "block2")]
5499 #[unsafe(method(applyConfiguration:completionHandler:))]
5510 #[unsafe(method_family = none)]
5511 pub unsafe fn applyConfiguration_completionHandler(
5512 &self,
5513 configuration: &NEHotspotConfiguration,
5514 completion_handler: Option<&block2::Block<dyn Fn(*mut NSError)>>,
5515 );
5516
5517 #[unsafe(method(removeConfigurationForSSID:))]
5523 #[unsafe(method_family = none)]
5524 pub unsafe fn removeConfigurationForSSID(&self, ssid: &NSString);
5525
5526 #[unsafe(method(removeConfigurationForHS20DomainName:))]
5530 #[unsafe(method_family = none)]
5531 pub unsafe fn removeConfigurationForHS20DomainName(&self, domain_name: &NSString);
5532
5533 #[cfg(feature = "block2")]
5534 #[unsafe(method(getConfiguredSSIDsWithCompletionHandler:))]
5537 #[unsafe(method_family = none)]
5538 pub unsafe fn getConfiguredSSIDsWithCompletionHandler(
5539 &self,
5540 completion_handler: &block2::Block<dyn Fn(NonNull<NSArray<NSString>>)>,
5541 );
5542 );
5543}
5544
5545impl NEHotspotConfigurationManager {
5547 extern_methods!(
5548 #[unsafe(method(init))]
5549 #[unsafe(method_family = init)]
5550 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5551
5552 #[unsafe(method(new))]
5553 #[unsafe(method_family = new)]
5554 pub unsafe fn new() -> Retained<Self>;
5555 );
5556}
5557
5558extern_class!(
5559 #[unsafe(super(NSObject))]
5565 #[derive(Debug, PartialEq, Eq, Hash)]
5566 pub struct NEIPv4Settings;
5567);
5568
5569unsafe impl NSCoding for NEIPv4Settings {}
5570
5571unsafe impl NSCopying for NEIPv4Settings {}
5572
5573unsafe impl CopyingHelper for NEIPv4Settings {
5574 type Result = Self;
5575}
5576
5577unsafe impl NSObjectProtocol for NEIPv4Settings {}
5578
5579unsafe impl NSSecureCoding for NEIPv4Settings {}
5580
5581impl NEIPv4Settings {
5582 extern_methods!(
5583 #[unsafe(method(initWithAddresses:subnetMasks:))]
5591 #[unsafe(method_family = init)]
5592 pub unsafe fn initWithAddresses_subnetMasks(
5593 this: Allocated<Self>,
5594 addresses: &NSArray<NSString>,
5595 subnet_masks: &NSArray<NSString>,
5596 ) -> Retained<Self>;
5597
5598 #[unsafe(method(settingsWithAutomaticAddressing))]
5602 #[unsafe(method_family = none)]
5603 pub unsafe fn settingsWithAutomaticAddressing() -> Retained<Self>;
5604
5605 #[unsafe(method(addresses))]
5607 #[unsafe(method_family = none)]
5608 pub unsafe fn addresses(&self) -> Retained<NSArray<NSString>>;
5609
5610 #[unsafe(method(subnetMasks))]
5612 #[unsafe(method_family = none)]
5613 pub unsafe fn subnetMasks(&self) -> Retained<NSArray<NSString>>;
5614
5615 #[unsafe(method(router))]
5617 #[unsafe(method_family = none)]
5618 pub unsafe fn router(&self) -> Option<Retained<NSString>>;
5619
5620 #[unsafe(method(setRouter:))]
5622 #[unsafe(method_family = none)]
5623 pub unsafe fn setRouter(&self, router: Option<&NSString>);
5624
5625 #[unsafe(method(includedRoutes))]
5627 #[unsafe(method_family = none)]
5628 pub unsafe fn includedRoutes(&self) -> Option<Retained<NSArray<NEIPv4Route>>>;
5629
5630 #[unsafe(method(setIncludedRoutes:))]
5632 #[unsafe(method_family = none)]
5633 pub unsafe fn setIncludedRoutes(&self, included_routes: Option<&NSArray<NEIPv4Route>>);
5634
5635 #[unsafe(method(excludedRoutes))]
5637 #[unsafe(method_family = none)]
5638 pub unsafe fn excludedRoutes(&self) -> Option<Retained<NSArray<NEIPv4Route>>>;
5639
5640 #[unsafe(method(setExcludedRoutes:))]
5642 #[unsafe(method_family = none)]
5643 pub unsafe fn setExcludedRoutes(&self, excluded_routes: Option<&NSArray<NEIPv4Route>>);
5644 );
5645}
5646
5647impl NEIPv4Settings {
5649 extern_methods!(
5650 #[unsafe(method(init))]
5651 #[unsafe(method_family = init)]
5652 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5653
5654 #[unsafe(method(new))]
5655 #[unsafe(method_family = new)]
5656 pub unsafe fn new() -> Retained<Self>;
5657 );
5658}
5659
5660extern_class!(
5661 #[unsafe(super(NSObject))]
5667 #[derive(Debug, PartialEq, Eq, Hash)]
5668 pub struct NEIPv4Route;
5669);
5670
5671unsafe impl NSCoding for NEIPv4Route {}
5672
5673unsafe impl NSCopying for NEIPv4Route {}
5674
5675unsafe impl CopyingHelper for NEIPv4Route {
5676 type Result = Self;
5677}
5678
5679unsafe impl NSObjectProtocol for NEIPv4Route {}
5680
5681unsafe impl NSSecureCoding for NEIPv4Route {}
5682
5683impl NEIPv4Route {
5684 extern_methods!(
5685 #[unsafe(method(initWithDestinationAddress:subnetMask:))]
5693 #[unsafe(method_family = init)]
5694 pub unsafe fn initWithDestinationAddress_subnetMask(
5695 this: Allocated<Self>,
5696 address: &NSString,
5697 subnet_mask: &NSString,
5698 ) -> Retained<Self>;
5699
5700 #[unsafe(method(destinationAddress))]
5702 #[unsafe(method_family = none)]
5703 pub unsafe fn destinationAddress(&self) -> Retained<NSString>;
5704
5705 #[unsafe(method(destinationSubnetMask))]
5707 #[unsafe(method_family = none)]
5708 pub unsafe fn destinationSubnetMask(&self) -> Retained<NSString>;
5709
5710 #[unsafe(method(gatewayAddress))]
5712 #[unsafe(method_family = none)]
5713 pub unsafe fn gatewayAddress(&self) -> Option<Retained<NSString>>;
5714
5715 #[unsafe(method(setGatewayAddress:))]
5717 #[unsafe(method_family = none)]
5718 pub unsafe fn setGatewayAddress(&self, gateway_address: Option<&NSString>);
5719
5720 #[unsafe(method(defaultRoute))]
5722 #[unsafe(method_family = none)]
5723 pub unsafe fn defaultRoute() -> Retained<NEIPv4Route>;
5724 );
5725}
5726
5727impl NEIPv4Route {
5729 extern_methods!(
5730 #[unsafe(method(init))]
5731 #[unsafe(method_family = init)]
5732 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5733
5734 #[unsafe(method(new))]
5735 #[unsafe(method_family = new)]
5736 pub unsafe fn new() -> Retained<Self>;
5737 );
5738}
5739
5740extern_class!(
5741 #[unsafe(super(NSObject))]
5747 #[derive(Debug, PartialEq, Eq, Hash)]
5748 pub struct NEIPv6Settings;
5749);
5750
5751unsafe impl NSCoding for NEIPv6Settings {}
5752
5753unsafe impl NSCopying for NEIPv6Settings {}
5754
5755unsafe impl CopyingHelper for NEIPv6Settings {
5756 type Result = Self;
5757}
5758
5759unsafe impl NSObjectProtocol for NEIPv6Settings {}
5760
5761unsafe impl NSSecureCoding for NEIPv6Settings {}
5762
5763impl NEIPv6Settings {
5764 extern_methods!(
5765 #[unsafe(method(initWithAddresses:networkPrefixLengths:))]
5773 #[unsafe(method_family = init)]
5774 pub unsafe fn initWithAddresses_networkPrefixLengths(
5775 this: Allocated<Self>,
5776 addresses: &NSArray<NSString>,
5777 network_prefix_lengths: &NSArray<NSNumber>,
5778 ) -> Retained<Self>;
5779
5780 #[unsafe(method(settingsWithAutomaticAddressing))]
5782 #[unsafe(method_family = none)]
5783 pub unsafe fn settingsWithAutomaticAddressing() -> Retained<Self>;
5784
5785 #[unsafe(method(settingsWithLinkLocalAddressing))]
5787 #[unsafe(method_family = none)]
5788 pub unsafe fn settingsWithLinkLocalAddressing() -> Retained<Self>;
5789
5790 #[unsafe(method(addresses))]
5792 #[unsafe(method_family = none)]
5793 pub unsafe fn addresses(&self) -> Retained<NSArray<NSString>>;
5794
5795 #[unsafe(method(networkPrefixLengths))]
5797 #[unsafe(method_family = none)]
5798 pub unsafe fn networkPrefixLengths(&self) -> Retained<NSArray<NSNumber>>;
5799
5800 #[unsafe(method(includedRoutes))]
5802 #[unsafe(method_family = none)]
5803 pub unsafe fn includedRoutes(&self) -> Option<Retained<NSArray<NEIPv6Route>>>;
5804
5805 #[unsafe(method(setIncludedRoutes:))]
5807 #[unsafe(method_family = none)]
5808 pub unsafe fn setIncludedRoutes(&self, included_routes: Option<&NSArray<NEIPv6Route>>);
5809
5810 #[unsafe(method(excludedRoutes))]
5812 #[unsafe(method_family = none)]
5813 pub unsafe fn excludedRoutes(&self) -> Option<Retained<NSArray<NEIPv6Route>>>;
5814
5815 #[unsafe(method(setExcludedRoutes:))]
5817 #[unsafe(method_family = none)]
5818 pub unsafe fn setExcludedRoutes(&self, excluded_routes: Option<&NSArray<NEIPv6Route>>);
5819 );
5820}
5821
5822impl NEIPv6Settings {
5824 extern_methods!(
5825 #[unsafe(method(init))]
5826 #[unsafe(method_family = init)]
5827 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5828
5829 #[unsafe(method(new))]
5830 #[unsafe(method_family = new)]
5831 pub unsafe fn new() -> Retained<Self>;
5832 );
5833}
5834
5835extern_class!(
5836 #[unsafe(super(NSObject))]
5842 #[derive(Debug, PartialEq, Eq, Hash)]
5843 pub struct NEIPv6Route;
5844);
5845
5846unsafe impl NSCoding for NEIPv6Route {}
5847
5848unsafe impl NSCopying for NEIPv6Route {}
5849
5850unsafe impl CopyingHelper for NEIPv6Route {
5851 type Result = Self;
5852}
5853
5854unsafe impl NSObjectProtocol for NEIPv6Route {}
5855
5856unsafe impl NSSecureCoding for NEIPv6Route {}
5857
5858impl NEIPv6Route {
5859 extern_methods!(
5860 #[unsafe(method(initWithDestinationAddress:networkPrefixLength:))]
5868 #[unsafe(method_family = init)]
5869 pub unsafe fn initWithDestinationAddress_networkPrefixLength(
5870 this: Allocated<Self>,
5871 address: &NSString,
5872 network_prefix_length: &NSNumber,
5873 ) -> Retained<Self>;
5874
5875 #[unsafe(method(destinationAddress))]
5877 #[unsafe(method_family = none)]
5878 pub unsafe fn destinationAddress(&self) -> Retained<NSString>;
5879
5880 #[unsafe(method(destinationNetworkPrefixLength))]
5882 #[unsafe(method_family = none)]
5883 pub unsafe fn destinationNetworkPrefixLength(&self) -> Retained<NSNumber>;
5884
5885 #[unsafe(method(gatewayAddress))]
5887 #[unsafe(method_family = none)]
5888 pub unsafe fn gatewayAddress(&self) -> Option<Retained<NSString>>;
5889
5890 #[unsafe(method(setGatewayAddress:))]
5892 #[unsafe(method_family = none)]
5893 pub unsafe fn setGatewayAddress(&self, gateway_address: Option<&NSString>);
5894
5895 #[unsafe(method(defaultRoute))]
5897 #[unsafe(method_family = none)]
5898 pub unsafe fn defaultRoute() -> Retained<NEIPv6Route>;
5899 );
5900}
5901
5902impl NEIPv6Route {
5904 extern_methods!(
5905 #[unsafe(method(init))]
5906 #[unsafe(method_family = init)]
5907 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5908
5909 #[unsafe(method(new))]
5910 #[unsafe(method_family = new)]
5911 pub unsafe fn new() -> Retained<Self>;
5912 );
5913}
5914
5915extern_class!(
5916 #[unsafe(super(NSObject))]
5924 #[derive(Debug, PartialEq, Eq, Hash)]
5925 pub struct NETunnelNetworkSettings;
5926);
5927
5928unsafe impl NSCoding for NETunnelNetworkSettings {}
5929
5930unsafe impl NSCopying for NETunnelNetworkSettings {}
5931
5932unsafe impl CopyingHelper for NETunnelNetworkSettings {
5933 type Result = Self;
5934}
5935
5936unsafe impl NSObjectProtocol for NETunnelNetworkSettings {}
5937
5938unsafe impl NSSecureCoding for NETunnelNetworkSettings {}
5939
5940impl NETunnelNetworkSettings {
5941 extern_methods!(
5942 #[unsafe(method(initWithTunnelRemoteAddress:))]
5946 #[unsafe(method_family = init)]
5947 pub unsafe fn initWithTunnelRemoteAddress(
5948 this: Allocated<Self>,
5949 address: &NSString,
5950 ) -> Retained<Self>;
5951
5952 #[unsafe(method(tunnelRemoteAddress))]
5954 #[unsafe(method_family = none)]
5955 pub unsafe fn tunnelRemoteAddress(&self) -> Retained<NSString>;
5956
5957 #[unsafe(method(DNSSettings))]
5959 #[unsafe(method_family = none)]
5960 pub unsafe fn DNSSettings(&self) -> Option<Retained<NEDNSSettings>>;
5961
5962 #[unsafe(method(setDNSSettings:))]
5964 #[unsafe(method_family = none)]
5965 pub unsafe fn setDNSSettings(&self, dns_settings: Option<&NEDNSSettings>);
5966
5967 #[unsafe(method(proxySettings))]
5969 #[unsafe(method_family = none)]
5970 pub unsafe fn proxySettings(&self) -> Option<Retained<NEProxySettings>>;
5971
5972 #[unsafe(method(setProxySettings:))]
5974 #[unsafe(method_family = none)]
5975 pub unsafe fn setProxySettings(&self, proxy_settings: Option<&NEProxySettings>);
5976 );
5977}
5978
5979impl NETunnelNetworkSettings {
5981 extern_methods!(
5982 #[unsafe(method(init))]
5983 #[unsafe(method_family = init)]
5984 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5985
5986 #[unsafe(method(new))]
5987 #[unsafe(method_family = new)]
5988 pub unsafe fn new() -> Retained<Self>;
5989 );
5990}
5991
5992extern_class!(
5993 #[unsafe(super(NETunnelNetworkSettings, NSObject))]
6001 #[derive(Debug, PartialEq, Eq, Hash)]
6002 pub struct NEPacketTunnelNetworkSettings;
6003);
6004
6005unsafe impl NSCoding for NEPacketTunnelNetworkSettings {}
6006
6007unsafe impl NSCopying for NEPacketTunnelNetworkSettings {}
6008
6009unsafe impl CopyingHelper for NEPacketTunnelNetworkSettings {
6010 type Result = Self;
6011}
6012
6013unsafe impl NSObjectProtocol for NEPacketTunnelNetworkSettings {}
6014
6015unsafe impl NSSecureCoding for NEPacketTunnelNetworkSettings {}
6016
6017impl NEPacketTunnelNetworkSettings {
6018 extern_methods!(
6019 #[unsafe(method(IPv4Settings))]
6021 #[unsafe(method_family = none)]
6022 pub unsafe fn IPv4Settings(&self) -> Option<Retained<NEIPv4Settings>>;
6023
6024 #[unsafe(method(setIPv4Settings:))]
6026 #[unsafe(method_family = none)]
6027 pub unsafe fn setIPv4Settings(&self, i_pv4_settings: Option<&NEIPv4Settings>);
6028
6029 #[unsafe(method(IPv6Settings))]
6031 #[unsafe(method_family = none)]
6032 pub unsafe fn IPv6Settings(&self) -> Option<Retained<NEIPv6Settings>>;
6033
6034 #[unsafe(method(setIPv6Settings:))]
6036 #[unsafe(method_family = none)]
6037 pub unsafe fn setIPv6Settings(&self, i_pv6_settings: Option<&NEIPv6Settings>);
6038
6039 #[unsafe(method(tunnelOverheadBytes))]
6041 #[unsafe(method_family = none)]
6042 pub unsafe fn tunnelOverheadBytes(&self) -> Option<Retained<NSNumber>>;
6043
6044 #[unsafe(method(setTunnelOverheadBytes:))]
6046 #[unsafe(method_family = none)]
6047 pub unsafe fn setTunnelOverheadBytes(&self, tunnel_overhead_bytes: Option<&NSNumber>);
6048
6049 #[unsafe(method(MTU))]
6051 #[unsafe(method_family = none)]
6052 pub unsafe fn MTU(&self) -> Option<Retained<NSNumber>>;
6053
6054 #[unsafe(method(setMTU:))]
6056 #[unsafe(method_family = none)]
6057 pub unsafe fn setMTU(&self, mtu: Option<&NSNumber>);
6058 );
6059}
6060
6061impl NEPacketTunnelNetworkSettings {
6063 extern_methods!(
6064 #[unsafe(method(initWithTunnelRemoteAddress:))]
6068 #[unsafe(method_family = init)]
6069 pub unsafe fn initWithTunnelRemoteAddress(
6070 this: Allocated<Self>,
6071 address: &NSString,
6072 ) -> Retained<Self>;
6073 );
6074}
6075
6076impl NEPacketTunnelNetworkSettings {
6078 extern_methods!(
6079 #[unsafe(method(init))]
6080 #[unsafe(method_family = init)]
6081 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6082
6083 #[unsafe(method(new))]
6084 #[unsafe(method_family = new)]
6085 pub unsafe fn new() -> Retained<Self>;
6086 );
6087}
6088
6089extern_class!(
6090 #[unsafe(super(NEPacketTunnelNetworkSettings, NETunnelNetworkSettings, NSObject))]
6098 #[derive(Debug, PartialEq, Eq, Hash)]
6099 pub struct NEEthernetTunnelNetworkSettings;
6100);
6101
6102unsafe impl NSCoding for NEEthernetTunnelNetworkSettings {}
6103
6104unsafe impl NSCopying for NEEthernetTunnelNetworkSettings {}
6105
6106unsafe impl CopyingHelper for NEEthernetTunnelNetworkSettings {
6107 type Result = Self;
6108}
6109
6110unsafe impl NSObjectProtocol for NEEthernetTunnelNetworkSettings {}
6111
6112unsafe impl NSSecureCoding for NEEthernetTunnelNetworkSettings {}
6113
6114impl NEEthernetTunnelNetworkSettings {
6115 extern_methods!(
6116 #[unsafe(method(initWithTunnelRemoteAddress:ethernetAddress:mtu:))]
6124 #[unsafe(method_family = init)]
6125 pub unsafe fn initWithTunnelRemoteAddress_ethernetAddress_mtu(
6126 this: Allocated<Self>,
6127 address: &NSString,
6128 ethernet_address: &NSString,
6129 mtu: NSInteger,
6130 ) -> Retained<Self>;
6131
6132 #[unsafe(method(ethernetAddress))]
6134 #[unsafe(method_family = none)]
6135 pub unsafe fn ethernetAddress(&self) -> Retained<NSString>;
6136 );
6137}
6138
6139impl NEEthernetTunnelNetworkSettings {
6141 extern_methods!(
6142 #[unsafe(method(initWithTunnelRemoteAddress:))]
6146 #[unsafe(method_family = init)]
6147 pub unsafe fn initWithTunnelRemoteAddress(
6148 this: Allocated<Self>,
6149 address: &NSString,
6150 ) -> Retained<Self>;
6151 );
6152}
6153
6154impl NEEthernetTunnelNetworkSettings {
6156 extern_methods!(
6157 #[unsafe(method(init))]
6158 #[unsafe(method_family = init)]
6159 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6160
6161 #[unsafe(method(new))]
6162 #[unsafe(method_family = new)]
6163 pub unsafe fn new() -> Retained<Self>;
6164 );
6165}
6166
6167extern_class!(
6168 #[unsafe(super(NETunnelProvider, NEProvider, NSObject))]
6174 #[derive(Debug, PartialEq, Eq, Hash)]
6175 pub struct NEPacketTunnelProvider;
6176);
6177
6178unsafe impl NSObjectProtocol for NEPacketTunnelProvider {}
6179
6180impl NEPacketTunnelProvider {
6181 extern_methods!(
6182 #[cfg(feature = "block2")]
6183 #[unsafe(method(startTunnelWithOptions:completionHandler:))]
6189 #[unsafe(method_family = none)]
6190 pub unsafe fn startTunnelWithOptions_completionHandler(
6191 &self,
6192 options: Option<&NSDictionary<NSString, NSObject>>,
6193 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
6194 );
6195
6196 #[cfg(feature = "block2")]
6197 #[unsafe(method(stopTunnelWithReason:completionHandler:))]
6203 #[unsafe(method_family = none)]
6204 pub unsafe fn stopTunnelWithReason_completionHandler(
6205 &self,
6206 reason: NEProviderStopReason,
6207 completion_handler: &block2::Block<dyn Fn()>,
6208 );
6209
6210 #[unsafe(method(cancelTunnelWithError:))]
6214 #[unsafe(method_family = none)]
6215 pub unsafe fn cancelTunnelWithError(&self, error: Option<&NSError>);
6216
6217 #[unsafe(method(packetFlow))]
6219 #[unsafe(method_family = none)]
6220 pub unsafe fn packetFlow(&self) -> Retained<NEPacketTunnelFlow>;
6221
6222 #[deprecated = "Use the `virtualInterface` property with `nw_parameters_require_interface`"]
6234 #[unsafe(method(createTCPConnectionThroughTunnelToEndpoint:enableTLS:TLSParameters:delegate:))]
6235 #[unsafe(method_family = none)]
6236 pub unsafe fn createTCPConnectionThroughTunnelToEndpoint_enableTLS_TLSParameters_delegate(
6237 &self,
6238 remote_endpoint: &NWEndpoint,
6239 enable_tls: bool,
6240 tls_parameters: Option<&NWTLSParameters>,
6241 delegate: Option<&AnyObject>,
6242 ) -> Retained<NWTCPConnection>;
6243
6244 #[deprecated = "Use the `virtualInterface` property with `nw_parameters_require_interface`"]
6252 #[unsafe(method(createUDPSessionThroughTunnelToEndpoint:fromEndpoint:))]
6253 #[unsafe(method_family = none)]
6254 pub unsafe fn createUDPSessionThroughTunnelToEndpoint_fromEndpoint(
6255 &self,
6256 remote_endpoint: &NWEndpoint,
6257 local_endpoint: Option<&NWHostEndpoint>,
6258 ) -> Retained<NWUDPSession>;
6259 );
6260}
6261
6262impl NEPacketTunnelProvider {
6264 extern_methods!(
6265 #[unsafe(method(init))]
6266 #[unsafe(method_family = init)]
6267 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6268
6269 #[unsafe(method(new))]
6270 #[unsafe(method_family = new)]
6271 pub unsafe fn new() -> Retained<Self>;
6272 );
6273}
6274
6275extern_class!(
6276 #[unsafe(super(NEPacketTunnelProvider, NETunnelProvider, NEProvider, NSObject))]
6282 #[derive(Debug, PartialEq, Eq, Hash)]
6283 pub struct NEEthernetTunnelProvider;
6284);
6285
6286unsafe impl NSObjectProtocol for NEEthernetTunnelProvider {}
6287
6288impl NEEthernetTunnelProvider {
6289 extern_methods!();
6290}
6291
6292impl NEEthernetTunnelProvider {
6294 extern_methods!(
6295 #[unsafe(method(init))]
6296 #[unsafe(method_family = init)]
6297 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6298
6299 #[unsafe(method(new))]
6300 #[unsafe(method_family = new)]
6301 pub unsafe fn new() -> Retained<Self>;
6302 );
6303}
6304
6305#[repr(transparent)]
6310#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
6311pub struct NEOnDemandRuleAction(pub NSInteger);
6312impl NEOnDemandRuleAction {
6313 #[doc(alias = "NEOnDemandRuleActionConnect")]
6314 pub const Connect: Self = Self(1);
6315 #[doc(alias = "NEOnDemandRuleActionDisconnect")]
6316 pub const Disconnect: Self = Self(2);
6317 #[doc(alias = "NEOnDemandRuleActionEvaluateConnection")]
6318 pub const EvaluateConnection: Self = Self(3);
6319 #[doc(alias = "NEOnDemandRuleActionIgnore")]
6320 pub const Ignore: Self = Self(4);
6321}
6322
6323unsafe impl Encode for NEOnDemandRuleAction {
6324 const ENCODING: Encoding = NSInteger::ENCODING;
6325}
6326
6327unsafe impl RefEncode for NEOnDemandRuleAction {
6328 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
6329}
6330
6331#[repr(transparent)]
6336#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
6337pub struct NEOnDemandRuleInterfaceType(pub NSInteger);
6338impl NEOnDemandRuleInterfaceType {
6339 #[doc(alias = "NEOnDemandRuleInterfaceTypeAny")]
6340 pub const Any: Self = Self(0);
6341 #[doc(alias = "NEOnDemandRuleInterfaceTypeEthernet")]
6342 pub const Ethernet: Self = Self(1);
6343 #[doc(alias = "NEOnDemandRuleInterfaceTypeWiFi")]
6344 pub const WiFi: Self = Self(2);
6345 #[doc(alias = "NEOnDemandRuleInterfaceTypeCellular")]
6346 pub const Cellular: Self = Self(3);
6347}
6348
6349unsafe impl Encode for NEOnDemandRuleInterfaceType {
6350 const ENCODING: Encoding = NSInteger::ENCODING;
6351}
6352
6353unsafe impl RefEncode for NEOnDemandRuleInterfaceType {
6354 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
6355}
6356
6357extern_class!(
6358 #[unsafe(super(NSObject))]
6366 #[derive(Debug, PartialEq, Eq, Hash)]
6367 pub struct NEOnDemandRule;
6368);
6369
6370unsafe impl NSCoding for NEOnDemandRule {}
6371
6372unsafe impl NSCopying for NEOnDemandRule {}
6373
6374unsafe impl CopyingHelper for NEOnDemandRule {
6375 type Result = Self;
6376}
6377
6378unsafe impl NSObjectProtocol for NEOnDemandRule {}
6379
6380unsafe impl NSSecureCoding for NEOnDemandRule {}
6381
6382impl NEOnDemandRule {
6383 extern_methods!(
6384 #[unsafe(method(action))]
6386 #[unsafe(method_family = none)]
6387 pub unsafe fn action(&self) -> NEOnDemandRuleAction;
6388
6389 #[unsafe(method(DNSSearchDomainMatch))]
6391 #[unsafe(method_family = none)]
6392 pub unsafe fn DNSSearchDomainMatch(&self) -> Option<Retained<NSArray<NSString>>>;
6393
6394 #[unsafe(method(setDNSSearchDomainMatch:))]
6396 #[unsafe(method_family = none)]
6397 pub unsafe fn setDNSSearchDomainMatch(
6398 &self,
6399 dns_search_domain_match: Option<&NSArray<NSString>>,
6400 );
6401
6402 #[unsafe(method(DNSServerAddressMatch))]
6404 #[unsafe(method_family = none)]
6405 pub unsafe fn DNSServerAddressMatch(&self) -> Option<Retained<NSArray<NSString>>>;
6406
6407 #[unsafe(method(setDNSServerAddressMatch:))]
6409 #[unsafe(method_family = none)]
6410 pub unsafe fn setDNSServerAddressMatch(
6411 &self,
6412 dns_server_address_match: Option<&NSArray<NSString>>,
6413 );
6414
6415 #[unsafe(method(interfaceTypeMatch))]
6417 #[unsafe(method_family = none)]
6418 pub unsafe fn interfaceTypeMatch(&self) -> NEOnDemandRuleInterfaceType;
6419
6420 #[unsafe(method(setInterfaceTypeMatch:))]
6422 #[unsafe(method_family = none)]
6423 pub unsafe fn setInterfaceTypeMatch(
6424 &self,
6425 interface_type_match: NEOnDemandRuleInterfaceType,
6426 );
6427
6428 #[unsafe(method(SSIDMatch))]
6430 #[unsafe(method_family = none)]
6431 pub unsafe fn SSIDMatch(&self) -> Option<Retained<NSArray<NSString>>>;
6432
6433 #[unsafe(method(setSSIDMatch:))]
6435 #[unsafe(method_family = none)]
6436 pub unsafe fn setSSIDMatch(&self, ssid_match: Option<&NSArray<NSString>>);
6437
6438 #[unsafe(method(probeURL))]
6440 #[unsafe(method_family = none)]
6441 pub unsafe fn probeURL(&self) -> Option<Retained<NSURL>>;
6442
6443 #[unsafe(method(setProbeURL:))]
6445 #[unsafe(method_family = none)]
6446 pub unsafe fn setProbeURL(&self, probe_url: Option<&NSURL>);
6447 );
6448}
6449
6450impl NEOnDemandRule {
6452 extern_methods!(
6453 #[unsafe(method(init))]
6454 #[unsafe(method_family = init)]
6455 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6456
6457 #[unsafe(method(new))]
6458 #[unsafe(method_family = new)]
6459 pub unsafe fn new() -> Retained<Self>;
6460 );
6461}
6462
6463extern_class!(
6464 #[unsafe(super(NEOnDemandRule, NSObject))]
6472 #[derive(Debug, PartialEq, Eq, Hash)]
6473 pub struct NEOnDemandRuleConnect;
6474);
6475
6476unsafe impl NSCoding for NEOnDemandRuleConnect {}
6477
6478unsafe impl NSCopying for NEOnDemandRuleConnect {}
6479
6480unsafe impl CopyingHelper for NEOnDemandRuleConnect {
6481 type Result = Self;
6482}
6483
6484unsafe impl NSObjectProtocol for NEOnDemandRuleConnect {}
6485
6486unsafe impl NSSecureCoding for NEOnDemandRuleConnect {}
6487
6488impl NEOnDemandRuleConnect {
6489 extern_methods!();
6490}
6491
6492impl NEOnDemandRuleConnect {
6494 extern_methods!(
6495 #[unsafe(method(init))]
6496 #[unsafe(method_family = init)]
6497 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6498
6499 #[unsafe(method(new))]
6500 #[unsafe(method_family = new)]
6501 pub unsafe fn new() -> Retained<Self>;
6502 );
6503}
6504
6505extern_class!(
6506 #[unsafe(super(NEOnDemandRule, NSObject))]
6514 #[derive(Debug, PartialEq, Eq, Hash)]
6515 pub struct NEOnDemandRuleDisconnect;
6516);
6517
6518unsafe impl NSCoding for NEOnDemandRuleDisconnect {}
6519
6520unsafe impl NSCopying for NEOnDemandRuleDisconnect {}
6521
6522unsafe impl CopyingHelper for NEOnDemandRuleDisconnect {
6523 type Result = Self;
6524}
6525
6526unsafe impl NSObjectProtocol for NEOnDemandRuleDisconnect {}
6527
6528unsafe impl NSSecureCoding for NEOnDemandRuleDisconnect {}
6529
6530impl NEOnDemandRuleDisconnect {
6531 extern_methods!();
6532}
6533
6534impl NEOnDemandRuleDisconnect {
6536 extern_methods!(
6537 #[unsafe(method(init))]
6538 #[unsafe(method_family = init)]
6539 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6540
6541 #[unsafe(method(new))]
6542 #[unsafe(method_family = new)]
6543 pub unsafe fn new() -> Retained<Self>;
6544 );
6545}
6546
6547extern_class!(
6548 #[unsafe(super(NEOnDemandRule, NSObject))]
6556 #[derive(Debug, PartialEq, Eq, Hash)]
6557 pub struct NEOnDemandRuleIgnore;
6558);
6559
6560unsafe impl NSCoding for NEOnDemandRuleIgnore {}
6561
6562unsafe impl NSCopying for NEOnDemandRuleIgnore {}
6563
6564unsafe impl CopyingHelper for NEOnDemandRuleIgnore {
6565 type Result = Self;
6566}
6567
6568unsafe impl NSObjectProtocol for NEOnDemandRuleIgnore {}
6569
6570unsafe impl NSSecureCoding for NEOnDemandRuleIgnore {}
6571
6572impl NEOnDemandRuleIgnore {
6573 extern_methods!();
6574}
6575
6576impl NEOnDemandRuleIgnore {
6578 extern_methods!(
6579 #[unsafe(method(init))]
6580 #[unsafe(method_family = init)]
6581 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6582
6583 #[unsafe(method(new))]
6584 #[unsafe(method_family = new)]
6585 pub unsafe fn new() -> Retained<Self>;
6586 );
6587}
6588
6589extern_class!(
6590 #[unsafe(super(NEOnDemandRule, NSObject))]
6598 #[derive(Debug, PartialEq, Eq, Hash)]
6599 pub struct NEOnDemandRuleEvaluateConnection;
6600);
6601
6602unsafe impl NSCoding for NEOnDemandRuleEvaluateConnection {}
6603
6604unsafe impl NSCopying for NEOnDemandRuleEvaluateConnection {}
6605
6606unsafe impl CopyingHelper for NEOnDemandRuleEvaluateConnection {
6607 type Result = Self;
6608}
6609
6610unsafe impl NSObjectProtocol for NEOnDemandRuleEvaluateConnection {}
6611
6612unsafe impl NSSecureCoding for NEOnDemandRuleEvaluateConnection {}
6613
6614impl NEOnDemandRuleEvaluateConnection {
6615 extern_methods!(
6616 #[unsafe(method(connectionRules))]
6618 #[unsafe(method_family = none)]
6619 pub unsafe fn connectionRules(&self)
6620 -> Option<Retained<NSArray<NEEvaluateConnectionRule>>>;
6621
6622 #[unsafe(method(setConnectionRules:))]
6624 #[unsafe(method_family = none)]
6625 pub unsafe fn setConnectionRules(
6626 &self,
6627 connection_rules: Option<&NSArray<NEEvaluateConnectionRule>>,
6628 );
6629 );
6630}
6631
6632impl NEOnDemandRuleEvaluateConnection {
6634 extern_methods!(
6635 #[unsafe(method(init))]
6636 #[unsafe(method_family = init)]
6637 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6638
6639 #[unsafe(method(new))]
6640 #[unsafe(method_family = new)]
6641 pub unsafe fn new() -> Retained<Self>;
6642 );
6643}
6644
6645#[repr(transparent)]
6650#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
6651pub struct NEEvaluateConnectionRuleAction(pub NSInteger);
6652impl NEEvaluateConnectionRuleAction {
6653 #[doc(alias = "NEEvaluateConnectionRuleActionConnectIfNeeded")]
6654 pub const ConnectIfNeeded: Self = Self(1);
6655 #[doc(alias = "NEEvaluateConnectionRuleActionNeverConnect")]
6656 pub const NeverConnect: Self = Self(2);
6657}
6658
6659unsafe impl Encode for NEEvaluateConnectionRuleAction {
6660 const ENCODING: Encoding = NSInteger::ENCODING;
6661}
6662
6663unsafe impl RefEncode for NEEvaluateConnectionRuleAction {
6664 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
6665}
6666
6667extern_class!(
6668 #[unsafe(super(NSObject))]
6674 #[derive(Debug, PartialEq, Eq, Hash)]
6675 pub struct NEEvaluateConnectionRule;
6676);
6677
6678unsafe impl NSCoding for NEEvaluateConnectionRule {}
6679
6680unsafe impl NSCopying for NEEvaluateConnectionRule {}
6681
6682unsafe impl CopyingHelper for NEEvaluateConnectionRule {
6683 type Result = Self;
6684}
6685
6686unsafe impl NSObjectProtocol for NEEvaluateConnectionRule {}
6687
6688unsafe impl NSSecureCoding for NEEvaluateConnectionRule {}
6689
6690impl NEEvaluateConnectionRule {
6691 extern_methods!(
6692 #[unsafe(method(initWithMatchDomains:andAction:))]
6694 #[unsafe(method_family = init)]
6695 pub unsafe fn initWithMatchDomains_andAction(
6696 this: Allocated<Self>,
6697 domains: &NSArray<NSString>,
6698 action: NEEvaluateConnectionRuleAction,
6699 ) -> Retained<Self>;
6700
6701 #[unsafe(method(action))]
6703 #[unsafe(method_family = none)]
6704 pub unsafe fn action(&self) -> NEEvaluateConnectionRuleAction;
6705
6706 #[unsafe(method(matchDomains))]
6708 #[unsafe(method_family = none)]
6709 pub unsafe fn matchDomains(&self) -> Retained<NSArray<NSString>>;
6710
6711 #[unsafe(method(useDNSServers))]
6713 #[unsafe(method_family = none)]
6714 pub unsafe fn useDNSServers(&self) -> Option<Retained<NSArray<NSString>>>;
6715
6716 #[unsafe(method(setUseDNSServers:))]
6718 #[unsafe(method_family = none)]
6719 pub unsafe fn setUseDNSServers(&self, use_dns_servers: Option<&NSArray<NSString>>);
6720
6721 #[unsafe(method(probeURL))]
6723 #[unsafe(method_family = none)]
6724 pub unsafe fn probeURL(&self) -> Option<Retained<NSURL>>;
6725
6726 #[unsafe(method(setProbeURL:))]
6728 #[unsafe(method_family = none)]
6729 pub unsafe fn setProbeURL(&self, probe_url: Option<&NSURL>);
6730 );
6731}
6732
6733impl NEEvaluateConnectionRule {
6735 extern_methods!(
6736 #[unsafe(method(init))]
6737 #[unsafe(method_family = init)]
6738 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6739
6740 #[unsafe(method(new))]
6741 #[unsafe(method_family = new)]
6742 pub unsafe fn new() -> Retained<Self>;
6743 );
6744}
6745
6746extern_class!(
6747 #[unsafe(super(NSObject))]
6756 #[derive(Debug, PartialEq, Eq, Hash)]
6757 pub struct NEPacket;
6758);
6759
6760unsafe impl NSCoding for NEPacket {}
6761
6762unsafe impl NSCopying for NEPacket {}
6763
6764unsafe impl CopyingHelper for NEPacket {
6765 type Result = Self;
6766}
6767
6768unsafe impl NSObjectProtocol for NEPacket {}
6769
6770unsafe impl NSSecureCoding for NEPacket {}
6771
6772impl NEPacket {
6773 extern_methods!(
6774 #[cfg(feature = "libc")]
6775 #[unsafe(method(initWithData:protocolFamily:))]
6781 #[unsafe(method_family = init)]
6782 pub unsafe fn initWithData_protocolFamily(
6783 this: Allocated<Self>,
6784 data: &NSData,
6785 protocol_family: libc::sa_family_t,
6786 ) -> Retained<Self>;
6787
6788 #[unsafe(method(data))]
6790 #[unsafe(method_family = none)]
6791 pub unsafe fn data(&self) -> Retained<NSData>;
6792
6793 #[cfg(feature = "libc")]
6794 #[unsafe(method(protocolFamily))]
6796 #[unsafe(method_family = none)]
6797 pub unsafe fn protocolFamily(&self) -> libc::sa_family_t;
6798
6799 #[unsafe(method(direction))]
6801 #[unsafe(method_family = none)]
6802 pub unsafe fn direction(&self) -> NETrafficDirection;
6803
6804 #[unsafe(method(metadata))]
6808 #[unsafe(method_family = none)]
6809 pub unsafe fn metadata(&self) -> Option<Retained<NEFlowMetaData>>;
6810 );
6811}
6812
6813impl NEPacket {
6815 extern_methods!(
6816 #[unsafe(method(init))]
6817 #[unsafe(method_family = init)]
6818 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6819
6820 #[unsafe(method(new))]
6821 #[unsafe(method_family = new)]
6822 pub unsafe fn new() -> Retained<Self>;
6823 );
6824}
6825
6826extern_class!(
6827 #[unsafe(super(NSObject))]
6835 #[derive(Debug, PartialEq, Eq, Hash)]
6836 pub struct NEPacketTunnelFlow;
6837);
6838
6839unsafe impl NSObjectProtocol for NEPacketTunnelFlow {}
6840
6841impl NEPacketTunnelFlow {
6842 extern_methods!(
6843 #[cfg(feature = "block2")]
6844 #[unsafe(method(readPacketsWithCompletionHandler:))]
6848 #[unsafe(method_family = none)]
6849 pub unsafe fn readPacketsWithCompletionHandler(
6850 &self,
6851 completion_handler: &block2::Block<
6852 dyn Fn(NonNull<NSArray<NSData>>, NonNull<NSArray<NSNumber>>),
6853 >,
6854 );
6855
6856 #[unsafe(method(writePackets:withProtocols:))]
6862 #[unsafe(method_family = none)]
6863 pub unsafe fn writePackets_withProtocols(
6864 &self,
6865 packets: &NSArray<NSData>,
6866 protocols: &NSArray<NSNumber>,
6867 ) -> bool;
6868
6869 #[cfg(feature = "block2")]
6870 #[unsafe(method(readPacketObjectsWithCompletionHandler:))]
6874 #[unsafe(method_family = none)]
6875 pub unsafe fn readPacketObjectsWithCompletionHandler(
6876 &self,
6877 completion_handler: &block2::Block<dyn Fn(NonNull<NSArray<NEPacket>>)>,
6878 );
6879
6880 #[unsafe(method(writePacketObjects:))]
6884 #[unsafe(method_family = none)]
6885 pub unsafe fn writePacketObjects(&self, packets: &NSArray<NEPacket>) -> bool;
6886 );
6887}
6888
6889impl NEPacketTunnelFlow {
6891 extern_methods!(
6892 #[unsafe(method(init))]
6893 #[unsafe(method_family = init)]
6894 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
6895
6896 #[unsafe(method(new))]
6897 #[unsafe(method_family = new)]
6898 pub unsafe fn new() -> Retained<Self>;
6899 );
6900}
6901
6902extern_class!(
6903 #[unsafe(super(NSObject))]
6910 #[derive(Debug, PartialEq, Eq, Hash)]
6911 pub struct NERelay;
6912);
6913
6914unsafe impl NSCoding for NERelay {}
6915
6916unsafe impl NSCopying for NERelay {}
6917
6918unsafe impl CopyingHelper for NERelay {
6919 type Result = Self;
6920}
6921
6922unsafe impl NSObjectProtocol for NERelay {}
6923
6924unsafe impl NSSecureCoding for NERelay {}
6925
6926impl NERelay {
6927 extern_methods!(
6928 #[unsafe(method(HTTP3RelayURL))]
6930 #[unsafe(method_family = none)]
6931 pub unsafe fn HTTP3RelayURL(&self) -> Option<Retained<NSURL>>;
6932
6933 #[unsafe(method(setHTTP3RelayURL:))]
6935 #[unsafe(method_family = none)]
6936 pub unsafe fn setHTTP3RelayURL(&self, http3_relay_url: Option<&NSURL>);
6937
6938 #[unsafe(method(HTTP2RelayURL))]
6940 #[unsafe(method_family = none)]
6941 pub unsafe fn HTTP2RelayURL(&self) -> Option<Retained<NSURL>>;
6942
6943 #[unsafe(method(setHTTP2RelayURL:))]
6945 #[unsafe(method_family = none)]
6946 pub unsafe fn setHTTP2RelayURL(&self, http2_relay_url: Option<&NSURL>);
6947
6948 #[unsafe(method(dnsOverHTTPSURL))]
6950 #[unsafe(method_family = none)]
6951 pub unsafe fn dnsOverHTTPSURL(&self) -> Option<Retained<NSURL>>;
6952
6953 #[unsafe(method(setDnsOverHTTPSURL:))]
6955 #[unsafe(method_family = none)]
6956 pub unsafe fn setDnsOverHTTPSURL(&self, dns_over_httpsurl: Option<&NSURL>);
6957
6958 #[unsafe(method(syntheticDNSAnswerIPv4Prefix))]
6961 #[unsafe(method_family = none)]
6962 pub unsafe fn syntheticDNSAnswerIPv4Prefix(&self) -> Option<Retained<NSString>>;
6963
6964 #[unsafe(method(setSyntheticDNSAnswerIPv4Prefix:))]
6966 #[unsafe(method_family = none)]
6967 pub unsafe fn setSyntheticDNSAnswerIPv4Prefix(
6968 &self,
6969 synthetic_dns_answer_i_pv4_prefix: Option<&NSString>,
6970 );
6971
6972 #[unsafe(method(syntheticDNSAnswerIPv6Prefix))]
6975 #[unsafe(method_family = none)]
6976 pub unsafe fn syntheticDNSAnswerIPv6Prefix(&self) -> Option<Retained<NSString>>;
6977
6978 #[unsafe(method(setSyntheticDNSAnswerIPv6Prefix:))]
6980 #[unsafe(method_family = none)]
6981 pub unsafe fn setSyntheticDNSAnswerIPv6Prefix(
6982 &self,
6983 synthetic_dns_answer_i_pv6_prefix: Option<&NSString>,
6984 );
6985
6986 #[unsafe(method(additionalHTTPHeaderFields))]
6988 #[unsafe(method_family = none)]
6989 pub unsafe fn additionalHTTPHeaderFields(
6990 &self,
6991 ) -> Retained<NSDictionary<NSString, NSString>>;
6992
6993 #[unsafe(method(setAdditionalHTTPHeaderFields:))]
6995 #[unsafe(method_family = none)]
6996 pub unsafe fn setAdditionalHTTPHeaderFields(
6997 &self,
6998 additional_http_header_fields: &NSDictionary<NSString, NSString>,
6999 );
7000
7001 #[unsafe(method(rawPublicKeys))]
7003 #[unsafe(method_family = none)]
7004 pub unsafe fn rawPublicKeys(&self) -> Option<Retained<NSArray<NSData>>>;
7005
7006 #[unsafe(method(setRawPublicKeys:))]
7008 #[unsafe(method_family = none)]
7009 pub unsafe fn setRawPublicKeys(&self, raw_public_keys: Option<&NSArray<NSData>>);
7010
7011 #[unsafe(method(identityData))]
7013 #[unsafe(method_family = none)]
7014 pub unsafe fn identityData(&self) -> Option<Retained<NSData>>;
7015
7016 #[unsafe(method(setIdentityData:))]
7018 #[unsafe(method_family = none)]
7019 pub unsafe fn setIdentityData(&self, identity_data: Option<&NSData>);
7020
7021 #[unsafe(method(identityDataPassword))]
7023 #[unsafe(method_family = none)]
7024 pub unsafe fn identityDataPassword(&self) -> Option<Retained<NSString>>;
7025
7026 #[unsafe(method(setIdentityDataPassword:))]
7028 #[unsafe(method_family = none)]
7029 pub unsafe fn setIdentityDataPassword(&self, identity_data_password: Option<&NSString>);
7030 );
7031}
7032
7033impl NERelay {
7035 extern_methods!(
7036 #[unsafe(method(init))]
7037 #[unsafe(method_family = init)]
7038 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7039
7040 #[unsafe(method(new))]
7041 #[unsafe(method_family = new)]
7042 pub unsafe fn new() -> Retained<Self>;
7043 );
7044}
7045
7046#[repr(transparent)]
7051#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
7052pub struct NERelayManagerError(pub NSInteger);
7053impl NERelayManagerError {
7054 #[doc(alias = "NERelayManagerErrorConfigurationInvalid")]
7055 pub const ConfigurationInvalid: Self = Self(1);
7056 #[doc(alias = "NERelayManagerErrorConfigurationDisabled")]
7057 pub const ConfigurationDisabled: Self = Self(2);
7058 #[doc(alias = "NERelayManagerErrorConfigurationStale")]
7059 pub const ConfigurationStale: Self = Self(3);
7060 #[doc(alias = "NERelayManagerErrorConfigurationCannotBeRemoved")]
7061 pub const ConfigurationCannotBeRemoved: Self = Self(4);
7062}
7063
7064unsafe impl Encode for NERelayManagerError {
7065 const ENCODING: Encoding = NSInteger::ENCODING;
7066}
7067
7068unsafe impl RefEncode for NERelayManagerError {
7069 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
7070}
7071
7072extern "C" {
7073 pub static NERelayErrorDomain: &'static NSString;
7075}
7076
7077#[repr(transparent)]
7082#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
7083pub struct NERelayManagerClientError(pub NSInteger);
7084impl NERelayManagerClientError {
7085 #[doc(alias = "NERelayManagerClientErrorNone")]
7086 pub const None: Self = Self(1);
7087 #[doc(alias = "NERelayManagerClientErrorDNSFailed")]
7088 pub const DNSFailed: Self = Self(2);
7089 #[doc(alias = "NERelayManagerClientErrorServerUnreachable")]
7090 pub const ServerUnreachable: Self = Self(3);
7091 #[doc(alias = "NERelayManagerClientErrorServerDisconnected")]
7092 pub const ServerDisconnected: Self = Self(4);
7093 #[doc(alias = "NERelayManagerClientErrorCertificateMissing")]
7094 pub const CertificateMissing: Self = Self(5);
7095 #[doc(alias = "NERelayManagerClientErrorCertificateInvalid")]
7096 pub const CertificateInvalid: Self = Self(6);
7097 #[doc(alias = "NERelayManagerClientErrorCertificateExpired")]
7098 pub const CertificateExpired: Self = Self(7);
7099 #[doc(alias = "NERelayManagerClientErrorServerCertificateInvalid")]
7100 pub const ServerCertificateInvalid: Self = Self(8);
7101 #[doc(alias = "NERelayManagerClientErrorServerCertificateExpired")]
7102 pub const ServerCertificateExpired: Self = Self(9);
7103 #[doc(alias = "NERelayManagerClientErrorOther")]
7104 pub const Other: Self = Self(10);
7105}
7106
7107unsafe impl Encode for NERelayManagerClientError {
7108 const ENCODING: Encoding = NSInteger::ENCODING;
7109}
7110
7111unsafe impl RefEncode for NERelayManagerClientError {
7112 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
7113}
7114
7115extern "C" {
7116 pub static NERelayClientErrorDomain: &'static NSString;
7118}
7119
7120extern "C" {
7121 pub static NERelayConfigurationDidChangeNotification: &'static NSString;
7123}
7124
7125extern_class!(
7126 #[unsafe(super(NSObject))]
7134 #[derive(Debug, PartialEq, Eq, Hash)]
7135 pub struct NERelayManager;
7136);
7137
7138unsafe impl NSObjectProtocol for NERelayManager {}
7139
7140impl NERelayManager {
7141 extern_methods!(
7142 #[unsafe(method(sharedManager))]
7144 #[unsafe(method_family = none)]
7145 pub unsafe fn sharedManager() -> Retained<NERelayManager>;
7146
7147 #[cfg(feature = "block2")]
7148 #[unsafe(method(loadFromPreferencesWithCompletionHandler:))]
7152 #[unsafe(method_family = none)]
7153 pub unsafe fn loadFromPreferencesWithCompletionHandler(
7154 &self,
7155 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
7156 );
7157
7158 #[cfg(feature = "block2")]
7159 #[unsafe(method(removeFromPreferencesWithCompletionHandler:))]
7163 #[unsafe(method_family = none)]
7164 pub unsafe fn removeFromPreferencesWithCompletionHandler(
7165 &self,
7166 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
7167 );
7168
7169 #[cfg(feature = "block2")]
7170 #[unsafe(method(saveToPreferencesWithCompletionHandler:))]
7174 #[unsafe(method_family = none)]
7175 pub unsafe fn saveToPreferencesWithCompletionHandler(
7176 &self,
7177 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
7178 );
7179
7180 #[cfg(feature = "block2")]
7181 #[unsafe(method(getLastClientErrors:completionHandler:))]
7187 #[unsafe(method_family = none)]
7188 pub unsafe fn getLastClientErrors_completionHandler(
7189 &self,
7190 seconds: NSTimeInterval,
7191 completion_handler: &block2::Block<dyn Fn(*mut NSArray<NSError>)>,
7192 );
7193
7194 #[unsafe(method(localizedDescription))]
7196 #[unsafe(method_family = none)]
7197 pub unsafe fn localizedDescription(&self) -> Option<Retained<NSString>>;
7198
7199 #[unsafe(method(setLocalizedDescription:))]
7201 #[unsafe(method_family = none)]
7202 pub unsafe fn setLocalizedDescription(&self, localized_description: Option<&NSString>);
7203
7204 #[unsafe(method(isEnabled))]
7206 #[unsafe(method_family = none)]
7207 pub unsafe fn isEnabled(&self) -> bool;
7208
7209 #[unsafe(method(setEnabled:))]
7211 #[unsafe(method_family = none)]
7212 pub unsafe fn setEnabled(&self, enabled: bool);
7213
7214 #[unsafe(method(relays))]
7216 #[unsafe(method_family = none)]
7217 pub unsafe fn relays(&self) -> Option<Retained<NSArray<NERelay>>>;
7218
7219 #[unsafe(method(setRelays:))]
7221 #[unsafe(method_family = none)]
7222 pub unsafe fn setRelays(&self, relays: Option<&NSArray<NERelay>>);
7223
7224 #[unsafe(method(matchDomains))]
7226 #[unsafe(method_family = none)]
7227 pub unsafe fn matchDomains(&self) -> Option<Retained<NSArray<NSString>>>;
7228
7229 #[unsafe(method(setMatchDomains:))]
7231 #[unsafe(method_family = none)]
7232 pub unsafe fn setMatchDomains(&self, match_domains: Option<&NSArray<NSString>>);
7233
7234 #[unsafe(method(excludedDomains))]
7236 #[unsafe(method_family = none)]
7237 pub unsafe fn excludedDomains(&self) -> Option<Retained<NSArray<NSString>>>;
7238
7239 #[unsafe(method(setExcludedDomains:))]
7241 #[unsafe(method_family = none)]
7242 pub unsafe fn setExcludedDomains(&self, excluded_domains: Option<&NSArray<NSString>>);
7243
7244 #[unsafe(method(onDemandRules))]
7246 #[unsafe(method_family = none)]
7247 pub unsafe fn onDemandRules(&self) -> Option<Retained<NSArray<NEOnDemandRule>>>;
7248
7249 #[unsafe(method(setOnDemandRules:))]
7251 #[unsafe(method_family = none)]
7252 pub unsafe fn setOnDemandRules(&self, on_demand_rules: Option<&NSArray<NEOnDemandRule>>);
7253
7254 #[cfg(feature = "block2")]
7255 #[unsafe(method(loadAllManagersFromPreferencesWithCompletionHandler:))]
7259 #[unsafe(method_family = none)]
7260 pub unsafe fn loadAllManagersFromPreferencesWithCompletionHandler(
7261 completion_handler: &block2::Block<
7262 dyn Fn(NonNull<NSArray<NERelayManager>>, *mut NSError),
7263 >,
7264 );
7265 );
7266}
7267
7268impl NERelayManager {
7270 extern_methods!(
7271 #[unsafe(method(init))]
7272 #[unsafe(method_family = init)]
7273 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7274
7275 #[unsafe(method(new))]
7276 #[unsafe(method_family = new)]
7277 pub unsafe fn new() -> Retained<Self>;
7278 );
7279}
7280
7281extern_class!(
7282 #[unsafe(super(NEVPNManager, NSObject))]
7288 #[derive(Debug, PartialEq, Eq, Hash)]
7289 pub struct NETransparentProxyManager;
7290);
7291
7292unsafe impl NSObjectProtocol for NETransparentProxyManager {}
7293
7294impl NETransparentProxyManager {
7295 extern_methods!(
7296 #[cfg(feature = "block2")]
7297 #[unsafe(method(loadAllFromPreferencesWithCompletionHandler:))]
7301 #[unsafe(method_family = none)]
7302 pub unsafe fn loadAllFromPreferencesWithCompletionHandler(
7303 completion_handler: &block2::Block<
7304 dyn Fn(*mut NSArray<NETransparentProxyManager>, *mut NSError),
7305 >,
7306 );
7307 );
7308}
7309
7310impl NETransparentProxyManager {
7312 extern_methods!(
7313 #[unsafe(method(init))]
7314 #[unsafe(method_family = init)]
7315 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7316
7317 #[unsafe(method(new))]
7318 #[unsafe(method_family = new)]
7319 pub unsafe fn new() -> Retained<Self>;
7320 );
7321}
7322
7323extern_class!(
7324 #[unsafe(super(NETunnelNetworkSettings, NSObject))]
7332 #[derive(Debug, PartialEq, Eq, Hash)]
7333 pub struct NETransparentProxyNetworkSettings;
7334);
7335
7336unsafe impl NSCoding for NETransparentProxyNetworkSettings {}
7337
7338unsafe impl NSCopying for NETransparentProxyNetworkSettings {}
7339
7340unsafe impl CopyingHelper for NETransparentProxyNetworkSettings {
7341 type Result = Self;
7342}
7343
7344unsafe impl NSObjectProtocol for NETransparentProxyNetworkSettings {}
7345
7346unsafe impl NSSecureCoding for NETransparentProxyNetworkSettings {}
7347
7348impl NETransparentProxyNetworkSettings {
7349 extern_methods!(
7350 #[unsafe(method(includedNetworkRules))]
7359 #[unsafe(method_family = none)]
7360 pub unsafe fn includedNetworkRules(&self) -> Option<Retained<NSArray<NENetworkRule>>>;
7361
7362 #[unsafe(method(setIncludedNetworkRules:))]
7364 #[unsafe(method_family = none)]
7365 pub unsafe fn setIncludedNetworkRules(
7366 &self,
7367 included_network_rules: Option<&NSArray<NENetworkRule>>,
7368 );
7369
7370 #[unsafe(method(excludedNetworkRules))]
7379 #[unsafe(method_family = none)]
7380 pub unsafe fn excludedNetworkRules(&self) -> Option<Retained<NSArray<NENetworkRule>>>;
7381
7382 #[unsafe(method(setExcludedNetworkRules:))]
7384 #[unsafe(method_family = none)]
7385 pub unsafe fn setExcludedNetworkRules(
7386 &self,
7387 excluded_network_rules: Option<&NSArray<NENetworkRule>>,
7388 );
7389 );
7390}
7391
7392impl NETransparentProxyNetworkSettings {
7394 extern_methods!(
7395 #[unsafe(method(initWithTunnelRemoteAddress:))]
7399 #[unsafe(method_family = init)]
7400 pub unsafe fn initWithTunnelRemoteAddress(
7401 this: Allocated<Self>,
7402 address: &NSString,
7403 ) -> Retained<Self>;
7404 );
7405}
7406
7407impl NETransparentProxyNetworkSettings {
7409 extern_methods!(
7410 #[unsafe(method(init))]
7411 #[unsafe(method_family = init)]
7412 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7413
7414 #[unsafe(method(new))]
7415 #[unsafe(method_family = new)]
7416 pub unsafe fn new() -> Retained<Self>;
7417 );
7418}
7419
7420extern_class!(
7421 #[unsafe(super(NEAppProxyProvider, NETunnelProvider, NEProvider, NSObject))]
7431 #[derive(Debug, PartialEq, Eq, Hash)]
7432 pub struct NETransparentProxyProvider;
7433);
7434
7435unsafe impl NSObjectProtocol for NETransparentProxyProvider {}
7436
7437impl NETransparentProxyProvider {
7438 extern_methods!();
7439}
7440
7441impl NETransparentProxyProvider {
7443 extern_methods!(
7444 #[unsafe(method(init))]
7445 #[unsafe(method_family = init)]
7446 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7447
7448 #[unsafe(method(new))]
7449 #[unsafe(method_family = new)]
7450 pub unsafe fn new() -> Retained<Self>;
7451 );
7452}
7453
7454#[repr(transparent)]
7459#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
7460pub struct NEVPNStatus(pub NSInteger);
7461impl NEVPNStatus {
7462 #[doc(alias = "NEVPNStatusInvalid")]
7463 pub const Invalid: Self = Self(0);
7464 #[doc(alias = "NEVPNStatusDisconnected")]
7465 pub const Disconnected: Self = Self(1);
7466 #[doc(alias = "NEVPNStatusConnecting")]
7467 pub const Connecting: Self = Self(2);
7468 #[doc(alias = "NEVPNStatusConnected")]
7469 pub const Connected: Self = Self(3);
7470 #[doc(alias = "NEVPNStatusReasserting")]
7471 pub const Reasserting: Self = Self(4);
7472 #[doc(alias = "NEVPNStatusDisconnecting")]
7473 pub const Disconnecting: Self = Self(5);
7474}
7475
7476unsafe impl Encode for NEVPNStatus {
7477 const ENCODING: Encoding = NSInteger::ENCODING;
7478}
7479
7480unsafe impl RefEncode for NEVPNStatus {
7481 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
7482}
7483
7484extern "C" {
7485 pub static NEVPNStatusDidChangeNotification: &'static NSString;
7487}
7488
7489extern "C" {
7490 pub static NEVPNConnectionStartOptionUsername: &'static NSString;
7492}
7493
7494extern "C" {
7495 pub static NEVPNConnectionStartOptionPassword: &'static NSString;
7497}
7498
7499#[repr(transparent)]
7504#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
7505pub struct NEVPNConnectionError(pub NSInteger);
7506impl NEVPNConnectionError {
7507 #[doc(alias = "NEVPNConnectionErrorOverslept")]
7508 pub const Overslept: Self = Self(1);
7509 #[doc(alias = "NEVPNConnectionErrorNoNetworkAvailable")]
7510 pub const NoNetworkAvailable: Self = Self(2);
7511 #[doc(alias = "NEVPNConnectionErrorUnrecoverableNetworkChange")]
7513 pub const UnrecoverableNetworkChange: Self = Self(3);
7514 #[doc(alias = "NEVPNConnectionErrorConfigurationFailed")]
7515 pub const ConfigurationFailed: Self = Self(4);
7516 #[doc(alias = "NEVPNConnectionErrorServerAddressResolutionFailed")]
7517 pub const ServerAddressResolutionFailed: Self = Self(5);
7518 #[doc(alias = "NEVPNConnectionErrorServerNotResponding")]
7519 pub const ServerNotResponding: Self = Self(6);
7520 #[doc(alias = "NEVPNConnectionErrorServerDead")]
7521 pub const ServerDead: Self = Self(7);
7522 #[doc(alias = "NEVPNConnectionErrorAuthenticationFailed")]
7523 pub const AuthenticationFailed: Self = Self(8);
7524 #[doc(alias = "NEVPNConnectionErrorClientCertificateInvalid")]
7525 pub const ClientCertificateInvalid: Self = Self(9);
7526 #[doc(alias = "NEVPNConnectionErrorClientCertificateNotYetValid")]
7527 pub const ClientCertificateNotYetValid: Self = Self(10);
7528 #[doc(alias = "NEVPNConnectionErrorClientCertificateExpired")]
7529 pub const ClientCertificateExpired: Self = Self(11);
7530 #[doc(alias = "NEVPNConnectionErrorPluginFailed")]
7531 pub const PluginFailed: Self = Self(12);
7532 #[doc(alias = "NEVPNConnectionErrorConfigurationNotFound")]
7533 pub const ConfigurationNotFound: Self = Self(13);
7534 #[doc(alias = "NEVPNConnectionErrorPluginDisabled")]
7535 pub const PluginDisabled: Self = Self(14);
7536 #[doc(alias = "NEVPNConnectionErrorNegotiationFailed")]
7537 pub const NegotiationFailed: Self = Self(15);
7538 #[doc(alias = "NEVPNConnectionErrorServerDisconnected")]
7539 pub const ServerDisconnected: Self = Self(16);
7540 #[doc(alias = "NEVPNConnectionErrorServerCertificateInvalid")]
7541 pub const ServerCertificateInvalid: Self = Self(17);
7542 #[doc(alias = "NEVPNConnectionErrorServerCertificateNotYetValid")]
7543 pub const ServerCertificateNotYetValid: Self = Self(18);
7544 #[doc(alias = "NEVPNConnectionErrorServerCertificateExpired")]
7545 pub const ServerCertificateExpired: Self = Self(19);
7546}
7547
7548unsafe impl Encode for NEVPNConnectionError {
7549 const ENCODING: Encoding = NSInteger::ENCODING;
7550}
7551
7552unsafe impl RefEncode for NEVPNConnectionError {
7553 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
7554}
7555
7556extern "C" {
7557 pub static NEVPNConnectionErrorDomain: &'static NSString;
7559}
7560
7561extern_class!(
7562 #[unsafe(super(NSObject))]
7568 #[derive(Debug, PartialEq, Eq, Hash)]
7569 pub struct NEVPNConnection;
7570);
7571
7572unsafe impl NSObjectProtocol for NEVPNConnection {}
7573
7574impl NEVPNConnection {
7575 extern_methods!(
7576 #[unsafe(method(startVPNTunnelAndReturnError:_))]
7584 #[unsafe(method_family = none)]
7585 pub unsafe fn startVPNTunnelAndReturnError(&self) -> Result<(), Retained<NSError>>;
7586
7587 #[unsafe(method(startVPNTunnelWithOptions:andReturnError:_))]
7600 #[unsafe(method_family = none)]
7601 pub unsafe fn startVPNTunnelWithOptions_andReturnError(
7602 &self,
7603 options: Option<&NSDictionary<NSString, NSObject>>,
7604 ) -> Result<(), Retained<NSError>>;
7605
7606 #[unsafe(method(stopVPNTunnel))]
7608 #[unsafe(method_family = none)]
7609 pub unsafe fn stopVPNTunnel(&self);
7610
7611 #[cfg(feature = "block2")]
7612 #[unsafe(method(fetchLastDisconnectErrorWithCompletionHandler:))]
7616 #[unsafe(method_family = none)]
7617 pub unsafe fn fetchLastDisconnectErrorWithCompletionHandler(
7618 &self,
7619 handler: &block2::Block<dyn Fn(*mut NSError)>,
7620 );
7621
7622 #[unsafe(method(status))]
7624 #[unsafe(method_family = none)]
7625 pub unsafe fn status(&self) -> NEVPNStatus;
7626
7627 #[unsafe(method(connectedDate))]
7629 #[unsafe(method_family = none)]
7630 pub unsafe fn connectedDate(&self) -> Option<Retained<NSDate>>;
7631
7632 #[unsafe(method(manager))]
7634 #[unsafe(method_family = none)]
7635 pub unsafe fn manager(&self) -> Retained<NEVPNManager>;
7636 );
7637}
7638
7639impl NEVPNConnection {
7641 extern_methods!(
7642 #[unsafe(method(init))]
7643 #[unsafe(method_family = init)]
7644 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7645
7646 #[unsafe(method(new))]
7647 #[unsafe(method_family = new)]
7648 pub unsafe fn new() -> Retained<Self>;
7649 );
7650}
7651
7652extern_class!(
7653 #[unsafe(super(NEVPNConnection, NSObject))]
7659 #[derive(Debug, PartialEq, Eq, Hash)]
7660 pub struct NETunnelProviderSession;
7661);
7662
7663unsafe impl NSObjectProtocol for NETunnelProviderSession {}
7664
7665impl NETunnelProviderSession {
7666 extern_methods!(
7667 #[unsafe(method(startTunnelWithOptions:andReturnError:_))]
7677 #[unsafe(method_family = none)]
7678 pub unsafe fn startTunnelWithOptions_andReturnError(
7679 &self,
7680 options: Option<&NSDictionary<NSString, AnyObject>>,
7681 ) -> Result<(), Retained<NSError>>;
7682
7683 #[unsafe(method(stopTunnel))]
7685 #[unsafe(method_family = none)]
7686 pub unsafe fn stopTunnel(&self);
7687
7688 #[cfg(feature = "block2")]
7689 #[unsafe(method(sendProviderMessage:returnError:responseHandler:))]
7701 #[unsafe(method_family = none)]
7702 pub unsafe fn sendProviderMessage_returnError_responseHandler(
7703 &self,
7704 message_data: &NSData,
7705 error: Option<&mut Option<Retained<NSError>>>,
7706 response_handler: Option<&block2::Block<dyn Fn(*mut NSData)>>,
7707 ) -> bool;
7708 );
7709}
7710
7711impl NETunnelProviderSession {
7713 extern_methods!(
7714 #[unsafe(method(init))]
7715 #[unsafe(method_family = init)]
7716 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7717
7718 #[unsafe(method(new))]
7719 #[unsafe(method_family = new)]
7720 pub unsafe fn new() -> Retained<Self>;
7721 );
7722}
7723
7724extern_class!(
7725 #[unsafe(super(NEVPNProtocol, NSObject))]
7731 #[derive(Debug, PartialEq, Eq, Hash)]
7732 pub struct NETunnelProviderProtocol;
7733);
7734
7735unsafe impl NSCoding for NETunnelProviderProtocol {}
7736
7737unsafe impl NSCopying for NETunnelProviderProtocol {}
7738
7739unsafe impl CopyingHelper for NETunnelProviderProtocol {
7740 type Result = Self;
7741}
7742
7743unsafe impl NSObjectProtocol for NETunnelProviderProtocol {}
7744
7745unsafe impl NSSecureCoding for NETunnelProviderProtocol {}
7746
7747impl NETunnelProviderProtocol {
7748 extern_methods!(
7749 #[unsafe(method(providerConfiguration))]
7751 #[unsafe(method_family = none)]
7752 pub unsafe fn providerConfiguration(
7753 &self,
7754 ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
7755
7756 #[unsafe(method(setProviderConfiguration:))]
7758 #[unsafe(method_family = none)]
7759 pub unsafe fn setProviderConfiguration(
7760 &self,
7761 provider_configuration: Option<&NSDictionary<NSString, AnyObject>>,
7762 );
7763
7764 #[unsafe(method(providerBundleIdentifier))]
7766 #[unsafe(method_family = none)]
7767 pub unsafe fn providerBundleIdentifier(&self) -> Option<Retained<NSString>>;
7768
7769 #[unsafe(method(setProviderBundleIdentifier:))]
7771 #[unsafe(method_family = none)]
7772 pub unsafe fn setProviderBundleIdentifier(
7773 &self,
7774 provider_bundle_identifier: Option<&NSString>,
7775 );
7776 );
7777}
7778
7779impl NETunnelProviderProtocol {
7781 extern_methods!(
7782 #[unsafe(method(init))]
7783 #[unsafe(method_family = init)]
7784 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7785
7786 #[unsafe(method(new))]
7787 #[unsafe(method_family = new)]
7788 pub unsafe fn new() -> Retained<Self>;
7789 );
7790}
7791
7792#[repr(transparent)]
7797#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
7798pub struct NEVPNIKEAuthenticationMethod(pub NSInteger);
7799impl NEVPNIKEAuthenticationMethod {
7800 #[doc(alias = "NEVPNIKEAuthenticationMethodNone")]
7801 pub const None: Self = Self(0);
7802 #[doc(alias = "NEVPNIKEAuthenticationMethodCertificate")]
7803 pub const Certificate: Self = Self(1);
7804 #[doc(alias = "NEVPNIKEAuthenticationMethodSharedSecret")]
7805 pub const SharedSecret: Self = Self(2);
7806}
7807
7808unsafe impl Encode for NEVPNIKEAuthenticationMethod {
7809 const ENCODING: Encoding = NSInteger::ENCODING;
7810}
7811
7812unsafe impl RefEncode for NEVPNIKEAuthenticationMethod {
7813 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
7814}
7815
7816extern_class!(
7817 #[unsafe(super(NEVPNProtocol, NSObject))]
7823 #[derive(Debug, PartialEq, Eq, Hash)]
7824 pub struct NEVPNProtocolIPSec;
7825);
7826
7827unsafe impl NSCoding for NEVPNProtocolIPSec {}
7828
7829unsafe impl NSCopying for NEVPNProtocolIPSec {}
7830
7831unsafe impl CopyingHelper for NEVPNProtocolIPSec {
7832 type Result = Self;
7833}
7834
7835unsafe impl NSObjectProtocol for NEVPNProtocolIPSec {}
7836
7837unsafe impl NSSecureCoding for NEVPNProtocolIPSec {}
7838
7839impl NEVPNProtocolIPSec {
7840 extern_methods!(
7841 #[unsafe(method(authenticationMethod))]
7843 #[unsafe(method_family = none)]
7844 pub unsafe fn authenticationMethod(&self) -> NEVPNIKEAuthenticationMethod;
7845
7846 #[unsafe(method(setAuthenticationMethod:))]
7848 #[unsafe(method_family = none)]
7849 pub unsafe fn setAuthenticationMethod(
7850 &self,
7851 authentication_method: NEVPNIKEAuthenticationMethod,
7852 );
7853
7854 #[unsafe(method(useExtendedAuthentication))]
7858 #[unsafe(method_family = none)]
7859 pub unsafe fn useExtendedAuthentication(&self) -> bool;
7860
7861 #[unsafe(method(setUseExtendedAuthentication:))]
7863 #[unsafe(method_family = none)]
7864 pub unsafe fn setUseExtendedAuthentication(&self, use_extended_authentication: bool);
7865
7866 #[unsafe(method(sharedSecretReference))]
7868 #[unsafe(method_family = none)]
7869 pub unsafe fn sharedSecretReference(&self) -> Option<Retained<NSData>>;
7870
7871 #[unsafe(method(setSharedSecretReference:))]
7873 #[unsafe(method_family = none)]
7874 pub unsafe fn setSharedSecretReference(&self, shared_secret_reference: Option<&NSData>);
7875
7876 #[unsafe(method(localIdentifier))]
7878 #[unsafe(method_family = none)]
7879 pub unsafe fn localIdentifier(&self) -> Option<Retained<NSString>>;
7880
7881 #[unsafe(method(setLocalIdentifier:))]
7883 #[unsafe(method_family = none)]
7884 pub unsafe fn setLocalIdentifier(&self, local_identifier: Option<&NSString>);
7885
7886 #[unsafe(method(remoteIdentifier))]
7888 #[unsafe(method_family = none)]
7889 pub unsafe fn remoteIdentifier(&self) -> Option<Retained<NSString>>;
7890
7891 #[unsafe(method(setRemoteIdentifier:))]
7893 #[unsafe(method_family = none)]
7894 pub unsafe fn setRemoteIdentifier(&self, remote_identifier: Option<&NSString>);
7895 );
7896}
7897
7898impl NEVPNProtocolIPSec {
7900 extern_methods!(
7901 #[unsafe(method(init))]
7902 #[unsafe(method_family = init)]
7903 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
7904
7905 #[unsafe(method(new))]
7906 #[unsafe(method_family = new)]
7907 pub unsafe fn new() -> Retained<Self>;
7908 );
7909}
7910
7911#[repr(transparent)]
7916#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
7917pub struct NEVPNIKEv2IntegrityAlgorithm(pub NSInteger);
7918impl NEVPNIKEv2IntegrityAlgorithm {
7919 #[deprecated = "Use SHA-2 for integrity protection instead"]
7920 #[doc(alias = "NEVPNIKEv2IntegrityAlgorithmSHA96")]
7921 pub const SHA96: Self = Self(1);
7922 #[deprecated = "Use SHA-2 for integrity protection instead"]
7923 #[doc(alias = "NEVPNIKEv2IntegrityAlgorithmSHA160")]
7924 pub const SHA160: Self = Self(2);
7925 #[doc(alias = "NEVPNIKEv2IntegrityAlgorithmSHA256")]
7926 pub const SHA256: Self = Self(3);
7927 #[doc(alias = "NEVPNIKEv2IntegrityAlgorithmSHA384")]
7928 pub const SHA384: Self = Self(4);
7929 #[doc(alias = "NEVPNIKEv2IntegrityAlgorithmSHA512")]
7930 pub const SHA512: Self = Self(5);
7931}
7932
7933unsafe impl Encode for NEVPNIKEv2IntegrityAlgorithm {
7934 const ENCODING: Encoding = NSInteger::ENCODING;
7935}
7936
7937unsafe impl RefEncode for NEVPNIKEv2IntegrityAlgorithm {
7938 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
7939}
7940
7941#[repr(transparent)]
7946#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
7947pub struct NEVPNIKEv2DeadPeerDetectionRate(pub NSInteger);
7948impl NEVPNIKEv2DeadPeerDetectionRate {
7949 #[doc(alias = "NEVPNIKEv2DeadPeerDetectionRateNone")]
7950 pub const None: Self = Self(0);
7951 #[doc(alias = "NEVPNIKEv2DeadPeerDetectionRateLow")]
7952 pub const Low: Self = Self(1);
7953 #[doc(alias = "NEVPNIKEv2DeadPeerDetectionRateMedium")]
7954 pub const Medium: Self = Self(2);
7955 #[doc(alias = "NEVPNIKEv2DeadPeerDetectionRateHigh")]
7956 pub const High: Self = Self(3);
7957}
7958
7959unsafe impl Encode for NEVPNIKEv2DeadPeerDetectionRate {
7960 const ENCODING: Encoding = NSInteger::ENCODING;
7961}
7962
7963unsafe impl RefEncode for NEVPNIKEv2DeadPeerDetectionRate {
7964 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
7965}
7966
7967#[repr(transparent)]
7972#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
7973pub struct NEVPNIKEv2DiffieHellmanGroup(pub NSInteger);
7974impl NEVPNIKEv2DiffieHellmanGroup {
7975 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroupInvalid")]
7976 pub const GroupInvalid: Self = Self(0);
7977 #[deprecated = "Use Diffie Hellman group 14 or greater instead"]
7978 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup1")]
7979 pub const Group1: Self = Self(1);
7980 #[deprecated = "Use Diffie Hellman group 14 or greater instead"]
7981 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup2")]
7982 pub const Group2: Self = Self(2);
7983 #[deprecated = "Use Diffie Hellman group 14 or greater instead"]
7984 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup5")]
7985 pub const Group5: Self = Self(5);
7986 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup14")]
7987 pub const Group14: Self = Self(14);
7988 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup15")]
7989 pub const Group15: Self = Self(15);
7990 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup16")]
7991 pub const Group16: Self = Self(16);
7992 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup17")]
7993 pub const Group17: Self = Self(17);
7994 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup18")]
7995 pub const Group18: Self = Self(18);
7996 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup19")]
7997 pub const Group19: Self = Self(19);
7998 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup20")]
7999 pub const Group20: Self = Self(20);
8000 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup21")]
8001 pub const Group21: Self = Self(21);
8002 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup31")]
8003 pub const Group31: Self = Self(31);
8004 #[doc(alias = "NEVPNIKEv2DiffieHellmanGroup32")]
8005 pub const Group32: Self = Self(32);
8006}
8007
8008unsafe impl Encode for NEVPNIKEv2DiffieHellmanGroup {
8009 const ENCODING: Encoding = NSInteger::ENCODING;
8010}
8011
8012unsafe impl RefEncode for NEVPNIKEv2DiffieHellmanGroup {
8013 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
8014}
8015
8016#[repr(transparent)]
8021#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
8022pub struct NEVPNIKEv2CertificateType(pub NSInteger);
8023impl NEVPNIKEv2CertificateType {
8024 #[doc(alias = "NEVPNIKEv2CertificateTypeRSA")]
8025 pub const RSA: Self = Self(1);
8026 #[doc(alias = "NEVPNIKEv2CertificateTypeECDSA256")]
8027 pub const ECDSA256: Self = Self(2);
8028 #[doc(alias = "NEVPNIKEv2CertificateTypeECDSA384")]
8029 pub const ECDSA384: Self = Self(3);
8030 #[doc(alias = "NEVPNIKEv2CertificateTypeECDSA521")]
8031 pub const ECDSA521: Self = Self(4);
8032 #[doc(alias = "NEVPNIKEv2CertificateTypeEd25519")]
8033 pub const Ed25519: Self = Self(5);
8034 #[doc(alias = "NEVPNIKEv2CertificateTypeRSAPSS")]
8035 pub const RSAPSS: Self = Self(6);
8036}
8037
8038unsafe impl Encode for NEVPNIKEv2CertificateType {
8039 const ENCODING: Encoding = NSInteger::ENCODING;
8040}
8041
8042unsafe impl RefEncode for NEVPNIKEv2CertificateType {
8043 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
8044}
8045
8046#[repr(transparent)]
8051#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
8052pub struct NEVPNIKEv2TLSVersion(pub NSInteger);
8053impl NEVPNIKEv2TLSVersion {
8054 #[doc(alias = "NEVPNIKEv2TLSVersionDefault")]
8055 pub const VersionDefault: Self = Self(0);
8056 #[doc(alias = "NEVPNIKEv2TLSVersion1_0")]
8057 pub const Version1_0: Self = Self(1);
8058 #[doc(alias = "NEVPNIKEv2TLSVersion1_1")]
8059 pub const Version1_1: Self = Self(2);
8060 #[doc(alias = "NEVPNIKEv2TLSVersion1_2")]
8061 pub const Version1_2: Self = Self(3);
8062}
8063
8064unsafe impl Encode for NEVPNIKEv2TLSVersion {
8065 const ENCODING: Encoding = NSInteger::ENCODING;
8066}
8067
8068unsafe impl RefEncode for NEVPNIKEv2TLSVersion {
8069 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
8070}
8071
8072extern_class!(
8073 #[unsafe(super(NSObject))]
8079 #[derive(Debug, PartialEq, Eq, Hash)]
8080 pub struct NEVPNIKEv2SecurityAssociationParameters;
8081);
8082
8083unsafe impl NSCoding for NEVPNIKEv2SecurityAssociationParameters {}
8084
8085unsafe impl NSCopying for NEVPNIKEv2SecurityAssociationParameters {}
8086
8087unsafe impl CopyingHelper for NEVPNIKEv2SecurityAssociationParameters {
8088 type Result = Self;
8089}
8090
8091unsafe impl NSObjectProtocol for NEVPNIKEv2SecurityAssociationParameters {}
8092
8093unsafe impl NSSecureCoding for NEVPNIKEv2SecurityAssociationParameters {}
8094
8095impl NEVPNIKEv2SecurityAssociationParameters {
8096 extern_methods!(
8097 #[unsafe(method(encryptionAlgorithm))]
8100 #[unsafe(method_family = none)]
8101 pub unsafe fn encryptionAlgorithm(&self) -> NEVPNIKEv2EncryptionAlgorithm;
8102
8103 #[unsafe(method(setEncryptionAlgorithm:))]
8105 #[unsafe(method_family = none)]
8106 pub unsafe fn setEncryptionAlgorithm(
8107 &self,
8108 encryption_algorithm: NEVPNIKEv2EncryptionAlgorithm,
8109 );
8110
8111 #[unsafe(method(integrityAlgorithm))]
8114 #[unsafe(method_family = none)]
8115 pub unsafe fn integrityAlgorithm(&self) -> NEVPNIKEv2IntegrityAlgorithm;
8116
8117 #[unsafe(method(setIntegrityAlgorithm:))]
8119 #[unsafe(method_family = none)]
8120 pub unsafe fn setIntegrityAlgorithm(
8121 &self,
8122 integrity_algorithm: NEVPNIKEv2IntegrityAlgorithm,
8123 );
8124
8125 #[unsafe(method(diffieHellmanGroup))]
8127 #[unsafe(method_family = none)]
8128 pub unsafe fn diffieHellmanGroup(&self) -> NEVPNIKEv2DiffieHellmanGroup;
8129
8130 #[unsafe(method(setDiffieHellmanGroup:))]
8132 #[unsafe(method_family = none)]
8133 pub unsafe fn setDiffieHellmanGroup(
8134 &self,
8135 diffie_hellman_group: NEVPNIKEv2DiffieHellmanGroup,
8136 );
8137
8138 #[unsafe(method(lifetimeMinutes))]
8140 #[unsafe(method_family = none)]
8141 pub unsafe fn lifetimeMinutes(&self) -> i32;
8142
8143 #[unsafe(method(setLifetimeMinutes:))]
8145 #[unsafe(method_family = none)]
8146 pub unsafe fn setLifetimeMinutes(&self, lifetime_minutes: i32);
8147 );
8148}
8149
8150impl NEVPNIKEv2SecurityAssociationParameters {
8152 extern_methods!(
8153 #[unsafe(method(init))]
8154 #[unsafe(method_family = init)]
8155 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
8156
8157 #[unsafe(method(new))]
8158 #[unsafe(method_family = new)]
8159 pub unsafe fn new() -> Retained<Self>;
8160 );
8161}
8162
8163extern_class!(
8164 #[unsafe(super(NSObject))]
8171 #[derive(Debug, PartialEq, Eq, Hash)]
8172 pub struct NEVPNIKEv2PPKConfiguration;
8173);
8174
8175unsafe impl NSCopying for NEVPNIKEv2PPKConfiguration {}
8176
8177unsafe impl CopyingHelper for NEVPNIKEv2PPKConfiguration {
8178 type Result = Self;
8179}
8180
8181unsafe impl NSObjectProtocol for NEVPNIKEv2PPKConfiguration {}
8182
8183impl NEVPNIKEv2PPKConfiguration {
8184 extern_methods!(
8185 #[unsafe(method(initWithIdentifier:keychainReference:))]
8191 #[unsafe(method_family = init)]
8192 pub unsafe fn initWithIdentifier_keychainReference(
8193 this: Allocated<Self>,
8194 identifier: &NSString,
8195 keychain_reference: &NSData,
8196 ) -> Retained<Self>;
8197
8198 #[unsafe(method(identifier))]
8200 #[unsafe(method_family = none)]
8201 pub unsafe fn identifier(&self) -> Retained<NSString>;
8202
8203 #[unsafe(method(keychainReference))]
8205 #[unsafe(method_family = none)]
8206 pub unsafe fn keychainReference(&self) -> Retained<NSData>;
8207
8208 #[unsafe(method(isMandatory))]
8210 #[unsafe(method_family = none)]
8211 pub unsafe fn isMandatory(&self) -> bool;
8212
8213 #[unsafe(method(setIsMandatory:))]
8215 #[unsafe(method_family = none)]
8216 pub unsafe fn setIsMandatory(&self, is_mandatory: bool);
8217 );
8218}
8219
8220impl NEVPNIKEv2PPKConfiguration {
8222 extern_methods!(
8223 #[unsafe(method(init))]
8224 #[unsafe(method_family = init)]
8225 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
8226
8227 #[unsafe(method(new))]
8228 #[unsafe(method_family = new)]
8229 pub unsafe fn new() -> Retained<Self>;
8230 );
8231}
8232
8233extern_class!(
8234 #[unsafe(super(NEVPNProtocolIPSec, NEVPNProtocol, NSObject))]
8241 #[derive(Debug, PartialEq, Eq, Hash)]
8242 pub struct NEVPNProtocolIKEv2;
8243);
8244
8245unsafe impl NSCoding for NEVPNProtocolIKEv2 {}
8246
8247unsafe impl NSCopying for NEVPNProtocolIKEv2 {}
8248
8249unsafe impl CopyingHelper for NEVPNProtocolIKEv2 {
8250 type Result = Self;
8251}
8252
8253unsafe impl NSObjectProtocol for NEVPNProtocolIKEv2 {}
8254
8255unsafe impl NSSecureCoding for NEVPNProtocolIKEv2 {}
8256
8257impl NEVPNProtocolIKEv2 {
8258 extern_methods!(
8259 #[unsafe(method(deadPeerDetectionRate))]
8261 #[unsafe(method_family = none)]
8262 pub unsafe fn deadPeerDetectionRate(&self) -> NEVPNIKEv2DeadPeerDetectionRate;
8263
8264 #[unsafe(method(setDeadPeerDetectionRate:))]
8266 #[unsafe(method_family = none)]
8267 pub unsafe fn setDeadPeerDetectionRate(
8268 &self,
8269 dead_peer_detection_rate: NEVPNIKEv2DeadPeerDetectionRate,
8270 );
8271
8272 #[unsafe(method(serverCertificateIssuerCommonName))]
8274 #[unsafe(method_family = none)]
8275 pub unsafe fn serverCertificateIssuerCommonName(&self) -> Option<Retained<NSString>>;
8276
8277 #[unsafe(method(setServerCertificateIssuerCommonName:))]
8279 #[unsafe(method_family = none)]
8280 pub unsafe fn setServerCertificateIssuerCommonName(
8281 &self,
8282 server_certificate_issuer_common_name: Option<&NSString>,
8283 );
8284
8285 #[unsafe(method(serverCertificateCommonName))]
8287 #[unsafe(method_family = none)]
8288 pub unsafe fn serverCertificateCommonName(&self) -> Option<Retained<NSString>>;
8289
8290 #[unsafe(method(setServerCertificateCommonName:))]
8292 #[unsafe(method_family = none)]
8293 pub unsafe fn setServerCertificateCommonName(
8294 &self,
8295 server_certificate_common_name: Option<&NSString>,
8296 );
8297
8298 #[unsafe(method(certificateType))]
8300 #[unsafe(method_family = none)]
8301 pub unsafe fn certificateType(&self) -> NEVPNIKEv2CertificateType;
8302
8303 #[unsafe(method(setCertificateType:))]
8305 #[unsafe(method_family = none)]
8306 pub unsafe fn setCertificateType(&self, certificate_type: NEVPNIKEv2CertificateType);
8307
8308 #[unsafe(method(useConfigurationAttributeInternalIPSubnet))]
8310 #[unsafe(method_family = none)]
8311 pub unsafe fn useConfigurationAttributeInternalIPSubnet(&self) -> bool;
8312
8313 #[unsafe(method(setUseConfigurationAttributeInternalIPSubnet:))]
8315 #[unsafe(method_family = none)]
8316 pub unsafe fn setUseConfigurationAttributeInternalIPSubnet(
8317 &self,
8318 use_configuration_attribute_internal_ip_subnet: bool,
8319 );
8320
8321 #[unsafe(method(IKESecurityAssociationParameters))]
8323 #[unsafe(method_family = none)]
8324 pub unsafe fn IKESecurityAssociationParameters(
8325 &self,
8326 ) -> Retained<NEVPNIKEv2SecurityAssociationParameters>;
8327
8328 #[unsafe(method(childSecurityAssociationParameters))]
8330 #[unsafe(method_family = none)]
8331 pub unsafe fn childSecurityAssociationParameters(
8332 &self,
8333 ) -> Retained<NEVPNIKEv2SecurityAssociationParameters>;
8334
8335 #[unsafe(method(disableMOBIKE))]
8337 #[unsafe(method_family = none)]
8338 pub unsafe fn disableMOBIKE(&self) -> bool;
8339
8340 #[unsafe(method(setDisableMOBIKE:))]
8342 #[unsafe(method_family = none)]
8343 pub unsafe fn setDisableMOBIKE(&self, disable_mobike: bool);
8344
8345 #[unsafe(method(disableRedirect))]
8347 #[unsafe(method_family = none)]
8348 pub unsafe fn disableRedirect(&self) -> bool;
8349
8350 #[unsafe(method(setDisableRedirect:))]
8352 #[unsafe(method_family = none)]
8353 pub unsafe fn setDisableRedirect(&self, disable_redirect: bool);
8354
8355 #[unsafe(method(enablePFS))]
8357 #[unsafe(method_family = none)]
8358 pub unsafe fn enablePFS(&self) -> bool;
8359
8360 #[unsafe(method(setEnablePFS:))]
8362 #[unsafe(method_family = none)]
8363 pub unsafe fn setEnablePFS(&self, enable_pfs: bool);
8364
8365 #[unsafe(method(enableRevocationCheck))]
8367 #[unsafe(method_family = none)]
8368 pub unsafe fn enableRevocationCheck(&self) -> bool;
8369
8370 #[unsafe(method(setEnableRevocationCheck:))]
8372 #[unsafe(method_family = none)]
8373 pub unsafe fn setEnableRevocationCheck(&self, enable_revocation_check: bool);
8374
8375 #[unsafe(method(strictRevocationCheck))]
8377 #[unsafe(method_family = none)]
8378 pub unsafe fn strictRevocationCheck(&self) -> bool;
8379
8380 #[unsafe(method(setStrictRevocationCheck:))]
8382 #[unsafe(method_family = none)]
8383 pub unsafe fn setStrictRevocationCheck(&self, strict_revocation_check: bool);
8384
8385 #[unsafe(method(minimumTLSVersion))]
8387 #[unsafe(method_family = none)]
8388 pub unsafe fn minimumTLSVersion(&self) -> NEVPNIKEv2TLSVersion;
8389
8390 #[unsafe(method(setMinimumTLSVersion:))]
8392 #[unsafe(method_family = none)]
8393 pub unsafe fn setMinimumTLSVersion(&self, minimum_tls_version: NEVPNIKEv2TLSVersion);
8394
8395 #[unsafe(method(maximumTLSVersion))]
8397 #[unsafe(method_family = none)]
8398 pub unsafe fn maximumTLSVersion(&self) -> NEVPNIKEv2TLSVersion;
8399
8400 #[unsafe(method(setMaximumTLSVersion:))]
8402 #[unsafe(method_family = none)]
8403 pub unsafe fn setMaximumTLSVersion(&self, maximum_tls_version: NEVPNIKEv2TLSVersion);
8404
8405 #[unsafe(method(enableFallback))]
8410 #[unsafe(method_family = none)]
8411 pub unsafe fn enableFallback(&self) -> bool;
8412
8413 #[unsafe(method(setEnableFallback:))]
8415 #[unsafe(method_family = none)]
8416 pub unsafe fn setEnableFallback(&self, enable_fallback: bool);
8417
8418 #[unsafe(method(mtu))]
8420 #[unsafe(method_family = none)]
8421 pub unsafe fn mtu(&self) -> NSUInteger;
8422
8423 #[unsafe(method(setMtu:))]
8425 #[unsafe(method_family = none)]
8426 pub unsafe fn setMtu(&self, mtu: NSUInteger);
8427
8428 #[unsafe(method(ppkConfiguration))]
8430 #[unsafe(method_family = none)]
8431 pub unsafe fn ppkConfiguration(&self) -> Option<Retained<NEVPNIKEv2PPKConfiguration>>;
8432
8433 #[unsafe(method(setPpkConfiguration:))]
8435 #[unsafe(method_family = none)]
8436 pub unsafe fn setPpkConfiguration(
8437 &self,
8438 ppk_configuration: Option<&NEVPNIKEv2PPKConfiguration>,
8439 );
8440 );
8441}
8442
8443impl NEVPNProtocolIKEv2 {
8445 extern_methods!(
8446 #[unsafe(method(init))]
8447 #[unsafe(method_family = init)]
8448 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
8449
8450 #[unsafe(method(new))]
8451 #[unsafe(method_family = new)]
8452 pub unsafe fn new() -> Retained<Self>;
8453 );
8454}
8455
8456extern "C" {
8457 pub static NEAppPushErrorDomain: &'static NSErrorDomain;
8459}
8460
8461#[repr(transparent)]
8465#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
8466pub struct NEAppPushManagerError(pub NSInteger);
8467impl NEAppPushManagerError {
8468 #[doc(alias = "NEAppPushManagerErrorConfigurationInvalid")]
8469 pub const ConfigurationInvalid: Self = Self(1);
8470 #[doc(alias = "NEAppPushManagerErrorConfigurationNotLoaded")]
8471 pub const ConfigurationNotLoaded: Self = Self(2);
8472 #[doc(alias = "NEAppPushManagerErrorInternalError")]
8473 pub const InternalError: Self = Self(3);
8474 #[doc(alias = "NEAppPushManagerErrorInactiveSession")]
8475 pub const InactiveSession: Self = Self(4);
8476}
8477
8478unsafe impl Encode for NEAppPushManagerError {
8479 const ENCODING: Encoding = NSInteger::ENCODING;
8480}
8481
8482unsafe impl RefEncode for NEAppPushManagerError {
8483 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
8484}
8485
8486extern_class!(
8487 #[unsafe(super(NSObject))]
8491 #[derive(Debug, PartialEq, Eq, Hash)]
8492 pub struct NEPrivateLTENetwork;
8493);
8494
8495unsafe impl NSCoding for NEPrivateLTENetwork {}
8496
8497unsafe impl NSCopying for NEPrivateLTENetwork {}
8498
8499unsafe impl CopyingHelper for NEPrivateLTENetwork {
8500 type Result = Self;
8501}
8502
8503unsafe impl NSObjectProtocol for NEPrivateLTENetwork {}
8504
8505unsafe impl NSSecureCoding for NEPrivateLTENetwork {}
8506
8507impl NEPrivateLTENetwork {
8508 extern_methods!(
8509 #[unsafe(method(mobileCountryCode))]
8511 #[unsafe(method_family = none)]
8512 pub unsafe fn mobileCountryCode(&self) -> Retained<NSString>;
8513
8514 #[unsafe(method(setMobileCountryCode:))]
8516 #[unsafe(method_family = none)]
8517 pub unsafe fn setMobileCountryCode(&self, mobile_country_code: &NSString);
8518
8519 #[unsafe(method(mobileNetworkCode))]
8521 #[unsafe(method_family = none)]
8522 pub unsafe fn mobileNetworkCode(&self) -> Retained<NSString>;
8523
8524 #[unsafe(method(setMobileNetworkCode:))]
8526 #[unsafe(method_family = none)]
8527 pub unsafe fn setMobileNetworkCode(&self, mobile_network_code: &NSString);
8528
8529 #[unsafe(method(trackingAreaCode))]
8531 #[unsafe(method_family = none)]
8532 pub unsafe fn trackingAreaCode(&self) -> Option<Retained<NSString>>;
8533
8534 #[unsafe(method(setTrackingAreaCode:))]
8536 #[unsafe(method_family = none)]
8537 pub unsafe fn setTrackingAreaCode(&self, tracking_area_code: Option<&NSString>);
8538 );
8539}
8540
8541impl NEPrivateLTENetwork {
8543 extern_methods!(
8544 #[unsafe(method(init))]
8545 #[unsafe(method_family = init)]
8546 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
8547
8548 #[unsafe(method(new))]
8549 #[unsafe(method_family = new)]
8550 pub unsafe fn new() -> Retained<Self>;
8551 );
8552}
8553
8554extern_class!(
8555 #[unsafe(super(NSObject))]
8563 #[derive(Debug, PartialEq, Eq, Hash)]
8564 pub struct NEAppPushManager;
8565);
8566
8567unsafe impl NSObjectProtocol for NEAppPushManager {}
8568
8569impl NEAppPushManager {
8570 extern_methods!(
8571 #[unsafe(method(matchSSIDs))]
8574 #[unsafe(method_family = none)]
8575 pub unsafe fn matchSSIDs(&self) -> Retained<NSArray<NSString>>;
8576
8577 #[unsafe(method(setMatchSSIDs:))]
8579 #[unsafe(method_family = none)]
8580 pub unsafe fn setMatchSSIDs(&self, match_ssi_ds: &NSArray<NSString>);
8581
8582 #[unsafe(method(matchPrivateLTENetworks))]
8585 #[unsafe(method_family = none)]
8586 pub unsafe fn matchPrivateLTENetworks(&self) -> Retained<NSArray<NEPrivateLTENetwork>>;
8587
8588 #[unsafe(method(setMatchPrivateLTENetworks:))]
8590 #[unsafe(method_family = none)]
8591 pub unsafe fn setMatchPrivateLTENetworks(
8592 &self,
8593 match_private_lte_networks: &NSArray<NEPrivateLTENetwork>,
8594 );
8595
8596 #[unsafe(method(providerConfiguration))]
8599 #[unsafe(method_family = none)]
8600 pub unsafe fn providerConfiguration(&self) -> Retained<NSDictionary<NSString, AnyObject>>;
8601
8602 #[unsafe(method(setProviderConfiguration:))]
8604 #[unsafe(method_family = none)]
8605 pub unsafe fn setProviderConfiguration(
8606 &self,
8607 provider_configuration: &NSDictionary<NSString, AnyObject>,
8608 );
8609
8610 #[unsafe(method(providerBundleIdentifier))]
8612 #[unsafe(method_family = none)]
8613 pub unsafe fn providerBundleIdentifier(&self) -> Option<Retained<NSString>>;
8614
8615 #[unsafe(method(setProviderBundleIdentifier:))]
8617 #[unsafe(method_family = none)]
8618 pub unsafe fn setProviderBundleIdentifier(
8619 &self,
8620 provider_bundle_identifier: Option<&NSString>,
8621 );
8622
8623 #[unsafe(method(delegate))]
8625 #[unsafe(method_family = none)]
8626 pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NEAppPushDelegate>>>;
8627
8628 #[unsafe(method(setDelegate:))]
8631 #[unsafe(method_family = none)]
8632 pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NEAppPushDelegate>>);
8633
8634 #[cfg(feature = "block2")]
8635 #[unsafe(method(loadAllFromPreferencesWithCompletionHandler:))]
8640 #[unsafe(method_family = none)]
8641 pub unsafe fn loadAllFromPreferencesWithCompletionHandler(
8642 completion_handler: &block2::Block<
8643 dyn Fn(*mut NSArray<NEAppPushManager>, *mut NSError),
8644 >,
8645 );
8646
8647 #[cfg(feature = "block2")]
8648 #[unsafe(method(loadFromPreferencesWithCompletionHandler:))]
8652 #[unsafe(method_family = none)]
8653 pub unsafe fn loadFromPreferencesWithCompletionHandler(
8654 &self,
8655 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
8656 );
8657
8658 #[cfg(feature = "block2")]
8659 #[unsafe(method(removeFromPreferencesWithCompletionHandler:))]
8663 #[unsafe(method_family = none)]
8664 pub unsafe fn removeFromPreferencesWithCompletionHandler(
8665 &self,
8666 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
8667 );
8668
8669 #[cfg(feature = "block2")]
8670 #[unsafe(method(saveToPreferencesWithCompletionHandler:))]
8674 #[unsafe(method_family = none)]
8675 pub unsafe fn saveToPreferencesWithCompletionHandler(
8676 &self,
8677 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
8678 );
8679
8680 #[unsafe(method(localizedDescription))]
8682 #[unsafe(method_family = none)]
8683 pub unsafe fn localizedDescription(&self) -> Option<Retained<NSString>>;
8684
8685 #[unsafe(method(setLocalizedDescription:))]
8687 #[unsafe(method_family = none)]
8688 pub unsafe fn setLocalizedDescription(&self, localized_description: Option<&NSString>);
8689
8690 #[unsafe(method(isEnabled))]
8692 #[unsafe(method_family = none)]
8693 pub unsafe fn isEnabled(&self) -> bool;
8694
8695 #[unsafe(method(setEnabled:))]
8697 #[unsafe(method_family = none)]
8698 pub unsafe fn setEnabled(&self, enabled: bool);
8699
8700 #[unsafe(method(isActive))]
8702 #[unsafe(method_family = none)]
8703 pub unsafe fn isActive(&self) -> bool;
8704 );
8705}
8706
8707impl NEAppPushManager {
8709 extern_methods!(
8710 #[unsafe(method(init))]
8711 #[unsafe(method_family = init)]
8712 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
8713
8714 #[unsafe(method(new))]
8715 #[unsafe(method_family = new)]
8716 pub unsafe fn new() -> Retained<Self>;
8717 );
8718}
8719
8720extern_protocol!(
8721 pub unsafe trait NEAppPushDelegate: NSObjectProtocol {
8725 #[unsafe(method(appPushManager:didReceiveIncomingCallWithUserInfo:))]
8729 #[unsafe(method_family = none)]
8730 unsafe fn appPushManager_didReceiveIncomingCallWithUserInfo(
8731 &self,
8732 manager: &NEAppPushManager,
8733 user_info: &NSDictionary,
8734 );
8735 }
8736);
8737
8738extern_class!(
8739 #[unsafe(super(NEProvider, NSObject))]
8745 #[derive(Debug, PartialEq, Eq, Hash)]
8746 pub struct NEAppPushProvider;
8747);
8748
8749unsafe impl NSObjectProtocol for NEAppPushProvider {}
8750
8751impl NEAppPushProvider {
8752 extern_methods!(
8753 #[unsafe(method(providerConfiguration))]
8755 #[unsafe(method_family = none)]
8756 pub unsafe fn providerConfiguration(
8757 &self,
8758 ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
8759
8760 #[cfg(feature = "block2")]
8761 #[deprecated]
8767 #[unsafe(method(startWithCompletionHandler:))]
8768 #[unsafe(method_family = none)]
8769 pub unsafe fn startWithCompletionHandler(
8770 &self,
8771 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
8772 );
8773
8774 #[unsafe(method(start))]
8776 #[unsafe(method_family = none)]
8777 pub unsafe fn start(&self);
8778
8779 #[cfg(feature = "block2")]
8780 #[unsafe(method(stopWithReason:completionHandler:))]
8786 #[unsafe(method_family = none)]
8787 pub unsafe fn stopWithReason_completionHandler(
8788 &self,
8789 reason: NEProviderStopReason,
8790 completion_handler: &block2::Block<dyn Fn()>,
8791 );
8792
8793 #[unsafe(method(reportIncomingCallWithUserInfo:))]
8797 #[unsafe(method_family = none)]
8798 pub unsafe fn reportIncomingCallWithUserInfo(&self, user_info: &NSDictionary);
8799
8800 #[unsafe(method(reportPushToTalkMessageWithUserInfo:))]
8804 #[unsafe(method_family = none)]
8805 pub unsafe fn reportPushToTalkMessageWithUserInfo(&self, user_info: &NSDictionary);
8806
8807 #[unsafe(method(handleTimerEvent))]
8809 #[unsafe(method_family = none)]
8810 pub unsafe fn handleTimerEvent(&self);
8811 );
8812}
8813
8814impl NEAppPushProvider {
8816 extern_methods!(
8817 #[unsafe(method(init))]
8818 #[unsafe(method_family = init)]
8819 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
8820
8821 #[unsafe(method(new))]
8822 #[unsafe(method_family = new)]
8823 pub unsafe fn new() -> Retained<Self>;
8824 );
8825}
8826
8827extern_class!(
8828 #[unsafe(super(NSObject))]
8832 #[derive(Debug, PartialEq, Eq, Hash)]
8833 #[deprecated = "Use nw_endpoint_t in Network framework instead, see deprecation notice in <NetworkExtension/NWEndpoint.h>"]
8834 pub struct NWEndpoint;
8835);
8836
8837unsafe impl NSCoding for NWEndpoint {}
8838
8839unsafe impl NSCopying for NWEndpoint {}
8840
8841unsafe impl CopyingHelper for NWEndpoint {
8842 type Result = Self;
8843}
8844
8845unsafe impl NSObjectProtocol for NWEndpoint {}
8846
8847unsafe impl NSSecureCoding for NWEndpoint {}
8848
8849impl NWEndpoint {
8850 extern_methods!();
8851}
8852
8853impl NWEndpoint {
8855 extern_methods!(
8856 #[unsafe(method(init))]
8857 #[unsafe(method_family = init)]
8858 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
8859
8860 #[unsafe(method(new))]
8861 #[unsafe(method_family = new)]
8862 pub unsafe fn new() -> Retained<Self>;
8863 );
8864}
8865
8866extern_class!(
8867 #[unsafe(super(NWEndpoint, NSObject))]
8872 #[derive(Debug, PartialEq, Eq, Hash)]
8873 #[deprecated = "Use `nw_endpoint_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWHostEndpoint.h>"]
8874 pub struct NWHostEndpoint;
8875);
8876
8877unsafe impl NSCoding for NWHostEndpoint {}
8878
8879unsafe impl NSCopying for NWHostEndpoint {}
8880
8881unsafe impl CopyingHelper for NWHostEndpoint {
8882 type Result = Self;
8883}
8884
8885unsafe impl NSObjectProtocol for NWHostEndpoint {}
8886
8887unsafe impl NSSecureCoding for NWHostEndpoint {}
8888
8889impl NWHostEndpoint {
8890 extern_methods!(
8891 #[deprecated = "Use `nw_endpoint_create_host` in Network framework instead, see deprecation notice in <NetworkExtension/NWHostEndpoint.h>"]
8897 #[unsafe(method(endpointWithHostname:port:))]
8898 #[unsafe(method_family = none)]
8899 pub unsafe fn endpointWithHostname_port(
8900 hostname: &NSString,
8901 port: &NSString,
8902 ) -> Retained<Self>;
8903
8904 #[deprecated = "Use `nw_endpoint_get_hostname` in Network framework instead, see deprecation notice in <NetworkExtension/NWHostEndpoint.h>"]
8906 #[unsafe(method(hostname))]
8907 #[unsafe(method_family = none)]
8908 pub unsafe fn hostname(&self) -> Retained<NSString>;
8909
8910 #[deprecated = "Use `nw_endpoint_get_port` in Network framework instead, see deprecation notice in <NetworkExtension/NWHostEndpoint.h>"]
8912 #[unsafe(method(port))]
8913 #[unsafe(method_family = none)]
8914 pub unsafe fn port(&self) -> Retained<NSString>;
8915 );
8916}
8917
8918impl NWHostEndpoint {
8920 extern_methods!(
8921 #[unsafe(method(init))]
8922 #[unsafe(method_family = init)]
8923 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
8924
8925 #[unsafe(method(new))]
8926 #[unsafe(method_family = new)]
8927 pub unsafe fn new() -> Retained<Self>;
8928 );
8929}
8930
8931extern_class!(
8932 #[unsafe(super(NWEndpoint, NSObject))]
8939 #[derive(Debug, PartialEq, Eq, Hash)]
8940 #[deprecated = "Use `nw_endpoint_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWBonjourServiceEndpoint.h>"]
8941 pub struct NWBonjourServiceEndpoint;
8942);
8943
8944unsafe impl NSCoding for NWBonjourServiceEndpoint {}
8945
8946unsafe impl NSCopying for NWBonjourServiceEndpoint {}
8947
8948unsafe impl CopyingHelper for NWBonjourServiceEndpoint {
8949 type Result = Self;
8950}
8951
8952unsafe impl NSObjectProtocol for NWBonjourServiceEndpoint {}
8953
8954unsafe impl NSSecureCoding for NWBonjourServiceEndpoint {}
8955
8956impl NWBonjourServiceEndpoint {
8957 extern_methods!(
8958 #[deprecated = "Use `nw_endpoint_create_bonjour_service` in Network framework instead, see deprecation notice in <NetworkExtension/NWBonjourServiceEndpoint.h>"]
8966 #[unsafe(method(endpointWithName:type:domain:))]
8967 #[unsafe(method_family = none)]
8968 pub unsafe fn endpointWithName_type_domain(
8969 name: &NSString,
8970 r#type: &NSString,
8971 domain: &NSString,
8972 ) -> Retained<Self>;
8973
8974 #[deprecated = "Use `nw_endpoint_get_bonjour_service_name` in Network framework instead, see deprecation notice in <NetworkExtension/NWBonjourServiceEndpoint.h>"]
8976 #[unsafe(method(name))]
8977 #[unsafe(method_family = none)]
8978 pub unsafe fn name(&self) -> Retained<NSString>;
8979
8980 #[deprecated = "Use `nw_endpoint_get_bonjour_service_type` in Network framework instead, see deprecation notice in <NetworkExtension/NWBonjourServiceEndpoint.h>"]
8982 #[unsafe(method(type))]
8983 #[unsafe(method_family = none)]
8984 pub unsafe fn r#type(&self) -> Retained<NSString>;
8985
8986 #[deprecated = "Use `nw_endpoint_get_bonjour_service_domain` in Network framework instead, see deprecation notice in <NetworkExtension/NWBonjourServiceEndpoint.h>"]
8988 #[unsafe(method(domain))]
8989 #[unsafe(method_family = none)]
8990 pub unsafe fn domain(&self) -> Retained<NSString>;
8991 );
8992}
8993
8994impl NWBonjourServiceEndpoint {
8996 extern_methods!(
8997 #[unsafe(method(init))]
8998 #[unsafe(method_family = init)]
8999 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
9000
9001 #[unsafe(method(new))]
9002 #[unsafe(method_family = new)]
9003 pub unsafe fn new() -> Retained<Self>;
9004 );
9005}
9006
9007#[deprecated = "Use `nw_path_status_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9012#[repr(transparent)]
9013#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
9014pub struct NWPathStatus(pub NSInteger);
9015impl NWPathStatus {
9016 #[deprecated = "Use `nw_path_status_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9017 #[doc(alias = "NWPathStatusInvalid")]
9018 pub const Invalid: Self = Self(0);
9019 #[deprecated = "Use `nw_path_status_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9020 #[doc(alias = "NWPathStatusSatisfied")]
9021 pub const Satisfied: Self = Self(1);
9022 #[deprecated = "Use `nw_path_status_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9023 #[doc(alias = "NWPathStatusUnsatisfied")]
9024 pub const Unsatisfied: Self = Self(2);
9025 #[deprecated = "Use `nw_path_status_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9027 #[doc(alias = "NWPathStatusSatisfiable")]
9028 pub const Satisfiable: Self = Self(3);
9029}
9030
9031unsafe impl Encode for NWPathStatus {
9032 const ENCODING: Encoding = NSInteger::ENCODING;
9033}
9034
9035unsafe impl RefEncode for NWPathStatus {
9036 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
9037}
9038
9039extern_class!(
9040 #[unsafe(super(NSObject))]
9046 #[derive(Debug, PartialEq, Eq, Hash)]
9047 #[deprecated = "Use `nw_path_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9048 pub struct NWPath;
9049);
9050
9051unsafe impl NSObjectProtocol for NWPath {}
9052
9053impl NWPath {
9054 extern_methods!(
9055 #[deprecated = "Use `nw_path_get_status` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9057 #[unsafe(method(status))]
9058 #[unsafe(method_family = none)]
9059 pub unsafe fn status(&self) -> NWPathStatus;
9060
9061 #[deprecated = "Use `nw_path_is_expensive` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9063 #[unsafe(method(isExpensive))]
9064 #[unsafe(method_family = none)]
9065 pub unsafe fn isExpensive(&self) -> bool;
9066
9067 #[deprecated = "Use `nw_path_is_constrained` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9069 #[unsafe(method(isConstrained))]
9070 #[unsafe(method_family = none)]
9071 pub unsafe fn isConstrained(&self) -> bool;
9072
9073 #[deprecated = "Use `nw_path_is_equal` in Network framework instead, see deprecation notice in <NetworkExtension/NWPath.h>"]
9077 #[unsafe(method(isEqualToPath:))]
9078 #[unsafe(method_family = none)]
9079 pub unsafe fn isEqualToPath(&self, path: &NWPath) -> bool;
9080 );
9081}
9082
9083impl NWPath {
9085 extern_methods!(
9086 #[unsafe(method(init))]
9087 #[unsafe(method_family = init)]
9088 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
9089
9090 #[unsafe(method(new))]
9091 #[unsafe(method_family = new)]
9092 pub unsafe fn new() -> Retained<Self>;
9093 );
9094}
9095
9096#[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9101#[repr(transparent)]
9102#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
9103pub struct NWTCPConnectionState(pub NSInteger);
9104impl NWTCPConnectionState {
9105 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9106 #[doc(alias = "NWTCPConnectionStateInvalid")]
9107 pub const Invalid: Self = Self(0);
9108 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9109 #[doc(alias = "NWTCPConnectionStateConnecting")]
9110 pub const Connecting: Self = Self(1);
9111 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9113 #[doc(alias = "NWTCPConnectionStateWaiting")]
9114 pub const Waiting: Self = Self(2);
9115 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9118 #[doc(alias = "NWTCPConnectionStateConnected")]
9119 pub const Connected: Self = Self(3);
9120 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9123 #[doc(alias = "NWTCPConnectionStateDisconnected")]
9124 pub const Disconnected: Self = Self(4);
9125 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9127 #[doc(alias = "NWTCPConnectionStateCancelled")]
9128 pub const Cancelled: Self = Self(5);
9129}
9130
9131unsafe impl Encode for NWTCPConnectionState {
9132 const ENCODING: Encoding = NSInteger::ENCODING;
9133}
9134
9135unsafe impl RefEncode for NWTCPConnectionState {
9136 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
9137}
9138
9139extern_class!(
9140 #[unsafe(super(NSObject))]
9144 #[derive(Debug, PartialEq, Eq, Hash)]
9145 #[deprecated = "Use `nw_connection_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9146 pub struct NWTCPConnection;
9147);
9148
9149unsafe impl NSObjectProtocol for NWTCPConnection {}
9150
9151impl NWTCPConnection {
9152 extern_methods!(
9153 #[deprecated = "Use `nw_connection_create` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9174 #[unsafe(method(initWithUpgradeForConnection:))]
9175 #[unsafe(method_family = init)]
9176 pub unsafe fn initWithUpgradeForConnection(
9177 this: Allocated<Self>,
9178 connection: &NWTCPConnection,
9179 ) -> Retained<Self>;
9180
9181 #[deprecated = "Use `nw_connection_set_state_changed_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9183 #[unsafe(method(state))]
9184 #[unsafe(method_family = none)]
9185 pub unsafe fn state(&self) -> NWTCPConnectionState;
9186
9187 #[deprecated = "Use `nw_connection_set_viability_changed_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9189 #[unsafe(method(isViable))]
9190 #[unsafe(method_family = none)]
9191 pub unsafe fn isViable(&self) -> bool;
9192
9193 #[deprecated = "Use `nw_connection_set_better_path_available_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9198 #[unsafe(method(hasBetterPath))]
9199 #[unsafe(method_family = none)]
9200 pub unsafe fn hasBetterPath(&self) -> bool;
9201
9202 #[deprecated = "Use `nw_connection_copy_endpoint` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9204 #[unsafe(method(endpoint))]
9205 #[unsafe(method_family = none)]
9206 pub unsafe fn endpoint(&self) -> Retained<NWEndpoint>;
9207
9208 #[deprecated = "Use `nw_connection_copy_current_path` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9215 #[unsafe(method(connectedPath))]
9216 #[unsafe(method_family = none)]
9217 pub unsafe fn connectedPath(&self) -> Option<Retained<NWPath>>;
9218
9219 #[deprecated = "Use `nw_path_copy_effective_local_endpoint` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9221 #[unsafe(method(localAddress))]
9222 #[unsafe(method_family = none)]
9223 pub unsafe fn localAddress(&self) -> Option<Retained<NWEndpoint>>;
9224
9225 #[deprecated = "Use `nw_path_copy_effective_remote_endpoint` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9227 #[unsafe(method(remoteAddress))]
9228 #[unsafe(method_family = none)]
9229 pub unsafe fn remoteAddress(&self) -> Option<Retained<NWEndpoint>>;
9230
9231 #[deprecated = "Use `nw_endpoint_copy_txt_record` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9235 #[unsafe(method(txtRecord))]
9236 #[unsafe(method_family = none)]
9237 pub unsafe fn txtRecord(&self) -> Option<Retained<NSData>>;
9238
9239 #[deprecated = "Use `nw_connection_set_state_changed_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9242 #[unsafe(method(error))]
9243 #[unsafe(method_family = none)]
9244 pub unsafe fn error(&self) -> Option<Retained<NSError>>;
9245
9246 #[deprecated = "Use `nw_connection_cancel` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9249 #[unsafe(method(cancel))]
9250 #[unsafe(method_family = none)]
9251 pub unsafe fn cancel(&self);
9252
9253 #[cfg(feature = "block2")]
9254 #[deprecated = "Use `nw_connection_receive` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9261 #[unsafe(method(readLength:completionHandler:))]
9262 #[unsafe(method_family = none)]
9263 pub unsafe fn readLength_completionHandler(
9264 &self,
9265 length: NSUInteger,
9266 completion: &block2::Block<dyn Fn(*mut NSData, *mut NSError)>,
9267 );
9268
9269 #[cfg(feature = "block2")]
9270 #[deprecated = "Use `nw_connection_receive` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9295 #[unsafe(method(readMinimumLength:maximumLength:completionHandler:))]
9296 #[unsafe(method_family = none)]
9297 pub unsafe fn readMinimumLength_maximumLength_completionHandler(
9298 &self,
9299 minimum: NSUInteger,
9300 maximum: NSUInteger,
9301 completion: &block2::Block<dyn Fn(*mut NSData, *mut NSError)>,
9302 );
9303
9304 #[cfg(feature = "block2")]
9305 #[deprecated = "Use `nw_connection_send` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9313 #[unsafe(method(write:completionHandler:))]
9314 #[unsafe(method_family = none)]
9315 pub unsafe fn write_completionHandler(
9316 &self,
9317 data: &NSData,
9318 completion: &block2::Block<dyn Fn(*mut NSError)>,
9319 );
9320
9321 #[deprecated = "Use `nw_connection_send` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9326 #[unsafe(method(writeClose))]
9327 #[unsafe(method_family = none)]
9328 pub unsafe fn writeClose(&self);
9329 );
9330}
9331
9332impl NWTCPConnection {
9334 extern_methods!(
9335 #[unsafe(method(init))]
9336 #[unsafe(method_family = init)]
9337 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
9338
9339 #[unsafe(method(new))]
9340 #[unsafe(method_family = new)]
9341 pub unsafe fn new() -> Retained<Self>;
9342 );
9343}
9344
9345extern_protocol!(
9346 #[deprecated = "Use `sec_protocol_options_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9350 pub unsafe trait NWTCPConnectionAuthenticationDelegate: NSObjectProtocol {
9351 #[deprecated = "Use `sec_protocol_options_set_challenge_block` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9361 #[optional]
9362 #[unsafe(method(shouldProvideIdentityForConnection:))]
9363 #[unsafe(method_family = none)]
9364 unsafe fn shouldProvideIdentityForConnection(&self, connection: &NWTCPConnection) -> bool;
9365
9366 #[cfg(all(feature = "block2", feature = "objc2-security"))]
9367 #[deprecated = "Use `sec_protocol_options_set_challenge_block` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9381 #[optional]
9382 #[unsafe(method(provideIdentityForConnection:completionHandler:))]
9383 #[unsafe(method_family = none)]
9384 unsafe fn provideIdentityForConnection_completionHandler(
9385 &self,
9386 connection: &NWTCPConnection,
9387 completion: &block2::Block<dyn Fn(NonNull<SecIdentity>, NonNull<NSArray<AnyObject>>)>,
9388 );
9389
9390 #[deprecated = "Use `sec_protocol_options_set_verify_block` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9400 #[optional]
9401 #[unsafe(method(shouldEvaluateTrustForConnection:))]
9402 #[unsafe(method_family = none)]
9403 unsafe fn shouldEvaluateTrustForConnection(&self, connection: &NWTCPConnection) -> bool;
9404
9405 #[cfg(all(feature = "block2", feature = "objc2-security"))]
9406 #[deprecated = "Use `sec_protocol_options_set_verify_block` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>"]
9420 #[optional]
9421 #[unsafe(method(evaluateTrustForConnection:peerCertificateChain:completionHandler:))]
9422 #[unsafe(method_family = none)]
9423 unsafe fn evaluateTrustForConnection_peerCertificateChain_completionHandler(
9424 &self,
9425 connection: &NWTCPConnection,
9426 peer_certificate_chain: &NSArray<AnyObject>,
9427 completion: &block2::Block<dyn Fn(NonNull<SecTrust>)>,
9428 );
9429 }
9430);
9431
9432#[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9437#[repr(transparent)]
9438#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
9439pub struct NWUDPSessionState(pub NSInteger);
9440impl NWUDPSessionState {
9441 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9442 #[doc(alias = "NWUDPSessionStateInvalid")]
9443 pub const Invalid: Self = Self(0);
9444 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9446 #[doc(alias = "NWUDPSessionStateWaiting")]
9447 pub const Waiting: Self = Self(1);
9448 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9449 #[doc(alias = "NWUDPSessionStatePreparing")]
9450 pub const Preparing: Self = Self(2);
9451 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9452 #[doc(alias = "NWUDPSessionStateReady")]
9453 pub const Ready: Self = Self(3);
9454 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9457 #[doc(alias = "NWUDPSessionStateFailed")]
9458 pub const Failed: Self = Self(4);
9459 #[deprecated = "Use `nw_connection_state_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9460 #[doc(alias = "NWUDPSessionStateCancelled")]
9461 pub const Cancelled: Self = Self(5);
9462}
9463
9464unsafe impl Encode for NWUDPSessionState {
9465 const ENCODING: Encoding = NSInteger::ENCODING;
9466}
9467
9468unsafe impl RefEncode for NWUDPSessionState {
9469 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
9470}
9471
9472extern_class!(
9473 #[unsafe(super(NSObject))]
9477 #[derive(Debug, PartialEq, Eq, Hash)]
9478 #[deprecated = "Use `nw_connection_t` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9479 pub struct NWUDPSession;
9480);
9481
9482unsafe impl NSObjectProtocol for NWUDPSession {}
9483
9484impl NWUDPSession {
9485 extern_methods!(
9486 #[deprecated = "Use `nw_connection_create` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9502 #[unsafe(method(initWithUpgradeForSession:))]
9503 #[unsafe(method_family = init)]
9504 pub unsafe fn initWithUpgradeForSession(
9505 this: Allocated<Self>,
9506 session: &NWUDPSession,
9507 ) -> Retained<Self>;
9508
9509 #[deprecated = "Use `nw_connection_set_state_changed_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9514 #[unsafe(method(state))]
9515 #[unsafe(method_family = none)]
9516 pub unsafe fn state(&self) -> NWUDPSessionState;
9517
9518 #[deprecated = "Use `nw_connection_copy_endpoint` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9520 #[unsafe(method(endpoint))]
9521 #[unsafe(method_family = none)]
9522 pub unsafe fn endpoint(&self) -> Retained<NWEndpoint>;
9523
9524 #[deprecated = "Use `nw_connection_copy_current_path` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9526 #[unsafe(method(resolvedEndpoint))]
9527 #[unsafe(method_family = none)]
9528 pub unsafe fn resolvedEndpoint(&self) -> Option<Retained<NWEndpoint>>;
9529
9530 #[deprecated = "Use `nw_connection_set_viability_changed_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9533 #[unsafe(method(isViable))]
9534 #[unsafe(method_family = none)]
9535 pub unsafe fn isViable(&self) -> bool;
9536
9537 #[deprecated = "Use `nw_connection_set_better_path_available_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9540 #[unsafe(method(hasBetterPath))]
9541 #[unsafe(method_family = none)]
9542 pub unsafe fn hasBetterPath(&self) -> bool;
9543
9544 #[deprecated = "Use `nw_connection_copy_current_path` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9546 #[unsafe(method(currentPath))]
9547 #[unsafe(method_family = none)]
9548 pub unsafe fn currentPath(&self) -> Option<Retained<NWPath>>;
9549
9550 #[deprecated = "Use `nw_connection_cancel_current_endpoint` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9555 #[unsafe(method(tryNextResolvedEndpoint))]
9556 #[unsafe(method_family = none)]
9557 pub unsafe fn tryNextResolvedEndpoint(&self);
9558
9559 #[deprecated = "Use `nw_connection_get_maximum_datagram_size` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9564 #[unsafe(method(maximumDatagramLength))]
9565 #[unsafe(method_family = none)]
9566 pub unsafe fn maximumDatagramLength(&self) -> NSUInteger;
9567
9568 #[cfg(feature = "block2")]
9569 #[deprecated = "Use `nw_connection_receive` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9576 #[unsafe(method(setReadHandler:maxDatagrams:))]
9577 #[unsafe(method_family = none)]
9578 pub unsafe fn setReadHandler_maxDatagrams(
9579 &self,
9580 handler: &block2::Block<dyn Fn(*mut NSArray<NSData>, *mut NSError)>,
9581 max_datagrams: NSUInteger,
9582 );
9583
9584 #[cfg(feature = "block2")]
9585 #[deprecated = "Use `nw_connection_send` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9592 #[unsafe(method(writeMultipleDatagrams:completionHandler:))]
9593 #[unsafe(method_family = none)]
9594 pub unsafe fn writeMultipleDatagrams_completionHandler(
9595 &self,
9596 datagram_array: &NSArray<NSData>,
9597 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
9598 );
9599
9600 #[cfg(feature = "block2")]
9601 #[deprecated = "Use `nw_connection_send` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9608 #[unsafe(method(writeDatagram:completionHandler:))]
9609 #[unsafe(method_family = none)]
9610 pub unsafe fn writeDatagram_completionHandler(
9611 &self,
9612 datagram: &NSData,
9613 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
9614 );
9615
9616 #[deprecated = "Use `nw_connection_cancel` in Network framework instead, see deprecation notice in <NetworkExtension/NWUDPSession.h>"]
9619 #[unsafe(method(cancel))]
9620 #[unsafe(method_family = none)]
9621 pub unsafe fn cancel(&self);
9622 );
9623}
9624
9625impl NWUDPSession {
9627 extern_methods!(
9628 #[unsafe(method(init))]
9629 #[unsafe(method_family = init)]
9630 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
9631
9632 #[unsafe(method(new))]
9633 #[unsafe(method_family = new)]
9634 pub unsafe fn new() -> Retained<Self>;
9635 );
9636}
9637
9638extern_class!(
9639 #[unsafe(super(NSObject))]
9646 #[derive(Debug, PartialEq, Eq, Hash)]
9647 #[deprecated = "Use `sec_protocol_options_t` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
9648 pub struct NWTLSParameters;
9649);
9650
9651unsafe impl NSObjectProtocol for NWTLSParameters {}
9652
9653impl NWTLSParameters {
9654 extern_methods!(
9655 #[deprecated = "Use `sec_protocol_options_set_tls_resumption_enabled` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
9658 #[unsafe(method(TLSSessionID))]
9659 #[unsafe(method_family = none)]
9660 pub unsafe fn TLSSessionID(&self) -> Option<Retained<NSData>>;
9661
9662 #[deprecated = "Use `sec_protocol_options_set_tls_resumption_enabled` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
9664 #[unsafe(method(setTLSSessionID:))]
9665 #[unsafe(method_family = none)]
9666 pub unsafe fn setTLSSessionID(&self, tls_session_id: Option<&NSData>);
9667
9668 #[deprecated = "Use `sec_protocol_options_append_tls_ciphersuite` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
9673 #[unsafe(method(SSLCipherSuites))]
9674 #[unsafe(method_family = none)]
9675 pub unsafe fn SSLCipherSuites(&self) -> Option<Retained<NSSet<NSNumber>>>;
9676
9677 #[deprecated = "Use `sec_protocol_options_append_tls_ciphersuite` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
9679 #[unsafe(method(setSSLCipherSuites:))]
9680 #[unsafe(method_family = none)]
9681 pub unsafe fn setSSLCipherSuites(&self, ssl_cipher_suites: Option<&NSSet<NSNumber>>);
9682
9683 #[deprecated = "Use `sec_protocol_options_set_min_tls_protocol_version` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
9688 #[unsafe(method(minimumSSLProtocolVersion))]
9689 #[unsafe(method_family = none)]
9690 pub unsafe fn minimumSSLProtocolVersion(&self) -> NSUInteger;
9691
9692 #[deprecated = "Use `sec_protocol_options_set_min_tls_protocol_version` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
9694 #[unsafe(method(setMinimumSSLProtocolVersion:))]
9695 #[unsafe(method_family = none)]
9696 pub unsafe fn setMinimumSSLProtocolVersion(&self, minimum_ssl_protocol_version: NSUInteger);
9697
9698 #[deprecated = "Use `sec_protocol_options_set_max_tls_protocol_version` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
9705 #[unsafe(method(maximumSSLProtocolVersion))]
9706 #[unsafe(method_family = none)]
9707 pub unsafe fn maximumSSLProtocolVersion(&self) -> NSUInteger;
9708
9709 #[deprecated = "Use `sec_protocol_options_set_max_tls_protocol_version` in Security framework instead, see deprecation notice in <NetworkExtension/NWTLSParameters.h>"]
9711 #[unsafe(method(setMaximumSSLProtocolVersion:))]
9712 #[unsafe(method_family = none)]
9713 pub unsafe fn setMaximumSSLProtocolVersion(&self, maximum_ssl_protocol_version: NSUInteger);
9714 );
9715}
9716
9717impl NWTLSParameters {
9719 extern_methods!(
9720 #[unsafe(method(init))]
9721 #[unsafe(method_family = init)]
9722 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
9723
9724 #[unsafe(method(new))]
9725 #[unsafe(method_family = new)]
9726 pub unsafe fn new() -> Retained<Self>;
9727 );
9728}