1
+ use core_foundation_sys:: base:: Boolean ;
2
+ use core_foundation_sys:: string:: CFStringRef ;
3
+ use core_foundation_sys:: dictionary:: CFDictionaryRef ;
4
+ use core_foundation_sys:: array:: CFArrayRef ;
5
+
6
+ use SCPreferencesRef ;
7
+
8
+ use std:: os:: raw:: { c_void, c_int} ;
9
+
10
+
11
+ pub type __SCNetworkInterface = c_void ;
12
+ pub type SCNetworkInterfaceRef = * const __SCNetworkInterface ;
13
+ pub type SCBondInterfaceRef = SCNetworkInterfaceRef ;
14
+ pub type SCVLANInterfaceRef = SCNetworkInterfaceRef ;
15
+
16
+ pub type __SCBondStatus = c_void ;
17
+ pub type SCBondStatusRef = * const __SCBondStatus ;
18
+
19
+ pub type __SCNetworkProtocol = c_void ;
20
+ pub type SCNetworkProtocolRef = * const __SCNetworkProtocol ;
21
+
22
+ pub type __SCNetworkService = c_void ;
23
+ pub type SCNetworkServiceRef = * const __SCNetworkService ;
24
+
25
+ pub type __SCNetworkSet = c_void ;
26
+ pub type SCNetworkSetRef = * const __SCNetworkSet ;
27
+
28
+
29
+ #[ link( name = "SystemConfiguration" , kind = "framework" ) ]
30
+ extern "C" {
31
+ pub fn SCNetworkServiceCopyAll ( prefs : SCPreferencesRef ) -> CFArrayRef ;
32
+ pub fn SCNetworkServiceCopy ( prefs : SCPreferencesRef ,
33
+ serviceID : CFStringRef ) -> SCNetworkServiceRef ;
34
+ pub fn SCNetworkServiceGetEnabled ( service : SCNetworkServiceRef ) -> Boolean ;
35
+ pub fn SCNetworkServiceGetInterface ( service : SCNetworkServiceRef ) -> SCNetworkInterfaceRef ;
36
+ pub fn SCNetworkServiceGetName ( service : SCNetworkServiceRef ) -> CFStringRef ;
37
+ pub fn SCNetworkServiceGetServiceID ( service : SCNetworkServiceRef ) -> CFStringRef ;
38
+ pub fn SCNetworkSetGetServiceOrder ( set : SCNetworkSetRef ) -> CFArrayRef ;
39
+ pub fn SCNetworkSetCopyServices ( set : SCNetworkSetRef ) -> CFArrayRef ;
40
+ pub fn SCNetworkSetCopyCurrent ( prefs : SCPreferencesRef ) -> SCNetworkSetRef ;
41
+
42
+ pub fn SCNetworkInterfaceCopyAll ( ) -> CFArrayRef ;
43
+ pub fn SCNetworkInterfaceCopyMTU ( interface : SCNetworkInterfaceRef ,
44
+ mtu_cur : * mut c_int ,
45
+ mtu_min : * mut c_int ,
46
+ mtu_max : * mut c_int ) -> Boolean ;
47
+ pub fn SCNetworkInterfaceCopyMediaOptions ( interface : SCNetworkInterfaceRef ,
48
+ urrent : * mut CFDictionaryRef ,
49
+ active : * mut CFDictionaryRef ,
50
+ available : * mut CFArrayRef ,
51
+ filter : Boolean ) -> Boolean ;
52
+ pub fn SCNetworkInterfaceGetBSDName ( interface : SCNetworkInterfaceRef ) -> CFStringRef ;
53
+ pub fn SCNetworkInterfaceGetInterfaceType ( interface : SCNetworkInterfaceRef ) -> CFStringRef ;
54
+ pub fn SCNetworkInterfaceGetHardwareAddressString ( interface : SCNetworkInterfaceRef ) -> CFStringRef ;
55
+
56
+ pub fn SCNetworkInterfaceGetConfiguration ( interface : SCNetworkInterfaceRef ) -> CFDictionaryRef ;
57
+ pub fn SCNetworkInterfaceGetExtendedConfiguration ( interface : SCNetworkInterfaceRef ,
58
+ extendedType : CFStringRef ) -> CFDictionaryRef ;
59
+
60
+ pub fn SCNetworkInterfaceSetConfiguration ( interface : SCNetworkInterfaceRef ,
61
+ config : CFDictionaryRef ) -> Boolean ;
62
+ pub fn SCNetworkInterfaceSetExtendedConfiguration ( interface : SCNetworkInterfaceRef ,
63
+ extendedType : CFStringRef ,
64
+ config : CFDictionaryRef ) -> Boolean ;
65
+ }
0 commit comments