]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SystemConfiguration.h
configd-84.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 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
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
13 * file.
14 *
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.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25
26 #ifndef _SYSTEMCONFIGURATION_H
27 #define _SYSTEMCONFIGURATION_H
28
29 #include <sys/cdefs.h>
30 #include <CoreFoundation/CoreFoundation.h>
31
32
33 /*!
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.
38
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
46 to date.
47 */
48
49 /*!
50 @enum
51 @discussion Returned status codes.
52
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
61
62 @constant kSCStatusNoStoreSession Configuration daemon session not active
63 @constant kSCStatusNoStoreServer Configuration daemon not (no longer) available
64 @constant kSCStatusNotifierActive Notifier is currently active
65
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
72
73 @constant kSCStatusReachabilityUnknown
74 A determination could not be made regarding the reachability
75 of the specified nodename/address.
76 */
77 enum {
78 /*
79 * Generic status codes
80 */
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
87 */
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 */
92 /*
93 * SCDynamicStore status codes
94 */
95 kSCStatusNoStoreSession = 2001, /* Configuration daemon session not active */
96 kSCStatusNoStoreServer = 2002, /* Configuration daemon not (no longer) available */
97 kSCStatusNotifierActive = 2003, /* Notifier is currently active */
98 /*
99 * SCPreferences status codes
100 */
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 */
107 /*
108 * SCNetwork status codes
109 */
110 kSCStatusReachabilityUnknown = 4001 /* Network reachability cannot be determined */
111 };
112
113
114 /* store access APIs */
115 #include <SystemConfiguration/SCDynamicStore.h>
116 #include <SystemConfiguration/SCDynamicStoreKey.h>
117 #include <SystemConfiguration/SCDynamicStoreCopySpecific.h>
118
119 /* preference access APIs */
120 #include <SystemConfiguration/SCPreferences.h>
121 #include <SystemConfiguration/SCPreferencesPath.h>
122
123 /* store and preference scheme definitions */
124 #include <SystemConfiguration/SCSchemaDefinitions.h>
125
126 /* network reachability / connection APIs */
127 #include <SystemConfiguration/SCNetwork.h>
128 #include <SystemConfiguration/SCNetworkReachability.h>
129 #include <SystemConfiguration/SCNetworkConnection.h>
130
131 __BEGIN_DECLS
132
133 /*!
134 @function SCError
135 @discussion Returns a last SystemConfiguration.framework API error code.
136 @result The last error encountered.
137 */
138 int SCError ();
139
140 /*!
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.
146 */
147 const char * SCErrorString (int status);
148
149 __END_DECLS
150
151 #endif /* _SYSTEMCONFIGURATION_H */