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