2 #ifndef SOSTransportMessage_h
3 #define SOSTransportMessage_h
5 #import <Foundation/Foundation.h>
6 #include "keychain/SecureObjectSync/SOSAccountPriv.h"
8 @interface SOSMessage
: NSObject
14 @
property (atomic
) CFTypeRef engine
;
15 @
property (strong
, atomic
) SOSAccount
* account
;
16 @
property (strong
, atomic
) NSString
*circleName
;
18 -(id
) initWithAccount
:(SOSAccount
*)acct andName
:(NSString
*)name
;
20 -(CFIndex
) SOSTransportMessageGetTransportType
;
21 -(CFStringRef
) SOSTransportMessageGetCircleName
;
22 -(CFTypeRef
) SOSTransportMessageGetEngine
;
23 -(SOSAccount
*) SOSTransportMessageGetAccount
;
25 -(bool) SOSTransportMessageCleanupAfterPeerMessages
:(SOSMessage
*) transport peers
:(CFDictionaryRef
) peers err
:(CFErrorRef
*) error
;
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
;
31 -(bool) SOSTransportMessageSyncWithPeers
:(SOSMessage
*) transport p
:(CFSetRef
) peers err
:(CFErrorRef
*)error
;
33 -(CFDictionaryRef
)CF_RETURNS_RETAINED SOSTransportMessageHandlePeerMessageReturnsHandledCopy
:(SOSMessage
*) transport peerMessages
:(CFMutableDictionaryRef
) circle_peer_messages_table err
:(CFErrorRef
*)error
;
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
;
38 bool SOSEngineHandleCodedMessage(SOSAccount
* account
, SOSEngineRef engine
, CFStringRef peerID
, CFDataRef codedMessage
, CFErrorRef
*error
);