2 * Copyright (c) 2000-2004, 2006, 2009, 2010 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
24 #ifndef _SCDYNAMICSTOREINTERNAL_H
25 #define _SCDYNAMICSTOREINTERNAL_H
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>
35 #include <CoreFoundation/CoreFoundation.h>
36 #include <CoreFoundation/CFRuntime.h>
37 #include <SystemConfiguration/SCDynamicStore.h>
40 /* Define the status of any registered notification. */
42 NotifierNotRegistered
= 0,
44 Using_NotifierInformViaCallback
,
45 Using_NotifierInformViaMachPort
,
46 Using_NotifierInformViaFD
,
47 Using_NotifierInformViaSignal
,
48 Using_NotifierInformViaRunLoop
,
49 Using_NotifierInformViaDispatch
50 } __SCDynamicStoreNotificationStatus
;
55 /* base CFType information */
58 /* client side of the "configd" session */
60 CFDictionaryRef options
;
62 /* server side of the "configd" session */
65 /* per-session flags */
67 Boolean useSessionKeys
;
69 /* current status of notification requests */
70 __SCDynamicStoreNotificationStatus notifyStatus
;
72 /* "client" information associated with SCDynamicStoreCreateRunLoopSource() */
73 CFMutableArrayRef rlList
;
74 CFRunLoopSourceRef rls
;
75 SCDynamicStoreCallBack rlsFunction
;
76 SCDynamicStoreContext rlsContext
;
78 /* "client" information associated with SCDynamicStoreNotifyCallback() */
79 SCDynamicStoreCallBack_v1 callbackFunction
;
80 void *callbackArgument
;
81 CFMachPortRef callbackPort
;
82 CFRunLoopSourceRef callbackRLS
;
84 /* "client" information associated with SCDynamicStoreSetDispatchQueue() */
85 dispatch_queue_t dispatchQueue
;
86 dispatch_source_t callbackSource
;
87 dispatch_queue_t callbackQueue
;
89 /* "client" information associated with SCDynamicStoreSetDisconnectCallBack() */
90 SCDynamicStoreDisconnectCallBack disconnectFunction
;
91 Boolean disconnectForceCallBack
;
93 /* "server" SCDynamicStoreKeys being watched */
94 CFMutableArrayRef keys
;
95 CFMutableArrayRef patterns
;
97 /* "server" information associated with SCDynamicStoreNotifyMachPort() */
98 mach_port_t notifyPort
;
99 mach_msg_id_t notifyPortIdentifier
;
101 /* "server" information associated with SCDynamicStoreNotifyFileDescriptor() */
103 int notifyFileIdentifier
;
105 /* "server" information associated with SCDynamicStoreNotifySignal() */
107 task_t notifySignalTask
;
109 } SCDynamicStorePrivate
, *SCDynamicStorePrivateRef
;
114 SCDynamicStorePrivateRef
115 __SCDynamicStoreCreatePrivate (CFAllocatorRef allocator
,
116 const CFStringRef name
,
117 SCDynamicStoreCallBack callout
,
118 SCDynamicStoreContext
*context
);
121 __SCDynamicStoreReconnect (SCDynamicStoreRef store
);
124 __SCDynamicStoreReconnectNotifications (SCDynamicStoreRef store
);
128 #endif /* _SCDYNAMICSTOREINTERNAL_H */