]> git.saurik.com Git - apple/security.git/blob - keychain/SecureObjectSync/SOSEnginePriv.h
Security-59306.11.20.tar.gz
[apple/security.git] / keychain / SecureObjectSync / SOSEnginePriv.h
1 //
2 // SOSEnginePriv.h
3 // sec
4 //
5 //
6
7 #ifndef SOSEnginePriv_h
8 #define SOSEnginePriv_h
9
10 #include <CoreFoundation/CoreFoundation.h>
11 #include <CoreFoundation/CFRuntime.h>
12 #include "keychain/SecureObjectSync/SOSEngine.h"
13
14 /* SOSEngine implementation. */
15 struct __OpaqueSOSEngine {
16 CFRuntimeBase _base;
17 SOSDataSourceRef dataSource;
18 CFStringRef myID; // My peerID in the circle
19 // We need to address the issues of corrupt keychain items
20 SOSManifestRef unreadable; // Possibly by having a set of unreadable items, to which we
21 // add any corrupted items in the db that have yet to be deleted.
22 // This happens if we notce corruption during a (read only) query.
23 // We would also perma-subtract unreadable from manifest whenever
24 // anyone asked for manifest. This result would be cached in
25 // The manifestCache below, so we just need a key into the cache
26 CFDataRef localMinusUnreadableDigest; // or a digest (CFDataRef of the right size).
27
28 CFMutableDictionaryRef manifestCache; // digest -> ( refcount, manifest )
29 CFMutableDictionaryRef peerMap; // peerId -> SOSPeerRef
30 CFDictionaryRef viewNameSet2ChangeTracker; // CFSetRef of CFStringRef -> SOSChangeTrackerRef
31 CFDictionaryRef viewName2ChangeTracker; // CFStringRef -> SOSChangeTrackerRef
32 CFArrayRef peerIDs;
33 CFDateRef lastTraceDate; // Last time we did a CloudKeychainTrace
34 CFMutableDictionaryRef coders;
35 bool haveLoadedCoders;
36
37 bool codersNeedSaving;
38 dispatch_queue_t queue; // Engine queue
39
40 dispatch_source_t save_timer; // Engine state save timer
41 dispatch_queue_t syncCompleteQueue; // Non-retained queue for async notificaion
42 SOSEnginePeerInSyncBlock syncCompleteListener; // Block to call to notify the listener.
43
44 bool save_timer_pending; // Engine state timer running, read/modify on engine queue
45
46 };
47
48 #endif /* SOSEnginePriv_h */