use core::cell::UnsafeCell;
use core::ffi::*;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use objc2_core_foundation::*;
use crate::*;
#[doc(alias = "SCNetworkInterfaceRef")]
#[repr(C)]
pub struct SCNetworkInterface {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl SCNetworkInterface {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"__SCNetworkInterface"> for SCNetworkInterface {}
);
extern "C" {
pub static kSCNetworkInterfaceType6to4: &'static CFString;
}
extern "C" {
pub static kSCNetworkInterfaceTypeBluetooth: &'static CFString;
}
extern "C" {
pub static kSCNetworkInterfaceTypeBond: &'static CFString;
}
extern "C" {
pub static kSCNetworkInterfaceTypeEthernet: &'static CFString;
}
extern "C" {
pub static kSCNetworkInterfaceTypeFireWire: &'static CFString;
}
extern "C" {
pub static kSCNetworkInterfaceTypeIEEE80211: &'static CFString;
}
extern "C" {
pub static kSCNetworkInterfaceTypeIPSec: &'static CFString;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kSCNetworkInterfaceTypeIrDA: &'static CFString;
}
extern "C" {
pub static kSCNetworkInterfaceTypeL2TP: &'static CFString;
}
extern "C" {
pub static kSCNetworkInterfaceTypeModem: &'static CFString;
}
extern "C" {
pub static kSCNetworkInterfaceTypePPP: &'static CFString;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kSCNetworkInterfaceTypePPTP: &'static CFString;
}
extern "C" {
pub static kSCNetworkInterfaceTypeSerial: &'static CFString;
}
extern "C" {
pub static kSCNetworkInterfaceTypeVLAN: &'static CFString;
}
extern "C" {
pub static kSCNetworkInterfaceTypeWWAN: &'static CFString;
}
extern "C" {
pub static kSCNetworkInterfaceTypeIPv4: &'static CFString;
}
extern "C" {
pub static kSCNetworkInterfaceIPv4: &'static SCNetworkInterface;
}
#[doc(alias = "SCBondInterfaceRef")]
pub type SCBondInterface = SCNetworkInterface;
#[doc(alias = "SCBondStatusRef")]
#[repr(C)]
pub struct SCBondStatus {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl SCBondStatus {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"__SCBondStatus"> for SCBondStatus {}
);
pub const kSCBondStatusOK: c_uint = 0;
pub const kSCBondStatusLinkInvalid: c_uint = 1;
pub const kSCBondStatusNoPartner: c_uint = 2;
pub const kSCBondStatusNotInActiveGroup: c_uint = 3;
pub const kSCBondStatusUnknown: c_uint = 999;
extern "C" {
pub static kSCBondStatusDeviceAggregationStatus: &'static CFString;
}
extern "C" {
pub static kSCBondStatusDeviceCollecting: &'static CFString;
}
extern "C" {
pub static kSCBondStatusDeviceDistributing: &'static CFString;
}
#[doc(alias = "SCVLANInterfaceRef")]
pub type SCVLANInterface = SCNetworkInterface;
#[doc(alias = "SCNetworkProtocolRef")]
#[repr(C)]
pub struct SCNetworkProtocol {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl SCNetworkProtocol {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"__SCNetworkProtocol"> for SCNetworkProtocol {}
);
extern "C" {
pub static kSCNetworkProtocolTypeDNS: &'static CFString;
}
extern "C" {
pub static kSCNetworkProtocolTypeIPv4: &'static CFString;
}
extern "C" {
pub static kSCNetworkProtocolTypeIPv6: &'static CFString;
}
extern "C" {
pub static kSCNetworkProtocolTypeProxies: &'static CFString;
}
extern "C" {
pub static kSCNetworkProtocolTypeSMB: &'static CFString;
}
#[doc(alias = "SCNetworkServiceRef")]
#[repr(C)]
pub struct SCNetworkService {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl SCNetworkService {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"__SCNetworkService"> for SCNetworkService {}
);
#[doc(alias = "SCNetworkSetRef")]
#[repr(C)]
pub struct SCNetworkSet {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl SCNetworkSet {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"__SCNetworkSet"> for SCNetworkSet {}
);
unsafe impl ConcreteType for SCNetworkInterface {
#[doc(alias = "SCNetworkInterfaceGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn SCNetworkInterfaceGetTypeID() -> CFTypeID;
}
unsafe { SCNetworkInterfaceGetTypeID() }
}
}
impl SCNetworkInterface {
#[doc(alias = "SCNetworkInterfaceCopyAll")]
#[inline]
pub fn all() -> CFRetained<CFArray> {
extern "C-unwind" {
fn SCNetworkInterfaceCopyAll() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkInterfaceCopyAll() };
let ret =
ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[doc(alias = "SCNetworkInterfaceGetSupportedInterfaceTypes")]
#[inline]
pub fn supported_interface_types(&self) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetSupportedInterfaceTypes(
interface: &SCNetworkInterface,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkInterfaceGetSupportedInterfaceTypes(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkInterfaceGetSupportedProtocolTypes")]
#[inline]
pub fn supported_protocol_types(&self) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetSupportedProtocolTypes(
interface: &SCNetworkInterface,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkInterfaceGetSupportedProtocolTypes(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkInterfaceCreateWithInterface")]
#[inline]
pub fn with_interface(
&self,
interface_type: &CFString,
) -> Option<CFRetained<SCNetworkInterface>> {
extern "C-unwind" {
fn SCNetworkInterfaceCreateWithInterface(
interface: &SCNetworkInterface,
interface_type: &CFString,
) -> Option<NonNull<SCNetworkInterface>>;
}
let ret = unsafe { SCNetworkInterfaceCreateWithInterface(self, interface_type) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SCNetworkInterfaceGetBSDName")]
#[inline]
pub fn bsd_name(&self) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetBSDName(
interface: &SCNetworkInterface,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkInterfaceGetBSDName(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkInterfaceGetConfiguration")]
#[inline]
pub fn configuration(&self) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetConfiguration(
interface: &SCNetworkInterface,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SCNetworkInterfaceGetConfiguration(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkInterfaceGetExtendedConfiguration")]
#[inline]
pub fn extended_configuration(
&self,
extended_type: &CFString,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetExtendedConfiguration(
interface: &SCNetworkInterface,
extended_type: &CFString,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SCNetworkInterfaceGetExtendedConfiguration(self, extended_type) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkInterfaceGetHardwareAddressString")]
#[inline]
pub fn hardware_address_string(&self) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetHardwareAddressString(
interface: &SCNetworkInterface,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkInterfaceGetHardwareAddressString(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkInterfaceGetInterface")]
#[inline]
pub fn interface(&self) -> Option<CFRetained<SCNetworkInterface>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetInterface(
interface: &SCNetworkInterface,
) -> Option<NonNull<SCNetworkInterface>>;
}
let ret = unsafe { SCNetworkInterfaceGetInterface(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkInterfaceGetInterfaceType")]
#[inline]
pub fn interface_type(&self) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetInterfaceType(
interface: &SCNetworkInterface,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkInterfaceGetInterfaceType(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkInterfaceGetLocalizedDisplayName")]
#[inline]
pub fn localized_display_name(&self) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetLocalizedDisplayName(
interface: &SCNetworkInterface,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkInterfaceGetLocalizedDisplayName(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkInterfaceSetConfiguration")]
#[inline]
pub unsafe fn set_configuration(&self, config: Option<&CFDictionary>) -> bool {
extern "C-unwind" {
fn SCNetworkInterfaceSetConfiguration(
interface: &SCNetworkInterface,
config: Option<&CFDictionary>,
) -> Boolean;
}
let ret = unsafe { SCNetworkInterfaceSetConfiguration(self, config) };
ret != 0
}
#[doc(alias = "SCNetworkInterfaceSetExtendedConfiguration")]
#[inline]
pub unsafe fn set_extended_configuration(
&self,
extended_type: &CFString,
config: Option<&CFDictionary>,
) -> bool {
extern "C-unwind" {
fn SCNetworkInterfaceSetExtendedConfiguration(
interface: &SCNetworkInterface,
extended_type: &CFString,
config: Option<&CFDictionary>,
) -> Boolean;
}
let ret =
unsafe { SCNetworkInterfaceSetExtendedConfiguration(self, extended_type, config) };
ret != 0
}
#[doc(alias = "SCNetworkInterfaceCopyMediaOptions")]
#[inline]
pub unsafe fn media_options(
&self,
current: *mut *const CFDictionary,
active: *mut *const CFDictionary,
available: *mut *const CFArray,
filter: bool,
) -> bool {
extern "C-unwind" {
fn SCNetworkInterfaceCopyMediaOptions(
interface: &SCNetworkInterface,
current: *mut *const CFDictionary,
active: *mut *const CFDictionary,
available: *mut *const CFArray,
filter: Boolean,
) -> Boolean;
}
let ret = unsafe {
SCNetworkInterfaceCopyMediaOptions(self, current, active, available, filter as _)
};
ret != 0
}
#[doc(alias = "SCNetworkInterfaceCopyMediaSubTypes")]
#[inline]
pub fn media_sub_types(available: &CFArray) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkInterfaceCopyMediaSubTypes(available: &CFArray)
-> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkInterfaceCopyMediaSubTypes(available) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SCNetworkInterfaceCopyMediaSubTypeOptions")]
#[inline]
pub fn media_sub_type_options(
available: &CFArray,
sub_type: &CFString,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkInterfaceCopyMediaSubTypeOptions(
available: &CFArray,
sub_type: &CFString,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkInterfaceCopyMediaSubTypeOptions(available, sub_type) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SCNetworkInterfaceCopyMTU")]
#[inline]
pub unsafe fn mtu(
&self,
mtu_cur: *mut c_int,
mtu_min: *mut c_int,
mtu_max: *mut c_int,
) -> bool {
extern "C-unwind" {
fn SCNetworkInterfaceCopyMTU(
interface: &SCNetworkInterface,
mtu_cur: *mut c_int,
mtu_min: *mut c_int,
mtu_max: *mut c_int,
) -> Boolean;
}
let ret = unsafe { SCNetworkInterfaceCopyMTU(self, mtu_cur, mtu_min, mtu_max) };
ret != 0
}
#[doc(alias = "SCNetworkInterfaceSetMediaOptions")]
#[inline]
pub fn set_media_options(&self, subtype: Option<&CFString>, options: Option<&CFArray>) -> bool {
extern "C-unwind" {
fn SCNetworkInterfaceSetMediaOptions(
interface: &SCNetworkInterface,
subtype: Option<&CFString>,
options: Option<&CFArray>,
) -> Boolean;
}
let ret = unsafe { SCNetworkInterfaceSetMediaOptions(self, subtype, options) };
ret != 0
}
#[doc(alias = "SCNetworkInterfaceSetMTU")]
#[inline]
pub fn set_mtu(&self, mtu: c_int) -> bool {
extern "C-unwind" {
fn SCNetworkInterfaceSetMTU(interface: &SCNetworkInterface, mtu: c_int) -> Boolean;
}
let ret = unsafe { SCNetworkInterfaceSetMTU(self, mtu) };
ret != 0
}
#[doc(alias = "SCNetworkInterfaceForceConfigurationRefresh")]
#[inline]
pub fn force_configuration_refresh(&self) -> bool {
extern "C-unwind" {
fn SCNetworkInterfaceForceConfigurationRefresh(
interface: &SCNetworkInterface,
) -> Boolean;
}
let ret = unsafe { SCNetworkInterfaceForceConfigurationRefresh(self) };
ret != 0
}
}
#[cfg(feature = "SCPreferences")]
#[inline]
pub extern "C-unwind" fn SCBondInterfaceCopyAll(prefs: &SCPreferences) -> CFRetained<CFArray> {
extern "C-unwind" {
fn SCBondInterfaceCopyAll(prefs: &SCPreferences) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCBondInterfaceCopyAll(prefs) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[cfg(feature = "SCPreferences")]
#[inline]
pub extern "C-unwind" fn SCBondInterfaceCopyAvailableMemberInterfaces(
prefs: &SCPreferences,
) -> CFRetained<CFArray> {
extern "C-unwind" {
fn SCBondInterfaceCopyAvailableMemberInterfaces(
prefs: &SCPreferences,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCBondInterfaceCopyAvailableMemberInterfaces(prefs) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[cfg(feature = "SCPreferences")]
#[inline]
pub extern "C-unwind" fn SCBondInterfaceCreate(
prefs: &SCPreferences,
) -> Option<CFRetained<SCBondInterface>> {
extern "C-unwind" {
fn SCBondInterfaceCreate(prefs: &SCPreferences) -> Option<NonNull<SCBondInterface>>;
}
let ret = unsafe { SCBondInterfaceCreate(prefs) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[inline]
pub extern "C-unwind" fn SCBondInterfaceRemove(bond: &SCBondInterface) -> bool {
extern "C-unwind" {
fn SCBondInterfaceRemove(bond: &SCBondInterface) -> Boolean;
}
let ret = unsafe { SCBondInterfaceRemove(bond) };
ret != 0
}
#[inline]
pub extern "C-unwind" fn SCBondInterfaceGetMemberInterfaces(
bond: &SCBondInterface,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCBondInterfaceGetMemberInterfaces(bond: &SCBondInterface) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCBondInterfaceGetMemberInterfaces(bond) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[inline]
pub extern "C-unwind" fn SCBondInterfaceGetOptions(
bond: &SCBondInterface,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SCBondInterfaceGetOptions(bond: &SCBondInterface) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SCBondInterfaceGetOptions(bond) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[inline]
pub unsafe extern "C-unwind" fn SCBondInterfaceSetMemberInterfaces(
bond: &SCBondInterface,
members: &CFArray,
) -> bool {
extern "C-unwind" {
fn SCBondInterfaceSetMemberInterfaces(bond: &SCBondInterface, members: &CFArray)
-> Boolean;
}
let ret = unsafe { SCBondInterfaceSetMemberInterfaces(bond, members) };
ret != 0
}
#[inline]
pub extern "C-unwind" fn SCBondInterfaceSetLocalizedDisplayName(
bond: &SCBondInterface,
new_name: &CFString,
) -> bool {
extern "C-unwind" {
fn SCBondInterfaceSetLocalizedDisplayName(
bond: &SCBondInterface,
new_name: &CFString,
) -> Boolean;
}
let ret = unsafe { SCBondInterfaceSetLocalizedDisplayName(bond, new_name) };
ret != 0
}
#[inline]
pub unsafe extern "C-unwind" fn SCBondInterfaceSetOptions(
bond: &SCBondInterface,
new_options: &CFDictionary,
) -> bool {
extern "C-unwind" {
fn SCBondInterfaceSetOptions(bond: &SCBondInterface, new_options: &CFDictionary)
-> Boolean;
}
let ret = unsafe { SCBondInterfaceSetOptions(bond, new_options) };
ret != 0
}
#[inline]
pub extern "C-unwind" fn SCBondInterfaceCopyStatus(
bond: &SCBondInterface,
) -> Option<CFRetained<SCBondStatus>> {
extern "C-unwind" {
fn SCBondInterfaceCopyStatus(bond: &SCBondInterface) -> Option<NonNull<SCBondStatus>>;
}
let ret = unsafe { SCBondInterfaceCopyStatus(bond) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
unsafe impl ConcreteType for SCBondStatus {
#[doc(alias = "SCBondStatusGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn SCBondStatusGetTypeID() -> CFTypeID;
}
unsafe { SCBondStatusGetTypeID() }
}
}
impl SCBondStatus {
#[doc(alias = "SCBondStatusGetMemberInterfaces")]
#[inline]
pub fn member_interfaces(&self) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCBondStatusGetMemberInterfaces(
bond_status: &SCBondStatus,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCBondStatusGetMemberInterfaces(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCBondStatusGetInterfaceStatus")]
#[inline]
pub fn interface_status(
&self,
interface: Option<&SCNetworkInterface>,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SCBondStatusGetInterfaceStatus(
bond_status: &SCBondStatus,
interface: Option<&SCNetworkInterface>,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SCBondStatusGetInterfaceStatus(self, interface) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
}
#[cfg(feature = "SCPreferences")]
#[inline]
pub extern "C-unwind" fn SCVLANInterfaceCopyAll(prefs: &SCPreferences) -> CFRetained<CFArray> {
extern "C-unwind" {
fn SCVLANInterfaceCopyAll(prefs: &SCPreferences) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCVLANInterfaceCopyAll(prefs) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[inline]
pub extern "C-unwind" fn SCVLANInterfaceCopyAvailablePhysicalInterfaces() -> CFRetained<CFArray> {
extern "C-unwind" {
fn SCVLANInterfaceCopyAvailablePhysicalInterfaces() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCVLANInterfaceCopyAvailablePhysicalInterfaces() };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[cfg(feature = "SCPreferences")]
#[inline]
pub extern "C-unwind" fn SCVLANInterfaceCreate(
prefs: &SCPreferences,
physical: &SCNetworkInterface,
tag: &CFNumber,
) -> Option<CFRetained<SCVLANInterface>> {
extern "C-unwind" {
fn SCVLANInterfaceCreate(
prefs: &SCPreferences,
physical: &SCNetworkInterface,
tag: &CFNumber,
) -> Option<NonNull<SCVLANInterface>>;
}
let ret = unsafe { SCVLANInterfaceCreate(prefs, physical, tag) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[inline]
pub extern "C-unwind" fn SCVLANInterfaceRemove(vlan: &SCVLANInterface) -> bool {
extern "C-unwind" {
fn SCVLANInterfaceRemove(vlan: &SCVLANInterface) -> Boolean;
}
let ret = unsafe { SCVLANInterfaceRemove(vlan) };
ret != 0
}
#[inline]
pub extern "C-unwind" fn SCVLANInterfaceGetPhysicalInterface(
vlan: &SCVLANInterface,
) -> Option<CFRetained<SCNetworkInterface>> {
extern "C-unwind" {
fn SCVLANInterfaceGetPhysicalInterface(
vlan: &SCVLANInterface,
) -> Option<NonNull<SCNetworkInterface>>;
}
let ret = unsafe { SCVLANInterfaceGetPhysicalInterface(vlan) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[inline]
pub extern "C-unwind" fn SCVLANInterfaceGetTag(
vlan: &SCVLANInterface,
) -> Option<CFRetained<CFNumber>> {
extern "C-unwind" {
fn SCVLANInterfaceGetTag(vlan: &SCVLANInterface) -> Option<NonNull<CFNumber>>;
}
let ret = unsafe { SCVLANInterfaceGetTag(vlan) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[inline]
pub extern "C-unwind" fn SCVLANInterfaceGetOptions(
vlan: &SCVLANInterface,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SCVLANInterfaceGetOptions(vlan: &SCVLANInterface) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SCVLANInterfaceGetOptions(vlan) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[inline]
pub extern "C-unwind" fn SCVLANInterfaceSetPhysicalInterfaceAndTag(
vlan: &SCVLANInterface,
physical: &SCNetworkInterface,
tag: &CFNumber,
) -> bool {
extern "C-unwind" {
fn SCVLANInterfaceSetPhysicalInterfaceAndTag(
vlan: &SCVLANInterface,
physical: &SCNetworkInterface,
tag: &CFNumber,
) -> Boolean;
}
let ret = unsafe { SCVLANInterfaceSetPhysicalInterfaceAndTag(vlan, physical, tag) };
ret != 0
}
#[inline]
pub extern "C-unwind" fn SCVLANInterfaceSetLocalizedDisplayName(
vlan: &SCVLANInterface,
new_name: &CFString,
) -> bool {
extern "C-unwind" {
fn SCVLANInterfaceSetLocalizedDisplayName(
vlan: &SCVLANInterface,
new_name: &CFString,
) -> Boolean;
}
let ret = unsafe { SCVLANInterfaceSetLocalizedDisplayName(vlan, new_name) };
ret != 0
}
#[inline]
pub unsafe extern "C-unwind" fn SCVLANInterfaceSetOptions(
vlan: &SCVLANInterface,
new_options: &CFDictionary,
) -> bool {
extern "C-unwind" {
fn SCVLANInterfaceSetOptions(vlan: &SCVLANInterface, new_options: &CFDictionary)
-> Boolean;
}
let ret = unsafe { SCVLANInterfaceSetOptions(vlan, new_options) };
ret != 0
}
unsafe impl ConcreteType for SCNetworkProtocol {
#[doc(alias = "SCNetworkProtocolGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn SCNetworkProtocolGetTypeID() -> CFTypeID;
}
unsafe { SCNetworkProtocolGetTypeID() }
}
}
impl SCNetworkProtocol {
#[doc(alias = "SCNetworkProtocolGetConfiguration")]
#[inline]
pub fn configuration(&self) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SCNetworkProtocolGetConfiguration(
protocol: &SCNetworkProtocol,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SCNetworkProtocolGetConfiguration(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkProtocolGetEnabled")]
#[inline]
pub fn enabled(&self) -> bool {
extern "C-unwind" {
fn SCNetworkProtocolGetEnabled(protocol: &SCNetworkProtocol) -> Boolean;
}
let ret = unsafe { SCNetworkProtocolGetEnabled(self) };
ret != 0
}
#[doc(alias = "SCNetworkProtocolGetProtocolType")]
#[inline]
pub fn protocol_type(&self) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkProtocolGetProtocolType(
protocol: &SCNetworkProtocol,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkProtocolGetProtocolType(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkProtocolSetConfiguration")]
#[inline]
pub unsafe fn set_configuration(&self, config: Option<&CFDictionary>) -> bool {
extern "C-unwind" {
fn SCNetworkProtocolSetConfiguration(
protocol: &SCNetworkProtocol,
config: Option<&CFDictionary>,
) -> Boolean;
}
let ret = unsafe { SCNetworkProtocolSetConfiguration(self, config) };
ret != 0
}
#[doc(alias = "SCNetworkProtocolSetEnabled")]
#[inline]
pub fn set_enabled(&self, enabled: bool) -> bool {
extern "C-unwind" {
fn SCNetworkProtocolSetEnabled(
protocol: &SCNetworkProtocol,
enabled: Boolean,
) -> Boolean;
}
let ret = unsafe { SCNetworkProtocolSetEnabled(self, enabled as _) };
ret != 0
}
}
unsafe impl ConcreteType for SCNetworkService {
#[doc(alias = "SCNetworkServiceGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn SCNetworkServiceGetTypeID() -> CFTypeID;
}
unsafe { SCNetworkServiceGetTypeID() }
}
}
impl SCNetworkService {
#[doc(alias = "SCNetworkServiceAddProtocolType")]
#[inline]
pub fn add_protocol_type(&self, protocol_type: &CFString) -> bool {
extern "C-unwind" {
fn SCNetworkServiceAddProtocolType(
service: &SCNetworkService,
protocol_type: &CFString,
) -> Boolean;
}
let ret = unsafe { SCNetworkServiceAddProtocolType(self, protocol_type) };
ret != 0
}
#[doc(alias = "SCNetworkServiceCopyAll")]
#[cfg(feature = "SCPreferences")]
#[inline]
pub fn all(prefs: &SCPreferences) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkServiceCopyAll(prefs: &SCPreferences) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkServiceCopyAll(prefs) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SCNetworkServiceCopyProtocols")]
#[inline]
pub fn protocols(&self) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkServiceCopyProtocols(
service: &SCNetworkService,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkServiceCopyProtocols(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SCNetworkServiceCreate")]
#[cfg(feature = "SCPreferences")]
#[inline]
pub fn new(
prefs: &SCPreferences,
interface: &SCNetworkInterface,
) -> Option<CFRetained<SCNetworkService>> {
extern "C-unwind" {
fn SCNetworkServiceCreate(
prefs: &SCPreferences,
interface: &SCNetworkInterface,
) -> Option<NonNull<SCNetworkService>>;
}
let ret = unsafe { SCNetworkServiceCreate(prefs, interface) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SCNetworkServiceCopy")]
#[cfg(feature = "SCPreferences")]
#[inline]
pub fn copy(
prefs: &SCPreferences,
service_id: &CFString,
) -> Option<CFRetained<SCNetworkService>> {
extern "C-unwind" {
fn SCNetworkServiceCopy(
prefs: &SCPreferences,
service_id: &CFString,
) -> Option<NonNull<SCNetworkService>>;
}
let ret = unsafe { SCNetworkServiceCopy(prefs, service_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SCNetworkServiceEstablishDefaultConfiguration")]
#[inline]
pub fn establish_default_configuration(&self) -> bool {
extern "C-unwind" {
fn SCNetworkServiceEstablishDefaultConfiguration(service: &SCNetworkService)
-> Boolean;
}
let ret = unsafe { SCNetworkServiceEstablishDefaultConfiguration(self) };
ret != 0
}
#[doc(alias = "SCNetworkServiceGetEnabled")]
#[inline]
pub fn enabled(&self) -> bool {
extern "C-unwind" {
fn SCNetworkServiceGetEnabled(service: &SCNetworkService) -> Boolean;
}
let ret = unsafe { SCNetworkServiceGetEnabled(self) };
ret != 0
}
#[doc(alias = "SCNetworkServiceGetInterface")]
#[inline]
pub fn interface(&self) -> Option<CFRetained<SCNetworkInterface>> {
extern "C-unwind" {
fn SCNetworkServiceGetInterface(
service: &SCNetworkService,
) -> Option<NonNull<SCNetworkInterface>>;
}
let ret = unsafe { SCNetworkServiceGetInterface(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkServiceGetName")]
#[inline]
pub fn name(&self) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkServiceGetName(service: &SCNetworkService) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkServiceGetName(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkServiceCopyProtocol")]
#[inline]
pub fn protocol(&self, protocol_type: &CFString) -> Option<CFRetained<SCNetworkProtocol>> {
extern "C-unwind" {
fn SCNetworkServiceCopyProtocol(
service: &SCNetworkService,
protocol_type: &CFString,
) -> Option<NonNull<SCNetworkProtocol>>;
}
let ret = unsafe { SCNetworkServiceCopyProtocol(self, protocol_type) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SCNetworkServiceGetServiceID")]
#[inline]
pub fn service_id(&self) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkServiceGetServiceID(
service: &SCNetworkService,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkServiceGetServiceID(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkServiceRemove")]
#[inline]
pub fn remove(&self) -> bool {
extern "C-unwind" {
fn SCNetworkServiceRemove(service: &SCNetworkService) -> Boolean;
}
let ret = unsafe { SCNetworkServiceRemove(self) };
ret != 0
}
#[doc(alias = "SCNetworkServiceRemoveProtocolType")]
#[inline]
pub fn remove_protocol_type(&self, protocol_type: &CFString) -> bool {
extern "C-unwind" {
fn SCNetworkServiceRemoveProtocolType(
service: &SCNetworkService,
protocol_type: &CFString,
) -> Boolean;
}
let ret = unsafe { SCNetworkServiceRemoveProtocolType(self, protocol_type) };
ret != 0
}
#[doc(alias = "SCNetworkServiceSetEnabled")]
#[inline]
pub fn set_enabled(&self, enabled: bool) -> bool {
extern "C-unwind" {
fn SCNetworkServiceSetEnabled(service: &SCNetworkService, enabled: Boolean) -> Boolean;
}
let ret = unsafe { SCNetworkServiceSetEnabled(self, enabled as _) };
ret != 0
}
#[doc(alias = "SCNetworkServiceSetName")]
#[inline]
pub fn set_name(&self, name: Option<&CFString>) -> bool {
extern "C-unwind" {
fn SCNetworkServiceSetName(
service: &SCNetworkService,
name: Option<&CFString>,
) -> Boolean;
}
let ret = unsafe { SCNetworkServiceSetName(self, name) };
ret != 0
}
}
unsafe impl ConcreteType for SCNetworkSet {
#[doc(alias = "SCNetworkSetGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn SCNetworkSetGetTypeID() -> CFTypeID;
}
unsafe { SCNetworkSetGetTypeID() }
}
}
impl SCNetworkSet {
#[doc(alias = "SCNetworkSetAddService")]
#[inline]
pub fn add_service(&self, service: &SCNetworkService) -> bool {
extern "C-unwind" {
fn SCNetworkSetAddService(set: &SCNetworkSet, service: &SCNetworkService) -> Boolean;
}
let ret = unsafe { SCNetworkSetAddService(self, service) };
ret != 0
}
#[doc(alias = "SCNetworkSetContainsInterface")]
#[inline]
pub fn contains_interface(&self, interface: &SCNetworkInterface) -> bool {
extern "C-unwind" {
fn SCNetworkSetContainsInterface(
set: &SCNetworkSet,
interface: &SCNetworkInterface,
) -> Boolean;
}
let ret = unsafe { SCNetworkSetContainsInterface(self, interface) };
ret != 0
}
#[doc(alias = "SCNetworkSetCopyAll")]
#[cfg(feature = "SCPreferences")]
#[inline]
pub fn all(prefs: &SCPreferences) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkSetCopyAll(prefs: &SCPreferences) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkSetCopyAll(prefs) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SCNetworkSetCopyCurrent")]
#[cfg(feature = "SCPreferences")]
#[inline]
pub fn current(prefs: &SCPreferences) -> Option<CFRetained<SCNetworkSet>> {
extern "C-unwind" {
fn SCNetworkSetCopyCurrent(prefs: &SCPreferences) -> Option<NonNull<SCNetworkSet>>;
}
let ret = unsafe { SCNetworkSetCopyCurrent(prefs) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SCNetworkSetCopyServices")]
#[inline]
pub fn services(&self) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkSetCopyServices(set: &SCNetworkSet) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkSetCopyServices(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SCNetworkSetCreate")]
#[cfg(feature = "SCPreferences")]
#[inline]
pub fn new(prefs: &SCPreferences) -> Option<CFRetained<SCNetworkSet>> {
extern "C-unwind" {
fn SCNetworkSetCreate(prefs: &SCPreferences) -> Option<NonNull<SCNetworkSet>>;
}
let ret = unsafe { SCNetworkSetCreate(prefs) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SCNetworkSetCopy")]
#[cfg(feature = "SCPreferences")]
#[inline]
pub fn copy(prefs: &SCPreferences, set_id: &CFString) -> Option<CFRetained<SCNetworkSet>> {
extern "C-unwind" {
fn SCNetworkSetCopy(
prefs: &SCPreferences,
set_id: &CFString,
) -> Option<NonNull<SCNetworkSet>>;
}
let ret = unsafe { SCNetworkSetCopy(prefs, set_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SCNetworkSetGetName")]
#[inline]
pub fn name(&self) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkSetGetName(set: &SCNetworkSet) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkSetGetName(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkSetGetSetID")]
#[inline]
pub fn set_id(&self) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkSetGetSetID(set: &SCNetworkSet) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkSetGetSetID(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkSetGetServiceOrder")]
#[inline]
pub fn service_order(&self) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkSetGetServiceOrder(set: &SCNetworkSet) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkSetGetServiceOrder(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SCNetworkSetRemove")]
#[inline]
pub fn remove(&self) -> bool {
extern "C-unwind" {
fn SCNetworkSetRemove(set: &SCNetworkSet) -> Boolean;
}
let ret = unsafe { SCNetworkSetRemove(self) };
ret != 0
}
#[doc(alias = "SCNetworkSetRemoveService")]
#[inline]
pub fn remove_service(&self, service: &SCNetworkService) -> bool {
extern "C-unwind" {
fn SCNetworkSetRemoveService(set: &SCNetworkSet, service: &SCNetworkService)
-> Boolean;
}
let ret = unsafe { SCNetworkSetRemoveService(self, service) };
ret != 0
}
#[doc(alias = "SCNetworkSetSetCurrent")]
#[inline]
pub fn set_current(&self) -> bool {
extern "C-unwind" {
fn SCNetworkSetSetCurrent(set: &SCNetworkSet) -> Boolean;
}
let ret = unsafe { SCNetworkSetSetCurrent(self) };
ret != 0
}
#[doc(alias = "SCNetworkSetSetName")]
#[inline]
pub fn set_name(&self, name: Option<&CFString>) -> bool {
extern "C-unwind" {
fn SCNetworkSetSetName(set: &SCNetworkSet, name: Option<&CFString>) -> Boolean;
}
let ret = unsafe { SCNetworkSetSetName(self, name) };
ret != 0
}
#[doc(alias = "SCNetworkSetSetServiceOrder")]
#[inline]
pub unsafe fn set_service_order(&self, new_order: &CFArray) -> bool {
extern "C-unwind" {
fn SCNetworkSetSetServiceOrder(set: &SCNetworkSet, new_order: &CFArray) -> Boolean;
}
let ret = unsafe { SCNetworkSetSetServiceOrder(self, new_order) };
ret != 0
}
}
#[deprecated = "renamed to `SCNetworkInterface::all`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceCopyAll() -> CFRetained<CFArray> {
extern "C-unwind" {
fn SCNetworkInterfaceCopyAll() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkInterfaceCopyAll() };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[deprecated = "renamed to `SCNetworkInterface::supported_interface_types`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceGetSupportedInterfaceTypes(
interface: &SCNetworkInterface,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetSupportedInterfaceTypes(
interface: &SCNetworkInterface,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkInterfaceGetSupportedInterfaceTypes(interface) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkInterface::supported_protocol_types`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceGetSupportedProtocolTypes(
interface: &SCNetworkInterface,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetSupportedProtocolTypes(
interface: &SCNetworkInterface,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkInterfaceGetSupportedProtocolTypes(interface) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkInterface::with_interface`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceCreateWithInterface(
interface: &SCNetworkInterface,
interface_type: &CFString,
) -> Option<CFRetained<SCNetworkInterface>> {
extern "C-unwind" {
fn SCNetworkInterfaceCreateWithInterface(
interface: &SCNetworkInterface,
interface_type: &CFString,
) -> Option<NonNull<SCNetworkInterface>>;
}
let ret = unsafe { SCNetworkInterfaceCreateWithInterface(interface, interface_type) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `SCNetworkInterface::bsd_name`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceGetBSDName(
interface: &SCNetworkInterface,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetBSDName(
interface: &SCNetworkInterface,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkInterfaceGetBSDName(interface) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkInterface::configuration`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceGetConfiguration(
interface: &SCNetworkInterface,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetConfiguration(
interface: &SCNetworkInterface,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SCNetworkInterfaceGetConfiguration(interface) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkInterface::extended_configuration`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceGetExtendedConfiguration(
interface: &SCNetworkInterface,
extended_type: &CFString,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetExtendedConfiguration(
interface: &SCNetworkInterface,
extended_type: &CFString,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SCNetworkInterfaceGetExtendedConfiguration(interface, extended_type) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkInterface::hardware_address_string`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceGetHardwareAddressString(
interface: &SCNetworkInterface,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetHardwareAddressString(
interface: &SCNetworkInterface,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkInterfaceGetHardwareAddressString(interface) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkInterface::interface`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceGetInterface(
interface: &SCNetworkInterface,
) -> Option<CFRetained<SCNetworkInterface>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetInterface(
interface: &SCNetworkInterface,
) -> Option<NonNull<SCNetworkInterface>>;
}
let ret = unsafe { SCNetworkInterfaceGetInterface(interface) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkInterface::interface_type`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceGetInterfaceType(
interface: &SCNetworkInterface,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetInterfaceType(
interface: &SCNetworkInterface,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkInterfaceGetInterfaceType(interface) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkInterface::localized_display_name`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceGetLocalizedDisplayName(
interface: &SCNetworkInterface,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkInterfaceGetLocalizedDisplayName(
interface: &SCNetworkInterface,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkInterfaceGetLocalizedDisplayName(interface) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkInterface::set_configuration`"]
#[inline]
pub unsafe extern "C-unwind" fn SCNetworkInterfaceSetConfiguration(
interface: &SCNetworkInterface,
config: Option<&CFDictionary>,
) -> bool {
extern "C-unwind" {
fn SCNetworkInterfaceSetConfiguration(
interface: &SCNetworkInterface,
config: Option<&CFDictionary>,
) -> Boolean;
}
let ret = unsafe { SCNetworkInterfaceSetConfiguration(interface, config) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkInterface::set_extended_configuration`"]
#[inline]
pub unsafe extern "C-unwind" fn SCNetworkInterfaceSetExtendedConfiguration(
interface: &SCNetworkInterface,
extended_type: &CFString,
config: Option<&CFDictionary>,
) -> bool {
extern "C-unwind" {
fn SCNetworkInterfaceSetExtendedConfiguration(
interface: &SCNetworkInterface,
extended_type: &CFString,
config: Option<&CFDictionary>,
) -> Boolean;
}
let ret =
unsafe { SCNetworkInterfaceSetExtendedConfiguration(interface, extended_type, config) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkInterface::media_options`"]
#[inline]
pub unsafe extern "C-unwind" fn SCNetworkInterfaceCopyMediaOptions(
interface: &SCNetworkInterface,
current: *mut *const CFDictionary,
active: *mut *const CFDictionary,
available: *mut *const CFArray,
filter: bool,
) -> bool {
extern "C-unwind" {
fn SCNetworkInterfaceCopyMediaOptions(
interface: &SCNetworkInterface,
current: *mut *const CFDictionary,
active: *mut *const CFDictionary,
available: *mut *const CFArray,
filter: Boolean,
) -> Boolean;
}
let ret = unsafe {
SCNetworkInterfaceCopyMediaOptions(interface, current, active, available, filter as _)
};
ret != 0
}
#[deprecated = "renamed to `SCNetworkInterface::media_sub_types`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceCopyMediaSubTypes(
available: &CFArray,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkInterfaceCopyMediaSubTypes(available: &CFArray) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkInterfaceCopyMediaSubTypes(available) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `SCNetworkInterface::media_sub_type_options`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceCopyMediaSubTypeOptions(
available: &CFArray,
sub_type: &CFString,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkInterfaceCopyMediaSubTypeOptions(
available: &CFArray,
sub_type: &CFString,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkInterfaceCopyMediaSubTypeOptions(available, sub_type) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `SCNetworkInterface::mtu`"]
#[inline]
pub unsafe extern "C-unwind" fn SCNetworkInterfaceCopyMTU(
interface: &SCNetworkInterface,
mtu_cur: *mut c_int,
mtu_min: *mut c_int,
mtu_max: *mut c_int,
) -> bool {
extern "C-unwind" {
fn SCNetworkInterfaceCopyMTU(
interface: &SCNetworkInterface,
mtu_cur: *mut c_int,
mtu_min: *mut c_int,
mtu_max: *mut c_int,
) -> Boolean;
}
let ret = unsafe { SCNetworkInterfaceCopyMTU(interface, mtu_cur, mtu_min, mtu_max) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkInterface::set_media_options`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceSetMediaOptions(
interface: &SCNetworkInterface,
subtype: Option<&CFString>,
options: Option<&CFArray>,
) -> bool {
extern "C-unwind" {
fn SCNetworkInterfaceSetMediaOptions(
interface: &SCNetworkInterface,
subtype: Option<&CFString>,
options: Option<&CFArray>,
) -> Boolean;
}
let ret = unsafe { SCNetworkInterfaceSetMediaOptions(interface, subtype, options) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkInterface::set_mtu`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceSetMTU(
interface: &SCNetworkInterface,
mtu: c_int,
) -> bool {
extern "C-unwind" {
fn SCNetworkInterfaceSetMTU(interface: &SCNetworkInterface, mtu: c_int) -> Boolean;
}
let ret = unsafe { SCNetworkInterfaceSetMTU(interface, mtu) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkInterface::force_configuration_refresh`"]
#[inline]
pub extern "C-unwind" fn SCNetworkInterfaceForceConfigurationRefresh(
interface: &SCNetworkInterface,
) -> bool {
extern "C-unwind" {
fn SCNetworkInterfaceForceConfigurationRefresh(interface: &SCNetworkInterface) -> Boolean;
}
let ret = unsafe { SCNetworkInterfaceForceConfigurationRefresh(interface) };
ret != 0
}
#[deprecated = "renamed to `SCBondStatus::member_interfaces`"]
#[inline]
pub extern "C-unwind" fn SCBondStatusGetMemberInterfaces(
bond_status: &SCBondStatus,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCBondStatusGetMemberInterfaces(bond_status: &SCBondStatus) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCBondStatusGetMemberInterfaces(bond_status) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCBondStatus::interface_status`"]
#[inline]
pub extern "C-unwind" fn SCBondStatusGetInterfaceStatus(
bond_status: &SCBondStatus,
interface: Option<&SCNetworkInterface>,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SCBondStatusGetInterfaceStatus(
bond_status: &SCBondStatus,
interface: Option<&SCNetworkInterface>,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SCBondStatusGetInterfaceStatus(bond_status, interface) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkProtocol::configuration`"]
#[inline]
pub extern "C-unwind" fn SCNetworkProtocolGetConfiguration(
protocol: &SCNetworkProtocol,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SCNetworkProtocolGetConfiguration(
protocol: &SCNetworkProtocol,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SCNetworkProtocolGetConfiguration(protocol) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkProtocol::enabled`"]
#[inline]
pub extern "C-unwind" fn SCNetworkProtocolGetEnabled(protocol: &SCNetworkProtocol) -> bool {
extern "C-unwind" {
fn SCNetworkProtocolGetEnabled(protocol: &SCNetworkProtocol) -> Boolean;
}
let ret = unsafe { SCNetworkProtocolGetEnabled(protocol) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkProtocol::protocol_type`"]
#[inline]
pub extern "C-unwind" fn SCNetworkProtocolGetProtocolType(
protocol: &SCNetworkProtocol,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkProtocolGetProtocolType(
protocol: &SCNetworkProtocol,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkProtocolGetProtocolType(protocol) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkProtocol::set_configuration`"]
#[inline]
pub unsafe extern "C-unwind" fn SCNetworkProtocolSetConfiguration(
protocol: &SCNetworkProtocol,
config: Option<&CFDictionary>,
) -> bool {
extern "C-unwind" {
fn SCNetworkProtocolSetConfiguration(
protocol: &SCNetworkProtocol,
config: Option<&CFDictionary>,
) -> Boolean;
}
let ret = unsafe { SCNetworkProtocolSetConfiguration(protocol, config) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkProtocol::set_enabled`"]
#[inline]
pub extern "C-unwind" fn SCNetworkProtocolSetEnabled(
protocol: &SCNetworkProtocol,
enabled: bool,
) -> bool {
extern "C-unwind" {
fn SCNetworkProtocolSetEnabled(protocol: &SCNetworkProtocol, enabled: Boolean) -> Boolean;
}
let ret = unsafe { SCNetworkProtocolSetEnabled(protocol, enabled as _) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkService::add_protocol_type`"]
#[inline]
pub extern "C-unwind" fn SCNetworkServiceAddProtocolType(
service: &SCNetworkService,
protocol_type: &CFString,
) -> bool {
extern "C-unwind" {
fn SCNetworkServiceAddProtocolType(
service: &SCNetworkService,
protocol_type: &CFString,
) -> Boolean;
}
let ret = unsafe { SCNetworkServiceAddProtocolType(service, protocol_type) };
ret != 0
}
#[cfg(feature = "SCPreferences")]
#[deprecated = "renamed to `SCNetworkService::all`"]
#[inline]
pub extern "C-unwind" fn SCNetworkServiceCopyAll(
prefs: &SCPreferences,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkServiceCopyAll(prefs: &SCPreferences) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkServiceCopyAll(prefs) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `SCNetworkService::protocols`"]
#[inline]
pub extern "C-unwind" fn SCNetworkServiceCopyProtocols(
service: &SCNetworkService,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkServiceCopyProtocols(service: &SCNetworkService) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkServiceCopyProtocols(service) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "SCPreferences")]
#[deprecated = "renamed to `SCNetworkService::new`"]
#[inline]
pub extern "C-unwind" fn SCNetworkServiceCreate(
prefs: &SCPreferences,
interface: &SCNetworkInterface,
) -> Option<CFRetained<SCNetworkService>> {
extern "C-unwind" {
fn SCNetworkServiceCreate(
prefs: &SCPreferences,
interface: &SCNetworkInterface,
) -> Option<NonNull<SCNetworkService>>;
}
let ret = unsafe { SCNetworkServiceCreate(prefs, interface) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "SCPreferences")]
#[deprecated = "renamed to `SCNetworkService::copy`"]
#[inline]
pub extern "C-unwind" fn SCNetworkServiceCopy(
prefs: &SCPreferences,
service_id: &CFString,
) -> Option<CFRetained<SCNetworkService>> {
extern "C-unwind" {
fn SCNetworkServiceCopy(
prefs: &SCPreferences,
service_id: &CFString,
) -> Option<NonNull<SCNetworkService>>;
}
let ret = unsafe { SCNetworkServiceCopy(prefs, service_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `SCNetworkService::establish_default_configuration`"]
#[inline]
pub extern "C-unwind" fn SCNetworkServiceEstablishDefaultConfiguration(
service: &SCNetworkService,
) -> bool {
extern "C-unwind" {
fn SCNetworkServiceEstablishDefaultConfiguration(service: &SCNetworkService) -> Boolean;
}
let ret = unsafe { SCNetworkServiceEstablishDefaultConfiguration(service) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkService::enabled`"]
#[inline]
pub extern "C-unwind" fn SCNetworkServiceGetEnabled(service: &SCNetworkService) -> bool {
extern "C-unwind" {
fn SCNetworkServiceGetEnabled(service: &SCNetworkService) -> Boolean;
}
let ret = unsafe { SCNetworkServiceGetEnabled(service) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkService::interface`"]
#[inline]
pub extern "C-unwind" fn SCNetworkServiceGetInterface(
service: &SCNetworkService,
) -> Option<CFRetained<SCNetworkInterface>> {
extern "C-unwind" {
fn SCNetworkServiceGetInterface(
service: &SCNetworkService,
) -> Option<NonNull<SCNetworkInterface>>;
}
let ret = unsafe { SCNetworkServiceGetInterface(service) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkService::name`"]
#[inline]
pub extern "C-unwind" fn SCNetworkServiceGetName(
service: &SCNetworkService,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkServiceGetName(service: &SCNetworkService) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkServiceGetName(service) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkService::protocol`"]
#[inline]
pub extern "C-unwind" fn SCNetworkServiceCopyProtocol(
service: &SCNetworkService,
protocol_type: &CFString,
) -> Option<CFRetained<SCNetworkProtocol>> {
extern "C-unwind" {
fn SCNetworkServiceCopyProtocol(
service: &SCNetworkService,
protocol_type: &CFString,
) -> Option<NonNull<SCNetworkProtocol>>;
}
let ret = unsafe { SCNetworkServiceCopyProtocol(service, protocol_type) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `SCNetworkService::service_id`"]
#[inline]
pub extern "C-unwind" fn SCNetworkServiceGetServiceID(
service: &SCNetworkService,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkServiceGetServiceID(service: &SCNetworkService) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkServiceGetServiceID(service) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkService::remove`"]
#[inline]
pub extern "C-unwind" fn SCNetworkServiceRemove(service: &SCNetworkService) -> bool {
extern "C-unwind" {
fn SCNetworkServiceRemove(service: &SCNetworkService) -> Boolean;
}
let ret = unsafe { SCNetworkServiceRemove(service) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkService::remove_protocol_type`"]
#[inline]
pub extern "C-unwind" fn SCNetworkServiceRemoveProtocolType(
service: &SCNetworkService,
protocol_type: &CFString,
) -> bool {
extern "C-unwind" {
fn SCNetworkServiceRemoveProtocolType(
service: &SCNetworkService,
protocol_type: &CFString,
) -> Boolean;
}
let ret = unsafe { SCNetworkServiceRemoveProtocolType(service, protocol_type) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkService::set_enabled`"]
#[inline]
pub extern "C-unwind" fn SCNetworkServiceSetEnabled(
service: &SCNetworkService,
enabled: bool,
) -> bool {
extern "C-unwind" {
fn SCNetworkServiceSetEnabled(service: &SCNetworkService, enabled: Boolean) -> Boolean;
}
let ret = unsafe { SCNetworkServiceSetEnabled(service, enabled as _) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkService::set_name`"]
#[inline]
pub extern "C-unwind" fn SCNetworkServiceSetName(
service: &SCNetworkService,
name: Option<&CFString>,
) -> bool {
extern "C-unwind" {
fn SCNetworkServiceSetName(service: &SCNetworkService, name: Option<&CFString>) -> Boolean;
}
let ret = unsafe { SCNetworkServiceSetName(service, name) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkSet::add_service`"]
#[inline]
pub extern "C-unwind" fn SCNetworkSetAddService(
set: &SCNetworkSet,
service: &SCNetworkService,
) -> bool {
extern "C-unwind" {
fn SCNetworkSetAddService(set: &SCNetworkSet, service: &SCNetworkService) -> Boolean;
}
let ret = unsafe { SCNetworkSetAddService(set, service) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkSet::contains_interface`"]
#[inline]
pub extern "C-unwind" fn SCNetworkSetContainsInterface(
set: &SCNetworkSet,
interface: &SCNetworkInterface,
) -> bool {
extern "C-unwind" {
fn SCNetworkSetContainsInterface(
set: &SCNetworkSet,
interface: &SCNetworkInterface,
) -> Boolean;
}
let ret = unsafe { SCNetworkSetContainsInterface(set, interface) };
ret != 0
}
#[cfg(feature = "SCPreferences")]
#[deprecated = "renamed to `SCNetworkSet::all`"]
#[inline]
pub extern "C-unwind" fn SCNetworkSetCopyAll(prefs: &SCPreferences) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkSetCopyAll(prefs: &SCPreferences) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkSetCopyAll(prefs) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "SCPreferences")]
#[deprecated = "renamed to `SCNetworkSet::current`"]
#[inline]
pub extern "C-unwind" fn SCNetworkSetCopyCurrent(
prefs: &SCPreferences,
) -> Option<CFRetained<SCNetworkSet>> {
extern "C-unwind" {
fn SCNetworkSetCopyCurrent(prefs: &SCPreferences) -> Option<NonNull<SCNetworkSet>>;
}
let ret = unsafe { SCNetworkSetCopyCurrent(prefs) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `SCNetworkSet::services`"]
#[inline]
pub extern "C-unwind" fn SCNetworkSetCopyServices(
set: &SCNetworkSet,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkSetCopyServices(set: &SCNetworkSet) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkSetCopyServices(set) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "SCPreferences")]
#[deprecated = "renamed to `SCNetworkSet::new`"]
#[inline]
pub extern "C-unwind" fn SCNetworkSetCreate(
prefs: &SCPreferences,
) -> Option<CFRetained<SCNetworkSet>> {
extern "C-unwind" {
fn SCNetworkSetCreate(prefs: &SCPreferences) -> Option<NonNull<SCNetworkSet>>;
}
let ret = unsafe { SCNetworkSetCreate(prefs) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "SCPreferences")]
#[deprecated = "renamed to `SCNetworkSet::copy`"]
#[inline]
pub extern "C-unwind" fn SCNetworkSetCopy(
prefs: &SCPreferences,
set_id: &CFString,
) -> Option<CFRetained<SCNetworkSet>> {
extern "C-unwind" {
fn SCNetworkSetCopy(
prefs: &SCPreferences,
set_id: &CFString,
) -> Option<NonNull<SCNetworkSet>>;
}
let ret = unsafe { SCNetworkSetCopy(prefs, set_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `SCNetworkSet::name`"]
#[inline]
pub extern "C-unwind" fn SCNetworkSetGetName(set: &SCNetworkSet) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkSetGetName(set: &SCNetworkSet) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkSetGetName(set) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkSet::set_id`"]
#[inline]
pub extern "C-unwind" fn SCNetworkSetGetSetID(set: &SCNetworkSet) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SCNetworkSetGetSetID(set: &SCNetworkSet) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SCNetworkSetGetSetID(set) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkSet::service_order`"]
#[inline]
pub extern "C-unwind" fn SCNetworkSetGetServiceOrder(
set: &SCNetworkSet,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SCNetworkSetGetServiceOrder(set: &SCNetworkSet) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SCNetworkSetGetServiceOrder(set) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SCNetworkSet::remove`"]
#[inline]
pub extern "C-unwind" fn SCNetworkSetRemove(set: &SCNetworkSet) -> bool {
extern "C-unwind" {
fn SCNetworkSetRemove(set: &SCNetworkSet) -> Boolean;
}
let ret = unsafe { SCNetworkSetRemove(set) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkSet::remove_service`"]
#[inline]
pub extern "C-unwind" fn SCNetworkSetRemoveService(
set: &SCNetworkSet,
service: &SCNetworkService,
) -> bool {
extern "C-unwind" {
fn SCNetworkSetRemoveService(set: &SCNetworkSet, service: &SCNetworkService) -> Boolean;
}
let ret = unsafe { SCNetworkSetRemoveService(set, service) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkSet::set_current`"]
#[inline]
pub extern "C-unwind" fn SCNetworkSetSetCurrent(set: &SCNetworkSet) -> bool {
extern "C-unwind" {
fn SCNetworkSetSetCurrent(set: &SCNetworkSet) -> Boolean;
}
let ret = unsafe { SCNetworkSetSetCurrent(set) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkSet::set_name`"]
#[inline]
pub extern "C-unwind" fn SCNetworkSetSetName(set: &SCNetworkSet, name: Option<&CFString>) -> bool {
extern "C-unwind" {
fn SCNetworkSetSetName(set: &SCNetworkSet, name: Option<&CFString>) -> Boolean;
}
let ret = unsafe { SCNetworkSetSetName(set, name) };
ret != 0
}
#[deprecated = "renamed to `SCNetworkSet::set_service_order`"]
#[inline]
pub unsafe extern "C-unwind" fn SCNetworkSetSetServiceOrder(
set: &SCNetworkSet,
new_order: &CFArray,
) -> bool {
extern "C-unwind" {
fn SCNetworkSetSetServiceOrder(set: &SCNetworkSet, new_order: &CFArray) -> Boolean;
}
let ret = unsafe { SCNetworkSetSetServiceOrder(set, new_order) };
ret != 0
}