]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCDynamicStoreInternal.h
be5209a5c50340a75b529622c212533c1e05b0a5
[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 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25
26 #ifndef _SCDYNAMICSTOREINTERNAL_H
27 #define _SCDYNAMICSTOREINTERNAL_H
28
29 #include <sys/cdefs.h>
30 #include <sys/types.h>
31 #include <mach/mach.h>
32 #include <pthread.h>
33 #include <regex.h>
34 #include <CoreFoundation/CoreFoundation.h>
35 #include <CoreFoundation/CFRuntime.h>
36 #include <SystemConfiguration/SCDynamicStore.h>
37
38
39 /* Define the status of any registered notification. */
40 typedef enum {
41 NotifierNotRegistered = 0,
42 Using_NotifierWait,
43 Using_NotifierInformViaCallback,
44 Using_NotifierInformViaMachPort,
45 Using_NotifierInformViaFD,
46 Using_NotifierInformViaSignal,
47 Using_NotifierInformViaRunLoop
48 } __SCDynamicStoreNotificationStatus;
49
50
51 typedef struct {
52
53 /* base CFType information */
54 CFRuntimeBase cfBase;
55
56 /* server side of the "configd" session */
57 mach_port_t server;
58
59 /* per-session flags */
60 Boolean locked;
61
62 /* SCDynamicStoreKeys being watched */
63 CFMutableSetRef keys;
64 CFMutableSetRef patterns;
65
66 /* current status of notification requests */
67 __SCDynamicStoreNotificationStatus notifyStatus;
68
69 /* "client" information associated with SCDynamicStoreCreateRunLoopSource() */
70 CFIndex rlsRefs;
71 CFRunLoopSourceRef rls;
72 SCDynamicStoreCallBack rlsFunction;
73 SCDynamicStoreContext rlsContext;
74
75 /* "client" information associated with SCDynamicStoreNotifyCallback() */
76 SCDynamicStoreCallBack_v1 callbackFunction;
77 void *callbackArgument;
78 CFMachPortRef callbackPort;
79 CFRunLoopRef callbackRunLoop;
80 CFRunLoopSourceRef callbackRunLoopSource;
81
82 /* "server" information associated with SCDynamicStoreNotifyMachPort() */
83 mach_port_t notifyPort;
84 mach_msg_id_t notifyPortIdentifier;
85
86 /* "server" information associated with SCDynamicStoreNotifyFileDescriptor() */
87 int notifyFile;
88 int notifyFileIdentifier;
89
90 /* "server" information associated with SCDynamicStoreNotifySignal() */
91 int notifySignal;
92 task_t notifySignalTask;
93
94 } SCDynamicStorePrivate, *SCDynamicStorePrivateRef;
95
96
97 __BEGIN_DECLS
98
99 SCDynamicStorePrivateRef
100 __SCDynamicStoreCreatePrivate (CFAllocatorRef allocator,
101 const CFStringRef name,
102 SCDynamicStoreCallBack callout,
103 SCDynamicStoreContext *context);
104
105 void
106 __showMachPortStatus ();
107
108 void
109 __showMachPortReferences (mach_port_t port);
110
111 __END_DECLS
112
113 #endif /* _SCDYNAMICSTOREINTERNAL_H */