]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SystemConfiguration.h
3467ba6c7ab70a0916e92516e104f2f7c48aa855
[apple/configd.git] / SystemConfiguration.fproj / SystemConfiguration.h
1 /*
2 * Copyright (c) 2000-2002 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 @constant kSCStatusMaxLink Maximum link count exceeded
69
70 @constant kSCStatusReachabilityUnknown
71 A determination could not be made regarding the reachability
72 of the specified nodename/address.
73 */
74 enum {
75 /*
76 * Generic status codes
77 */
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
84 */
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 */
89 /*
90 * SCDynamicStore status codes
91 */
92 kSCStatusNoStoreSession = 2001, /* Configuration daemon session not active */
93 kSCStatusNoStoreServer = 2002, /* Configuration daemon not (no longer) available */
94 kSCStatusNotifierActive = 2003, /* Notifier is currently active */
95 /*
96 * SCPreferences status codes
97 */
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 */
104 /*
105 * SCNetwork status codes
106 */
107 kSCStatusReachabilityUnknown = 4001, /* Network reachability cannot be determined */
108 };
109
110
111 /* store access APIs */
112 #include <SystemConfiguration/SCDynamicStore.h>
113 #include <SystemConfiguration/SCDynamicStoreKey.h>
114 #include <SystemConfiguration/SCDynamicStoreCopySpecific.h>
115
116 /* preference access APIs */
117 #include <SystemConfiguration/SCPreferences.h>
118 #include <SystemConfiguration/SCPreferencesPath.h>
119
120 /* store and preference scheme definitions */
121 #include <SystemConfiguration/SCSchemaDefinitions.h>
122
123 /* "network reachability" APIs */
124 #include <SystemConfiguration/SCNetwork.h>
125
126 __BEGIN_DECLS
127
128 /*!
129 @function SCError
130 @discussion Returns a last SystemConfiguration.framework API error code.
131 @result The last error encountered.
132 */
133 int SCError ();
134
135 /*!
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.
141 */
142 const char * SCErrorString (int status);
143
144 __END_DECLS
145
146 #endif /* _SYSTEMCONFIGURATION_H */