2 * Copyright (c) 2000-2002, 2004, 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 _SCDYNAMICSTOREKEY_H
25 #ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
26 #include <SystemConfiguration/_SCDynamicStoreKey.h>
27 #else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
28 #define _SCDYNAMICSTOREKEY_H
30 #include <Availability.h>
31 #include <sys/cdefs.h>
32 #include <CoreFoundation/CoreFoundation.h>
34 CF_IMPLICIT_BRIDGING_ENABLED
35 CF_ASSUME_NONNULL_BEGIN
38 @header SCDynamicStoreKey
39 @discussion The SCDynamicStoreKey API provides convenience functions
40 that an application can use to create a correctly formatted
41 dynamic store key for accessing specific items in the dynamic
42 store. An application can then use the resulting string in
43 any function that requires a dynamic store key.
50 * SCDynamicStoreKeyCreate
51 * - convenience routines that create a CFString key for an item in the store
55 @function SCDynamicStoreKeyCreate
56 @discussion Creates a dynamic store key using the given format.
57 @param allocator The CFAllocator that should be used to allocate
59 This parameter may be NULL in which case the current
60 default CFAllocator is used. If this reference is not
61 a valid CFAllocator, the behavior is undefined.
62 @param fmt A CFStringRef describing the format for this key.
63 @result Returns a string containing the formatted key.
66 SCDynamicStoreKeyCreate (
67 CFAllocatorRef __nullable allocator
,
70 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
73 @function SCDynamicStoreKeyCreateNetworkGlobalEntity
74 @discussion Creates a dynamic store key that can be used to access
75 a specific global (as opposed to a per-service or per-interface)
76 network configuration entity.
77 @param allocator The CFAllocator that should be used to allocate
79 This parameter may be NULL in which case the current
80 default CFAllocator is used. If this reference is not
81 a valid CFAllocator, the behavior is undefined.
82 @param domain A string specifying the desired domain, such as the
83 requested configuration (kSCDynamicStoreDomainSetup) or the
84 actual state (kSCDynamicStoreDomainState).
85 @param entity A string containing the specific global entity, such
86 as IPv4 (kSCEntNetIPv4) or DNS (kSCEntNetDNS).
87 @result Returns a string containing the formatted key.
91 SCDynamicStoreKeyCreateNetworkGlobalEntity (
92 CFAllocatorRef __nullable allocator
,
95 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
98 @function SCDynamicStoreKeyCreateNetworkInterface
99 @discussion Creates a dynamic store key that can be used to access
100 the network interface configuration information stored in
102 @param allocator The CFAllocator that should be used to allocate
104 This parameter may be NULL in which case the current
105 default CFAllocator is used. If this reference is not
106 a valid CFAllocator, the behavior is undefined.
107 @param domain A string specifying the desired domain, such as the
108 requested configuration (kSCDynamicStoreDomainSetup) or the
109 actual state (kSCDynamicStoreDomainState).
110 @result Returns a string containing the formatted key.
114 SCDynamicStoreKeyCreateNetworkInterface (
115 CFAllocatorRef __nullable allocator
,
117 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
120 @function SCDynamicStoreKeyCreateNetworkInterfaceEntity
121 @discussion Creates a dynamic store key that can be used to access
122 the per-interface network configuration information stored in
124 @param allocator The CFAllocator that should be used to allocate
126 This parameter may be NULL in which case the current
127 default CFAllocator is used. If this reference is not
128 a valid CFAllocator, the behavior is undefined.
129 @param domain A string specifying the desired domain, such as the
130 requested configuration (kSCDynamicStoreDomainSetup) or the
131 actual state (kSCDynamicStoreDomainState).
132 @param ifname A string containing the interface name or a regular
134 @param entity A string containing the specific global entity, such
135 as IPv4 (kSCEntNetIPv4) or DNS (kSCEntNetDNS).
136 @result Returns a string containing the formatted key.
140 SCDynamicStoreKeyCreateNetworkInterfaceEntity (
141 CFAllocatorRef __nullable allocator
,
144 CFStringRef __nullable entity
145 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
148 @function SCDynamicStoreKeyCreateNetworkServiceEntity
149 @discussion Creates a dynamic store key that can be used to access
150 the per-service network configuration information stored in
152 @param allocator The CFAllocator that should be used to allocate
154 This parameter may be NULL in which case the current
155 default CFAllocator is used. If this reference is not
156 a valid CFAllocator, the behavior is undefined.
157 @param domain A string specifying the desired domain, such as the
158 requested configuration (kSCDynamicStoreDomainSetup) or the
159 actual state (kSCDynamicStoreDomainState).
160 @param serviceID A string containing the service ID or a regular
162 @param entity A string containing the specific global entity, such
163 as IPv4 (kSCEntNetIPv4) or DNS (kSCEntNetDNS).
164 @result Returns a string containing the formatted key.
169 SCDynamicStoreKeyCreateNetworkServiceEntity (
170 CFAllocatorRef __nullable allocator
,
172 CFStringRef serviceID
,
173 CFStringRef __nullable entity
174 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
177 @function SCDynamicStoreKeyCreateComputerName
178 @discussion Creates a key that can be used in conjuntion with
179 SCDynamicStoreSetNotificationKeys function to receive
180 notifications when the current computer name changes.
181 @param allocator The CFAllocator that should be used to allocate
183 This parameter may be NULL in which case the current
184 default CFAllocator is used. If this reference is not
185 a valid CFAllocator, the behavior is undefined.
186 @result Returns a notification string for the current computer or
190 SCDynamicStoreKeyCreateComputerName (
191 CFAllocatorRef __nullable allocator
192 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
195 @function SCDynamicStoreKeyCreateConsoleUser
196 @discussion Creates a key that can be used in conjunction with
197 SCDynamicStoreSetNotificationKeys function to receive
198 notifications when the current console user changes.
199 @param allocator The CFAllocator that should be used to allocate
201 This parameter may be NULL in which case the current
202 default CFAllocator is used. If this reference is not
203 a valid CFAllocator, the behavior is undefined.
204 @result Returns a notification string for the current console user.
207 SCDynamicStoreKeyCreateConsoleUser (
208 CFAllocatorRef __nullable allocator
209 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_NA
);
212 @function SCDynamicStoreKeyCreateHostNames
213 @discussion Creates a key that can be used in conjunction with the
214 SCDynamicStoreSetNotificationKeys function to receive
215 notifications when the HostNames entity changes. The
216 HostNames entity includes the local host name.
217 @param allocator The CFAllocator that should be used to allocate
219 This parameter may be NULL in which case the current
220 default CFAllocator is used. If this reference is not
221 a valid CFAllocator, the behavior is undefined.
222 @result Returns a notification string for the HostNames entity.
225 SCDynamicStoreKeyCreateHostNames (
226 CFAllocatorRef __nullable allocator
227 ) __OSX_AVAILABLE_STARTING(__MAC_10_2
,__IPHONE_2_0
/*SPI*/);
230 @function SCDynamicStoreKeyCreateLocation
231 @discussion Creates a key that can be used in conjunction with the
232 SCDynamicStoreSetNotificationKeys function to receive
233 notifications when the location identifier changes.
234 @param allocator The CFAllocator that should be used to allocate
236 This parameter may be NULL in which case the current
237 default CFAllocator is used. If this reference is not
238 a valid CFAllocator, the behavior is undefined.
239 @result Returns a notification string for the current location
243 SCDynamicStoreKeyCreateLocation (
244 CFAllocatorRef __nullable allocator
245 ) __OSX_AVAILABLE_STARTING(__MAC_10_2
,__IPHONE_2_0
/*SPI*/);
248 @function SCDynamicStoreKeyCreateProxies
249 @discussion Creates a key that can be used in conjunction with
250 the SCDynamicStoreSetNotificationKeys function to receive
251 notifications when the current network proxy settings
252 (such as HTTP or FTP) are changed.
253 @param allocator The CFAllocator that should be used to allocate
255 This parameter may be NULL in which case the current
256 default CFAllocator is used. If this reference is not
257 a valid CFAllocator, the behavior is undefined.
258 @result Returns a notification string for the current proxy settings.
261 SCDynamicStoreKeyCreateProxies (
262 CFAllocatorRef __nullable allocator
263 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
267 CF_ASSUME_NONNULL_END
268 CF_IMPLICIT_BRIDGING_DISABLED
270 #endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
271 #endif /* _SCDYNAMICSTOREKEY_H */