]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SystemConfiguration.h
13b85037f13391d6b3e3dadab9ae44cf896360de
[apple/configd.git] / SystemConfiguration.fproj / SystemConfiguration.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
11 *
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
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22
23 #ifndef _SYSTEMCONFIGURATION_H
24 #define _SYSTEMCONFIGURATION_H
25
26 #include <sys/cdefs.h>
27 #include <CoreFoundation/CoreFoundation.h>
28
29
30 /*!
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.
35
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
43 to date.
44 */
45
46 /*!
47 @enum
48 @discussion Returned status codes.
49
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
58
59 @constant kSCStatusNoStoreSession Configuration daemon session not active
60 @constant kSCStatusNoStoreServer Configuration daemon not (no longer) available
61 @constant kSCStatusNotifierActive Notifier is currently active
62
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
69 @constant kSCStatusReachabilityUnknown
70 A determination could not be made regarding the reachability
71 of the specified nodename/address.
72 */
73 enum {
74 /*
75 * Generic status codes
76 */
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
83 */
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 */
88 /*
89 * SCDynamicStore status codes
90 */
91 kSCStatusNoStoreSession = 2001, /* Configuration daemon session not active */
92 kSCStatusNoStoreServer = 2002, /* Configuration daemon not (no longer) available */
93 kSCStatusNotifierActive = 2003, /* Notifier is currently active */
94 /*
95 * SCPreferences status codes
96 */
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 */
102 /*
103 * SCNetwork status codes
104 */
105 kSCStatusReachabilityUnknown = 4001, /* Network reachability cannot be determined */
106 };
107
108
109 /* store access APIs */
110 #include <SystemConfiguration/SCDynamicStore.h>
111 #include <SystemConfiguration/SCDynamicStoreKey.h>
112 #include <SystemConfiguration/SCDynamicStoreCopySpecific.h>
113
114 /* preference access APIs */
115 #include <SystemConfiguration/SCPreferences.h>
116 #include <SystemConfiguration/SCPreferencesPath.h>
117
118 /* store and preference scheme definitions */
119 #include <SystemConfiguration/SCSchemaDefinitions.h>
120
121 /* "network reachability" APIs */
122 #include <SystemConfiguration/SCNetwork.h>
123
124 __BEGIN_DECLS
125
126 /*!
127 @function SCError
128 @discussion Returns a last SystemConfiguration.framework API error code.
129 @result The last error encountered.
130 */
131 int SCError ();
132
133 /*!
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.
139 */
140 const char * SCErrorString (int status);
141
142 __END_DECLS
143
144 #endif /* _SYSTEMCONFIGURATION_H */