2 * Copyright (c) 2000-2004, 2006, 2009-2011, 2013 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_NotifierInformViaMachPort
,
45 Using_NotifierInformViaFD
,
46 Using_NotifierInformViaSignal
,
47 Using_NotifierInformViaRunLoop
,
48 Using_NotifierInformViaDispatch
49 } __SCDynamicStoreNotificationStatus
;
54 /* base CFType information */
57 /* client side of the "configd" session */
59 CFDictionaryRef options
;
61 /* server side of the "configd" session */
63 Boolean serverNullSession
;
65 /* per-session flags */
66 Boolean useSessionKeys
;
68 /* current status of notification requests */
69 __SCDynamicStoreNotificationStatus notifyStatus
;
71 /* "client" information associated with SCDynamicStoreCreateRunLoopSource() */
72 CFMutableArrayRef rlList
;
73 CFRunLoopSourceRef rls
;
74 SCDynamicStoreCallBack rlsFunction
;
75 SCDynamicStoreContext rlsContext
;
76 CFMachPortRef rlsNotifyPort
;
77 CFRunLoopSourceRef rlsNotifyRLS
;
79 /* "client" information associated with SCDynamicStoreSetDispatchQueue() */
80 dispatch_group_t dispatchGroup
;
81 dispatch_queue_t dispatchQueue
;
82 dispatch_source_t dispatchSource
;
84 /* "client" information associated with SCDynamicStoreSetDisconnectCallBack() */
85 SCDynamicStoreDisconnectCallBack disconnectFunction
;
86 Boolean disconnectForceCallBack
;
88 /* SCDynamicStoreKeys being watched */
89 CFMutableArrayRef keys
;
90 CFMutableArrayRef patterns
;
92 /* "server" information associated with mach port based notifications */
93 mach_port_t notifyPort
;
94 mach_msg_id_t notifyPortIdentifier
;
96 /* "server" information associated with SCDynamicStoreNotifyFileDescriptor() */
98 int notifyFileIdentifier
;
100 /* "server" information associated with SCDynamicStoreNotifySignal() */
102 task_t notifySignalTask
;
104 } SCDynamicStorePrivate
, *SCDynamicStorePrivateRef
;
109 SCDynamicStorePrivateRef
110 __SCDynamicStoreCreatePrivate (CFAllocatorRef allocator
,
111 const CFStringRef name
,
112 SCDynamicStoreCallBack callout
,
113 SCDynamicStoreContext
*context
);
116 __SCDynamicStoreNullSession (void);
119 __SCDynamicStoreCheckRetryAndHandleError(SCDynamicStoreRef store
,
120 kern_return_t status
,
125 __SCDynamicStoreReconnectNotifications (SCDynamicStoreRef store
);
129 #endif /* _SCDYNAMICSTOREINTERNAL_H */