2 * Copyright (c) 2000-2002, 2004, 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 _SCDYNAMICSTOREKEY_H
25 #define _SCDYNAMICSTOREKEY_H
27 #include <os/availability.h>
28 #include <sys/cdefs.h>
29 #include <CoreFoundation/CoreFoundation.h>
31 CF_IMPLICIT_BRIDGING_ENABLED
32 CF_ASSUME_NONNULL_BEGIN
35 @header SCDynamicStoreKey
36 @discussion The SCDynamicStoreKey API provides convenience functions
37 that an application can use to create a correctly formatted
38 dynamic store key for accessing specific items in the dynamic
39 store. An application can then use the resulting string in
40 any function that requires a dynamic store key.
47 * SCDynamicStoreKeyCreate
48 * - convenience routines that create a CFString key for an item in the store
52 @function SCDynamicStoreKeyCreate
53 @discussion Creates a dynamic store key using the given format.
54 @param allocator The CFAllocator that should be used to allocate
56 This parameter may be NULL in which case the current
57 default CFAllocator is used. If this reference is not
58 a valid CFAllocator, the behavior is undefined.
59 @param fmt A CFStringRef describing the format for this key.
60 @result Returns a string containing the formatted key.
63 SCDynamicStoreKeyCreate (
64 CFAllocatorRef __nullable allocator
,
67 ) API_AVAILABLE(macos(10.1)) SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
70 @function SCDynamicStoreKeyCreateNetworkGlobalEntity
71 @discussion Creates a dynamic store key that can be used to access
72 a specific global (as opposed to a per-service or per-interface)
73 network configuration entity.
74 @param allocator The CFAllocator that should be used to allocate
76 This parameter may be NULL in which case the current
77 default CFAllocator is used. If this reference is not
78 a valid CFAllocator, the behavior is undefined.
79 @param domain A string specifying the desired domain, such as the
80 requested configuration (kSCDynamicStoreDomainSetup) or the
81 actual state (kSCDynamicStoreDomainState).
82 @param entity A string containing the specific global entity, such
83 as IPv4 (kSCEntNetIPv4) or DNS (kSCEntNetDNS).
84 @result Returns a string containing the formatted key.
88 SCDynamicStoreKeyCreateNetworkGlobalEntity (
89 CFAllocatorRef __nullable allocator
,
92 ) API_AVAILABLE(macos(10.1)) SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
95 @function SCDynamicStoreKeyCreateNetworkInterface
96 @discussion Creates a dynamic store key that can be used to access
97 the network interface configuration information stored in
99 @param allocator The CFAllocator that should be used to allocate
101 This parameter may be NULL in which case the current
102 default CFAllocator is used. If this reference is not
103 a valid CFAllocator, the behavior is undefined.
104 @param domain A string specifying the desired domain, such as the
105 requested configuration (kSCDynamicStoreDomainSetup) or the
106 actual state (kSCDynamicStoreDomainState).
107 @result Returns a string containing the formatted key.
111 SCDynamicStoreKeyCreateNetworkInterface (
112 CFAllocatorRef __nullable allocator
,
114 ) API_AVAILABLE(macos(10.1)) SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
117 @function SCDynamicStoreKeyCreateNetworkInterfaceEntity
118 @discussion Creates a dynamic store key that can be used to access
119 the per-interface network configuration information stored in
121 @param allocator The CFAllocator that should be used to allocate
123 This parameter may be NULL in which case the current
124 default CFAllocator is used. If this reference is not
125 a valid CFAllocator, the behavior is undefined.
126 @param domain A string specifying the desired domain, such as the
127 requested configuration (kSCDynamicStoreDomainSetup) or the
128 actual state (kSCDynamicStoreDomainState).
129 @param ifname A string containing the interface name or a regular
131 @param entity A string containing the specific global entity, such
132 as IPv4 (kSCEntNetIPv4) or DNS (kSCEntNetDNS).
133 @result Returns a string containing the formatted key.
137 SCDynamicStoreKeyCreateNetworkInterfaceEntity (
138 CFAllocatorRef __nullable allocator
,
141 CFStringRef __nullable entity
142 ) API_AVAILABLE(macos(10.1)) SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
145 @function SCDynamicStoreKeyCreateNetworkServiceEntity
146 @discussion Creates a dynamic store key that can be used to access
147 the per-service network configuration information stored in
149 @param allocator The CFAllocator that should be used to allocate
151 This parameter may be NULL in which case the current
152 default CFAllocator is used. If this reference is not
153 a valid CFAllocator, the behavior is undefined.
154 @param domain A string specifying the desired domain, such as the
155 requested configuration (kSCDynamicStoreDomainSetup) or the
156 actual state (kSCDynamicStoreDomainState).
157 @param serviceID A string containing the service ID or a regular
159 @param entity A string containing the specific global entity, such
160 as IPv4 (kSCEntNetIPv4) or DNS (kSCEntNetDNS).
161 @result Returns a string containing the formatted key.
166 SCDynamicStoreKeyCreateNetworkServiceEntity (
167 CFAllocatorRef __nullable allocator
,
169 CFStringRef serviceID
,
170 CFStringRef __nullable entity
171 ) API_AVAILABLE(macos(10.1)) SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
174 @function SCDynamicStoreKeyCreateComputerName
175 @discussion Creates a key that can be used in conjuntion with
176 SCDynamicStoreSetNotificationKeys function to receive
177 notifications when the current computer name changes.
178 @param allocator The CFAllocator that should be used to allocate
180 This parameter may be NULL in which case the current
181 default CFAllocator is used. If this reference is not
182 a valid CFAllocator, the behavior is undefined.
183 @result Returns a notification string for the current computer or
187 SCDynamicStoreKeyCreateComputerName (
188 CFAllocatorRef __nullable allocator
189 ) API_AVAILABLE(macos(10.1)) SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
192 @function SCDynamicStoreKeyCreateConsoleUser
193 @discussion Creates a key that can be used in conjunction with
194 SCDynamicStoreSetNotificationKeys function to receive
195 notifications when the current console user changes.
196 @param allocator The CFAllocator that should be used to allocate
198 This parameter may be NULL in which case the current
199 default CFAllocator is used. If this reference is not
200 a valid CFAllocator, the behavior is undefined.
201 @result Returns a notification string for the current console user.
204 SCDynamicStoreKeyCreateConsoleUser (
205 CFAllocatorRef __nullable allocator
206 ) API_AVAILABLE(macos(10.1)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
209 @function SCDynamicStoreKeyCreateHostNames
210 @discussion Creates a key that can be used in conjunction with the
211 SCDynamicStoreSetNotificationKeys function to receive
212 notifications when the HostNames entity changes. The
213 HostNames entity includes the local host name.
214 @param allocator The CFAllocator that should be used to allocate
216 This parameter may be NULL in which case the current
217 default CFAllocator is used. If this reference is not
218 a valid CFAllocator, the behavior is undefined.
219 @result Returns a notification string for the HostNames entity.
222 SCDynamicStoreKeyCreateHostNames (
223 CFAllocatorRef __nullable allocator
224 ) API_AVAILABLE(macos(10.2)) SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
227 @function SCDynamicStoreKeyCreateLocation
228 @discussion Creates a key that can be used in conjunction with the
229 SCDynamicStoreSetNotificationKeys function to receive
230 notifications when the location identifier changes.
231 @param allocator The CFAllocator that should be used to allocate
233 This parameter may be NULL in which case the current
234 default CFAllocator is used. If this reference is not
235 a valid CFAllocator, the behavior is undefined.
236 @result Returns a notification string for the current location
240 SCDynamicStoreKeyCreateLocation (
241 CFAllocatorRef __nullable allocator
242 ) API_AVAILABLE(macos(10.2)) SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
245 @function SCDynamicStoreKeyCreateProxies
246 @discussion Creates a key that can be used in conjunction with
247 the SCDynamicStoreSetNotificationKeys function to receive
248 notifications when the current network proxy settings
249 (such as HTTP or FTP) are changed.
250 @param allocator The CFAllocator that should be used to allocate
252 This parameter may be NULL in which case the current
253 default CFAllocator is used. If this reference is not
254 a valid CFAllocator, the behavior is undefined.
255 @result Returns a notification string for the current proxy settings.
258 SCDynamicStoreKeyCreateProxies (
259 CFAllocatorRef __nullable allocator
260 ) API_AVAILABLE(macos(10.1)) SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
264 CF_ASSUME_NONNULL_END
265 CF_IMPLICIT_BRIDGING_DISABLED
267 #endif /* _SCDYNAMICSTOREKEY_H */