]> git.saurik.com Git - apple/security.git/blob - keychain/SecureObjectSync/SOSTransport.h
Security-59306.140.5.tar.gz
[apple/security.git] / keychain / SecureObjectSync / SOSTransport.h
1
2
3 #ifndef SOSTransport_h
4 #define SOSTransport_h
5 #include "keychain/SecureObjectSync/SOSTransportMessage.h"
6 #include "keychain/SecureObjectSync/SOSTransportCircle.h"
7 #include "keychain/SecureObjectSync/SOSTransportKeyParameter.h"
8 #include "keychain/SecureObjectSync/SOSAccount.h"
9
10 CF_RETURNS_RETAINED CFMutableArrayRef SOSTransportDispatchMessages(SOSAccountTransaction* txn, CFDictionaryRef updates, CFErrorRef *error);
11
12 void SOSRegisterTransportMessage(SOSMessage* additional);
13 void SOSUnregisterTransportMessage(SOSMessage* removal);
14
15 void SOSRegisterTransportCircle(SOSCircleStorageTransport* additional);
16 void SOSUnregisterTransportCircle(SOSCircleStorageTransport* removal);
17
18 void SOSRegisterTransportKeyParameter(CKKeyParameter* additional);
19 void SOSUnregisterTransportKeyParameter(CKKeyParameter* removal);
20 void SOSUnregisterAllTransportMessages(void);
21 void SOSUnregisterAllTransportCircles(void);
22 void SOSUnregisterAllTransportKeyParameters(void);
23
24
25 void SOSUpdateKeyInterest(SOSAccount* account);
26
27 enum TransportType{
28 kUnknown = 0,
29 kKVS = 1,
30 kIDS = 2,
31 kBackupPeer = 3,
32 kIDSTest = 4,
33 kKVSTest = 5,
34 kCK = 6
35 };
36
37 static inline CFMutableDictionaryRef CFDictionaryEnsureCFDictionaryAndGetCurrentValue(CFMutableDictionaryRef dict, CFTypeRef key)
38 {
39 CFMutableDictionaryRef result = (CFMutableDictionaryRef) CFDictionaryGetValue(dict, key);
40
41 if (!isDictionary(result)) {
42 result = CFDictionaryCreateMutableForCFTypes(kCFAllocatorDefault);
43 CFDictionarySetValue(dict, key, result);
44 CFReleaseSafe(result);
45 }
46
47 return result;
48 }
49
50 #endif