1use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7use objc2_core_foundation::*;
8
9use crate::*;
10
11#[repr(C)]
16pub struct SCNetworkInterface {
17 inner: [u8; 0],
18 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
19}
20
21cf_type!(
22 #[encoding_name = "__SCNetworkInterface"]
23 unsafe impl SCNetworkInterface {}
24);
25
26extern "C" {
27 pub static kSCNetworkInterfaceType6to4: &'static CFString;
29}
30
31extern "C" {
32 pub static kSCNetworkInterfaceTypeBluetooth: &'static CFString;
34}
35
36extern "C" {
37 pub static kSCNetworkInterfaceTypeBond: &'static CFString;
39}
40
41extern "C" {
42 pub static kSCNetworkInterfaceTypeEthernet: &'static CFString;
44}
45
46extern "C" {
47 pub static kSCNetworkInterfaceTypeFireWire: &'static CFString;
49}
50
51extern "C" {
52 pub static kSCNetworkInterfaceTypeIEEE80211: &'static CFString;
54}
55
56extern "C" {
57 pub static kSCNetworkInterfaceTypeIPSec: &'static CFString;
59}
60
61extern "C" {
62 pub static kSCNetworkInterfaceTypeIrDA: &'static CFString;
64}
65
66extern "C" {
67 pub static kSCNetworkInterfaceTypeL2TP: &'static CFString;
69}
70
71extern "C" {
72 pub static kSCNetworkInterfaceTypeModem: &'static CFString;
74}
75
76extern "C" {
77 pub static kSCNetworkInterfaceTypePPP: &'static CFString;
79}
80
81extern "C" {
82 pub static kSCNetworkInterfaceTypePPTP: &'static CFString;
84}
85
86extern "C" {
87 pub static kSCNetworkInterfaceTypeSerial: &'static CFString;
89}
90
91extern "C" {
92 pub static kSCNetworkInterfaceTypeVLAN: &'static CFString;
94}
95
96extern "C" {
97 pub static kSCNetworkInterfaceTypeWWAN: &'static CFString;
99}
100
101extern "C" {
102 pub static kSCNetworkInterfaceTypeIPv4: &'static CFString;
104}
105
106extern "C" {
107 pub static kSCNetworkInterfaceIPv4: &'static SCNetworkInterface;
113}
114
115pub type SCBondInterface = SCNetworkInterface;
120
121#[repr(C)]
126pub struct SCBondStatus {
127 inner: [u8; 0],
128 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
129}
130
131cf_type!(
132 #[encoding_name = "__SCBondStatus"]
133 unsafe impl SCBondStatus {}
134);
135
136pub const kSCBondStatusOK: c_uint = 0;
138pub const kSCBondStatusLinkInvalid: c_uint = 1;
140pub const kSCBondStatusNoPartner: c_uint = 2;
142pub const kSCBondStatusNotInActiveGroup: c_uint = 3;
144pub const kSCBondStatusUnknown: c_uint = 999;
146
147extern "C" {
148 pub static kSCBondStatusDeviceAggregationStatus: &'static CFString;
150}
151
152extern "C" {
153 pub static kSCBondStatusDeviceCollecting: &'static CFString;
155}
156
157extern "C" {
158 pub static kSCBondStatusDeviceDistributing: &'static CFString;
160}
161
162pub type SCVLANInterface = SCNetworkInterface;
167
168#[repr(C)]
173pub struct SCNetworkProtocol {
174 inner: [u8; 0],
175 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
176}
177
178cf_type!(
179 #[encoding_name = "__SCNetworkProtocol"]
180 unsafe impl SCNetworkProtocol {}
181);
182
183extern "C" {
184 pub static kSCNetworkProtocolTypeDNS: &'static CFString;
186}
187
188extern "C" {
189 pub static kSCNetworkProtocolTypeIPv4: &'static CFString;
191}
192
193extern "C" {
194 pub static kSCNetworkProtocolTypeIPv6: &'static CFString;
196}
197
198extern "C" {
199 pub static kSCNetworkProtocolTypeProxies: &'static CFString;
201}
202
203extern "C" {
204 pub static kSCNetworkProtocolTypeSMB: &'static CFString;
206}
207
208#[repr(C)]
213pub struct SCNetworkService {
214 inner: [u8; 0],
215 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
216}
217
218cf_type!(
219 #[encoding_name = "__SCNetworkService"]
220 unsafe impl SCNetworkService {}
221);
222
223#[repr(C)]
228pub struct SCNetworkSet {
229 inner: [u8; 0],
230 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
231}
232
233cf_type!(
234 #[encoding_name = "__SCNetworkSet"]
235 unsafe impl SCNetworkSet {}
236);
237
238unsafe impl ConcreteType for SCNetworkInterface {
239 #[doc(alias = "SCNetworkInterfaceGetTypeID")]
241 #[inline]
242 fn type_id() -> CFTypeID {
243 extern "C-unwind" {
244 fn SCNetworkInterfaceGetTypeID() -> CFTypeID;
245 }
246 unsafe { SCNetworkInterfaceGetTypeID() }
247 }
248}
249
250#[inline]
255pub unsafe extern "C-unwind" fn SCNetworkInterfaceCopyAll() -> CFRetained<CFArray> {
256 extern "C-unwind" {
257 fn SCNetworkInterfaceCopyAll() -> Option<NonNull<CFArray>>;
258 }
259 let ret = unsafe { SCNetworkInterfaceCopyAll() };
260 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
261 unsafe { CFRetained::from_raw(ret) }
262}
263
264#[inline]
272pub unsafe extern "C-unwind" fn SCNetworkInterfaceGetSupportedInterfaceTypes(
273 interface: &SCNetworkInterface,
274) -> Option<CFRetained<CFArray>> {
275 extern "C-unwind" {
276 fn SCNetworkInterfaceGetSupportedInterfaceTypes(
277 interface: &SCNetworkInterface,
278 ) -> Option<NonNull<CFArray>>;
279 }
280 let ret = unsafe { SCNetworkInterfaceGetSupportedInterfaceTypes(interface) };
281 ret.map(|ret| unsafe { CFRetained::retain(ret) })
282}
283
284#[inline]
292pub unsafe extern "C-unwind" fn SCNetworkInterfaceGetSupportedProtocolTypes(
293 interface: &SCNetworkInterface,
294) -> Option<CFRetained<CFArray>> {
295 extern "C-unwind" {
296 fn SCNetworkInterfaceGetSupportedProtocolTypes(
297 interface: &SCNetworkInterface,
298 ) -> Option<NonNull<CFArray>>;
299 }
300 let ret = unsafe { SCNetworkInterfaceGetSupportedProtocolTypes(interface) };
301 ret.map(|ret| unsafe { CFRetained::retain(ret) })
302}
303
304#[inline]
316pub unsafe extern "C-unwind" fn SCNetworkInterfaceCreateWithInterface(
317 interface: &SCNetworkInterface,
318 interface_type: &CFString,
319) -> Option<CFRetained<SCNetworkInterface>> {
320 extern "C-unwind" {
321 fn SCNetworkInterfaceCreateWithInterface(
322 interface: &SCNetworkInterface,
323 interface_type: &CFString,
324 ) -> Option<NonNull<SCNetworkInterface>>;
325 }
326 let ret = unsafe { SCNetworkInterfaceCreateWithInterface(interface, interface_type) };
327 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
328}
329
330#[inline]
338pub unsafe extern "C-unwind" fn SCNetworkInterfaceGetBSDName(
339 interface: &SCNetworkInterface,
340) -> Option<CFRetained<CFString>> {
341 extern "C-unwind" {
342 fn SCNetworkInterfaceGetBSDName(
343 interface: &SCNetworkInterface,
344 ) -> Option<NonNull<CFString>>;
345 }
346 let ret = unsafe { SCNetworkInterfaceGetBSDName(interface) };
347 ret.map(|ret| unsafe { CFRetained::retain(ret) })
348}
349
350#[inline]
358pub unsafe extern "C-unwind" fn SCNetworkInterfaceGetConfiguration(
359 interface: &SCNetworkInterface,
360) -> Option<CFRetained<CFDictionary>> {
361 extern "C-unwind" {
362 fn SCNetworkInterfaceGetConfiguration(
363 interface: &SCNetworkInterface,
364 ) -> Option<NonNull<CFDictionary>>;
365 }
366 let ret = unsafe { SCNetworkInterfaceGetConfiguration(interface) };
367 ret.map(|ret| unsafe { CFRetained::retain(ret) })
368}
369
370#[inline]
380pub unsafe extern "C-unwind" fn SCNetworkInterfaceGetExtendedConfiguration(
381 interface: &SCNetworkInterface,
382 extended_type: &CFString,
383) -> Option<CFRetained<CFDictionary>> {
384 extern "C-unwind" {
385 fn SCNetworkInterfaceGetExtendedConfiguration(
386 interface: &SCNetworkInterface,
387 extended_type: &CFString,
388 ) -> Option<NonNull<CFDictionary>>;
389 }
390 let ret = unsafe { SCNetworkInterfaceGetExtendedConfiguration(interface, extended_type) };
391 ret.map(|ret| unsafe { CFRetained::retain(ret) })
392}
393
394#[inline]
400pub unsafe extern "C-unwind" fn SCNetworkInterfaceGetHardwareAddressString(
401 interface: &SCNetworkInterface,
402) -> Option<CFRetained<CFString>> {
403 extern "C-unwind" {
404 fn SCNetworkInterfaceGetHardwareAddressString(
405 interface: &SCNetworkInterface,
406 ) -> Option<NonNull<CFString>>;
407 }
408 let ret = unsafe { SCNetworkInterfaceGetHardwareAddressString(interface) };
409 ret.map(|ret| unsafe { CFRetained::retain(ret) })
410}
411
412#[inline]
419pub unsafe extern "C-unwind" fn SCNetworkInterfaceGetInterface(
420 interface: &SCNetworkInterface,
421) -> Option<CFRetained<SCNetworkInterface>> {
422 extern "C-unwind" {
423 fn SCNetworkInterfaceGetInterface(
424 interface: &SCNetworkInterface,
425 ) -> Option<NonNull<SCNetworkInterface>>;
426 }
427 let ret = unsafe { SCNetworkInterfaceGetInterface(interface) };
428 ret.map(|ret| unsafe { CFRetained::retain(ret) })
429}
430
431#[inline]
437pub unsafe extern "C-unwind" fn SCNetworkInterfaceGetInterfaceType(
438 interface: &SCNetworkInterface,
439) -> Option<CFRetained<CFString>> {
440 extern "C-unwind" {
441 fn SCNetworkInterfaceGetInterfaceType(
442 interface: &SCNetworkInterface,
443 ) -> Option<NonNull<CFString>>;
444 }
445 let ret = unsafe { SCNetworkInterfaceGetInterfaceType(interface) };
446 ret.map(|ret| unsafe { CFRetained::retain(ret) })
447}
448
449#[inline]
457pub unsafe extern "C-unwind" fn SCNetworkInterfaceGetLocalizedDisplayName(
458 interface: &SCNetworkInterface,
459) -> Option<CFRetained<CFString>> {
460 extern "C-unwind" {
461 fn SCNetworkInterfaceGetLocalizedDisplayName(
462 interface: &SCNetworkInterface,
463 ) -> Option<NonNull<CFString>>;
464 }
465 let ret = unsafe { SCNetworkInterfaceGetLocalizedDisplayName(interface) };
466 ret.map(|ret| unsafe { CFRetained::retain(ret) })
467}
468
469#[inline]
477pub unsafe extern "C-unwind" fn SCNetworkInterfaceSetConfiguration(
478 interface: &SCNetworkInterface,
479 config: Option<&CFDictionary>,
480) -> bool {
481 extern "C-unwind" {
482 fn SCNetworkInterfaceSetConfiguration(
483 interface: &SCNetworkInterface,
484 config: Option<&CFDictionary>,
485 ) -> Boolean;
486 }
487 let ret = unsafe { SCNetworkInterfaceSetConfiguration(interface, config) };
488 ret != 0
489}
490
491#[inline]
499pub unsafe extern "C-unwind" fn SCNetworkInterfaceSetExtendedConfiguration(
500 interface: &SCNetworkInterface,
501 extended_type: &CFString,
502 config: Option<&CFDictionary>,
503) -> bool {
504 extern "C-unwind" {
505 fn SCNetworkInterfaceSetExtendedConfiguration(
506 interface: &SCNetworkInterface,
507 extended_type: &CFString,
508 config: Option<&CFDictionary>,
509 ) -> Boolean;
510 }
511 let ret =
512 unsafe { SCNetworkInterfaceSetExtendedConfiguration(interface, extended_type, config) };
513 ret != 0
514}
515
516#[inline]
540pub unsafe extern "C-unwind" fn SCNetworkInterfaceCopyMediaOptions(
541 interface: &SCNetworkInterface,
542 current: *mut *const CFDictionary,
543 active: *mut *const CFDictionary,
544 available: *mut *const CFArray,
545 filter: bool,
546) -> bool {
547 extern "C-unwind" {
548 fn SCNetworkInterfaceCopyMediaOptions(
549 interface: &SCNetworkInterface,
550 current: *mut *const CFDictionary,
551 active: *mut *const CFDictionary,
552 available: *mut *const CFArray,
553 filter: Boolean,
554 ) -> Boolean;
555 }
556 let ret = unsafe {
557 SCNetworkInterfaceCopyMediaOptions(interface, current, active, available, filter as _)
558 };
559 ret != 0
560}
561
562#[inline]
571pub unsafe extern "C-unwind" fn SCNetworkInterfaceCopyMediaSubTypes(
572 available: &CFArray,
573) -> Option<CFRetained<CFArray>> {
574 extern "C-unwind" {
575 fn SCNetworkInterfaceCopyMediaSubTypes(available: &CFArray) -> Option<NonNull<CFArray>>;
576 }
577 let ret = unsafe { SCNetworkInterfaceCopyMediaSubTypes(available) };
578 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
579}
580
581#[inline]
596pub unsafe extern "C-unwind" fn SCNetworkInterfaceCopyMediaSubTypeOptions(
597 available: &CFArray,
598 sub_type: &CFString,
599) -> Option<CFRetained<CFArray>> {
600 extern "C-unwind" {
601 fn SCNetworkInterfaceCopyMediaSubTypeOptions(
602 available: &CFArray,
603 sub_type: &CFString,
604 ) -> Option<NonNull<CFArray>>;
605 }
606 let ret = unsafe { SCNetworkInterfaceCopyMediaSubTypeOptions(available, sub_type) };
607 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
608}
609
610#[inline]
629pub unsafe extern "C-unwind" fn SCNetworkInterfaceCopyMTU(
630 interface: &SCNetworkInterface,
631 mtu_cur: *mut c_int,
632 mtu_min: *mut c_int,
633 mtu_max: *mut c_int,
634) -> bool {
635 extern "C-unwind" {
636 fn SCNetworkInterfaceCopyMTU(
637 interface: &SCNetworkInterface,
638 mtu_cur: *mut c_int,
639 mtu_min: *mut c_int,
640 mtu_max: *mut c_int,
641 ) -> Boolean;
642 }
643 let ret = unsafe { SCNetworkInterfaceCopyMTU(interface, mtu_cur, mtu_min, mtu_max) };
644 ret != 0
645}
646
647#[inline]
660pub unsafe extern "C-unwind" fn SCNetworkInterfaceSetMediaOptions(
661 interface: &SCNetworkInterface,
662 subtype: Option<&CFString>,
663 options: Option<&CFArray>,
664) -> bool {
665 extern "C-unwind" {
666 fn SCNetworkInterfaceSetMediaOptions(
667 interface: &SCNetworkInterface,
668 subtype: Option<&CFString>,
669 options: Option<&CFArray>,
670 ) -> Boolean;
671 }
672 let ret = unsafe { SCNetworkInterfaceSetMediaOptions(interface, subtype, options) };
673 ret != 0
674}
675
676#[inline]
686pub unsafe extern "C-unwind" fn SCNetworkInterfaceSetMTU(
687 interface: &SCNetworkInterface,
688 mtu: c_int,
689) -> bool {
690 extern "C-unwind" {
691 fn SCNetworkInterfaceSetMTU(interface: &SCNetworkInterface, mtu: c_int) -> Boolean;
692 }
693 let ret = unsafe { SCNetworkInterfaceSetMTU(interface, mtu) };
694 ret != 0
695}
696
697#[inline]
717pub unsafe extern "C-unwind" fn SCNetworkInterfaceForceConfigurationRefresh(
718 interface: &SCNetworkInterface,
719) -> bool {
720 extern "C-unwind" {
721 fn SCNetworkInterfaceForceConfigurationRefresh(interface: &SCNetworkInterface) -> Boolean;
722 }
723 let ret = unsafe { SCNetworkInterfaceForceConfigurationRefresh(interface) };
724 ret != 0
725}
726
727#[cfg(feature = "SCPreferences")]
734#[inline]
735pub unsafe extern "C-unwind" fn SCBondInterfaceCopyAll(
736 prefs: &SCPreferences,
737) -> CFRetained<CFArray> {
738 extern "C-unwind" {
739 fn SCBondInterfaceCopyAll(prefs: &SCPreferences) -> Option<NonNull<CFArray>>;
740 }
741 let ret = unsafe { SCBondInterfaceCopyAll(prefs) };
742 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
743 unsafe { CFRetained::from_raw(ret) }
744}
745
746#[cfg(feature = "SCPreferences")]
754#[inline]
755pub unsafe extern "C-unwind" fn SCBondInterfaceCopyAvailableMemberInterfaces(
756 prefs: &SCPreferences,
757) -> CFRetained<CFArray> {
758 extern "C-unwind" {
759 fn SCBondInterfaceCopyAvailableMemberInterfaces(
760 prefs: &SCPreferences,
761 ) -> Option<NonNull<CFArray>>;
762 }
763 let ret = unsafe { SCBondInterfaceCopyAvailableMemberInterfaces(prefs) };
764 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
765 unsafe { CFRetained::from_raw(ret) }
766}
767
768#[cfg(feature = "SCPreferences")]
775#[inline]
776pub unsafe extern "C-unwind" fn SCBondInterfaceCreate(
777 prefs: &SCPreferences,
778) -> Option<CFRetained<SCBondInterface>> {
779 extern "C-unwind" {
780 fn SCBondInterfaceCreate(prefs: &SCPreferences) -> Option<NonNull<SCBondInterface>>;
781 }
782 let ret = unsafe { SCBondInterfaceCreate(prefs) };
783 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
784}
785
786#[inline]
792pub unsafe extern "C-unwind" fn SCBondInterfaceRemove(bond: &SCBondInterface) -> bool {
793 extern "C-unwind" {
794 fn SCBondInterfaceRemove(bond: &SCBondInterface) -> Boolean;
795 }
796 let ret = unsafe { SCBondInterfaceRemove(bond) };
797 ret != 0
798}
799
800#[inline]
806pub unsafe extern "C-unwind" fn SCBondInterfaceGetMemberInterfaces(
807 bond: &SCBondInterface,
808) -> Option<CFRetained<CFArray>> {
809 extern "C-unwind" {
810 fn SCBondInterfaceGetMemberInterfaces(bond: &SCBondInterface) -> Option<NonNull<CFArray>>;
811 }
812 let ret = unsafe { SCBondInterfaceGetMemberInterfaces(bond) };
813 ret.map(|ret| unsafe { CFRetained::retain(ret) })
814}
815
816#[inline]
823pub unsafe extern "C-unwind" fn SCBondInterfaceGetOptions(
824 bond: &SCBondInterface,
825) -> Option<CFRetained<CFDictionary>> {
826 extern "C-unwind" {
827 fn SCBondInterfaceGetOptions(bond: &SCBondInterface) -> Option<NonNull<CFDictionary>>;
828 }
829 let ret = unsafe { SCBondInterfaceGetOptions(bond) };
830 ret.map(|ret| unsafe { CFRetained::retain(ret) })
831}
832
833#[inline]
841pub unsafe extern "C-unwind" fn SCBondInterfaceSetMemberInterfaces(
842 bond: &SCBondInterface,
843 members: &CFArray,
844) -> bool {
845 extern "C-unwind" {
846 fn SCBondInterfaceSetMemberInterfaces(bond: &SCBondInterface, members: &CFArray)
847 -> Boolean;
848 }
849 let ret = unsafe { SCBondInterfaceSetMemberInterfaces(bond, members) };
850 ret != 0
851}
852
853#[inline]
861pub unsafe extern "C-unwind" fn SCBondInterfaceSetLocalizedDisplayName(
862 bond: &SCBondInterface,
863 new_name: &CFString,
864) -> bool {
865 extern "C-unwind" {
866 fn SCBondInterfaceSetLocalizedDisplayName(
867 bond: &SCBondInterface,
868 new_name: &CFString,
869 ) -> Boolean;
870 }
871 let ret = unsafe { SCBondInterfaceSetLocalizedDisplayName(bond, new_name) };
872 ret != 0
873}
874
875#[inline]
883pub unsafe extern "C-unwind" fn SCBondInterfaceSetOptions(
884 bond: &SCBondInterface,
885 new_options: &CFDictionary,
886) -> bool {
887 extern "C-unwind" {
888 fn SCBondInterfaceSetOptions(bond: &SCBondInterface, new_options: &CFDictionary)
889 -> Boolean;
890 }
891 let ret = unsafe { SCBondInterfaceSetOptions(bond, new_options) };
892 ret != 0
893}
894
895#[inline]
902pub unsafe extern "C-unwind" fn SCBondInterfaceCopyStatus(
903 bond: &SCBondInterface,
904) -> Option<CFRetained<SCBondStatus>> {
905 extern "C-unwind" {
906 fn SCBondInterfaceCopyStatus(bond: &SCBondInterface) -> Option<NonNull<SCBondStatus>>;
907 }
908 let ret = unsafe { SCBondInterfaceCopyStatus(bond) };
909 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
910}
911
912unsafe impl ConcreteType for SCBondStatus {
913 #[doc(alias = "SCBondStatusGetTypeID")]
915 #[inline]
916 fn type_id() -> CFTypeID {
917 extern "C-unwind" {
918 fn SCBondStatusGetTypeID() -> CFTypeID;
919 }
920 unsafe { SCBondStatusGetTypeID() }
921 }
922}
923
924#[inline]
931pub unsafe extern "C-unwind" fn SCBondStatusGetMemberInterfaces(
932 bond_status: &SCBondStatus,
933) -> Option<CFRetained<CFArray>> {
934 extern "C-unwind" {
935 fn SCBondStatusGetMemberInterfaces(bond_status: &SCBondStatus) -> Option<NonNull<CFArray>>;
936 }
937 let ret = unsafe { SCBondStatusGetMemberInterfaces(bond_status) };
938 ret.map(|ret| unsafe { CFRetained::retain(ret) })
939}
940
941#[inline]
955pub unsafe extern "C-unwind" fn SCBondStatusGetInterfaceStatus(
956 bond_status: &SCBondStatus,
957 interface: Option<&SCNetworkInterface>,
958) -> Option<CFRetained<CFDictionary>> {
959 extern "C-unwind" {
960 fn SCBondStatusGetInterfaceStatus(
961 bond_status: &SCBondStatus,
962 interface: Option<&SCNetworkInterface>,
963 ) -> Option<NonNull<CFDictionary>>;
964 }
965 let ret = unsafe { SCBondStatusGetInterfaceStatus(bond_status, interface) };
966 ret.map(|ret| unsafe { CFRetained::retain(ret) })
967}
968
969#[cfg(feature = "SCPreferences")]
974#[inline]
975pub unsafe extern "C-unwind" fn SCVLANInterfaceCopyAll(
976 prefs: &SCPreferences,
977) -> CFRetained<CFArray> {
978 extern "C-unwind" {
979 fn SCVLANInterfaceCopyAll(prefs: &SCPreferences) -> Option<NonNull<CFArray>>;
980 }
981 let ret = unsafe { SCVLANInterfaceCopyAll(prefs) };
982 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
983 unsafe { CFRetained::from_raw(ret) }
984}
985
986#[inline]
992pub unsafe extern "C-unwind" fn SCVLANInterfaceCopyAvailablePhysicalInterfaces(
993) -> CFRetained<CFArray> {
994 extern "C-unwind" {
995 fn SCVLANInterfaceCopyAvailablePhysicalInterfaces() -> Option<NonNull<CFArray>>;
996 }
997 let ret = unsafe { SCVLANInterfaceCopyAvailablePhysicalInterfaces() };
998 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
999 unsafe { CFRetained::from_raw(ret) }
1000}
1001
1002#[cfg(feature = "SCPreferences")]
1019#[inline]
1020pub unsafe extern "C-unwind" fn SCVLANInterfaceCreate(
1021 prefs: &SCPreferences,
1022 physical: &SCNetworkInterface,
1023 tag: &CFNumber,
1024) -> Option<CFRetained<SCVLANInterface>> {
1025 extern "C-unwind" {
1026 fn SCVLANInterfaceCreate(
1027 prefs: &SCPreferences,
1028 physical: &SCNetworkInterface,
1029 tag: &CFNumber,
1030 ) -> Option<NonNull<SCVLANInterface>>;
1031 }
1032 let ret = unsafe { SCVLANInterfaceCreate(prefs, physical, tag) };
1033 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1034}
1035
1036#[inline]
1042pub unsafe extern "C-unwind" fn SCVLANInterfaceRemove(vlan: &SCVLANInterface) -> bool {
1043 extern "C-unwind" {
1044 fn SCVLANInterfaceRemove(vlan: &SCVLANInterface) -> Boolean;
1045 }
1046 let ret = unsafe { SCVLANInterfaceRemove(vlan) };
1047 ret != 0
1048}
1049
1050#[inline]
1056pub unsafe extern "C-unwind" fn SCVLANInterfaceGetPhysicalInterface(
1057 vlan: &SCVLANInterface,
1058) -> Option<CFRetained<SCNetworkInterface>> {
1059 extern "C-unwind" {
1060 fn SCVLANInterfaceGetPhysicalInterface(
1061 vlan: &SCVLANInterface,
1062 ) -> Option<NonNull<SCNetworkInterface>>;
1063 }
1064 let ret = unsafe { SCVLANInterfaceGetPhysicalInterface(vlan) };
1065 ret.map(|ret| unsafe { CFRetained::retain(ret) })
1066}
1067
1068#[inline]
1074pub unsafe extern "C-unwind" fn SCVLANInterfaceGetTag(
1075 vlan: &SCVLANInterface,
1076) -> Option<CFRetained<CFNumber>> {
1077 extern "C-unwind" {
1078 fn SCVLANInterfaceGetTag(vlan: &SCVLANInterface) -> Option<NonNull<CFNumber>>;
1079 }
1080 let ret = unsafe { SCVLANInterfaceGetTag(vlan) };
1081 ret.map(|ret| unsafe { CFRetained::retain(ret) })
1082}
1083
1084#[inline]
1091pub unsafe extern "C-unwind" fn SCVLANInterfaceGetOptions(
1092 vlan: &SCVLANInterface,
1093) -> Option<CFRetained<CFDictionary>> {
1094 extern "C-unwind" {
1095 fn SCVLANInterfaceGetOptions(vlan: &SCVLANInterface) -> Option<NonNull<CFDictionary>>;
1096 }
1097 let ret = unsafe { SCVLANInterfaceGetOptions(vlan) };
1098 ret.map(|ret| unsafe { CFRetained::retain(ret) })
1099}
1100
1101#[inline]
1117pub unsafe extern "C-unwind" fn SCVLANInterfaceSetPhysicalInterfaceAndTag(
1118 vlan: &SCVLANInterface,
1119 physical: &SCNetworkInterface,
1120 tag: &CFNumber,
1121) -> bool {
1122 extern "C-unwind" {
1123 fn SCVLANInterfaceSetPhysicalInterfaceAndTag(
1124 vlan: &SCVLANInterface,
1125 physical: &SCNetworkInterface,
1126 tag: &CFNumber,
1127 ) -> Boolean;
1128 }
1129 let ret = unsafe { SCVLANInterfaceSetPhysicalInterfaceAndTag(vlan, physical, tag) };
1130 ret != 0
1131}
1132
1133#[inline]
1141pub unsafe extern "C-unwind" fn SCVLANInterfaceSetLocalizedDisplayName(
1142 vlan: &SCVLANInterface,
1143 new_name: &CFString,
1144) -> bool {
1145 extern "C-unwind" {
1146 fn SCVLANInterfaceSetLocalizedDisplayName(
1147 vlan: &SCVLANInterface,
1148 new_name: &CFString,
1149 ) -> Boolean;
1150 }
1151 let ret = unsafe { SCVLANInterfaceSetLocalizedDisplayName(vlan, new_name) };
1152 ret != 0
1153}
1154
1155#[inline]
1163pub unsafe extern "C-unwind" fn SCVLANInterfaceSetOptions(
1164 vlan: &SCVLANInterface,
1165 new_options: &CFDictionary,
1166) -> bool {
1167 extern "C-unwind" {
1168 fn SCVLANInterfaceSetOptions(vlan: &SCVLANInterface, new_options: &CFDictionary)
1169 -> Boolean;
1170 }
1171 let ret = unsafe { SCVLANInterfaceSetOptions(vlan, new_options) };
1172 ret != 0
1173}
1174
1175unsafe impl ConcreteType for SCNetworkProtocol {
1176 #[doc(alias = "SCNetworkProtocolGetTypeID")]
1178 #[inline]
1179 fn type_id() -> CFTypeID {
1180 extern "C-unwind" {
1181 fn SCNetworkProtocolGetTypeID() -> CFTypeID;
1182 }
1183 unsafe { SCNetworkProtocolGetTypeID() }
1184 }
1185}
1186
1187#[inline]
1195pub unsafe extern "C-unwind" fn SCNetworkProtocolGetConfiguration(
1196 protocol: &SCNetworkProtocol,
1197) -> Option<CFRetained<CFDictionary>> {
1198 extern "C-unwind" {
1199 fn SCNetworkProtocolGetConfiguration(
1200 protocol: &SCNetworkProtocol,
1201 ) -> Option<NonNull<CFDictionary>>;
1202 }
1203 let ret = unsafe { SCNetworkProtocolGetConfiguration(protocol) };
1204 ret.map(|ret| unsafe { CFRetained::retain(ret) })
1205}
1206
1207#[inline]
1213pub unsafe extern "C-unwind" fn SCNetworkProtocolGetEnabled(protocol: &SCNetworkProtocol) -> bool {
1214 extern "C-unwind" {
1215 fn SCNetworkProtocolGetEnabled(protocol: &SCNetworkProtocol) -> Boolean;
1216 }
1217 let ret = unsafe { SCNetworkProtocolGetEnabled(protocol) };
1218 ret != 0
1219}
1220
1221#[inline]
1227pub unsafe extern "C-unwind" fn SCNetworkProtocolGetProtocolType(
1228 protocol: &SCNetworkProtocol,
1229) -> Option<CFRetained<CFString>> {
1230 extern "C-unwind" {
1231 fn SCNetworkProtocolGetProtocolType(
1232 protocol: &SCNetworkProtocol,
1233 ) -> Option<NonNull<CFString>>;
1234 }
1235 let ret = unsafe { SCNetworkProtocolGetProtocolType(protocol) };
1236 ret.map(|ret| unsafe { CFRetained::retain(ret) })
1237}
1238
1239#[inline]
1247pub unsafe extern "C-unwind" fn SCNetworkProtocolSetConfiguration(
1248 protocol: &SCNetworkProtocol,
1249 config: Option<&CFDictionary>,
1250) -> bool {
1251 extern "C-unwind" {
1252 fn SCNetworkProtocolSetConfiguration(
1253 protocol: &SCNetworkProtocol,
1254 config: Option<&CFDictionary>,
1255 ) -> Boolean;
1256 }
1257 let ret = unsafe { SCNetworkProtocolSetConfiguration(protocol, config) };
1258 ret != 0
1259}
1260
1261#[inline]
1269pub unsafe extern "C-unwind" fn SCNetworkProtocolSetEnabled(
1270 protocol: &SCNetworkProtocol,
1271 enabled: bool,
1272) -> bool {
1273 extern "C-unwind" {
1274 fn SCNetworkProtocolSetEnabled(protocol: &SCNetworkProtocol, enabled: Boolean) -> Boolean;
1275 }
1276 let ret = unsafe { SCNetworkProtocolSetEnabled(protocol, enabled as _) };
1277 ret != 0
1278}
1279
1280unsafe impl ConcreteType for SCNetworkService {
1281 #[doc(alias = "SCNetworkServiceGetTypeID")]
1283 #[inline]
1284 fn type_id() -> CFTypeID {
1285 extern "C-unwind" {
1286 fn SCNetworkServiceGetTypeID() -> CFTypeID;
1287 }
1288 unsafe { SCNetworkServiceGetTypeID() }
1289 }
1290}
1291
1292#[inline]
1304pub unsafe extern "C-unwind" fn SCNetworkServiceAddProtocolType(
1305 service: &SCNetworkService,
1306 protocol_type: &CFString,
1307) -> bool {
1308 extern "C-unwind" {
1309 fn SCNetworkServiceAddProtocolType(
1310 service: &SCNetworkService,
1311 protocol_type: &CFString,
1312 ) -> Boolean;
1313 }
1314 let ret = unsafe { SCNetworkServiceAddProtocolType(service, protocol_type) };
1315 ret != 0
1316}
1317
1318#[cfg(feature = "SCPreferences")]
1325#[inline]
1326pub unsafe extern "C-unwind" fn SCNetworkServiceCopyAll(
1327 prefs: &SCPreferences,
1328) -> Option<CFRetained<CFArray>> {
1329 extern "C-unwind" {
1330 fn SCNetworkServiceCopyAll(prefs: &SCPreferences) -> Option<NonNull<CFArray>>;
1331 }
1332 let ret = unsafe { SCNetworkServiceCopyAll(prefs) };
1333 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1334}
1335
1336#[inline]
1343pub unsafe extern "C-unwind" fn SCNetworkServiceCopyProtocols(
1344 service: &SCNetworkService,
1345) -> Option<CFRetained<CFArray>> {
1346 extern "C-unwind" {
1347 fn SCNetworkServiceCopyProtocols(service: &SCNetworkService) -> Option<NonNull<CFArray>>;
1348 }
1349 let ret = unsafe { SCNetworkServiceCopyProtocols(service) };
1350 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1351}
1352
1353#[cfg(feature = "SCPreferences")]
1361#[inline]
1362pub unsafe extern "C-unwind" fn SCNetworkServiceCreate(
1363 prefs: &SCPreferences,
1364 interface: &SCNetworkInterface,
1365) -> Option<CFRetained<SCNetworkService>> {
1366 extern "C-unwind" {
1367 fn SCNetworkServiceCreate(
1368 prefs: &SCPreferences,
1369 interface: &SCNetworkInterface,
1370 ) -> Option<NonNull<SCNetworkService>>;
1371 }
1372 let ret = unsafe { SCNetworkServiceCreate(prefs, interface) };
1373 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1374}
1375
1376#[cfg(feature = "SCPreferences")]
1387#[inline]
1388pub unsafe extern "C-unwind" fn SCNetworkServiceCopy(
1389 prefs: &SCPreferences,
1390 service_id: &CFString,
1391) -> Option<CFRetained<SCNetworkService>> {
1392 extern "C-unwind" {
1393 fn SCNetworkServiceCopy(
1394 prefs: &SCPreferences,
1395 service_id: &CFString,
1396 ) -> Option<NonNull<SCNetworkService>>;
1397 }
1398 let ret = unsafe { SCNetworkServiceCopy(prefs, service_id) };
1399 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1400}
1401
1402#[inline]
1411pub unsafe extern "C-unwind" fn SCNetworkServiceEstablishDefaultConfiguration(
1412 service: &SCNetworkService,
1413) -> bool {
1414 extern "C-unwind" {
1415 fn SCNetworkServiceEstablishDefaultConfiguration(service: &SCNetworkService) -> Boolean;
1416 }
1417 let ret = unsafe { SCNetworkServiceEstablishDefaultConfiguration(service) };
1418 ret != 0
1419}
1420
1421#[inline]
1427pub unsafe extern "C-unwind" fn SCNetworkServiceGetEnabled(service: &SCNetworkService) -> bool {
1428 extern "C-unwind" {
1429 fn SCNetworkServiceGetEnabled(service: &SCNetworkService) -> Boolean;
1430 }
1431 let ret = unsafe { SCNetworkServiceGetEnabled(service) };
1432 ret != 0
1433}
1434
1435#[inline]
1442pub unsafe extern "C-unwind" fn SCNetworkServiceGetInterface(
1443 service: &SCNetworkService,
1444) -> Option<CFRetained<SCNetworkInterface>> {
1445 extern "C-unwind" {
1446 fn SCNetworkServiceGetInterface(
1447 service: &SCNetworkService,
1448 ) -> Option<NonNull<SCNetworkInterface>>;
1449 }
1450 let ret = unsafe { SCNetworkServiceGetInterface(service) };
1451 ret.map(|ret| unsafe { CFRetained::retain(ret) })
1452}
1453
1454#[inline]
1460pub unsafe extern "C-unwind" fn SCNetworkServiceGetName(
1461 service: &SCNetworkService,
1462) -> Option<CFRetained<CFString>> {
1463 extern "C-unwind" {
1464 fn SCNetworkServiceGetName(service: &SCNetworkService) -> Option<NonNull<CFString>>;
1465 }
1466 let ret = unsafe { SCNetworkServiceGetName(service) };
1467 ret.map(|ret| unsafe { CFRetained::retain(ret) })
1468}
1469
1470#[inline]
1479pub unsafe extern "C-unwind" fn SCNetworkServiceCopyProtocol(
1480 service: &SCNetworkService,
1481 protocol_type: &CFString,
1482) -> Option<CFRetained<SCNetworkProtocol>> {
1483 extern "C-unwind" {
1484 fn SCNetworkServiceCopyProtocol(
1485 service: &SCNetworkService,
1486 protocol_type: &CFString,
1487 ) -> Option<NonNull<SCNetworkProtocol>>;
1488 }
1489 let ret = unsafe { SCNetworkServiceCopyProtocol(service, protocol_type) };
1490 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1491}
1492
1493#[inline]
1499pub unsafe extern "C-unwind" fn SCNetworkServiceGetServiceID(
1500 service: &SCNetworkService,
1501) -> Option<CFRetained<CFString>> {
1502 extern "C-unwind" {
1503 fn SCNetworkServiceGetServiceID(service: &SCNetworkService) -> Option<NonNull<CFString>>;
1504 }
1505 let ret = unsafe { SCNetworkServiceGetServiceID(service) };
1506 ret.map(|ret| unsafe { CFRetained::retain(ret) })
1507}
1508
1509#[inline]
1515pub unsafe extern "C-unwind" fn SCNetworkServiceRemove(service: &SCNetworkService) -> bool {
1516 extern "C-unwind" {
1517 fn SCNetworkServiceRemove(service: &SCNetworkService) -> Boolean;
1518 }
1519 let ret = unsafe { SCNetworkServiceRemove(service) };
1520 ret != 0
1521}
1522
1523#[inline]
1532pub unsafe extern "C-unwind" fn SCNetworkServiceRemoveProtocolType(
1533 service: &SCNetworkService,
1534 protocol_type: &CFString,
1535) -> bool {
1536 extern "C-unwind" {
1537 fn SCNetworkServiceRemoveProtocolType(
1538 service: &SCNetworkService,
1539 protocol_type: &CFString,
1540 ) -> Boolean;
1541 }
1542 let ret = unsafe { SCNetworkServiceRemoveProtocolType(service, protocol_type) };
1543 ret != 0
1544}
1545
1546#[inline]
1554pub unsafe extern "C-unwind" fn SCNetworkServiceSetEnabled(
1555 service: &SCNetworkService,
1556 enabled: bool,
1557) -> bool {
1558 extern "C-unwind" {
1559 fn SCNetworkServiceSetEnabled(service: &SCNetworkService, enabled: Boolean) -> Boolean;
1560 }
1561 let ret = unsafe { SCNetworkServiceSetEnabled(service, enabled as _) };
1562 ret != 0
1563}
1564
1565#[inline]
1578pub unsafe extern "C-unwind" fn SCNetworkServiceSetName(
1579 service: &SCNetworkService,
1580 name: Option<&CFString>,
1581) -> bool {
1582 extern "C-unwind" {
1583 fn SCNetworkServiceSetName(service: &SCNetworkService, name: Option<&CFString>) -> Boolean;
1584 }
1585 let ret = unsafe { SCNetworkServiceSetName(service, name) };
1586 ret != 0
1587}
1588
1589unsafe impl ConcreteType for SCNetworkSet {
1590 #[doc(alias = "SCNetworkSetGetTypeID")]
1592 #[inline]
1593 fn type_id() -> CFTypeID {
1594 extern "C-unwind" {
1595 fn SCNetworkSetGetTypeID() -> CFTypeID;
1596 }
1597 unsafe { SCNetworkSetGetTypeID() }
1598 }
1599}
1600
1601#[inline]
1615pub unsafe extern "C-unwind" fn SCNetworkSetAddService(
1616 set: &SCNetworkSet,
1617 service: &SCNetworkService,
1618) -> bool {
1619 extern "C-unwind" {
1620 fn SCNetworkSetAddService(set: &SCNetworkSet, service: &SCNetworkService) -> Boolean;
1621 }
1622 let ret = unsafe { SCNetworkSetAddService(set, service) };
1623 ret != 0
1624}
1625
1626#[inline]
1635pub unsafe extern "C-unwind" fn SCNetworkSetContainsInterface(
1636 set: &SCNetworkSet,
1637 interface: &SCNetworkInterface,
1638) -> bool {
1639 extern "C-unwind" {
1640 fn SCNetworkSetContainsInterface(
1641 set: &SCNetworkSet,
1642 interface: &SCNetworkInterface,
1643 ) -> Boolean;
1644 }
1645 let ret = unsafe { SCNetworkSetContainsInterface(set, interface) };
1646 ret != 0
1647}
1648
1649#[cfg(feature = "SCPreferences")]
1656#[inline]
1657pub unsafe extern "C-unwind" fn SCNetworkSetCopyAll(
1658 prefs: &SCPreferences,
1659) -> Option<CFRetained<CFArray>> {
1660 extern "C-unwind" {
1661 fn SCNetworkSetCopyAll(prefs: &SCPreferences) -> Option<NonNull<CFArray>>;
1662 }
1663 let ret = unsafe { SCNetworkSetCopyAll(prefs) };
1664 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1665}
1666
1667#[cfg(feature = "SCPreferences")]
1673#[inline]
1674pub unsafe extern "C-unwind" fn SCNetworkSetCopyCurrent(
1675 prefs: &SCPreferences,
1676) -> Option<CFRetained<SCNetworkSet>> {
1677 extern "C-unwind" {
1678 fn SCNetworkSetCopyCurrent(prefs: &SCPreferences) -> Option<NonNull<SCNetworkSet>>;
1679 }
1680 let ret = unsafe { SCNetworkSetCopyCurrent(prefs) };
1681 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1682}
1683
1684#[inline]
1691pub unsafe extern "C-unwind" fn SCNetworkSetCopyServices(
1692 set: &SCNetworkSet,
1693) -> Option<CFRetained<CFArray>> {
1694 extern "C-unwind" {
1695 fn SCNetworkSetCopyServices(set: &SCNetworkSet) -> Option<NonNull<CFArray>>;
1696 }
1697 let ret = unsafe { SCNetworkSetCopyServices(set) };
1698 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1699}
1700
1701#[cfg(feature = "SCPreferences")]
1708#[inline]
1709pub unsafe extern "C-unwind" fn SCNetworkSetCreate(
1710 prefs: &SCPreferences,
1711) -> Option<CFRetained<SCNetworkSet>> {
1712 extern "C-unwind" {
1713 fn SCNetworkSetCreate(prefs: &SCPreferences) -> Option<NonNull<SCNetworkSet>>;
1714 }
1715 let ret = unsafe { SCNetworkSetCreate(prefs) };
1716 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1717}
1718
1719#[cfg(feature = "SCPreferences")]
1730#[inline]
1731pub unsafe extern "C-unwind" fn SCNetworkSetCopy(
1732 prefs: &SCPreferences,
1733 set_id: &CFString,
1734) -> Option<CFRetained<SCNetworkSet>> {
1735 extern "C-unwind" {
1736 fn SCNetworkSetCopy(
1737 prefs: &SCPreferences,
1738 set_id: &CFString,
1739 ) -> Option<NonNull<SCNetworkSet>>;
1740 }
1741 let ret = unsafe { SCNetworkSetCopy(prefs, set_id) };
1742 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1743}
1744
1745#[inline]
1751pub unsafe extern "C-unwind" fn SCNetworkSetGetName(
1752 set: &SCNetworkSet,
1753) -> Option<CFRetained<CFString>> {
1754 extern "C-unwind" {
1755 fn SCNetworkSetGetName(set: &SCNetworkSet) -> Option<NonNull<CFString>>;
1756 }
1757 let ret = unsafe { SCNetworkSetGetName(set) };
1758 ret.map(|ret| unsafe { CFRetained::retain(ret) })
1759}
1760
1761#[inline]
1767pub unsafe extern "C-unwind" fn SCNetworkSetGetSetID(
1768 set: &SCNetworkSet,
1769) -> Option<CFRetained<CFString>> {
1770 extern "C-unwind" {
1771 fn SCNetworkSetGetSetID(set: &SCNetworkSet) -> Option<NonNull<CFString>>;
1772 }
1773 let ret = unsafe { SCNetworkSetGetSetID(set) };
1774 ret.map(|ret| unsafe { CFRetained::retain(ret) })
1775}
1776
1777#[inline]
1787pub unsafe extern "C-unwind" fn SCNetworkSetGetServiceOrder(
1788 set: &SCNetworkSet,
1789) -> Option<CFRetained<CFArray>> {
1790 extern "C-unwind" {
1791 fn SCNetworkSetGetServiceOrder(set: &SCNetworkSet) -> Option<NonNull<CFArray>>;
1792 }
1793 let ret = unsafe { SCNetworkSetGetServiceOrder(set) };
1794 ret.map(|ret| unsafe { CFRetained::retain(ret) })
1795}
1796
1797#[inline]
1803pub unsafe extern "C-unwind" fn SCNetworkSetRemove(set: &SCNetworkSet) -> bool {
1804 extern "C-unwind" {
1805 fn SCNetworkSetRemove(set: &SCNetworkSet) -> Boolean;
1806 }
1807 let ret = unsafe { SCNetworkSetRemove(set) };
1808 ret != 0
1809}
1810
1811#[inline]
1820pub unsafe extern "C-unwind" fn SCNetworkSetRemoveService(
1821 set: &SCNetworkSet,
1822 service: &SCNetworkService,
1823) -> bool {
1824 extern "C-unwind" {
1825 fn SCNetworkSetRemoveService(set: &SCNetworkSet, service: &SCNetworkService) -> Boolean;
1826 }
1827 let ret = unsafe { SCNetworkSetRemoveService(set, service) };
1828 ret != 0
1829}
1830
1831#[inline]
1838pub unsafe extern "C-unwind" fn SCNetworkSetSetCurrent(set: &SCNetworkSet) -> bool {
1839 extern "C-unwind" {
1840 fn SCNetworkSetSetCurrent(set: &SCNetworkSet) -> Boolean;
1841 }
1842 let ret = unsafe { SCNetworkSetSetCurrent(set) };
1843 ret != 0
1844}
1845
1846#[inline]
1858pub unsafe extern "C-unwind" fn SCNetworkSetSetName(
1859 set: &SCNetworkSet,
1860 name: Option<&CFString>,
1861) -> bool {
1862 extern "C-unwind" {
1863 fn SCNetworkSetSetName(set: &SCNetworkSet, name: Option<&CFString>) -> Boolean;
1864 }
1865 let ret = unsafe { SCNetworkSetSetName(set, name) };
1866 ret != 0
1867}
1868
1869#[inline]
1877pub unsafe extern "C-unwind" fn SCNetworkSetSetServiceOrder(
1878 set: &SCNetworkSet,
1879 new_order: &CFArray,
1880) -> bool {
1881 extern "C-unwind" {
1882 fn SCNetworkSetSetServiceOrder(set: &SCNetworkSet, new_order: &CFArray) -> Boolean;
1883 }
1884 let ret = unsafe { SCNetworkSetSetServiceOrder(set, new_order) };
1885 ret != 0
1886}