]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCDynamicStoreInternal.h
configd-395.10.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCDynamicStoreInternal.h
1 /*
2 * Copyright (c) 2000-2004, 2006, 2009, 2010 Apple 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 <Availability.h>
28 #include <TargetConditionals.h>
29 #include <sys/cdefs.h>
30 #include <dispatch/dispatch.h>
31 #include <sys/types.h>
32 #include <mach/mach.h>
33 #include <pthread.h>
34 #include <regex.h>
35 #include <CoreFoundation/CoreFoundation.h>
36 #include <CoreFoundation/CFRuntime.h>
37 #include <SystemConfiguration/SCDynamicStore.h>
38
39
40 /* Define the status of any registered notification. */
41 typedef enum {
42 NotifierNotRegistered = 0,
43 Using_NotifierWait,
44 Using_NotifierInformViaCallback,
45 Using_NotifierInformViaMachPort,
46 Using_NotifierInformViaFD,
47 Using_NotifierInformViaSignal,
48 Using_NotifierInformViaRunLoop,
49 Using_NotifierInformViaDispatch
50 } __SCDynamicStoreNotificationStatus;
51
52
53 typedef struct {
54
55 /* base CFType information */
56 CFRuntimeBase cfBase;
57
58 /* client side of the "configd" session */
59 CFStringRef name;
60 CFDictionaryRef options;
61
62 /* server side of the "configd" session */
63 mach_port_t server;
64
65 /* per-session flags */
66 Boolean locked;
67 Boolean useSessionKeys;
68
69 /* current status of notification requests */
70 __SCDynamicStoreNotificationStatus notifyStatus;
71
72 /* "client" information associated with SCDynamicStoreCreateRunLoopSource() */
73 CFMutableArrayRef rlList;
74 CFRunLoopSourceRef rls;
75 SCDynamicStoreCallBack rlsFunction;
76 SCDynamicStoreContext rlsContext;
77
78 /* "client" information associated with SCDynamicStoreNotifyCallback() */
79 SCDynamicStoreCallBack_v1 callbackFunction;
80 void *callbackArgument;
81 CFMachPortRef callbackPort;
82 CFRunLoopSourceRef callbackRLS;
83
84 /* "client" information associated with SCDynamicStoreSetDispatchQueue() */
85 dispatch_queue_t dispatchQueue;
86 dispatch_source_t callbackSource;
87 dispatch_queue_t callbackQueue;
88
89 /* "client" information associated with SCDynamicStoreSetDisconnectCallBack() */
90 SCDynamicStoreDisconnectCallBack disconnectFunction;
91 Boolean disconnectForceCallBack;
92
93 /* "server" SCDynamicStoreKeys being watched */
94 CFMutableArrayRef keys;
95 CFMutableArrayRef patterns;
96
97 /* "server" information associated with SCDynamicStoreNotifyMachPort() */
98 mach_port_t notifyPort;
99 mach_msg_id_t notifyPortIdentifier;
100
101 /* "server" information associated with SCDynamicStoreNotifyFileDescriptor() */
102 int notifyFile;
103 int notifyFileIdentifier;
104
105 /* "server" information associated with SCDynamicStoreNotifySignal() */
106 int notifySignal;
107 task_t notifySignalTask;
108
109 } SCDynamicStorePrivate, *SCDynamicStorePrivateRef;
110
111
112 __BEGIN_DECLS
113
114 SCDynamicStorePrivateRef
115 __SCDynamicStoreCreatePrivate (CFAllocatorRef allocator,
116 const CFStringRef name,
117 SCDynamicStoreCallBack callout,
118 SCDynamicStoreContext *context);
119
120 Boolean
121 __SCDynamicStoreReconnect (SCDynamicStoreRef store);
122
123 Boolean
124 __SCDynamicStoreReconnectNotifications (SCDynamicStoreRef store);
125
126 __END_DECLS
127
128 #endif /* _SCDYNAMICSTOREINTERNAL_H */