]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCDynamicStoreCopySpecific.h
configd-1109.60.2.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCDynamicStoreCopySpecific.h
1 /*
2 * Copyright (c) 2000-2005, 2008, 2015, 2018 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 _SCDYNAMICSTORECOPYSPECIFIC_H
25 #define _SCDYNAMICSTORECOPYSPECIFIC_H
26
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>
32
33 CF_IMPLICIT_BRIDGING_ENABLED
34 CF_ASSUME_NONNULL_BEGIN
35
36 /*!
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.).
42 */
43
44
45 __BEGIN_DECLS
46
47 /*!
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
55 host name.
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.
59 */
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));
65
66 /*!
67 @function SCDynamicStoreCopyConsoleUser
68 @discussion Gets the name, user ID, and group ID of the currently
69 logged-in user.
70
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
80 be returned.
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
83 returned.
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.
87 */
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);
94
95 /*!
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.
104 */
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));
109
110 /*!
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
118 was encountered.
119 You must release the returned value.
120 */
121 CFStringRef __nullable
122 SCDynamicStoreCopyLocation (
123 SCDynamicStoreRef __nullable store
124 ) API_AVAILABLE(macos(10.1)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
125
126 /*!
127 @function SCDynamicStoreCopyProxies
128 @discussion Gets the current internet proxy settings.
129 The returned proxy settings dictionary includes:
130
131 <TABLE BORDER>
132 <TR>
133 <TH>key</TD>
134 <TH>type</TD>
135 <TH>description</TD>
136 </TR>
137 <TR>
138 <TD>kSCPropNetProxiesExceptionsList</TD>
139 <TD>CFArray[CFString]</TD>
140 <TD>Host name patterns which should bypass the proxy</TD>
141 </TR>
142 <TR>
143 <TD>kSCPropNetProxiesHTTPEnable</TD>
144 <TD>CFNumber (0 or 1)</TD>
145 <TD>Enables/disables the use of an HTTP proxy</TD>
146 </TR>
147 <TR>
148 <TD>kSCPropNetProxiesHTTPProxy</TD>
149 <TD>CFString</TD>
150 <TD>The proxy host</TD>
151 </TR>
152 <TR>
153 <TD>kSCPropNetProxiesHTTPPort</TD>
154 <TD>CFNumber</TD>
155 <TD>The proxy port number</TD>
156 </TR>
157 <TR>
158 <TD>kSCPropNetProxiesHTTPSEnable</TD>
159 <TD>CFNumber (0 or 1)</TD>
160 <TD>Enables/disables the use of an HTTPS proxy</TD>
161 </TR>
162 <TR>
163 <TD>kSCPropNetProxiesHTTPSProxy</TD>
164 <TD>CFString</TD>
165 <TD>The proxy host</TD>
166 </TR>
167 <TR>
168 <TD>kSCPropNetProxiesHTTPSPort</TD>
169 <TD>CFNumber</TD>
170 <TD>The proxy port number</TD>
171 </TR>
172 <TR>
173 <TD>kSCPropNetProxiesFTPEnable</TD>
174 <TD>CFNumber (0 or 1)</TD>
175 <TD>Enables/disables the use of an FTP proxy</TD>
176 </TR>
177 <TR>
178 <TD>kSCPropNetProxiesFTPProxy</TD>
179 <TD>CFString</TD>
180 <TD>The proxy host</TD>
181 </TR>
182 <TR>
183 <TD>kSCPropNetProxiesFTPPort</TD>
184 <TD>CFNumber</TD>
185 <TD>The proxy port number</TD>
186 </TR>
187 <TR>
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>
192 </TR>
193 </TABLE>
194
195 Other key-value pairs are defined in the SCSchemaDefinitions.h
196 header file.
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
203 was encountered.
204 You must release the returned value.
205 */
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));
210
211 __END_DECLS
212
213 CF_ASSUME_NONNULL_END
214 CF_IMPLICIT_BRIDGING_DISABLED
215
216 #endif /* _SCDYNAMICSTORECOPYSPECIFIC_H */