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