2 * Copyright (c) 2015 Apple Inc. All rights reserved.
4 * @APPLE_APACHE_LICENSE_HEADER_START@
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 * @APPLE_APACHE_LICENSE_HEADER_END@
21 #ifndef __FIREHOSE_SERVER_INTERNAL__
22 #define __FIREHOSE_SERVER_INTERNAL__
24 OS_OBJECT_CLASS_DECL(firehose_client
, object
);
25 #define FIREHOSE_CLIENT_CLASS OS_OBJECT_VTABLE(firehose_client)
27 typedef struct firehose_snapshot_s
*firehose_snapshot_t
;
28 struct firehose_snapshot_s
{
29 firehose_snapshot_handler_t handler
;
30 dispatch_group_t fs_group
;
33 struct firehose_client_s
{
35 _OS_OBJECT_HEADER(void *os_obj_isa
, os_obj_ref_cnt
, os_obj_xref_cnt
);
36 struct _os_object_s fc_as_os_object
;
38 TAILQ_ENTRY(firehose_client_s
) fc_entry
;
40 firehose_buffer_t fc_buffer
;
41 uint64_t volatile fc_mem_sent_flushed_pos
;
42 uint64_t volatile fc_mem_flushed_pos
;
43 uint64_t volatile fc_io_sent_flushed_pos
;
44 uint64_t volatile fc_io_flushed_pos
;
46 void *volatile fc_ctxt
;
49 dispatch_mach_t fc_mach_channel
;
50 dispatch_source_t fc_kernel_source
;
52 dispatch_source_t fc_io_source
;
53 dispatch_source_t fc_mem_source
;
56 os_unfair_lock fc_lock
;
61 bool fc_memory_corrupted
;
62 bool fc_needs_io_snapshot
;
63 bool fc_needs_mem_snapshot
;
67 _firehose_client_xref_dispose(struct firehose_client_s
*fc
);
69 _firehose_client_dispose(struct firehose_client_s
*fc
);
71 extern unsigned char __libfirehose_serverVersionString
[];
72 extern double __libfirehose_serverVersionNumber
;
74 #endif // __FIREHOSE_SERVER_INTERNAL__