]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurityd/lib/sscommon.h
Security-59306.101.1.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 default Mach bootstrap registration name for SecurityServer,
65 // and the environment variable to override it
66 //
67 #define SECURITYSERVER_BOOTSTRAP_NAME "com.apple.SecurityServer"
68 #define SECURITYSERVER_BOOTSTRAP_ENV "SECURITYSERVER"
69
70 //
71 // Types of ACL bearers
72 //
73 typedef enum { dbAcl, keyAcl, objectAcl, loginAcl } AclKind;
74
75
76 #ifdef __cplusplus
77
78
79 //
80 // Common structure for IPC-client mediator objects
81 //
82 class ClientCommon {
83 NOCOPY(ClientCommon)
84 public:
85 ClientCommon(Allocator &standard = Allocator::standard(),
86 Allocator &returning = Allocator::standard())
87 : internalAllocator(standard), returnAllocator(returning) { }
88
89 Allocator &internalAllocator;
90 Allocator &returnAllocator;
91
92 public:
93 typedef Security::Context Context;
94 };
95
96
97
98 } // end namespace SecurityServer
99 } // end namespace Security
100
101 #endif //__cplusplus
102
103
104 #endif //_H_SSCOMMON