]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCDynamicStoreInternal.h
configd-130.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCDynamicStoreInternal.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 _SCDYNAMICSTOREINTERNAL_H
25 #define _SCDYNAMICSTOREINTERNAL_H
26
27 #include <sys/cdefs.h>
28 #include <sys/types.h>
29 #include <mach/mach.h>
30 #include <pthread.h>
31 #include <regex.h>
32 #include <CoreFoundation/CoreFoundation.h>
33 #include <CoreFoundation/CFRuntime.h>
34 #include <SystemConfiguration/SCDynamicStore.h>
35
36
37 /* Define the status of any registered notification. */
38 typedef enum {
39 NotifierNotRegistered = 0,
40 Using_NotifierWait,
41 Using_NotifierInformViaCallback,
42 Using_NotifierInformViaMachPort,
43 Using_NotifierInformViaFD,
44 Using_NotifierInformViaSignal,
45 Using_NotifierInformViaRunLoop
46 } __SCDynamicStoreNotificationStatus;
47
48
49 typedef struct {
50
51 /* base CFType information */
52 CFRuntimeBase cfBase;
53
54 /* server side of the "configd" session */
55 mach_port_t server;
56
57 /* per-session flags */
58 Boolean locked;
59 Boolean useSessionKeys;
60
61 /* current status of notification requests */
62 __SCDynamicStoreNotificationStatus notifyStatus;
63
64 /* "client" information associated with SCDynamicStoreCreateRunLoopSource() */
65 CFIndex rlsRefs;
66 CFRunLoopSourceRef rls;
67 SCDynamicStoreCallBack rlsFunction;
68 SCDynamicStoreContext rlsContext;
69
70 /* "client" information associated with SCDynamicStoreNotifyCallback() */
71 SCDynamicStoreCallBack_v1 callbackFunction;
72 void *callbackArgument;
73 CFMachPortRef callbackPort;
74 CFRunLoopSourceRef callbackRLS;
75
76 /* "server" SCDynamicStoreKeys being watched */
77 CFMutableSetRef keys;
78 CFMutableSetRef patterns;
79
80 /* "server" information associated with SCDynamicStoreNotifyMachPort() */
81 mach_port_t notifyPort;
82 mach_msg_id_t notifyPortIdentifier;
83
84 /* "server" information associated with SCDynamicStoreNotifyFileDescriptor() */
85 int notifyFile;
86 int notifyFileIdentifier;
87
88 /* "server" information associated with SCDynamicStoreNotifySignal() */
89 int notifySignal;
90 task_t notifySignalTask;
91
92 } SCDynamicStorePrivate, *SCDynamicStorePrivateRef;
93
94
95 __BEGIN_DECLS
96
97 SCDynamicStorePrivateRef
98 __SCDynamicStoreCreatePrivate (CFAllocatorRef allocator,
99 const CFStringRef name,
100 SCDynamicStoreCallBack callout,
101 SCDynamicStoreContext *context);
102
103 void
104 __showMachPortStatus ();
105
106 void
107 __showMachPortReferences (mach_port_t port);
108
109 __END_DECLS
110
111 #endif /* _SCDYNAMICSTOREINTERNAL_H */