1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use *;
use NonNull;
use *;
use crate::*;
/// [Apple's documentation](https://developer.apple.com/documentation/systemconfiguration/kscnetworkflagstransientconnection?language=objc)
pub const kSCNetworkFlagsTransientConnection: c_uint = 1 << 0;
/// [Apple's documentation](https://developer.apple.com/documentation/systemconfiguration/kscnetworkflagsreachable?language=objc)
pub const kSCNetworkFlagsReachable: c_uint = 1 << 1;
/// [Apple's documentation](https://developer.apple.com/documentation/systemconfiguration/kscnetworkflagsconnectionrequired?language=objc)
pub const kSCNetworkFlagsConnectionRequired: c_uint = 1 << 2;
/// [Apple's documentation](https://developer.apple.com/documentation/systemconfiguration/kscnetworkflagsconnectionautomatic?language=objc)
pub const kSCNetworkFlagsConnectionAutomatic: c_uint = 1 << 3;
/// [Apple's documentation](https://developer.apple.com/documentation/systemconfiguration/kscnetworkflagsinterventionrequired?language=objc)
pub const kSCNetworkFlagsInterventionRequired: c_uint = 1 << 4;
/// [Apple's documentation](https://developer.apple.com/documentation/systemconfiguration/kscnetworkflagsislocaladdress?language=objc)
pub const kSCNetworkFlagsIsLocalAddress: c_uint = 1 << 16;
/// [Apple's documentation](https://developer.apple.com/documentation/systemconfiguration/kscnetworkflagsisdirect?language=objc)
pub const kSCNetworkFlagsIsDirect: c_uint = 1 << 17;
/// [Apple's documentation](https://developer.apple.com/documentation/systemconfiguration/scnetworkconnectionflags?language=objc)
pub type SCNetworkConnectionFlags = u32;
/// Determines if the given network address is
/// reachable using the current network configuration.
///
/// Note: this API has been deprecated but you can
/// get equivalent results with :
/// <pre>
/// SCNetworkReachabilityRef target;
/// SCNetworkReachabilityFlags flags = 0;
/// Boolean ok;
///
/// target = SCNetworkReachabilityCreateWithAddress(NULL, address);
/// ok = SCNetworkReachabilityGetFlags(target,
/// &flags
/// );
/// CFRelease(target);
/// </pre>
///
/// Parameter `address`: The network address of the desired host.
///
/// Parameter `addrlen`: The length, in bytes, of the address.
///
/// Parameter `flags`: A pointer to memory that will be filled with a
/// set of SCNetworkConnectionFlags detailing the reachability
/// of the specified address.
///
/// Returns: Returns TRUE if the network connection flags are valid;
/// FALSE if the status could not be determined.
///
/// # Safety
///
/// - `address` must be a valid pointer.
/// - `flags` must be a valid pointer.
pub unsafe extern "C-unwind"
/// Determines if the given network host or node name is
/// reachable using the current network configuration.
///
/// Note: this API has been deprecated but you can
/// get equivalent results with :
/// <pre>
/// SCNetworkReachabilityRef target;
/// SCNetworkReachabilityFlags flags = 0;
/// Boolean ok;
///
/// target = SCNetworkReachabilityCreateWithName(NULL, name);
/// ok = SCNetworkReachabilityGetFlags(target,
/// &flags
/// );
/// CFRelease(target);
/// </pre>
///
/// Parameter `nodename`: The node name of the desired host. This name would
/// be the same as that passed to the gethostbyname(3) or
/// getaddrinfo(3) functions.
///
/// Parameter `flags`: A pointer to memory that will be filled with a
/// set of SCNetworkConnectionFlags detailing the reachability
/// of the specified node name.
///
/// Returns: Returns TRUE if the network connection flags are valid;
/// FALSE if the status could not be determined.
///
/// # Safety
///
/// - `nodename` must be a valid pointer.
/// - `flags` must be a valid pointer.
pub unsafe extern "C-unwind"
/// Sends a notification to interested configuration agents
/// to have them immediately retry their configuration over a
/// particular network interface.
///
/// Note: This function must be invoked by root (uid == 0).
///
/// Parameter `ifName`: The BSD name of the network interface, such as
/// CFSTR("en0").
///
/// Returns: Returns TRUE if the notification was sent; FALSE otherwise.
pub extern "C-unwind"