]> git.saurik.com Git - apple/security.git/blob - keychain/SecureObjectSync/SOSTransportMessage.h
Security-59306.11.20.tar.gz
[apple/security.git] / keychain / SecureObjectSync / SOSTransportMessage.h
1
2 #ifndef SOSTransportMessage_h
3 #define SOSTransportMessage_h
4
5 #import <Foundation/Foundation.h>
6 #include "keychain/SecureObjectSync/SOSAccountPriv.h"
7
8 @interface SOSMessage : NSObject
9 {
10 CFTypeRef engine;
11 SOSAccount *account;
12 NSString *circleName;
13 }
14 @property (atomic) CFTypeRef engine;
15 @property (strong, atomic) SOSAccount* account;
16 @property (strong, atomic) NSString *circleName;
17
18 -(id) initWithAccount:(SOSAccount*)acct andName:(NSString*)name;
19
20 -(CFIndex) SOSTransportMessageGetTransportType;
21 -(CFStringRef) SOSTransportMessageGetCircleName;
22 -(CFTypeRef) SOSTransportMessageGetEngine;
23 -(SOSAccount*) SOSTransportMessageGetAccount;
24
25 -(bool) SOSTransportMessageCleanupAfterPeerMessages:(SOSMessage*) transport peers:(CFDictionaryRef) peers err:(CFErrorRef*) error;
26
27 -(bool) SOSTransportMessageSendMessage:(SOSMessage*) transport id:(CFStringRef) peerID messageToSend:(CFDataRef) message err:(CFErrorRef *)error;
28 -(bool) SOSTransportMessageSendMessages:(SOSMessage*) transport pm:(CFDictionaryRef) peer_messages err:(CFErrorRef *)error;
29 -(bool) SOSTransportMessageFlushChanges:(SOSMessage*) transport err:(CFErrorRef *)error;
30
31 -(bool) SOSTransportMessageSyncWithPeers:(SOSMessage*) transport p:(CFSetRef) peers err:(CFErrorRef *)error;
32
33 -(CFDictionaryRef)CF_RETURNS_RETAINED SOSTransportMessageHandlePeerMessageReturnsHandledCopy:(SOSMessage*) transport peerMessages:(CFMutableDictionaryRef) circle_peer_messages_table err:(CFErrorRef *)error;
34
35 -(bool) SOSTransportMessageHandlePeerMessage:(SOSMessage*) transport id:(CFStringRef) peer_id cm:(CFDataRef) codedMessage err:(CFErrorRef *)error;
36 -(bool) SOSTransportMessageSendMessageIfNeeded:(SOSMessage*) transport circleName:(CFStringRef) circle_id pID:(CFStringRef) peer_id err:(CFErrorRef *)error;
37 //for testing
38 bool SOSEngineHandleCodedMessage(SOSAccount* account, SOSEngineRef engine, CFStringRef peerID, CFDataRef codedMessage, CFErrorRef*error);
39
40 @end
41
42 #endif