]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/CaptiveNetwork.h
configd-395.11.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / CaptiveNetwork.h
1 /*
2 * Copyright (c) 2009, 2010 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 /*!
32 @header CaptiveNetwork
33 @discussion The CaptiveNetwork API allows applications to interact
34 with Captive Network Support. Captive Network Support is a
35 system component responsible for detecting and help users
36 navigate networks that require interaction before providing
37 internet access. The most common Captive Networks are WiFi
38 Hotspots in places like airports, restaurants, and hotels.
39 Captive Network Support will attempt to authenticate if
40 possible or drop a user in to a web sheet if authentication
41 is not possible. In the web sheet the user has an opportunity
42 to authenticate or disassociate from the network.
43
44 The following APIs are designed for third party applications
45 that may handle authentication on these networks on behalf of
46 the user.
47
48 These APIs are treated as advisory only.
49 There is no guarantee or contract that the operating system
50 will take the intended action.
51 */
52
53 __BEGIN_DECLS
54
55 /*!
56 @function CNSetSupportedSSIDs
57 @discussion Provides Captive Network Support with an updated list of
58 SSIDs that this application will perform authentication on.
59 When Captive Network Support would show the Web Sheet for a
60 network with an SSID the application has registered for, it
61 will suppress showing the Web Sheet if the application is
62 still installed.
63 @param ssidArray A CFArray of CFStrings of the SSIDs.
64 @result Returns TRUE if the operation succeeded, FALSE otherwise.
65 */
66 Boolean
67 CNSetSupportedSSIDs (CFArrayRef ssidArray) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);
68
69 /*!
70 @function CNMarkPortalOnline
71 @discussion Tells Captive Network Support that your application has
72 authenticated the device to the network. Captive Network Support
73 will notify the rest of the system that WiFi is now a viable
74 interface.
75 @param interfaceName Name of the interface that is now online.
76 @result Returns TRUE if the operation succeeded, FALSE otherwise.
77 */
78 Boolean
79 CNMarkPortalOnline (CFStringRef interfaceName) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);
80
81 /*!
82 @function CNMarkPortalOffline
83 @discussion Tells Captive Network Support that the device is not
84 authenticated on the given network interface.
85 @param interfaceName Name of the interface that is still captive.
86 @result Returns TRUE if the operation succeeded, FALSE otherwise.
87 */
88 Boolean
89 CNMarkPortalOffline (CFStringRef interfaceName) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);
90
91
92 /*!
93 @function CNCopySupportedInterfaces
94 @discussion copies a list of all interfaces CaptiveNetworkSupport is monitoring.
95 @result An array of CFStringRef- BSD interface names.
96 Returns NULL if an error was encountered.
97 You MUST release the returned value.
98 */
99 CFArrayRef
100 CNCopySupportedInterfaces (void) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_1);
101
102 /*!
103 @constant kCNNetworkInfoKeySSIDData
104 @discussion NetworkInfo Dictionary key for SSID in CFData format
105 */
106 extern const CFStringRef kCNNetworkInfoKeySSIDData __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_1);
107
108 /*!
109 @constant kCNNetworkInfoKeySSID
110 @discussion NetworkInfo Dictionary key for SSID in CFString format
111 */
112 extern const CFStringRef kCNNetworkInfoKeySSID __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_1);
113
114 /*!
115 @constant kCNNetworkInfoKeyBSSID
116 @discussion NetworkInfo Dictionary key for BSSID in CFString format
117 */
118 extern const CFStringRef kCNNetworkInfoKeyBSSID __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_1);
119
120 /*!
121 @function CNCopyCurrentNetworkInfo
122 @discussion Returns the Network Info for the specified interface.
123 For example, Network Info dictionary will contain the following
124 keys, and values:
125 <pre>
126 @textblock
127 Keys : Values
128 =======================================
129 kCNNetworkInfoKeySSIDData : CFDataRef
130 kCNNetworkInfoKeySSID : CFStringRef
131 kCNNetworkInfoKeyBSSID : CFStringRef
132 @/textblock
133 </pre>
134 @param interfaceName Name of the interface you are interested in
135 @result Network Info dictionary associated with the interface.
136 Returns NULL if an error was encountered.
137 You MUST release the returned value.
138 */
139 CFDictionaryRef
140 CNCopyCurrentNetworkInfo (CFStringRef interfaceName) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_1);
141
142 __END_DECLS
143
144 #endif /* _CAPTIVENETWORK_H */