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