]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurityd/lib/sscommon.h
Security-59306.140.5.tar.gz
[apple/security.git] / OSX / libsecurityd / lib / sscommon.h
1 /*
2 * Copyright (c) 2000-2004,2006-2008,2011 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24
25 //
26 // sscommon - common definitions for all securityd MIG interfaces
27 //
28 // This is meant to go into both ssclient and tdclient (for tokend), so it
29 // needs to be fairly generic.
30 //
31 #ifndef _H_SSCOMMON
32 #define _H_SSCOMMON
33
34 #include <Security/cssm.h>
35
36 //
37 // some handle types used to be defined here, so don't break anybody still
38 // relying on that
39 //
40 #include <securityd_client/handletypes.h>
41
42 #ifdef __cplusplus
43
44 #include <security_utilities/alloc.h>
45 #include <security_utilities/mach++.h>
46 #include <security_cdsa_utilities/cssmdata.h>
47 #include <security_cdsa_utilities/cssmkey.h>
48 #include <security_cdsa_utilities/cssmacl.h>
49 #include <security_cdsa_utilities/context.h>
50 #include <security_cdsa_utilities/cssmdbname.h>
51 #include <security_cdsa_utilities/cssmdb.h>
52
53
54 namespace Security {
55 namespace SecurityServer {
56
57 using MachPlusPlus::Port;
58 using MachPlusPlus::ReceivePort;
59
60 #endif //__cplusplus
61
62
63 //
64 // The Mach bootstrap registration name for SecurityServer
65 //
66 #define SECURITYSERVER_BOOTSTRAP_NAME "com.apple.SecurityServer"
67
68 //
69 // Types of ACL bearers
70 //
71 typedef enum { dbAcl, keyAcl, objectAcl, loginAcl } AclKind;
72
73
74 #ifdef __cplusplus
75
76
77 //
78 // Common structure for IPC-client mediator objects
79 //
80 class ClientCommon {
81 NOCOPY(ClientCommon)
82 public:
83 ClientCommon(Allocator &standard = Allocator::standard(),
84 Allocator &returning = Allocator::standard())
85 : internalAllocator(standard), returnAllocator(returning) { }
86
87 Allocator &internalAllocator;
88 Allocator &returnAllocator;
89
90 public:
91 typedef Security::Context Context;
92 };
93
94
95
96 } // end namespace SecurityServer
97 } // end namespace Security
98
99 #endif //__cplusplus
100
101
102 #endif //_H_SSCOMMON