2 #ifndef SOSTransportCircle_h
3 #define SOSTransportCircle_h
5 #include <CoreFoundation/CoreFoundation.h>
6 #include <CoreFoundation/CFRuntime.h>
7 #include <Security/SecureObjectSync/SOSAccount.h>
9 typedef struct __OpaqueSOSTransportCircle
* SOSTransportCircleRef
;
11 struct __OpaqueSOSTransportCircle
{
13 SOSAccountRef account
;
15 CFStringRef (*copyDescription
)(SOSTransportCircleRef transport
);
16 void (*destroy
)(SOSTransportCircleRef transport
);
18 bool (*postRetirement
)(SOSTransportCircleRef transport
, CFStringRef circleName
, CFStringRef peer_id
, CFDataRef retirement_data
, CFErrorRef
*error
);
19 bool (*expireRetirementRecords
)(SOSTransportCircleRef transport
, CFDictionaryRef retirements
, CFErrorRef
*error
);
20 bool (*flushChanges
)(SOSTransportCircleRef transport
, CFErrorRef
*error
);
21 bool (*postCircle
)(SOSTransportCircleRef transport
, CFStringRef circleName
, CFDataRef circle_data
, CFErrorRef
*error
);
22 CFIndex (*getTransportType
)(SOSTransportCircleRef transport
, CFErrorRef
*error
);
24 CFDictionaryRef (*handleRetirementMessages
)(SOSTransportCircleRef transport
, CFMutableDictionaryRef circle_retirement_messages_table
, CFErrorRef
*error
);
25 CFArrayRef (*handleCircleMessages
)(SOSTransportCircleRef transport
, CFMutableDictionaryRef circle_circle_messages_table
, CFErrorRef
*error
);
27 bool (*sendPeerInfo
)(SOSTransportCircleRef transport
, CFStringRef peerID
, CFDataRef peerInfoData
, CFErrorRef
*error
);
28 bool (*flushRingChanges
)(SOSTransportCircleRef transport
, CFErrorRef
* error
);
29 bool (*postRing
)(SOSTransportCircleRef transport
, CFStringRef ringName
, CFDataRef ring
, CFErrorRef
*error
);
30 bool (*sendDebugInfo
)(SOSTransportCircleRef transport
, CFStringRef type
, CFTypeRef debugInfo
, CFErrorRef
*error
);
31 bool (*sendAccountChangedWithDSID
)(SOSTransportCircleRef transport
, CFStringRef dsid
, CFErrorRef
*error
);
34 SOSTransportCircleRef
SOSTransportCircleCreateForSubclass(size_t size
, SOSAccountRef account
, CFErrorRef
*error
);
36 bool SOSTransportCirclePostCircle(SOSTransportCircleRef transport
, CFStringRef circleName
, CFDataRef circle_data
, CFErrorRef
*error
);
38 bool SOSTransportCirclePostRetirement(SOSTransportCircleRef transport
, CFStringRef circleName
, SOSPeerInfoRef peer
, CFErrorRef
*error
);
40 bool SOSTransportCircleExpireRetirementRecords(SOSTransportCircleRef transport
, CFDictionaryRef retirements
, CFErrorRef
*error
);
42 bool SOSTransportCircleFlushChanges(SOSTransportCircleRef transport
, CFErrorRef
*error
);
44 CFTypeID
SOSTransportCircleGetTypeID(void);
46 CFIndex
SOSTransportCircleGetTransportType(SOSTransportCircleRef transport
, CFErrorRef
*error
);
48 SOSAccountRef
SOSTransportCircleGetAccount(SOSTransportCircleRef transport
);
49 CF_RETURNS_RETAINED CFDictionaryRef
SOSTransportCircleHandleRetirementMessages(SOSTransportCircleRef transport
, CFMutableDictionaryRef circle_retirement_messages_table
, CFErrorRef
*error
);
52 CF_RETURNS_RETAINED CFArrayRef
SOSTransportCircleHandleCircleMessages(SOSTransportCircleRef transport
, CFMutableDictionaryRef circle_circle_messages_table
, CFErrorRef
*error
);
54 bool SOSTransportCircleSendPeerInfo(SOSTransportCircleRef transport
, CFStringRef peerID
, CFDataRef peerInfoData
, CFErrorRef
*error
);
56 bool SOSTransportCircleRingFlushChanges(SOSTransportCircleRef transport
, CFErrorRef
* error
);
58 bool SOSTransportCircleRingPostRing(SOSTransportCircleRef transport
, CFStringRef ringName
, CFDataRef ring
, CFErrorRef
*error
);
60 bool SOSTransportCircleSendDebugInfo(SOSTransportCircleRef transport
, CFStringRef type
, CFTypeRef debugInfo
, CFErrorRef
*error
);
62 bool SOSTransportCircleSendAccountChangedWithDSID(SOSTransportCircleRef transport
, CFStringRef dsid
, CFErrorRef
*error
);
64 bool SOSTransportCircleSendOfficialDSID(SOSTransportCircleRef transport
, CFStringRef dsid
, CFErrorRef
*error
);
66 bool SOSTransportCircleRecordLastCirclePushedInKVS(SOSTransportCircleRef transport
, CFStringRef circle_name
, CFDataRef circleData
);