2 * Copyright (c) 2000-2002 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
68 @constant kSCStatusMaxLink Maximum link count exceeded
70 @constant kSCStatusReachabilityUnknown
71 A determination could not be made regarding the reachability
72 of the specified nodename/address.
76 * Generic status codes
78 kSCStatusOK
= 0, /* Success */
79 kSCStatusFailed
= 1001, /* Non-specific failure */
80 kSCStatusInvalidArgument
= 1002, /* Invalid argument */
81 kSCStatusAccessError
= 1003, /* Permission denied
82 - must be root to obtain lock
83 - could not create access/create preferences
85 kSCStatusNoKey
= 1004, /* No such key */
86 kSCStatusKeyExists
= 1005, /* Key already defined */
87 kSCStatusLocked
= 1006, /* Lock already held */
88 kSCStatusNeedLock
= 1007, /* Lock required for this operation */
90 * SCDynamicStore status codes
92 kSCStatusNoStoreSession
= 2001, /* Configuration daemon session not active */
93 kSCStatusNoStoreServer
= 2002, /* Configuration daemon not (no longer) available */
94 kSCStatusNotifierActive
= 2003, /* Notifier is currently active */
96 * SCPreferences status codes
98 kSCStatusNoPrefsSession
= 3001, /* Preference session not active */
99 kSCStatusPrefsBusy
= 3002, /* Preferences update currently in progress */
100 kSCStatusNoConfigFile
= 3003, /* Configuration file not found */
101 kSCStatusNoLink
= 3004, /* No such link */
102 kSCStatusStale
= 3005, /* Write attempted on stale version of object */
103 kSCStatusMaxLink
= 3006, /* Maximum link count exceeded */
105 * SCNetwork status codes
107 kSCStatusReachabilityUnknown
= 4001, /* Network reachability cannot be determined */
111 /* store access APIs */
112 #include <SystemConfiguration/SCDynamicStore.h>
113 #include <SystemConfiguration/SCDynamicStoreKey.h>
114 #include <SystemConfiguration/SCDynamicStoreCopySpecific.h>
116 /* preference access APIs */
117 #include <SystemConfiguration/SCPreferences.h>
118 #include <SystemConfiguration/SCPreferencesPath.h>
120 /* store and preference scheme definitions */
121 #include <SystemConfiguration/SCSchemaDefinitions.h>
123 /* "network reachability" APIs */
124 #include <SystemConfiguration/SCNetwork.h>
130 @discussion Returns a last SystemConfiguration.framework API error code.
131 @result The last error encountered.
136 @function SCErrorString
137 @discussion Returns a pointer to the error message string associated
138 with the specified status.
139 @param status The SCDynamicStoreStatus to be returned.
140 @result The error message string.
142 const char * SCErrorString (int status
);
146 #endif /* _SYSTEMCONFIGURATION_H */