]> git.saurik.com Git - apple/security.git/blob - Security/sec/SOSCircle/SecureObjectSync/SOSTransportMessage.h
Security-57031.40.6.tar.gz
[apple/security.git] / Security / sec / SOSCircle / SecureObjectSync / SOSTransportMessage.h
1
2 #ifndef SOSTransportMessage_h
3 #define SOSTransportMessage_h
4
5 #include <SecureObjectSync/SOSAccount.h>
6 #include <CoreFoundation/CFRuntime.h>
7
8 typedef struct __OpaqueSOSTransportMessage *SOSTransportMessageRef;
9
10 struct __OpaqueSOSTransportMessage {
11 CFRuntimeBase _base;
12 SOSEngineRef engine;
13 SOSAccountRef account;
14
15 /* Connections from CF land to vtable land */
16 CFStringRef (*copyDescription)(SOSTransportMessageRef object);
17 void (*destroy)(SOSTransportMessageRef object);
18
19 /* send message operations */
20 bool (*syncWithPeers)(SOSTransportMessageRef transport, CFDictionaryRef circleToPeerIDs, CFErrorRef *error);
21 bool (*cleanupAfterPeerMessages)(SOSTransportMessageRef transport, CFDictionaryRef circleToPeerIDs, CFErrorRef* error);
22 bool (*sendMessages)(SOSTransportMessageRef transport, CFDictionaryRef circle_messages, CFErrorRef *error);
23 bool (*flushChanges)(SOSTransportMessageRef transport, CFErrorRef *error);
24 CFDictionaryRef (*handleMessages)(SOSTransportMessageRef transport, CFMutableDictionaryRef circle_peer_messages_table, CFErrorRef *error);
25 };
26
27 SOSTransportMessageRef SOSTransportMessageCreateForSubclass(size_t size,SOSAccountRef account, CFStringRef circleName, CFErrorRef *error);
28 bool SOSTransportMessageHandlePeerMessage(SOSTransportMessageRef transport, CFStringRef peer_id, CFDataRef codedMessage, CFErrorRef *error);
29
30 typedef bool (^SOSTransportSendToPeerBlock)(SOSTransportMessageRef transport, CFStringRef peerID, CFDataRef message, SOSEnginePeerMessageSentBlock sentBlock);
31
32 SOSEngineRef SOSTransportMessageGetEngine(SOSTransportMessageRef transport);
33
34 SOSAccountRef SOSTransportMessageGetAccount(SOSTransportMessageRef transport);
35
36 bool SOSTransportMessageCleanupAfterPeerMessages(SOSTransportMessageRef transport, CFDictionaryRef circleToPeerIDs, CFErrorRef* error);
37
38 bool SOSTransportMessageSendMessagesIfNeeded(SOSTransportMessageRef transport, CFStringRef circle_id, CFArrayRef handledPeers, CFErrorRef *error);
39
40 bool SOSTransportMessageSendMessages(SOSTransportMessageRef transport, CFDictionaryRef circle_messages, CFErrorRef *error);
41 bool SOSTransportMessageFlushChanges(SOSTransportMessageRef transport, CFErrorRef *error);
42
43
44 SOSTransportMessageRef SOSTransportMessageCreateForSubclass(size_t size,
45 SOSAccountRef account, CFStringRef circleName,
46 CFErrorRef *error);
47 CF_RETURNS_RETAINED
48 CFDictionaryRef SOSTransportMessageHandleMessages(SOSTransportMessageRef transport, CFMutableDictionaryRef circle_peer_messages_table, CFErrorRef *error);
49
50
51 #endif