]> git.saurik.com Git - apple/security.git/blob - OSX/authd/authd_private.h
Security-57740.20.22.tar.gz
[apple/security.git] / OSX / authd / authd_private.h
1 /* Copyright (c) 2012-2013 Apple Inc. All Rights Reserved. */
2
3 #ifndef _AUTHD_PRIVATE_H_
4 #define _AUTHD_PRIVATE_H_
5
6 #include <stdint.h>
7
8 #if defined(__cplusplus)
9 extern "C" {
10 #endif
11
12 #define AUTH_NONNULL1 __attribute__((__nonnull__(1)))
13 #define AUTH_NONNULL2 __attribute__((__nonnull__(2)))
14 #define AUTH_NONNULL3 __attribute__((__nonnull__(3)))
15 #define AUTH_NONNULL4 __attribute__((__nonnull__(4)))
16 #define AUTH_NONNULL5 __attribute__((__nonnull__(5)))
17 #define AUTH_NONNULL6 __attribute__((__nonnull__(6)))
18 #define AUTH_NONNULL7 __attribute__((__nonnull__(7)))
19 #define AUTH_NONNULL_ALL __attribute__((__nonnull__))
20 #define AUTH_MALLOC __attribute__((__malloc__))
21 #define AUTH_UNUSED __attribute__((unused))
22 #define AUTH_WARN_RESULT __attribute__((__warn_unused_result__))
23 #define AUTH_INLINE static __inline__ __attribute__((__always_inline__))
24
25 #if __has_feature(attribute_cf_returns_retained)
26 #define AUTH_RETURNS_RETAINED __attribute__((cf_returns_retained))
27 #else
28 #define AUTH_RETURNS_RETAINED
29 #endif
30
31 #if __has_feature(attribute_cf_returns_not_retained)
32 #define AUTH_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained))
33 #else
34 #define AUTH_RETURNS_NOT_RETAINED
35 #endif
36
37 #if __has_feature(attribute_cf_consumed)
38 #define AUTH_CONSUMED __attribute__((cf_consumed))
39 #else
40 #define AUTH_CONSUMED
41 #endif
42
43 #define SECURITY_AUTH_NAME "com.apple.authd"
44
45 #define AUTH_XPC_TYPE "_type"
46 #define AUTH_XPC_RIGHTS "_rights"
47 #define AUTH_XPC_ENVIRONMENT "_environment"
48 #define AUTH_XPC_FLAGS "_flags"
49 #define AUTH_XPC_BLOB "_blob"
50 #define AUTH_XPC_STATUS "_status"
51 #define AUTH_XPC_RIGHT_NAME "_right_name"
52 #define AUTH_XPC_TAG "_tag"
53 #define AUTH_XPC_OUT_ITEMS "_out_items"
54 #define AUTH_XPC_EXTERNAL "_external"
55 #define AUTH_XPC_DATA "_data"
56 #define AUTH_XPC_BOOTSTRAP "_bootstrap"
57
58 #define AUTH_XPC_ITEM_NAME "_item_name"
59 #define AUTH_XPC_ITEM_FLAGS "_item_flags"
60 #define AUTH_XPC_ITEM_VALUE "_item_value"
61 #define AUTH_XPC_ITEM_TYPE "_item_type"
62
63 #define AUTH_XPC_REQUEST_METHOD_KEY "_agent_request_key"
64 #define AUTH_XPC_REQUEST_METHOD_CREATE "_agent_request_create"
65 #define AUTH_XPC_REQUEST_METHOD_INVOKE "_agent_request_invoke"
66 #define AUTH_XPC_REQUEST_METHOD_DEACTIVATE "_agent_request_deactivate"
67 #define AUTH_XPC_REQUEST_METHOD_DESTROY "_agent_request_destroy"
68 #define AUTH_XPC_REQUEST_METHOD_INTERRUPT "_agent_request_interrupt"
69 #define AUTH_XPC_REPLY_METHOD_KEY "_agent_reply_key"
70 #define AUTH_XPC_REPLY_METHOD_RESULT "_agent_reply_result"
71 #define AUTH_XPC_REPLY_METHOD_INTERRUPT "_agent_reply_interrupt"
72 #define AUTH_XPC_REPLY_METHOD_CREATE "_agent_reply_create"
73 #define AUTH_XPC_REPLY_METHOD_DEACTIVATE "_agent_reply_deactivate"
74 #define AUTH_XPC_PLUGIN_NAME "_agent_plugin"
75 #define AUTH_XPC_MECHANISM_NAME "_agent_mechanism"
76 #define AUTH_XPC_HINTS_NAME "_agent_hints"
77 #define AUTH_XPC_CONTEXT_NAME "_agent_context"
78 #define AUTH_XPC_IMMUTABLE_HINTS_NAME "_agent_immutable_hints"
79 #define AUTH_XPC_REPLY_RESULT_VALUE "_agent_reply_result_value"
80 #define AUTH_XPC_AUDIT_SESSION_PORT "_agent_audit_session_port"
81 #define AUTH_XPC_BOOTSTRAP_PORT "_agent_bootstrap_port"
82
83 typedef struct AuthorizationBlob {
84 uint32_t data[2];
85 } AuthorizationBlob;
86
87 typedef struct AuthorizationExternalBlob {
88 AuthorizationBlob blob;
89 int32_t session;
90 } AuthorizationExternalBlob;
91
92 enum {
93 AUTHORIZATION_CREATE = 1,
94 AUTHORIZATION_FREE,
95 AUTHORIZATION_COPY_RIGHTS,
96 AUTHORIZATION_COPY_INFO,
97 AUTHORIZATION_MAKE_EXTERNAL_FORM,
98 AUTHORIZATION_CREATE_FROM_EXTERNAL_FORM,
99 AUTHORIZATION_RIGHT_GET,
100 AUTHORIZATION_RIGHT_SET,
101 AUTHORIZATION_RIGHT_REMOVE,
102 SESSION_SET_USER_PREFERENCES,
103 AUTHORIZATION_DEV,
104 AUTHORIZATION_CREATE_WITH_AUDIT_TOKEN,
105 AUTHORIZATION_DISMISS,
106 AUTHORIZATION_SETUP,
107 AUTHORIZATION_ENABLE_SMARTCARD
108 };
109
110 #if defined(__cplusplus)
111 }
112 #endif
113
114 #endif /* !_AUTHD_PRIVATE_H_ */