2 * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 #ifndef _SYSTEMCONFIGURATION_H
27 #define _SYSTEMCONFIGURATION_H
29 #include <sys/cdefs.h>
30 #include <CoreFoundation/CoreFoundation.h>
34 @header SystemConfiguration.h
35 The SystemConfiguration framework provides access to the
36 data used to configure a running system. The APIs provided
37 by this framework communicate with the "configd" daemon.
39 The "configd" daemon manages a "dynamic store" reflecting the
40 desired configuration settings as well as the current state
41 of the system. The daemon provides a notification mechanism
42 for user-level processes which need to be aware of changes
43 made to the data. Lastly, the daemon loads a number of
44 bundles (or plug-ins) that monitor low-level kernel events
45 and, via a set of policy modules, keep the state data up
51 @discussion Returned status codes.
53 @constant kSCStatusOK Success
54 @constant kSCStatusFailed Non-specific Failure
55 @constant kSCStatusInvalidArgument Invalid argument
56 @constant kSCStatusAccessError Permission denied
57 @constant kSCStatusNoKey No such key
58 @constant kSCStatusKeyExists Data associated with key already defined
59 @constant kSCStatusLocked Lock already held
60 @constant kSCStatusNeedLock Lock required for this operation
62 @constant kSCStatusNoStoreSession Configuration daemon session not active
63 @constant kSCStatusNoStoreServer Configuration daemon not (no longer) available
64 @constant kSCStatusNotifierActive Notifier is currently active
66 @constant kSCStatusNoPrefsSession Preference session not active
67 @constant kSCStatusPrefsBusy Preferences update currently in progress
68 @constant kSCStatusNoConfigFile Configuration file not found
69 @constant kSCStatusNoLink No such link
70 @constant kSCStatusStale Write attempted on stale version of object
71 @constant kSCStatusMaxLink Maximum link count exceeded
73 @constant kSCStatusReachabilityUnknown
74 A determination could not be made regarding the reachability
75 of the specified nodename/address.
79 * Generic status codes
81 kSCStatusOK
= 0, /* Success */
82 kSCStatusFailed
= 1001, /* Non-specific failure */
83 kSCStatusInvalidArgument
= 1002, /* Invalid argument */
84 kSCStatusAccessError
= 1003, /* Permission denied
85 - must be root to obtain lock
86 - could not create access/create preferences
88 kSCStatusNoKey
= 1004, /* No such key */
89 kSCStatusKeyExists
= 1005, /* Key already defined */
90 kSCStatusLocked
= 1006, /* Lock already held */
91 kSCStatusNeedLock
= 1007, /* Lock required for this operation */
93 * SCDynamicStore status codes
95 kSCStatusNoStoreSession
= 2001, /* Configuration daemon session not active */
96 kSCStatusNoStoreServer
= 2002, /* Configuration daemon not (no longer) available */
97 kSCStatusNotifierActive
= 2003, /* Notifier is currently active */
99 * SCPreferences status codes
101 kSCStatusNoPrefsSession
= 3001, /* Preference session not active */
102 kSCStatusPrefsBusy
= 3002, /* Preferences update currently in progress */
103 kSCStatusNoConfigFile
= 3003, /* Configuration file not found */
104 kSCStatusNoLink
= 3004, /* No such link */
105 kSCStatusStale
= 3005, /* Write attempted on stale version of object */
106 kSCStatusMaxLink
= 3006, /* Maximum link count exceeded */
108 * SCNetwork status codes
110 kSCStatusReachabilityUnknown
= 4001 /* Network reachability cannot be determined */
114 /* store access APIs */
115 #include <SystemConfiguration/SCDynamicStore.h>
116 #include <SystemConfiguration/SCDynamicStoreKey.h>
117 #include <SystemConfiguration/SCDynamicStoreCopySpecific.h>
119 /* preference access APIs */
120 #include <SystemConfiguration/SCPreferences.h>
121 #include <SystemConfiguration/SCPreferencesPath.h>
123 /* store and preference scheme definitions */
124 #include <SystemConfiguration/SCSchemaDefinitions.h>
126 /* network reachability / connection APIs */
127 #include <SystemConfiguration/SCNetwork.h>
128 #include <SystemConfiguration/SCNetworkReachability.h>
129 #include <SystemConfiguration/SCNetworkConnection.h>
135 @discussion Returns a last SystemConfiguration.framework API error code.
136 @result The last error encountered.
141 @function SCErrorString
142 @discussion Returns a pointer to the error message string associated
143 with the specified status.
144 @param status The SCDynamicStoreStatus to be returned.
145 @result The error message string.
147 const char * SCErrorString (int status
);
151 #endif /* _SYSTEMCONFIGURATION_H */