2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
26 #include <SystemConfiguration/SCD.h>
28 #include <sys/cdefs.h>
29 #include <sys/types.h>
32 #include <CoreFoundation/CFMachPort.h>
35 /* Define the per-session (and global) flags */
41 boolean_t useCFRunLoop
;
45 /* Define the status of any registered notification. */
47 NotifierNotRegistered
= 0,
49 Using_NotifierInformViaCallback
,
50 Using_NotifierInformViaMachPort
,
51 Using_NotifierInformViaFD
,
52 Using_NotifierInformViaSignal
,
53 } _SCDNotificationStatus
;
58 /* server side of the "configd" session */
61 /* per-session flags */
64 /* SCDKeys being watched */
66 CFMutableSetRef reKeys
;
68 /* current status of notification requests */
69 _SCDNotificationStatus notifyStatus
;
71 /* "client" information associated with SCDNotifierInformViaCallback() */
72 SCDCallbackRoutine_t callbackFunction
;
73 void *callbackArgument
;
74 CFMachPortRef callbackPort
;
75 CFRunLoopSourceRef callbackRunLoopSource
; /* XXX CFMachPortInvalidate() doesn't work */
76 pthread_t callbackHelper
;
78 /* "server" information associated with SCDNotifierInformViaMachPort() */
79 mach_port_t notifyPort
;
80 mach_msg_id_t notifyPortIdentifier
;
82 /* "server" information associated with SCDNotifierInformViaFD() */
84 int notifyFileIdentifier
;
86 /* "server" information associated with SCDNotifierInformViaSignal() */
88 task_t notifySignalTask
;
90 } SCDSessionPrivate
, *SCDSessionPrivateRef
;
95 /* configuration data associated with key */
96 CFPropertyListRef data
;
98 /* instance value of last fetched data */
101 } SCDHandlePrivate
, *SCDHandlePrivateRef
;
104 /* per-session options */
106 kSCDOptionIsLocked
= 1024,
107 } SCDServerSessionOptions
;
112 kSCDOptionIsServer
= 2048,
113 } SCDServerGlobalOptions
;
118 SCDSessionRef
_SCDSessionCreatePrivate ();
120 void _SCDHandleSetInstance (SCDHandleRef handle
,
123 mach_msg_id_t
_waitForMachMessage (mach_port_t port
);
125 void _showMachPortStatus ();
126 void _showMachPortReferences (mach_port_t port
);
130 #endif /* !_SCDPRIVATE_H */