1 #ifndef SEC_SOSTransportTestTransports_h
2 #define SEC_SOSTransportTestTransports_h
4 #import "Security/SecureObjectSync/SOSTransportCircleKVS.h"
5 #import "Security/SecureObjectSync/SOSTransportMessageKVS.h"
6 #import "Security/SecureObjectSync/SOSTransportMessageIDS.h"
8 extern CFMutableArrayRef key_transports
;
9 extern CFMutableArrayRef circle_transports
;
10 extern CFMutableArrayRef message_transports
;
12 void SOSAccountUpdateTestTransports(SOSAccount
* account
, CFDictionaryRef gestalt
);
14 @interface SOSMessageIDSTest
: SOSMessageIDS
16 @
property (nonatomic
) CFMutableDictionaryRef changes
;
17 @
property (nonatomic
) CFStringRef accountName
;
19 -(SOSMessageIDSTest
*) initWithAccount
:(SOSAccount
*)acct andAccountName
:(CFStringRef
) aN andCircleName
:(CFStringRef
) cN err
:(CFErrorRef
*)error
;
20 -(CFIndex
) SOSTransportMessageGetTransportType
;
21 -(CFStringRef
) SOSTransportMessageGetCircleName
;
22 -(CFTypeRef
) SOSTransportMessageGetEngine
;
23 -(SOSAccount
*) SOSTransportMessageGetAccount
;
24 void SOSTransportMessageIDSTestSetName(SOSMessageIDSTest
* transport
, CFStringRef acctName
);
25 -(bool) SOSTransportMessageSendMessages
:(SOSMessageIDSTest
*) transport pm
:(CFDictionaryRef
) peer_messages err
:(CFErrorRef
*)error
;
26 -(bool) SOSTransportMessageIDSGetIDSDeviceID
:(SOSAccount
*)acct
;
27 -(CFDictionaryRef
)CF_RETURNS_RETAINED SOSTransportMessageHandlePeerMessageReturnsHandledCopy
:(SOSMessageIDSTest
*) transport peerMessages
:(CFMutableDictionaryRef
)message err
:(CFErrorRef
*)error
;
28 -(HandleIDSMessageReason
) SOSTransportMessageIDSHandleMessage
:(SOSAccount
*)acct m
:(CFDictionaryRef
) message err
:(CFErrorRef
*)error
;
32 @interface CKKeyParameterTest
: CKKeyParameter
34 @
property (nonatomic
) CFMutableDictionaryRef changes
;
35 @
property (nonatomic
) CFStringRef name
;
36 @
property (nonatomic
) CFStringRef circleName
;
37 -(id
) initWithAccount
:(SOSAccount
*) acct andName
:(CFStringRef
) name andCircleName
:(CFStringRef
) circleName
;
38 -(bool) SOSTransportKeyParameterPublishCloudParameters
:(CKKeyParameterTest
*) transport data
:(CFDataRef
)newParameters err
:(CFErrorRef
*) error
;
39 -(bool) SOSTransportKeyParameterHandleKeyParameterChanges
:(CKKeyParameter
*) transport data
:(CFDataRef
) data err
:(CFErrorRef
) error
;
43 @interface SOSMessageKVSTest
: SOSMessageKVS
44 @
property (nonatomic
) CFMutableDictionaryRef changes
;
45 @
property (nonatomic
) CFStringRef name
;
47 -(id
) initWithAccount
:(SOSAccount
*) acct andName
:(CFStringRef
) name andCircleName
:(CFStringRef
) circleName
;
48 -(bool) SOSTransportMessageSendMessages
:(SOSMessageKVSTest
*) transport pm
:(CFDictionaryRef
) peer_messages err
:(CFErrorRef
*)error
;
49 -(CFIndex
) SOSTransportMessageGetTransportType
;
50 -(CFStringRef
) SOSTransportMessageGetCircleName
;
51 -(CFTypeRef
) SOSTransportMessageGetEngine
;
52 -(SOSAccount
*) SOSTransportMessageGetAccount
;
55 @interface SOSCircleStorageTransportTest
: SOSKVSCircleStorageTransport
57 NSString
*accountName
;
59 @
property (nonatomic
) NSString
*accountName
;
62 -(id
) initWithAccount
:(SOSAccount
*)account andWithAccountName
:(CFStringRef
)accountName andCircleName
:(CFStringRef
)circleName
;
64 bool SOSTransportCircleTestRemovePendingChange(SOSCircleStorageTransportTest
* transport
, CFStringRef circleName
, CFErrorRef
*error
);
65 CFStringRef
SOSTransportCircleTestGetName(SOSCircleStorageTransportTest
* transport
);
66 bool SOSAccountEnsureFactoryCirclesTest(SOSAccount
* a
, CFStringRef accountName
);
67 SOSAccount
* SOSTransportCircleTestGetAccount(SOSCircleStorageTransportTest
* transport
);
68 void SOSTransportCircleTestClearChanges(SOSCircleStorageTransportTest
* transport
);
69 void SOSTransportCircleTestSetName(SOSCircleStorageTransportTest
* transport
, CFStringRef accountName
);
70 bool SOSAccountInflateTestTransportsForCircle(SOSAccount
* account
, CFStringRef circleName
, CFStringRef accountName
, CFErrorRef
*error
);
71 -(void) SOSTransportCircleTestAddBulkToChanges
:(CFDictionaryRef
) updates
;
72 -(void) testAddToChanges
:(CFStringRef
) message_key data
:(CFDataRef
)message_data
;
73 -(CFMutableDictionaryRef
) SOSTransportCircleTestGetChanges
;
76 void SOSTransportMessageIDSTestSetName(SOSMessageIDSTest
* transport
, CFStringRef n
);
77 void SOSTransportMessageTestClearChanges(SOSMessageKVSTest
* transport
);
79 void SOSTransportMessageKVSTestSetName(SOSMessageKVSTest
* transport
, CFStringRef n
);
80 CFMutableDictionaryRef
SOSTransportMessageKVSTestGetChanges(SOSMessageKVSTest
* transport
);
81 CFStringRef
SOSTransportMessageKVSTestGetName(SOSMessageKVSTest
* transport
);
83 CFStringRef
SOSTransportKeyParameterTestGetName(CKKeyParameterTest
* transport
);
84 CFMutableDictionaryRef
SOSTransportKeyParameterTestGetChanges(CKKeyParameterTest
* transport
);
85 void SOSTransportKeyParameterTestSetName(CKKeyParameterTest
* transport
, CFStringRef accountName
);
86 void SOSTransportKeyParameterTestClearChanges(CKKeyParameterTest
* transport
);
87 SOSAccount
* SOSTransportKeyParameterTestGetAccount(CKKeyParameterTest
* transport
);
88 SOSAccount
* SOSTransportMessageKVSTestGetAccount(SOSMessageKVSTest
* transport
);
89 void SOSTransportMessageIDSTestClearChanges(SOSMessageIDSTest
* transport
);
91 CFMutableDictionaryRef
SOSTransportMessageIDSTestGetChanges(SOSMessageIDSTest
* transport
);
92 SOSAccount
* SOSTransportMessageIDSTestGetAccount(SOSMessageIDSTest
* transport
);
93 CFStringRef
SOSTransportMessageIDSTestGetName(SOSMessageIDSTest
* transport
);