2 * Copyright (c) 2000-2005, 2008, 2015, 2018 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
24 #ifndef _SCDYNAMICSTORECOPYSPECIFIC_H
25 #define _SCDYNAMICSTORECOPYSPECIFIC_H
27 #include <os/availability.h>
28 #include <sys/cdefs.h>
29 #include <sys/types.h>
30 #include <CoreFoundation/CoreFoundation.h>
31 #include <SystemConfiguration/SCDynamicStore.h>
33 CF_IMPLICIT_BRIDGING_ENABLED
34 CF_ASSUME_NONNULL_BEGIN
37 @header SCDynamicStoreCopySpecific
38 @discussion The functions of the SCDynamicStoreCopySpecific API
39 allow an application to determine specific configuration
40 information about the current system (for example, the
41 computer or sharing name, the currently logged-in user, etc.).
48 @function SCDynamicStoreCopyComputerName
49 @discussion Gets the current computer name.
50 @param store An SCDynamicStoreRef representing the dynamic store
51 session that should be used for communication with the server.
52 If NULL, a temporary session will be used.
53 @param nameEncoding A pointer to memory that, if non-NULL, will be
54 filled with the encoding associated with the computer or
56 @result Returns the current computer name;
57 NULL if the name has not been set or if an error was encountered.
58 You must release the returned value.
60 CFStringRef __nullable
61 SCDynamicStoreCopyComputerName (
62 SCDynamicStoreRef __nullable store
,
63 CFStringEncoding
* __nullable nameEncoding
64 ) API_AVAILABLE(macos(10.1)) SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
67 @function SCDynamicStoreCopyConsoleUser
68 @discussion Gets the name, user ID, and group ID of the currently
71 Note: this function only provides information about the
72 primary console. It does not provide any details
73 about console sessions that have fast user switched
74 out or about other consoles.
75 @param store An SCDynamicStoreRef representing the dynamic store
76 session that should be used for communication with the server.
77 If NULL, a temporary session will be used.
78 @param uid A pointer to memory that will be filled with the user ID
79 of the current console user. If NULL, this value will not
81 @param gid A pointer to memory that will be filled with the group ID
82 of the current console user. If NULL, this value will not be
84 @result Returns the user currently logged into the system;
85 NULL if no user is logged in or if an error was encountered.
86 You must release the returned value.
88 CFStringRef __nullable
89 SCDynamicStoreCopyConsoleUser (
90 SCDynamicStoreRef __nullable store
,
91 uid_t
* __nullable uid
,
92 gid_t
* __nullable gid
93 ) API_AVAILABLE(macos(10.1)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
96 @function SCDynamicStoreCopyLocalHostName
97 @discussion Gets the current local host name.
98 @param store An SCDynamicStoreRef representing the dynamic store
99 session that should be used for communication with the server.
100 If NULL, a temporary session will be used.
101 @result Returns the current local host name;
102 NULL if the name has not been set or if an error was encountered.
103 You must release the returned value.
105 CFStringRef __nullable
106 SCDynamicStoreCopyLocalHostName (
107 SCDynamicStoreRef __nullable store
108 ) API_AVAILABLE(macos(10.1)) SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
111 @function SCDynamicStoreCopyLocation
112 @discussion Gets the current location identifier.
113 @param store An SCDynamicStoreRef representing the dynamic store
114 session that should be used for communication with the server.
115 If NULL, a temporary session will be used.
116 @result Returns a string representing the current location identifier;
117 NULL if no location identifier has been defined or if an error
119 You must release the returned value.
121 CFStringRef __nullable
122 SCDynamicStoreCopyLocation (
123 SCDynamicStoreRef __nullable store
124 ) API_AVAILABLE(macos(10.1)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
127 @function SCDynamicStoreCopyProxies
128 @discussion Gets the current internet proxy settings.
129 The returned proxy settings dictionary includes:
138 <TD>kSCPropNetProxiesExceptionsList</TD>
139 <TD>CFArray[CFString]</TD>
140 <TD>Host name patterns which should bypass the proxy</TD>
143 <TD>kSCPropNetProxiesHTTPEnable</TD>
144 <TD>CFNumber (0 or 1)</TD>
145 <TD>Enables/disables the use of an HTTP proxy</TD>
148 <TD>kSCPropNetProxiesHTTPProxy</TD>
150 <TD>The proxy host</TD>
153 <TD>kSCPropNetProxiesHTTPPort</TD>
155 <TD>The proxy port number</TD>
158 <TD>kSCPropNetProxiesHTTPSEnable</TD>
159 <TD>CFNumber (0 or 1)</TD>
160 <TD>Enables/disables the use of an HTTPS proxy</TD>
163 <TD>kSCPropNetProxiesHTTPSProxy</TD>
165 <TD>The proxy host</TD>
168 <TD>kSCPropNetProxiesHTTPSPort</TD>
170 <TD>The proxy port number</TD>
173 <TD>kSCPropNetProxiesFTPEnable</TD>
174 <TD>CFNumber (0 or 1)</TD>
175 <TD>Enables/disables the use of an FTP proxy</TD>
178 <TD>kSCPropNetProxiesFTPProxy</TD>
180 <TD>The proxy host</TD>
183 <TD>kSCPropNetProxiesFTPPort</TD>
185 <TD>The proxy port number</TD>
188 <TD>kSCPropNetProxiesFTPPassive</TD>
189 <TD>CFNumber (0 or 1)</TD>
190 <TD>Enable passive mode operation for use behind connection
191 filter-ing firewalls.</TD>
195 Other key-value pairs are defined in the SCSchemaDefinitions.h
197 @param store An SCDynamicStoreRef representing the dynamic store
198 session that should be used for communication with the server.
199 If NULL, a temporary session will be used.
200 @result Returns a dictionary containing key-value pairs that represent
201 the current internet proxy settings;
202 NULL if no proxy settings have been defined or if an error
204 You must release the returned value.
206 CFDictionaryRef __nullable
207 SCDynamicStoreCopyProxies (
208 SCDynamicStoreRef __nullable store
209 ) API_AVAILABLE(macos(10.1)) SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
213 CF_ASSUME_NONNULL_END
214 CF_IMPLICIT_BRIDGING_DISABLED
216 #endif /* _SCDYNAMICSTORECOPYSPECIFIC_H */