]> git.saurik.com Git - apple/security.git/blob - keychain/Trieste/OctagonTestHarnessXPCService/main.m
Security-59306.11.20.tar.gz
[apple/security.git] / keychain / Trieste / OctagonTestHarnessXPCService / main.m
1 //
2 // main.m
3 // Security
4 //
5 // Copyright (c) 2018 Apple Inc. All rights reserved.
6 //
7
8 #import <Foundation/Foundation.h>
9 #import <Foundation/NSXPCConnection.h>
10 #import <Security/Security.h>
11 #import <Security/SecInternalReleasePriv.h>
12
13 #import "OctagonTestHarnessXPCServiceDelegate.h"
14
15 static OctagonTestHarnessXPCServiceDelegate *delegate = nil;
16 static NSXPCListener *listener =nil;
17
18 int main(int argc, const char *argv[]) {
19
20 @autoreleasepool {
21 if (!SecIsInternalRelease()) {
22 NSLog(@"not internal device");
23 return 1;
24 }
25
26 delegate = [[OctagonTestHarnessXPCServiceDelegate alloc] init];
27 listener = [[NSXPCListener alloc] initWithMachServiceName:@"com.apple.trieste.OctagonTestHarnessXPCService"];
28
29 listener.delegate = delegate;
30
31 NSLog(@"Done listener initialization, resuming");
32
33 [listener resume];
34 }
35 [[NSRunLoop mainRunLoop] run];
36
37 return 0;
38 }