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)
9extern "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_ENVIROMENT "_enviroment"
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_REQUEST_METHOD_SET_PREFS "_agent_request_setprefs"
70#define AUTH_XPC_REPLY_METHOD_KEY "_agent_reply_key"
71#define AUTH_XPC_REPLY_METHOD_RESULT "_agent_reply_result"
72#define AUTH_XPC_REPLY_METHOD_INTERRUPT "_agent_reply_interrupt"
73#define AUTH_XPC_REPLY_METHOD_CREATE "_agent_reply_create"
74#define AUTH_XPC_REPLY_METHOD_DEACTIVATE "_agent_reply_deactivate"
75#define AUTH_XPC_PLUGIN_NAME "_agent_plugin"
76#define AUTH_XPC_MECHANISM_NAME "_agent_mechanism"
77#define AUTH_XPC_HINTS_NAME "_agent_hints"
78#define AUTH_XPC_CONTEXT_NAME "_agent_context"
79#define AUTH_XPC_IMMUTABLE_HINTS_NAME "_agent_immutable_hints"
80#define AUTH_XPC_REPLY_RESULT_VALUE "_agent_reply_result_value"
81#define AUTH_XPC_AUDIT_SESSION_PORT "_agent_audit_session_port"
82#define AUTH_XPC_BOOTSTRAP_PORT "_agent_bootstrap_port"
83#define AUTH_XPC_SESSION_UUID "_agent_session_uuid"
84#define AUTH_XPC_SESSION_PREFS "_agent_session_prefs"
85#define AUTH_XPC_SESSION_INPUT_METHOD "_agent_session_inputMethod"
86
87typedef struct AuthorizationBlob {
88        uint32_t data[2];
89} AuthorizationBlob;
90
91typedef struct AuthorizationExternalBlob {
92    AuthorizationBlob blob;
93    int32_t session;
94} AuthorizationExternalBlob;
95
96enum {
97    AUTHORIZATION_CREATE = 1,
98    AUTHORIZATION_FREE,
99    AUTHORIZATION_COPY_RIGHTS,
100    AUTHORIZATION_COPY_INFO,
101    AUTHORIZATION_MAKE_EXTERNAL_FORM,
102    AUTHORIZATION_CREATE_FROM_EXTERNAL_FORM,
103    AUTHORIZATION_RIGHT_GET,
104    AUTHORIZATION_RIGHT_SET,
105    AUTHORIZATION_RIGHT_REMOVE,
106    SESSION_SET_USER_PREFERENCES,
107    AUTHORIZATION_DEV,
108    AUTHORIZATION_CREATE_WITH_AUDIT_TOKEN,
109    AUTHORIZATION_DISMISS,
110    AUTHORIZATION_SETUP,
111    AUTHORIZATION_ENABLE_SMARTCARD
112};
113
114#if defined(__cplusplus)
115}
116#endif
117
118#endif /* !_AUTHD_PRIVATE_H_ */
119