1 | #ifndef␉_host_security_user_␊ |
2 | #define␉_host_security_user_␊ |
3 | ␊ |
4 | /* Module host_security */␊ |
5 | ␊ |
6 | #include <string.h>␊ |
7 | #include <mach/ndr.h>␊ |
8 | #include <mach/boolean.h>␊ |
9 | #include <mach/kern_return.h>␊ |
10 | #include <mach/notify.h>␊ |
11 | #include <mach/mach_types.h>␊ |
12 | #include <mach/message.h>␊ |
13 | #include <mach/mig_errors.h>␊ |
14 | #include <mach/port.h>␊ |
15 | ␊ |
16 | #ifdef AUTOTEST␊ |
17 | #ifndef FUNCTION_PTR_T␊ |
18 | #define FUNCTION_PTR_T␊ |
19 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);␊ |
20 | typedef struct {␊ |
21 | char *name;␊ |
22 | function_ptr_t function;␊ |
23 | } function_table_entry;␊ |
24 | typedef function_table_entry *function_table_t;␊ |
25 | #endif /* FUNCTION_PTR_T */␊ |
26 | #endif /* AUTOTEST */␊ |
27 | ␊ |
28 | #ifndef␉host_security_MSG_COUNT␊ |
29 | #define␉host_security_MSG_COUNT␉2␊ |
30 | #endif␉/* host_security_MSG_COUNT */␊ |
31 | ␊ |
32 | #include <mach/std_types.h>␊ |
33 | #include <mach/mig.h>␊ |
34 | #include <mach/mach_types.h>␊ |
35 | ␊ |
36 | #ifdef __BeforeMigUserHeader␊ |
37 | __BeforeMigUserHeader␊ |
38 | #endif /* __BeforeMigUserHeader */␊ |
39 | ␊ |
40 | #include <sys/cdefs.h>␊ |
41 | __BEGIN_DECLS␊ |
42 | ␊ |
43 | ␊ |
44 | /* Routine host_security_create_task_token */␊ |
45 | #ifdef␉mig_external␊ |
46 | mig_external␊ |
47 | #else␊ |
48 | extern␊ |
49 | #endif␉/* mig_external */␊ |
50 | kern_return_t host_security_create_task_token␊ |
51 | (␊ |
52 | ␉host_security_t host_security,␊ |
53 | ␉task_t parent_task,␊ |
54 | ␉security_token_t sec_token,␊ |
55 | ␉audit_token_t audit_token,␊ |
56 | ␉host_t host,␊ |
57 | ␉ledger_array_t ledgers,␊ |
58 | ␉mach_msg_type_number_t ledgersCnt,␊ |
59 | ␉boolean_t inherit_memory,␊ |
60 | ␉task_t *child_task␊ |
61 | );␊ |
62 | ␊ |
63 | /* Routine host_security_set_task_token */␊ |
64 | #ifdef␉mig_external␊ |
65 | mig_external␊ |
66 | #else␊ |
67 | extern␊ |
68 | #endif␉/* mig_external */␊ |
69 | kern_return_t host_security_set_task_token␊ |
70 | (␊ |
71 | ␉host_security_t host_security,␊ |
72 | ␉task_t target_task,␊ |
73 | ␉security_token_t sec_token,␊ |
74 | ␉audit_token_t audit_token,␊ |
75 | ␉host_t host␊ |
76 | );␊ |
77 | ␊ |
78 | __END_DECLS␊ |
79 | ␊ |
80 | /********************** Caution **************************/␊ |
81 | /* The following data types should be used to calculate */␊ |
82 | /* maximum message sizes only. The actual message may be */␊ |
83 | /* smaller, and the position of the arguments within the */␊ |
84 | /* message layout may vary from what is presented here. */␊ |
85 | /* For example, if any of the arguments are variable- */␊ |
86 | /* sized, and less than the maximum is sent, the data */␊ |
87 | /* will be packed tight in the actual message to reduce */␊ |
88 | /* the presence of holes. */␊ |
89 | /********************** Caution **************************/␊ |
90 | ␊ |
91 | /* typedefs for all requests */␊ |
92 | ␊ |
93 | #ifndef __Request__host_security_subsystem__defined␊ |
94 | #define __Request__host_security_subsystem__defined␊ |
95 | ␊ |
96 | #ifdef __MigPackStructs␊ |
97 | #pragma pack(4)␊ |
98 | #endif␊ |
99 | ␉typedef struct {␊ |
100 | ␉␉mach_msg_header_t Head;␊ |
101 | ␉␉/* start of the kernel processed data */␊ |
102 | ␉␉mach_msg_body_t msgh_body;␊ |
103 | ␉␉mach_msg_port_descriptor_t parent_task;␊ |
104 | ␉␉mach_msg_port_descriptor_t host;␊ |
105 | ␉␉mach_msg_ool_ports_descriptor_t ledgers;␊ |
106 | ␉␉/* end of the kernel processed data */␊ |
107 | ␉␉NDR_record_t NDR;␊ |
108 | ␉␉security_token_t sec_token;␊ |
109 | ␉␉audit_token_t audit_token;␊ |
110 | ␉␉mach_msg_type_number_t ledgersCnt;␊ |
111 | ␉␉boolean_t inherit_memory;␊ |
112 | ␉} __Request__host_security_create_task_token_t;␊ |
113 | #ifdef __MigPackStructs␊ |
114 | #pragma pack()␊ |
115 | #endif␊ |
116 | ␊ |
117 | #ifdef __MigPackStructs␊ |
118 | #pragma pack(4)␊ |
119 | #endif␊ |
120 | ␉typedef struct {␊ |
121 | ␉␉mach_msg_header_t Head;␊ |
122 | ␉␉/* start of the kernel processed data */␊ |
123 | ␉␉mach_msg_body_t msgh_body;␊ |
124 | ␉␉mach_msg_port_descriptor_t target_task;␊ |
125 | ␉␉mach_msg_port_descriptor_t host;␊ |
126 | ␉␉/* end of the kernel processed data */␊ |
127 | ␉␉NDR_record_t NDR;␊ |
128 | ␉␉security_token_t sec_token;␊ |
129 | ␉␉audit_token_t audit_token;␊ |
130 | ␉} __Request__host_security_set_task_token_t;␊ |
131 | #ifdef __MigPackStructs␊ |
132 | #pragma pack()␊ |
133 | #endif␊ |
134 | #endif /* !__Request__host_security_subsystem__defined */␊ |
135 | ␊ |
136 | /* union of all requests */␊ |
137 | ␊ |
138 | #ifndef __RequestUnion__host_security_subsystem__defined␊ |
139 | #define __RequestUnion__host_security_subsystem__defined␊ |
140 | union __RequestUnion__host_security_subsystem {␊ |
141 | ␉__Request__host_security_create_task_token_t Request_host_security_create_task_token;␊ |
142 | ␉__Request__host_security_set_task_token_t Request_host_security_set_task_token;␊ |
143 | };␊ |
144 | #endif /* !__RequestUnion__host_security_subsystem__defined */␊ |
145 | /* typedefs for all replies */␊ |
146 | ␊ |
147 | #ifndef __Reply__host_security_subsystem__defined␊ |
148 | #define __Reply__host_security_subsystem__defined␊ |
149 | ␊ |
150 | #ifdef __MigPackStructs␊ |
151 | #pragma pack(4)␊ |
152 | #endif␊ |
153 | ␉typedef struct {␊ |
154 | ␉␉mach_msg_header_t Head;␊ |
155 | ␉␉/* start of the kernel processed data */␊ |
156 | ␉␉mach_msg_body_t msgh_body;␊ |
157 | ␉␉mach_msg_port_descriptor_t child_task;␊ |
158 | ␉␉/* end of the kernel processed data */␊ |
159 | ␉} __Reply__host_security_create_task_token_t;␊ |
160 | #ifdef __MigPackStructs␊ |
161 | #pragma pack()␊ |
162 | #endif␊ |
163 | ␊ |
164 | #ifdef __MigPackStructs␊ |
165 | #pragma pack(4)␊ |
166 | #endif␊ |
167 | ␉typedef struct {␊ |
168 | ␉␉mach_msg_header_t Head;␊ |
169 | ␉␉NDR_record_t NDR;␊ |
170 | ␉␉kern_return_t RetCode;␊ |
171 | ␉} __Reply__host_security_set_task_token_t;␊ |
172 | #ifdef __MigPackStructs␊ |
173 | #pragma pack()␊ |
174 | #endif␊ |
175 | #endif /* !__Reply__host_security_subsystem__defined */␊ |
176 | ␊ |
177 | /* union of all replies */␊ |
178 | ␊ |
179 | #ifndef __ReplyUnion__host_security_subsystem__defined␊ |
180 | #define __ReplyUnion__host_security_subsystem__defined␊ |
181 | union __ReplyUnion__host_security_subsystem {␊ |
182 | ␉__Reply__host_security_create_task_token_t Reply_host_security_create_task_token;␊ |
183 | ␉__Reply__host_security_set_task_token_t Reply_host_security_set_task_token;␊ |
184 | };␊ |
185 | #endif /* !__RequestUnion__host_security_subsystem__defined */␊ |
186 | ␊ |
187 | #ifndef subsystem_to_name_map_host_security␊ |
188 | #define subsystem_to_name_map_host_security \␊ |
189 | { "host_security_create_task_token", 600 },\␊ |
190 | { "host_security_set_task_token", 601 }␊ |
191 | #endif␊ |
192 | ␊ |
193 | #ifdef __AfterMigUserHeader␊ |
194 | __AfterMigUserHeader␊ |
195 | #endif /* __AfterMigUserHeader */␊ |
196 | ␊ |
197 | #endif␉ /* _host_security_user_ */␊ |
198 | |