]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SystemConfiguration.h
configd-136.2.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SystemConfiguration.h
1 /*
2 * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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
11 * file.
12 *
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 #ifndef _SYSTEMCONFIGURATION_H
25 #define _SYSTEMCONFIGURATION_H
26
27 #include <sys/cdefs.h>
28 #include <CoreFoundation/CoreFoundation.h>
29
30
31 /*!
32 @header SystemConfiguration
33 @discussion The System Configuration framework provides access to the
34 data used to configure a running system. The APIs provided
35 by this framework communicate with the configd daemon.
36
37 The configd daemon manages a dynamic store reflecting the
38 desired configuration settings as well as the current state
39 of the system. The daemon provides a notification mechanism
40 for processes that need to be aware of changes made to the
41 data. Lastly, the daemon loads a number of bundles (or
42 plug-ins) that monitor low-level kernel events and, through
43 a set of policy modules, keep the state data up to date.
44 */
45
46 /*!
47 @enum Error codes
48 @discussion Returned error codes.
49 @constant kSCStatusOK Success
50 @constant kSCStatusFailed Non-specific Failure
51 @constant kSCStatusInvalidArgument Invalid argument
52 @constant kSCStatusAccessError Permission denied
53 @constant kSCStatusNoKey No such key
54 @constant kSCStatusKeyExists Data associated with key already defined
55 @constant kSCStatusLocked Lock already held
56 @constant kSCStatusNeedLock Lock required for this operation
57 @constant kSCStatusNoStoreSession Configuration daemon session not active
58 @constant kSCStatusNoStoreServer Configuration daemon not (or no longer) available
59 @constant kSCStatusNotifierActive Notifier is currently active
60 @constant kSCStatusNoPrefsSession Preferences session not active
61 @constant kSCStatusPrefsBusy Preferences update currently in progress
62 @constant kSCStatusNoConfigFile Configuration file not found
63 @constant kSCStatusNoLink No such link
64 @constant kSCStatusStale Write attempted on stale version of object
65 @constant kSCStatusMaxLink Maximum link count exceeded
66 @constant kSCStatusReachabilityUnknown
67 A determination could not be made regarding the reachability
68 of the specified nodename or address.
69 */
70 enum {
71 /*
72 * Generic error codes
73 */
74 kSCStatusOK = 0, /* Success */
75 kSCStatusFailed = 1001, /* Non-specific failure */
76 kSCStatusInvalidArgument = 1002, /* Invalid argument */
77 kSCStatusAccessError = 1003, /* Permission denied
78 - must be root to obtain lock
79 - could not create access/create preferences
80 */
81 kSCStatusNoKey = 1004, /* No such key */
82 kSCStatusKeyExists = 1005, /* Key already defined */
83 kSCStatusLocked = 1006, /* Lock already held */
84 kSCStatusNeedLock = 1007, /* Lock required for this operation */
85 /*
86 * SCDynamicStore error codes
87 */
88 kSCStatusNoStoreSession = 2001, /* Configuration daemon session not active */
89 kSCStatusNoStoreServer = 2002, /* Configuration daemon not (no longer) available */
90 kSCStatusNotifierActive = 2003, /* Notifier is currently active */
91 /*
92 * SCPreferences error codes
93 */
94 kSCStatusNoPrefsSession = 3001, /* Preference session not active */
95 kSCStatusPrefsBusy = 3002, /* Preferences update currently in progress */
96 kSCStatusNoConfigFile = 3003, /* Configuration file not found */
97 kSCStatusNoLink = 3004, /* No such link */
98 kSCStatusStale = 3005, /* Write attempted on stale version of object */
99 kSCStatusMaxLink = 3006, /* Maximum link count exceeded */
100 /*
101 * SCNetwork error codes
102 */
103 kSCStatusReachabilityUnknown = 4001 /* Network reachability cannot be determined */
104 };
105
106
107 /* store access APIs */
108 #include <SystemConfiguration/SCDynamicStore.h>
109 #include <SystemConfiguration/SCDynamicStoreKey.h>
110 #include <SystemConfiguration/SCDynamicStoreCopySpecific.h>
111
112 /* preference access APIs */
113 #include <SystemConfiguration/SCPreferences.h>
114 #include <SystemConfiguration/SCPreferencesPath.h>
115
116 /* network configuration */
117 #include <SystemConfiguration/SCNetworkConfiguration.h>
118
119 /* store and preference scheme definitions */
120 #include <SystemConfiguration/SCSchemaDefinitions.h>
121
122 /* network reachability / connection APIs */
123 #include <SystemConfiguration/SCNetwork.h>
124 #include <SystemConfiguration/SCNetworkReachability.h>
125 #include <SystemConfiguration/SCNetworkConnection.h>
126
127 __BEGIN_DECLS
128
129 /*!
130 @function SCError
131 @discussion Returns the most recent status or error code generated
132 as the result of calling a System Configuration framework API.
133 @result Returns the last error encountered.
134 */
135 int SCError ();
136
137 /*!
138 @function SCErrorString
139 @discussion Returns a pointer to the message string
140 associated with the specified status or error.
141 @param status The SCDynamicStoreStatus to be returned.
142 @result Returns a pointer to the error message string.
143 */
144 const char * SCErrorString (int status);
145
146 __END_DECLS
147
148 #endif /* _SYSTEMCONFIGURATION_H */