]> git.saurik.com Git - apple/security.git/blob - OSX/sec/SOSCircle/SecureObjectSync/SOSTransport.h
Security-58286.270.3.0.1.tar.gz
[apple/security.git] / OSX / sec / SOSCircle / SecureObjectSync / SOSTransport.h
1
2
3 #ifndef SOSTransport_h
4 #define SOSTransport_h
5 #include <Security/SecureObjectSync/SOSTransportMessage.h>
6 #include <Security/SecureObjectSync/SOSTransportCircle.h>
7 #include <Security/SecureObjectSync/SOSTransportKeyParameter.h>
8 #include <Security/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