1 #include <CoreFoundation/CoreFoundation.h>
2 #include <Security/SecureObjectSync/SOSTransport.h>
3 #include <Security/SecureObjectSync/SOSTransportBackupPeer.h>
4 #include <Security/SecureObjectSync/SOSAccount.h>
5 #include <Security/SecureObjectSync/SOSAccountPriv.h>
7 #include <utilities/SecCFWrappers.h>
8 #include <AssertMacros.h>
11 CFGiblisWithHashFor(SOSTransportBackupPeer
);
13 SOSTransportBackupPeerRef
SOSTransportBackupPeerCreate(CFStringRef fileLocation
, CFErrorRef
*error
)
15 SOSTransportBackupPeerRef tpt
= (SOSTransportBackupPeerRef
)CFTypeAllocateWithSpace(SOSTransportBackupPeer
, sizeof(struct __OpaqueSOSTransportBackupPeer
) - sizeof(CFRuntimeBase
), kCFAllocatorDefault
);
16 tpt
->fileLocation
= CFRetainSafe(fileLocation
);
20 static CFStringRef
SOSTransportBackupPeerCopyFormatDescription(CFTypeRef aObj
, CFDictionaryRef formatOptions
){
21 SOSTransportBackupPeerRef t
= (SOSTransportBackupPeerRef
) aObj
;
23 return CFStringCreateWithFormat(NULL
, NULL
, CFSTR("<SOSTransportBackupPeer@%p\n>"), t
);
26 static void SOSTransportBackupPeerDestroy(CFTypeRef aObj
){
27 SOSTransportBackupPeerRef transport
= (SOSTransportBackupPeerRef
) aObj
;
28 CFReleaseNull(transport
);
31 CFIndex
SOSTransportBackupPeerGetTransportType(SOSTransportBackupPeerRef transport
, CFErrorRef
*error
){
35 static CFHashCode
SOSTransportBackupPeerHash(CFTypeRef obj
){
36 return (intptr_t) obj
;
39 static Boolean
SOSTransportBackupPeerCompare(CFTypeRef lhs
, CFTypeRef rhs
){
40 return SOSTransportBackupPeerHash(lhs
) == SOSTransportBackupPeerHash(rhs
);