]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/CaptiveNetwork.h
configd-888.1.2.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / CaptiveNetwork.h
1 /*
2 * Copyright (c) 2009-2016 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 #ifndef _CAPTIVENETWORK_H
25 #define _CAPTIVENETWORK_H
26
27 #include <Availability.h>
28 #include <sys/cdefs.h>
29 #include <CoreFoundation/CoreFoundation.h>
30
31 CF_IMPLICIT_BRIDGING_ENABLED
32 CF_ASSUME_NONNULL_BEGIN
33
34 /*!
35 @header CaptiveNetwork
36 @discussion The CaptiveNetwork API allows applications to interact
37 with Captive Network Support. Captive Network Support is a
38 system component responsible for detecting and help users
39 navigate networks that require interaction before providing
40 internet access. The most common Captive Networks are WiFi
41 Hotspots in places like airports, restaurants, and hotels.
42 Captive Network Support will attempt to authenticate if
43 possible or drop a user in to a web sheet if authentication
44 is not possible. In the web sheet the user has an opportunity
45 to authenticate or disassociate from the network.
46
47 The following APIs are designed for third party applications
48 that may handle authentication on these networks on behalf of
49 the user.
50
51 These APIs are treated as advisory only.
52 There is no guarantee or contract that the operating system
53 will take the intended action.
54 */
55
56 __BEGIN_DECLS
57
58 /*!
59 @function CNSetSupportedSSIDs
60 @discussion Provides Captive Network Support with an updated list of
61 SSIDs that this application will perform authentication on.
62
63 Captive Network Support suppresses showing the Web Sheet
64 for a captive Wi-Fi network if that network's SSID is in the
65 specified list.
66
67 On iOS, the registrations persist until the application is
68 removed from the device.
69
70 On MacOSX, the registrations persist as long as the application
71 is running.
72
73 @param ssidArray A CFArray of CFStrings of the SSIDs.
74 @result Returns TRUE if the operation succeeded, FALSE otherwise.
75 */
76 Boolean
77 CNSetSupportedSSIDs (CFArrayRef ssidArray)
78 __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_8, __MAC_NA,
79 __IPHONE_4_0, __IPHONE_9_0,
80 "Replaced by <NetworkExtension/NEHotspotHelper.h>");
81
82 /*!
83 @function CNMarkPortalOnline
84 @discussion Tells Captive Network Support that your application has
85 authenticated the device to the network. Captive Network Support
86 will notify the rest of the system that WiFi is now a viable
87 interface.
88 @param interfaceName Name of the interface that is now online.
89 @result Returns TRUE if the operation succeeded, FALSE otherwise.
90 */
91 Boolean
92 CNMarkPortalOnline (CFStringRef interfaceName)
93 __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_8, __MAC_NA,
94 __IPHONE_4_0, __IPHONE_9_0,
95 "Replaced by <NetworkExtension/NEHotspotHelper.h>");
96
97 /*!
98 @function CNMarkPortalOffline
99 @discussion Tells Captive Network Support that the device is not
100 authenticated on the given network interface.
101 @param interfaceName Name of the interface that is still captive.
102 @result Returns TRUE if the operation succeeded, FALSE otherwise.
103 */
104 Boolean
105 CNMarkPortalOffline (CFStringRef interfaceName)
106 __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_8, __MAC_NA,
107 __IPHONE_4_0, __IPHONE_9_0,
108 "Replaced by <NetworkExtension/NEHotspotHelper.h>");
109
110 /*!
111 @function CNCopySupportedInterfaces
112 @discussion copies a list of all interfaces CaptiveNetworkSupport is monitoring.
113 @result An array of CFStringRef- BSD interface names.
114 Returns NULL if an error was encountered.
115 You MUST release the returned value.
116 */
117 CFArrayRef __nullable
118 CNCopySupportedInterfaces (void) __OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_4_1);
119
120 /*!
121 @constant kCNNetworkInfoKeySSIDData
122 @discussion NetworkInfo Dictionary key for SSID in CFData format
123 */
124 extern const CFStringRef kCNNetworkInfoKeySSIDData __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_1);
125
126 /*!
127 @constant kCNNetworkInfoKeySSID
128 @discussion NetworkInfo Dictionary key for SSID in CFString format
129 */
130 extern const CFStringRef kCNNetworkInfoKeySSID __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_1);
131
132 /*!
133 @constant kCNNetworkInfoKeyBSSID
134 @discussion NetworkInfo Dictionary key for BSSID in CFString format
135 */
136 extern const CFStringRef kCNNetworkInfoKeyBSSID __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_1);
137
138 /*!
139 @function CNCopyCurrentNetworkInfo
140 @discussion Returns the Network Info for the specified interface.
141 For example, Network Info dictionary will contain the following
142 keys, and values:
143 <pre>
144 @textblock
145 Keys : Values
146 =======================================
147 kCNNetworkInfoKeySSIDData : CFDataRef
148 kCNNetworkInfoKeySSID : CFStringRef
149 kCNNetworkInfoKeyBSSID : CFStringRef
150 @/textblock
151 </pre>
152 @param interfaceName Name of the interface you are interested in
153 @result Network Info dictionary associated with the interface.
154 Returns NULL if an error was encountered.
155 You MUST release the returned value.
156 */
157 CFDictionaryRef __nullable
158 CNCopyCurrentNetworkInfo (CFStringRef interfaceName) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_1);
159
160 __END_DECLS
161
162 CF_ASSUME_NONNULL_END
163 CF_IMPLICIT_BRIDGING_DISABLED
164
165 #endif /* _CAPTIVENETWORK_H */