2 * Copyright (c) 2000-2005, 2008, 2015 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 #ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
26 #include <SystemConfiguration/_SCDynamicStoreCopySpecific.h>
27 #else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
28 #define _SCDYNAMICSTORECOPYSPECIFIC_H
30 #include <Availability.h>
31 #include <sys/cdefs.h>
32 #include <sys/types.h>
33 #include <CoreFoundation/CoreFoundation.h>
34 #include <SystemConfiguration/SCDynamicStore.h>
36 CF_IMPLICIT_BRIDGING_ENABLED
37 CF_ASSUME_NONNULL_BEGIN
40 @header SCDynamicStoreCopySpecific
41 @discussion The functions of the SCDynamicStoreCopySpecific API
42 allow an application to determine specific configuration
43 information about the current system (for example, the
44 computer or sharing name, the currently logged-in user, etc.).
51 @function SCDynamicStoreCopyComputerName
52 @discussion Gets the current computer name.
53 @param store An SCDynamicStoreRef representing the dynamic store
54 session that should be used for communication with the server.
55 If NULL, a temporary session will be used.
56 @param nameEncoding A pointer to memory that, if non-NULL, will be
57 filled with the encoding associated with the computer or
59 @result Returns the current computer name;
60 NULL if the name has not been set or if an error was encountered.
61 You must release the returned value.
63 CFStringRef __nullable
64 SCDynamicStoreCopyComputerName (
65 SCDynamicStoreRef __nullable store
,
66 CFStringEncoding
* __nullable nameEncoding
67 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
70 @function SCDynamicStoreCopyConsoleUser
71 @discussion Gets the name, user ID, and group ID of the currently
74 Note: this function only provides information about the
75 primary console. It does not provide any details
76 about console sessions that have fast user switched
77 out or about other consoles.
78 @param store An SCDynamicStoreRef representing the dynamic store
79 session that should be used for communication with the server.
80 If NULL, a temporary session will be used.
81 @param uid A pointer to memory that will be filled with the user ID
82 of the current console user. If NULL, this value will not
84 @param gid A pointer to memory that will be filled with the group ID
85 of the current console user. If NULL, this value will not be
87 @result Returns the user currently logged into the system;
88 NULL if no user is logged in or if an error was encountered.
89 You must release the returned value.
91 CFStringRef __nullable
92 SCDynamicStoreCopyConsoleUser (
93 SCDynamicStoreRef __nullable store
,
94 uid_t
* __nullable uid
,
95 gid_t
* __nullable gid
96 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_NA
);
99 @function SCDynamicStoreCopyLocalHostName
100 @discussion Gets the current local host name.
101 @param store An SCDynamicStoreRef representing the dynamic store
102 session that should be used for communication with the server.
103 If NULL, a temporary session will be used.
104 @result Returns the current local host name;
105 NULL if the name has not been set or if an error was encountered.
106 You must release the returned value.
108 CFStringRef __nullable
109 SCDynamicStoreCopyLocalHostName (
110 SCDynamicStoreRef __nullable store
111 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
114 @function SCDynamicStoreCopyLocation
115 @discussion Gets the current location identifier.
116 @param store An SCDynamicStoreRef representing the dynamic store
117 session that should be used for communication with the server.
118 If NULL, a temporary session will be used.
119 @result Returns a string representing the current location identifier;
120 NULL if no location identifier has been defined or if an error
122 You must release the returned value.
124 CFStringRef __nullable
125 SCDynamicStoreCopyLocation (
126 SCDynamicStoreRef __nullable store
127 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_NA
);
130 @function SCDynamicStoreCopyProxies
131 @discussion Gets the current internet proxy settings.
132 The returned proxy settings dictionary includes:
141 <TD>kSCPropNetProxiesExceptionsList</TD>
142 <TD>CFArray[CFString]</TD>
143 <TD>Host name patterns which should bypass the proxy</TD>
146 <TD>kSCPropNetProxiesHTTPEnable</TD>
147 <TD>CFNumber (0 or 1)</TD>
148 <TD>Enables/disables the use of an HTTP proxy</TD>
151 <TD>kSCPropNetProxiesHTTPProxy</TD>
153 <TD>The proxy host</TD>
156 <TD>kSCPropNetProxiesHTTPPort</TD>
158 <TD>The proxy port number</TD>
161 <TD>kSCPropNetProxiesHTTPSEnable</TD>
162 <TD>CFNumber (0 or 1)</TD>
163 <TD>Enables/disables the use of an HTTPS proxy</TD>
166 <TD>kSCPropNetProxiesHTTPSProxy</TD>
168 <TD>The proxy host</TD>
171 <TD>kSCPropNetProxiesHTTPSPort</TD>
173 <TD>The proxy port number</TD>
176 <TD>kSCPropNetProxiesFTPEnable</TD>
177 <TD>CFNumber (0 or 1)</TD>
178 <TD>Enables/disables the use of an FTP proxy</TD>
181 <TD>kSCPropNetProxiesFTPProxy</TD>
183 <TD>The proxy host</TD>
186 <TD>kSCPropNetProxiesFTPPort</TD>
188 <TD>The proxy port number</TD>
191 <TD>kSCPropNetProxiesFTPPassive</TD>
192 <TD>CFNumber (0 or 1)</TD>
193 <TD>Enable passive mode operation for use behind connection
194 filter-ing firewalls.</TD>
198 Other key-value pairs are defined in the SCSchemaDefinitions.h
200 @param store An SCDynamicStoreRef representing the dynamic store
201 session that should be used for communication with the server.
202 If NULL, a temporary session will be used.
203 @result Returns a dictionary containing key-value pairs that represent
204 the current internet proxy settings;
205 NULL if no proxy settings have been defined or if an error
207 You must release the returned value.
209 CFDictionaryRef __nullable
210 SCDynamicStoreCopyProxies (
211 SCDynamicStoreRef __nullable store
212 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
216 CF_ASSUME_NONNULL_END
217 CF_IMPLICIT_BRIDGING_DISABLED
219 #endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
220 #endif /* _SCDYNAMICSTORECOPYSPECIFIC_H */