1 | /* |
2 | * IDENTIFICATION: |
3 | * stub generated by bootstrap_cmds-133 |
4 | * OPTIONS: |
5 | * KernelServer |
6 | */ |
7 | |
8 | /* Module mach_voucher */ |
9 | |
10 | #define __MIG_check__Request__mach_voucher_subsystem__ 1 |
11 | |
12 | #include "mach_voucher_server.h" |
13 | |
14 | #ifndef mig_internal |
15 | #define mig_internal static __inline__ |
16 | #endif /* mig_internal */ |
17 | |
18 | #ifndef mig_external |
19 | #define mig_external |
20 | #endif /* mig_external */ |
21 | |
22 | #if !defined(__MigTypeCheck) && defined(TypeCheck) |
23 | #define __MigTypeCheck TypeCheck /* Legacy setting */ |
24 | #endif /* !defined(__MigTypeCheck) */ |
25 | |
26 | #if !defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_) |
27 | #define __MigKernelSpecificCode _MIG_KERNEL_SPECIFIC_CODE_ /* Legacy setting */ |
28 | #endif /* !defined(__MigKernelSpecificCode) */ |
29 | |
30 | #ifndef LimitCheck |
31 | #define LimitCheck 0 |
32 | #endif /* LimitCheck */ |
33 | |
34 | #ifndef min |
35 | #define min(a,b) ( ((a) < (b))? (a): (b) ) |
36 | #endif /* min */ |
37 | |
38 | #if !defined(_WALIGN_) |
39 | #define _WALIGN_(x) (((x) + 3) & ~3) |
40 | #endif /* !defined(_WALIGN_) */ |
41 | |
42 | #if !defined(_WALIGNSZ_) |
43 | #define _WALIGNSZ_(x) _WALIGN_(sizeof(x)) |
44 | #endif /* !defined(_WALIGNSZ_) */ |
45 | |
46 | #ifndef UseStaticTemplates |
47 | #define UseStaticTemplates 0 |
48 | #endif /* UseStaticTemplates */ |
49 | |
50 | #ifndef MIG_SERVER_ROUTINE |
51 | #define MIG_SERVER_ROUTINE |
52 | #endif |
53 | |
54 | #ifndef __DeclareRcvRpc |
55 | #define __DeclareRcvRpc(_NUM_, _NAME_) |
56 | #endif /* __DeclareRcvRpc */ |
57 | |
58 | #ifndef __BeforeRcvRpc |
59 | #define __BeforeRcvRpc(_NUM_, _NAME_) |
60 | #endif /* __BeforeRcvRpc */ |
61 | |
62 | #ifndef __AfterRcvRpc |
63 | #define __AfterRcvRpc(_NUM_, _NAME_) |
64 | #endif /* __AfterRcvRpc */ |
65 | |
66 | #ifndef __DeclareRcvSimple |
67 | #define __DeclareRcvSimple(_NUM_, _NAME_) |
68 | #endif /* __DeclareRcvSimple */ |
69 | |
70 | #ifndef __BeforeRcvSimple |
71 | #define __BeforeRcvSimple(_NUM_, _NAME_) |
72 | #endif /* __BeforeRcvSimple */ |
73 | |
74 | #ifndef __AfterRcvSimple |
75 | #define __AfterRcvSimple(_NUM_, _NAME_) |
76 | #endif /* __AfterRcvSimple */ |
77 | |
78 | #define novalue void |
79 | |
80 | #if __MigKernelSpecificCode |
81 | #define msgh_request_port msgh_remote_port |
82 | #define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_REMOTE(bits) |
83 | #define msgh_reply_port msgh_local_port |
84 | #define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_LOCAL(bits) |
85 | #else |
86 | #define msgh_request_port msgh_local_port |
87 | #define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_LOCAL(bits) |
88 | #define msgh_reply_port msgh_remote_port |
89 | #define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_REMOTE(bits) |
90 | #endif /* __MigKernelSpecificCode */ |
91 | |
92 | #define MIG_RETURN_ERROR(X, code) {\ |
93 | ((mig_reply_error_t *)X)->RetCode = code;\ |
94 | ((mig_reply_error_t *)X)->NDR = NDR_record;\ |
95 | return;\ |
96 | } |
97 | |
98 | /* Forward Declarations */ |
99 | |
100 | |
101 | mig_internal novalue _Xmach_voucher_extract_attr_content |
102 | (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP); |
103 | |
104 | mig_internal novalue _Xmach_voucher_extract_attr_recipe |
105 | (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP); |
106 | |
107 | mig_internal novalue _Xmach_voucher_extract_all_attr_recipes |
108 | (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP); |
109 | |
110 | mig_internal novalue _Xmach_voucher_attr_command |
111 | (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP); |
112 | |
113 | mig_internal novalue _Xmach_voucher_debug_info |
114 | (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP); |
115 | |
116 | |
117 | #if ( __MigTypeCheck ) |
118 | #if __MIG_check__Request__mach_voucher_subsystem__ |
119 | #if !defined(__MIG_check__Request__mach_voucher_extract_attr_content_t__defined) |
120 | #define |
121 | |
122 | mig_internal kern_return_t ( |
123 | __attribute__((__unused__)) __RequestKData__mach_voucher_extract_attr_content_t *InKP, |
124 | __attribute__((__unused__)) __RequestUData__mach_voucher_extract_attr_content_t *In0UP, |
125 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP) |
126 | { |
127 | |
128 | typedef __Request__mach_voucher_extract_attr_content_t __Request; |
129 | typedef __RequestUData__mach_voucher_extract_attr_content_t __RequestU __attribute__((unused)); |
130 | #if __MigTypeCheck |
131 | if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
132 | (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
133 | return MIG_BAD_ARGUMENTS; |
134 | #endif /* __MigTypeCheck */ |
135 | |
136 | return MACH_MSG_SUCCESS; |
137 | } |
138 | #endif /* !defined(__MIG_check__Request__mach_voucher_extract_attr_content_t__defined) */ |
139 | #endif /* __MIG_check__Request__mach_voucher_subsystem__ */ |
140 | #endif /* ( __MigTypeCheck ) */ |
141 | |
142 | |
143 | /* Routine mach_voucher_extract_attr_content */ |
144 | mig_internal novalue |
145 | (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP, |
146 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP, |
147 | mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP) |
148 | { |
149 | |
150 | #ifdef __MigPackStructs |
151 | #pragma pack(push, 4) |
152 | #endif |
153 | typedef struct { |
154 | NDR_record_t NDR; |
155 | mach_voucher_attr_key_t key; |
156 | mach_msg_type_number_t contentCnt; |
157 | mach_msg_trailer_t trailer; |
158 | char padding[0]; /* Avoid generating empty UData structs */ |
159 | } RequestU __attribute__((unused)); |
160 | #ifdef __MigPackStructs |
161 | #pragma pack(pop) |
162 | #endif |
163 | typedef __RequestKData__mach_voucher_extract_attr_content_t RequestK; |
164 | typedef __RequestUData__mach_voucher_extract_attr_content_t __RequestU; |
165 | typedef __ReplyKData__mach_voucher_extract_attr_content_t ReplyK __attribute__((unused)); |
166 | typedef __ReplyUData__mach_voucher_extract_attr_content_t ReplyU __attribute__((unused)); |
167 | typedef __Reply__mach_voucher_extract_attr_content_t Reply __attribute__((unused)); |
168 | typedef __Request__mach_voucher_extract_attr_content_t __Request __attribute__((unused)); |
169 | |
170 | /* |
171 | * typedef struct { |
172 | * mach_msg_header_t Head; |
173 | * NDR_record_t NDR; |
174 | * kern_return_t RetCode; |
175 | * } mig_reply_error_t; |
176 | */ |
177 | |
178 | RequestK *InKP = (RequestK *) InHeadP; |
179 | RequestU *In0UP = (RequestU *) InDataP; |
180 | ReplyK *OutKP = (ReplyK *) OutHeadP; |
181 | ReplyU *OutUP = (ReplyU *) OutDataP; |
182 | (void)OutUP; |
183 | #ifdef __MIG_check__Request__mach_voucher_extract_attr_content_t__defined |
184 | kern_return_t check_result; |
185 | #endif /* __MIG_check__Request__mach_voucher_extract_attr_content_t__defined */ |
186 | |
187 | #if __MigKernelSpecificCode |
188 | #else |
189 | #endif /* __MigKernelSpecificCode */ |
190 | ipc_voucher_t voucher; |
191 | |
192 | __DeclareRcvRpc(5400, "mach_voucher_extract_attr_content" ) |
193 | __BeforeRcvRpc(5400, "mach_voucher_extract_attr_content" ) |
194 | |
195 | #if defined(__MIG_check__Request__mach_voucher_extract_attr_content_t__defined) |
196 | check_result = __MIG_check__Request__mach_voucher_extract_attr_content_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP); |
197 | if (check_result != MACH_MSG_SUCCESS) |
198 | { MIG_RETURN_ERROR(OutKP, check_result); } |
199 | #endif /* defined(__MIG_check__Request__mach_voucher_extract_attr_content_t__defined) */ |
200 | |
201 | voucher = convert_port_to_voucher(port: InKP->Head.msgh_request_port); |
202 | |
203 | OutUP->contentCnt = 4096; |
204 | if (In0UP->contentCnt < OutUP->contentCnt) |
205 | OutUP->contentCnt = In0UP->contentCnt; |
206 | |
207 | OutUP->RetCode = mach_voucher_extract_attr_content(voucher, key: In0UP->key, content: OutUP->content, contentCnt: &OutUP->contentCnt); |
208 | ipc_voucher_release(voucher); |
209 | if (OutUP->RetCode != KERN_SUCCESS) { |
210 | MIG_RETURN_ERROR(OutKP, OutUP->RetCode); |
211 | } |
212 | #if __MigKernelSpecificCode |
213 | #endif /* __MigKernelSpecificCode */ |
214 | |
215 | OutUP->NDR = NDR_record; |
216 | |
217 | OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 4096) + (_WALIGN_((OutUP->contentCnt + 3) & ~3)); |
218 | |
219 | __AfterRcvRpc(5400, "mach_voucher_extract_attr_content" ) |
220 | } |
221 | |
222 | #if ( __MigTypeCheck ) |
223 | #if __MIG_check__Request__mach_voucher_subsystem__ |
224 | #if !defined(__MIG_check__Request__mach_voucher_extract_attr_recipe_t__defined) |
225 | #define |
226 | |
227 | mig_internal kern_return_t ( |
228 | __attribute__((__unused__)) __RequestKData__mach_voucher_extract_attr_recipe_t *InKP, |
229 | __attribute__((__unused__)) __RequestUData__mach_voucher_extract_attr_recipe_t *In0UP, |
230 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP) |
231 | { |
232 | |
233 | typedef __Request__mach_voucher_extract_attr_recipe_t __Request; |
234 | typedef __RequestUData__mach_voucher_extract_attr_recipe_t __RequestU __attribute__((unused)); |
235 | #if __MigTypeCheck |
236 | if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
237 | (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
238 | return MIG_BAD_ARGUMENTS; |
239 | #endif /* __MigTypeCheck */ |
240 | |
241 | return MACH_MSG_SUCCESS; |
242 | } |
243 | #endif /* !defined(__MIG_check__Request__mach_voucher_extract_attr_recipe_t__defined) */ |
244 | #endif /* __MIG_check__Request__mach_voucher_subsystem__ */ |
245 | #endif /* ( __MigTypeCheck ) */ |
246 | |
247 | |
248 | /* Routine mach_voucher_extract_attr_recipe */ |
249 | mig_internal novalue |
250 | (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP, |
251 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP, |
252 | mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP) |
253 | { |
254 | |
255 | #ifdef __MigPackStructs |
256 | #pragma pack(push, 4) |
257 | #endif |
258 | typedef struct { |
259 | NDR_record_t NDR; |
260 | mach_voucher_attr_key_t key; |
261 | mach_msg_type_number_t recipeCnt; |
262 | mach_msg_trailer_t trailer; |
263 | char padding[0]; /* Avoid generating empty UData structs */ |
264 | } RequestU __attribute__((unused)); |
265 | #ifdef __MigPackStructs |
266 | #pragma pack(pop) |
267 | #endif |
268 | typedef __RequestKData__mach_voucher_extract_attr_recipe_t RequestK; |
269 | typedef __RequestUData__mach_voucher_extract_attr_recipe_t __RequestU; |
270 | typedef __ReplyKData__mach_voucher_extract_attr_recipe_t ReplyK __attribute__((unused)); |
271 | typedef __ReplyUData__mach_voucher_extract_attr_recipe_t ReplyU __attribute__((unused)); |
272 | typedef __Reply__mach_voucher_extract_attr_recipe_t Reply __attribute__((unused)); |
273 | typedef __Request__mach_voucher_extract_attr_recipe_t __Request __attribute__((unused)); |
274 | |
275 | /* |
276 | * typedef struct { |
277 | * mach_msg_header_t Head; |
278 | * NDR_record_t NDR; |
279 | * kern_return_t RetCode; |
280 | * } mig_reply_error_t; |
281 | */ |
282 | |
283 | RequestK *InKP = (RequestK *) InHeadP; |
284 | RequestU *In0UP = (RequestU *) InDataP; |
285 | ReplyK *OutKP = (ReplyK *) OutHeadP; |
286 | ReplyU *OutUP = (ReplyU *) OutDataP; |
287 | (void)OutUP; |
288 | #ifdef __MIG_check__Request__mach_voucher_extract_attr_recipe_t__defined |
289 | kern_return_t check_result; |
290 | #endif /* __MIG_check__Request__mach_voucher_extract_attr_recipe_t__defined */ |
291 | |
292 | #if __MigKernelSpecificCode |
293 | #else |
294 | #endif /* __MigKernelSpecificCode */ |
295 | ipc_voucher_t voucher; |
296 | |
297 | __DeclareRcvRpc(5401, "mach_voucher_extract_attr_recipe" ) |
298 | __BeforeRcvRpc(5401, "mach_voucher_extract_attr_recipe" ) |
299 | |
300 | #if defined(__MIG_check__Request__mach_voucher_extract_attr_recipe_t__defined) |
301 | check_result = __MIG_check__Request__mach_voucher_extract_attr_recipe_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP); |
302 | if (check_result != MACH_MSG_SUCCESS) |
303 | { MIG_RETURN_ERROR(OutKP, check_result); } |
304 | #endif /* defined(__MIG_check__Request__mach_voucher_extract_attr_recipe_t__defined) */ |
305 | |
306 | voucher = convert_port_to_voucher(port: InKP->Head.msgh_request_port); |
307 | |
308 | OutUP->recipeCnt = 4096; |
309 | if (In0UP->recipeCnt < OutUP->recipeCnt) |
310 | OutUP->recipeCnt = In0UP->recipeCnt; |
311 | |
312 | OutUP->RetCode = mach_voucher_extract_attr_recipe(voucher, key: In0UP->key, recipe: OutUP->recipe, recipeCnt: &OutUP->recipeCnt); |
313 | ipc_voucher_release(voucher); |
314 | if (OutUP->RetCode != KERN_SUCCESS) { |
315 | MIG_RETURN_ERROR(OutKP, OutUP->RetCode); |
316 | } |
317 | #if __MigKernelSpecificCode |
318 | #endif /* __MigKernelSpecificCode */ |
319 | |
320 | OutUP->NDR = NDR_record; |
321 | |
322 | OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 4096) + (_WALIGN_((OutUP->recipeCnt + 3) & ~3)); |
323 | |
324 | __AfterRcvRpc(5401, "mach_voucher_extract_attr_recipe" ) |
325 | } |
326 | |
327 | #if ( __MigTypeCheck ) |
328 | #if __MIG_check__Request__mach_voucher_subsystem__ |
329 | #if !defined(__MIG_check__Request__mach_voucher_extract_all_attr_recipes_t__defined) |
330 | #define |
331 | |
332 | mig_internal kern_return_t ( |
333 | __attribute__((__unused__)) __RequestKData__mach_voucher_extract_all_attr_recipes_t *InKP, |
334 | __attribute__((__unused__)) __RequestUData__mach_voucher_extract_all_attr_recipes_t *In0UP, |
335 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP) |
336 | { |
337 | |
338 | typedef __Request__mach_voucher_extract_all_attr_recipes_t __Request; |
339 | typedef __RequestUData__mach_voucher_extract_all_attr_recipes_t __RequestU __attribute__((unused)); |
340 | #if __MigTypeCheck |
341 | if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
342 | (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
343 | return MIG_BAD_ARGUMENTS; |
344 | #endif /* __MigTypeCheck */ |
345 | |
346 | return MACH_MSG_SUCCESS; |
347 | } |
348 | #endif /* !defined(__MIG_check__Request__mach_voucher_extract_all_attr_recipes_t__defined) */ |
349 | #endif /* __MIG_check__Request__mach_voucher_subsystem__ */ |
350 | #endif /* ( __MigTypeCheck ) */ |
351 | |
352 | |
353 | /* Routine mach_voucher_extract_all_attr_recipes */ |
354 | mig_internal novalue |
355 | (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP, |
356 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP, |
357 | mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP) |
358 | { |
359 | |
360 | #ifdef __MigPackStructs |
361 | #pragma pack(push, 4) |
362 | #endif |
363 | typedef struct { |
364 | NDR_record_t NDR; |
365 | mach_msg_type_number_t recipesCnt; |
366 | mach_msg_trailer_t trailer; |
367 | char padding[0]; /* Avoid generating empty UData structs */ |
368 | } RequestU __attribute__((unused)); |
369 | #ifdef __MigPackStructs |
370 | #pragma pack(pop) |
371 | #endif |
372 | typedef __RequestKData__mach_voucher_extract_all_attr_recipes_t RequestK; |
373 | typedef __RequestUData__mach_voucher_extract_all_attr_recipes_t __RequestU; |
374 | typedef __ReplyKData__mach_voucher_extract_all_attr_recipes_t ReplyK __attribute__((unused)); |
375 | typedef __ReplyUData__mach_voucher_extract_all_attr_recipes_t ReplyU __attribute__((unused)); |
376 | typedef __Reply__mach_voucher_extract_all_attr_recipes_t Reply __attribute__((unused)); |
377 | typedef __Request__mach_voucher_extract_all_attr_recipes_t __Request __attribute__((unused)); |
378 | |
379 | /* |
380 | * typedef struct { |
381 | * mach_msg_header_t Head; |
382 | * NDR_record_t NDR; |
383 | * kern_return_t RetCode; |
384 | * } mig_reply_error_t; |
385 | */ |
386 | |
387 | RequestK *InKP = (RequestK *) InHeadP; |
388 | RequestU *In0UP = (RequestU *) InDataP; |
389 | ReplyK *OutKP = (ReplyK *) OutHeadP; |
390 | ReplyU *OutUP = (ReplyU *) OutDataP; |
391 | (void)OutUP; |
392 | #ifdef __MIG_check__Request__mach_voucher_extract_all_attr_recipes_t__defined |
393 | kern_return_t check_result; |
394 | #endif /* __MIG_check__Request__mach_voucher_extract_all_attr_recipes_t__defined */ |
395 | |
396 | #if __MigKernelSpecificCode |
397 | #else |
398 | #endif /* __MigKernelSpecificCode */ |
399 | ipc_voucher_t voucher; |
400 | |
401 | __DeclareRcvRpc(5402, "mach_voucher_extract_all_attr_recipes" ) |
402 | __BeforeRcvRpc(5402, "mach_voucher_extract_all_attr_recipes" ) |
403 | |
404 | #if defined(__MIG_check__Request__mach_voucher_extract_all_attr_recipes_t__defined) |
405 | check_result = __MIG_check__Request__mach_voucher_extract_all_attr_recipes_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP); |
406 | if (check_result != MACH_MSG_SUCCESS) |
407 | { MIG_RETURN_ERROR(OutKP, check_result); } |
408 | #endif /* defined(__MIG_check__Request__mach_voucher_extract_all_attr_recipes_t__defined) */ |
409 | |
410 | voucher = convert_port_to_voucher(port: InKP->Head.msgh_request_port); |
411 | |
412 | OutUP->recipesCnt = 5120; |
413 | if (In0UP->recipesCnt < OutUP->recipesCnt) |
414 | OutUP->recipesCnt = In0UP->recipesCnt; |
415 | |
416 | OutUP->RetCode = mach_voucher_extract_all_attr_recipes(voucher, recipes: OutUP->recipes, recipesCnt: &OutUP->recipesCnt); |
417 | ipc_voucher_release(voucher); |
418 | if (OutUP->RetCode != KERN_SUCCESS) { |
419 | MIG_RETURN_ERROR(OutKP, OutUP->RetCode); |
420 | } |
421 | #if __MigKernelSpecificCode |
422 | #endif /* __MigKernelSpecificCode */ |
423 | |
424 | OutUP->NDR = NDR_record; |
425 | |
426 | OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 5120) + (_WALIGN_((OutUP->recipesCnt + 3) & ~3)); |
427 | |
428 | __AfterRcvRpc(5402, "mach_voucher_extract_all_attr_recipes" ) |
429 | } |
430 | |
431 | #if ( __MigTypeCheck ) |
432 | #if __MIG_check__Request__mach_voucher_subsystem__ |
433 | #if !defined(__MIG_check__Request__mach_voucher_attr_command_t__defined) |
434 | #define __MIG_check__Request__mach_voucher_attr_command_t__defined |
435 | |
436 | mig_internal kern_return_t __MIG_check__Request__mach_voucher_attr_command_t( |
437 | __attribute__((__unused__)) __RequestKData__mach_voucher_attr_command_t *InKP, |
438 | __attribute__((__unused__)) __RequestUData__mach_voucher_attr_command_t *In0UP, |
439 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP, |
440 | __attribute__((__unused__)) __RequestUData__mach_voucher_attr_command_t **In1UPP) |
441 | { |
442 | |
443 | typedef __Request__mach_voucher_attr_command_t __Request; |
444 | typedef __RequestUData__mach_voucher_attr_command_t __RequestU __attribute__((unused)); |
445 | __RequestU *In1UP; |
446 | #if __MigTypeCheck |
447 | unsigned int msgh_size; |
448 | #endif /* __MigTypeCheck */ |
449 | unsigned int msgh_size_delta; |
450 | |
451 | #if __MigTypeCheck |
452 | msgh_size = InKP->Head.msgh_size; |
453 | if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
454 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4096)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
455 | return MIG_BAD_ARGUMENTS; |
456 | #endif /* __MigTypeCheck */ |
457 | |
458 | #if defined(__NDR_convert__int_rep__Request__mach_voucher_attr_command_t__in_contentCnt__defined) |
459 | if (In0UP->NDR.int_rep != NDR_record.int_rep) |
460 | __NDR_convert__int_rep__Request__mach_voucher_attr_command_t__in_contentCnt(&In0UP->in_contentCnt, In0UP->NDR.int_rep); |
461 | #endif /* __NDR_convert__int_rep__Request__mach_voucher_attr_command_t__in_contentCnt__defined */ |
462 | msgh_size_delta = _WALIGN_(In0UP->in_contentCnt); |
463 | #if __MigTypeCheck |
464 | if (In0UP->in_contentCnt > 4096) |
465 | return MIG_BAD_ARGUMENTS; |
466 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4096)) < In0UP->in_contentCnt) || |
467 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4096) + _WALIGN_(In0UP->in_contentCnt))) |
468 | return MIG_BAD_ARGUMENTS; |
469 | #endif /* __MigTypeCheck */ |
470 | |
471 | *In1UPP = In1UP = (__RequestU *) ((pointer_t) In0UP + msgh_size_delta - 4096); |
472 | |
473 | return MACH_MSG_SUCCESS; |
474 | } |
475 | #endif /* !defined(__MIG_check__Request__mach_voucher_attr_command_t__defined) */ |
476 | #endif /* __MIG_check__Request__mach_voucher_subsystem__ */ |
477 | #endif /* ( __MigTypeCheck ) */ |
478 | |
479 | |
480 | /* Routine mach_voucher_attr_command */ |
481 | mig_internal novalue _Xmach_voucher_attr_command |
482 | (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP, |
483 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP, |
484 | mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP) |
485 | { |
486 | |
487 | #ifdef __MigPackStructs |
488 | #pragma pack(push, 4) |
489 | #endif |
490 | typedef struct { |
491 | NDR_record_t NDR; |
492 | mach_voucher_attr_key_t key; |
493 | mach_voucher_attr_command_t command; |
494 | mach_msg_type_number_t in_contentCnt; |
495 | uint8_t in_content[4096]; |
496 | mach_msg_type_number_t out_contentCnt; |
497 | mach_msg_trailer_t trailer; |
498 | char padding[0]; /* Avoid generating empty UData structs */ |
499 | } RequestU __attribute__((unused)); |
500 | #ifdef __MigPackStructs |
501 | #pragma pack(pop) |
502 | #endif |
503 | typedef __RequestKData__mach_voucher_attr_command_t RequestK; |
504 | typedef __RequestUData__mach_voucher_attr_command_t __RequestU; |
505 | typedef __ReplyKData__mach_voucher_attr_command_t ReplyK __attribute__((unused)); |
506 | typedef __ReplyUData__mach_voucher_attr_command_t ReplyU __attribute__((unused)); |
507 | typedef __Reply__mach_voucher_attr_command_t Reply __attribute__((unused)); |
508 | typedef __Request__mach_voucher_attr_command_t __Request __attribute__((unused)); |
509 | |
510 | /* |
511 | * typedef struct { |
512 | * mach_msg_header_t Head; |
513 | * NDR_record_t NDR; |
514 | * kern_return_t RetCode; |
515 | * } mig_reply_error_t; |
516 | */ |
517 | |
518 | RequestK *InKP = (RequestK *) InHeadP; |
519 | RequestU *In0UP = (RequestU *) InDataP; |
520 | RequestU *In1UP; |
521 | ReplyK *OutKP = (ReplyK *) OutHeadP; |
522 | ReplyU *OutUP = (ReplyU *) OutDataP; |
523 | (void)OutUP; |
524 | #ifdef __MIG_check__Request__mach_voucher_attr_command_t__defined |
525 | kern_return_t check_result; |
526 | #endif /* __MIG_check__Request__mach_voucher_attr_command_t__defined */ |
527 | |
528 | #if __MigKernelSpecificCode |
529 | #else |
530 | #endif /* __MigKernelSpecificCode */ |
531 | ipc_voucher_t voucher; |
532 | |
533 | __DeclareRcvRpc(5403, "mach_voucher_attr_command" ) |
534 | __BeforeRcvRpc(5403, "mach_voucher_attr_command" ) |
535 | |
536 | #if defined(__MIG_check__Request__mach_voucher_attr_command_t__defined) |
537 | check_result = __MIG_check__Request__mach_voucher_attr_command_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP, In1UPP: (__RequestU **)&In1UP); |
538 | if (check_result != MACH_MSG_SUCCESS) |
539 | { MIG_RETURN_ERROR(OutKP, check_result); } |
540 | #endif /* defined(__MIG_check__Request__mach_voucher_attr_command_t__defined) */ |
541 | |
542 | voucher = convert_port_to_voucher(port: InKP->Head.msgh_request_port); |
543 | |
544 | OutUP->out_contentCnt = 4096; |
545 | if (In1UP->out_contentCnt < OutUP->out_contentCnt) |
546 | OutUP->out_contentCnt = In1UP->out_contentCnt; |
547 | |
548 | OutUP->RetCode = mach_voucher_attr_command(voucher, key: In0UP->key, command: In0UP->command, in_content: In0UP->in_content, in_contentCnt: In0UP->in_contentCnt, out_content: OutUP->out_content, out_contentCnt: &OutUP->out_contentCnt); |
549 | ipc_voucher_release(voucher); |
550 | if (OutUP->RetCode != KERN_SUCCESS) { |
551 | MIG_RETURN_ERROR(OutKP, OutUP->RetCode); |
552 | } |
553 | #if __MigKernelSpecificCode |
554 | #endif /* __MigKernelSpecificCode */ |
555 | |
556 | OutUP->NDR = NDR_record; |
557 | |
558 | OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 4096) + (_WALIGN_((OutUP->out_contentCnt + 3) & ~3)); |
559 | |
560 | __AfterRcvRpc(5403, "mach_voucher_attr_command" ) |
561 | } |
562 | |
563 | #if ( __MigTypeCheck ) |
564 | #if __MIG_check__Request__mach_voucher_subsystem__ |
565 | #if !defined(__MIG_check__Request__mach_voucher_debug_info_t__defined) |
566 | #define __MIG_check__Request__mach_voucher_debug_info_t__defined |
567 | |
568 | mig_internal kern_return_t __MIG_check__Request__mach_voucher_debug_info_t( |
569 | __attribute__((__unused__)) __RequestKData__mach_voucher_debug_info_t *InKP, |
570 | __attribute__((__unused__)) __RequestUData__mach_voucher_debug_info_t *In0UP, |
571 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP) |
572 | { |
573 | |
574 | typedef __Request__mach_voucher_debug_info_t __Request; |
575 | typedef __RequestUData__mach_voucher_debug_info_t __RequestU __attribute__((unused)); |
576 | #if __MigTypeCheck |
577 | if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
578 | (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
579 | return MIG_BAD_ARGUMENTS; |
580 | #endif /* __MigTypeCheck */ |
581 | |
582 | return MACH_MSG_SUCCESS; |
583 | } |
584 | #endif /* !defined(__MIG_check__Request__mach_voucher_debug_info_t__defined) */ |
585 | #endif /* __MIG_check__Request__mach_voucher_subsystem__ */ |
586 | #endif /* ( __MigTypeCheck ) */ |
587 | |
588 | |
589 | /* Routine mach_voucher_debug_info */ |
590 | mig_internal novalue _Xmach_voucher_debug_info |
591 | (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP, |
592 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP, |
593 | mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP) |
594 | { |
595 | |
596 | #ifdef __MigPackStructs |
597 | #pragma pack(push, 4) |
598 | #endif |
599 | typedef struct { |
600 | NDR_record_t NDR; |
601 | mach_port_name_t voucher_name; |
602 | mach_msg_type_number_t recipesCnt; |
603 | mach_msg_trailer_t trailer; |
604 | char padding[0]; /* Avoid generating empty UData structs */ |
605 | } RequestU __attribute__((unused)); |
606 | #ifdef __MigPackStructs |
607 | #pragma pack(pop) |
608 | #endif |
609 | typedef __RequestKData__mach_voucher_debug_info_t RequestK; |
610 | typedef __RequestUData__mach_voucher_debug_info_t __RequestU; |
611 | typedef __ReplyKData__mach_voucher_debug_info_t ReplyK __attribute__((unused)); |
612 | typedef __ReplyUData__mach_voucher_debug_info_t ReplyU __attribute__((unused)); |
613 | typedef __Reply__mach_voucher_debug_info_t Reply __attribute__((unused)); |
614 | typedef __Request__mach_voucher_debug_info_t __Request __attribute__((unused)); |
615 | |
616 | /* |
617 | * typedef struct { |
618 | * mach_msg_header_t Head; |
619 | * NDR_record_t NDR; |
620 | * kern_return_t RetCode; |
621 | * } mig_reply_error_t; |
622 | */ |
623 | |
624 | RequestK *InKP = (RequestK *) InHeadP; |
625 | RequestU *In0UP = (RequestU *) InDataP; |
626 | ReplyK *OutKP = (ReplyK *) OutHeadP; |
627 | ReplyU *OutUP = (ReplyU *) OutDataP; |
628 | (void)OutUP; |
629 | #ifdef __MIG_check__Request__mach_voucher_debug_info_t__defined |
630 | kern_return_t check_result; |
631 | #endif /* __MIG_check__Request__mach_voucher_debug_info_t__defined */ |
632 | |
633 | #if __MigKernelSpecificCode |
634 | #else |
635 | #endif /* __MigKernelSpecificCode */ |
636 | ipc_space_read_t task; |
637 | |
638 | __DeclareRcvRpc(5404, "mach_voucher_debug_info" ) |
639 | __BeforeRcvRpc(5404, "mach_voucher_debug_info" ) |
640 | |
641 | #if defined(__MIG_check__Request__mach_voucher_debug_info_t__defined) |
642 | check_result = __MIG_check__Request__mach_voucher_debug_info_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP); |
643 | if (check_result != MACH_MSG_SUCCESS) |
644 | { MIG_RETURN_ERROR(OutKP, check_result); } |
645 | #endif /* defined(__MIG_check__Request__mach_voucher_debug_info_t__defined) */ |
646 | |
647 | task = convert_port_to_space_read(port: InKP->Head.msgh_request_port); |
648 | |
649 | OutUP->recipesCnt = 5120; |
650 | if (In0UP->recipesCnt < OutUP->recipesCnt) |
651 | OutUP->recipesCnt = In0UP->recipesCnt; |
652 | |
653 | OutUP->RetCode = mach_voucher_debug_info(task, voucher_name: In0UP->voucher_name, recipes: OutUP->recipes, recipesCnt: &OutUP->recipesCnt); |
654 | space_read_deallocate(space: task); |
655 | if (OutUP->RetCode != KERN_SUCCESS) { |
656 | MIG_RETURN_ERROR(OutKP, OutUP->RetCode); |
657 | } |
658 | #if __MigKernelSpecificCode |
659 | #endif /* __MigKernelSpecificCode */ |
660 | |
661 | OutUP->NDR = NDR_record; |
662 | |
663 | OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 5120) + (_WALIGN_((OutUP->recipesCnt + 3) & ~3)); |
664 | |
665 | __AfterRcvRpc(5404, "mach_voucher_debug_info" ) |
666 | } |
667 | |
668 | |
669 | |
670 | /* Description of this kernel subsystem, for use in direct RPC */ |
671 | const struct mach_voucher_subsystem mach_voucher_subsystem = { |
672 | mach_voucher_server_routine, |
673 | 5400, |
674 | 5405, |
675 | (mach_msg_size_t)sizeof(union __ReplyUnion__mach_voucher_subsystem), |
676 | (vm_address_t)0, |
677 | { |
678 | { (mig_impl_routine_t) 0, |
679 | (mig_stub_kern_routine_t) _Xmach_voucher_extract_attr_content, 4, 0, 0, (mach_msg_size_t)sizeof(__Reply__mach_voucher_extract_attr_content_t)}, |
680 | { .impl_routine: (mig_impl_routine_t) 0, |
681 | .kstub_routine: (mig_stub_kern_routine_t) _Xmach_voucher_extract_attr_recipe, .argc: 4, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__mach_voucher_extract_attr_recipe_t)}, |
682 | { .impl_routine: (mig_impl_routine_t) 0, |
683 | .kstub_routine: (mig_stub_kern_routine_t) _Xmach_voucher_extract_all_attr_recipes, .argc: 3, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__mach_voucher_extract_all_attr_recipes_t)}, |
684 | { .impl_routine: (mig_impl_routine_t) 0, |
685 | .kstub_routine: (mig_stub_kern_routine_t) _Xmach_voucher_attr_command, .argc: 7, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__mach_voucher_attr_command_t)}, |
686 | { .impl_routine: (mig_impl_routine_t) 0, |
687 | .kstub_routine: (mig_stub_kern_routine_t) _Xmach_voucher_debug_info, .argc: 4, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__mach_voucher_debug_info_t)}, |
688 | } |
689 | }; |
690 | |
691 | mig_external boolean_t mach_voucher_server |
692 | (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP) |
693 | { |
694 | /* |
695 | * typedef struct { |
696 | * mach_msg_header_t Head; |
697 | * NDR_record_t NDR; |
698 | * kern_return_t RetCode; |
699 | * } mig_reply_error_t; |
700 | */ |
701 | |
702 | mig_kern_routine_t routine; |
703 | |
704 | OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0); |
705 | OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port; |
706 | /* Minimal size: routine() will update it if different */ |
707 | OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t); |
708 | OutHeadP->msgh_local_port = MACH_PORT_NULL; |
709 | OutHeadP->msgh_id = InHeadP->msgh_id + 100; |
710 | OutHeadP->msgh_reserved = 0; |
711 | |
712 | if ((InHeadP->msgh_id > 5404) || (InHeadP->msgh_id < 5400) || |
713 | ((routine = mach_voucher_subsystem.kroutine[InHeadP->msgh_id - 5400].kstub_routine) == 0)) { |
714 | ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record; |
715 | ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID; |
716 | return FALSE; |
717 | } |
718 | (*routine) (InHeadP, InDataP, InTrailerP, OutHeadP, OutDataP); |
719 | return TRUE; |
720 | } |
721 | |
722 | mig_external mig_kern_routine_t mach_voucher_server_routine |
723 | (mach_msg_header_t *InHeadP) |
724 | { |
725 | int msgh_id; |
726 | |
727 | msgh_id = InHeadP->msgh_id - 5400; |
728 | |
729 | if ((msgh_id > 4) || (msgh_id < 0)) |
730 | return 0; |
731 | |
732 | return mach_voucher_subsystem.kroutine[msgh_id].kstub_routine; |
733 | } |
734 | |