2 * Copyright (c) 2001, 2004, 2005, 2010 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@
25 * Modification History
27 * October 29, 2001 Allan Nathanson <ajn@apple.com>
31 #include <SystemConfiguration/SystemConfiguration.h>
35 __private_extern__ CFStringRef
36 SCPreferencesPathKeyCreate(CFAllocatorRef allocator
,
44 result
= CFStringCreateWithFormatAndArguments(allocator
,
54 __private_extern__ CFStringRef
55 SCPreferencesPathKeyCreateNetworkServices(CFAllocatorRef allocator
)
58 * create "/NetworkServices"
60 return CFStringCreateWithFormat(allocator
,
63 kSCPrefNetworkServices
);
67 __private_extern__ CFStringRef
68 SCPreferencesPathKeyCreateNetworkServiceEntity(CFAllocatorRef allocator
,
76 * create "/NetworkServices/service-id"
78 path
= CFStringCreateWithFormat(allocator
,
81 kSCPrefNetworkServices
,
85 * create "/NetworkServices/service-id/entity"
87 path
= CFStringCreateWithFormat(allocator
,
90 kSCPrefNetworkServices
,
99 __private_extern__ CFStringRef
100 SCPreferencesPathKeyCreateSets(CFAllocatorRef allocator
)
105 return (CFStringCreateWithFormat(allocator
,
112 __private_extern__ CFStringRef
113 SCPreferencesPathKeyCreateSet(CFAllocatorRef allocator
,
117 * create "/Sets/set-id"
119 return (CFStringCreateWithFormat(allocator
,
127 __private_extern__ CFStringRef
128 SCPreferencesPathKeyCreateSetNetworkGlobalEntity(CFAllocatorRef allocator
,
133 * create "/Sets/set-id/Network/Global/entity"
135 return CFStringCreateWithFormat(allocator
,
137 CFSTR("/%@/%@/%@/%@/%@"),
146 __private_extern__ CFStringRef
147 SCPreferencesPathKeyCreateSetNetworkInterfaceEntity(CFAllocatorRef allocator
,
153 * create "/Sets/set-id/Network/Interface/interface-name/entity"
155 return CFStringCreateWithFormat(allocator
,
157 CFSTR("/%@/%@/%@/%@/%@/%@"),
167 __private_extern__ CFStringRef
168 SCPreferencesPathKeyCreateSetNetworkService(CFAllocatorRef allocator
,
174 if (service
== NULL
) {
176 * create "/Sets/set-id/Network/Service"
178 path
= CFStringCreateWithFormat(allocator
,
180 CFSTR("/%@/%@/%@/%@"),
187 * create "/Sets/set-id/Network/Service/service-id"
189 path
= CFStringCreateWithFormat(allocator
,
191 CFSTR("/%@/%@/%@/%@/%@"),
203 __private_extern__ CFStringRef
204 SCPreferencesPathKeyCreateSetNetworkServiceEntity(CFAllocatorRef allocator
,
211 if (entity
== NULL
) {
213 * create "/Sets/set-id/Network/Service/service-id"
215 path
= CFStringCreateWithFormat(allocator
,
217 CFSTR("/%@/%@/%@/%@/%@"),
225 * create "/Sets/set-id/Network/Service/service-id/entity"
227 path
= CFStringCreateWithFormat(allocator
,
229 CFSTR("/%@/%@/%@/%@/%@/%@"),