File: | obj-scan-build/libnetfs/ioServer.c |
Location: | line 1052, column 2 |
Description: | Value stored to 'msgh_simple' is never read |
1 | /* Module io */ |
2 | |
3 | #ifndef _GNU_SOURCE1 |
4 | #define _GNU_SOURCE1 1 |
5 | #endif |
6 | |
7 | #define EXPORT_BOOLEAN |
8 | #include <mach/boolean.h> |
9 | #include <mach/kern_return.h> |
10 | #include <mach/message.h> |
11 | #include <mach/mig_errors.h> |
12 | #include <mach/mig_support.h> |
13 | |
14 | #ifndef mig_internalstatic |
15 | #define mig_internalstatic static |
16 | #endif |
17 | |
18 | #ifndef mig_external |
19 | #define mig_external |
20 | #endif |
21 | |
22 | #ifndef TypeCheck1 |
23 | #define TypeCheck1 1 |
24 | #endif |
25 | |
26 | #ifndef UseExternRCSId1 |
27 | #define UseExternRCSId1 1 |
28 | #endif |
29 | |
30 | #define BAD_TYPECHECK(type, check)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(type); _c.t = *(check); _t.w != _c.w; }) ({\ |
31 | union { mach_msg_type_t t; unsigned32_t w; } _t, _c;\ |
32 | _t.t = *(type); _c.t = *(check); _t.w != _c.w; }) |
33 | #define msgh_request_portmsgh_local_port msgh_local_port |
34 | #define MACH_MSGH_BITS_REQUEST(bits)(((bits) & 0x0000ff00) >> 8) MACH_MSGH_BITS_LOCAL(bits)(((bits) & 0x0000ff00) >> 8) |
35 | #define msgh_reply_portmsgh_remote_port msgh_remote_port |
36 | #define MACH_MSGH_BITS_REPLY(bits)((bits) & 0x000000ff) MACH_MSGH_BITS_REMOTE(bits)((bits) & 0x000000ff) |
37 | |
38 | #include <mach/std_types.h> |
39 | #include <mach/mach_types.h> |
40 | #include <device/device_types.h> |
41 | #include <device/net_status.h> |
42 | #include <sys/types.h> |
43 | #include <sys/stat.h> |
44 | #include <sys/statfs.h> |
45 | #include <sys/resource.h> |
46 | #include <sys/utsname.h> |
47 | #include <hurd/hurd_types.h> |
48 | #include "netfs.h" |
49 | #include "priv.h" |
50 | |
51 | /* Routine io_write */ |
52 | mig_internalstatic void _Xio_write |
53 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
54 | { |
55 | typedef struct { |
56 | mach_msg_header_t Head; |
57 | mach_msg_type_long_t dataType; |
58 | char data[2048]; |
59 | mach_msg_type_t offsetType; |
60 | loff_t offset; |
61 | } Request; |
62 | |
63 | typedef struct { |
64 | mach_msg_header_t Head; |
65 | mach_msg_type_t RetCodeType; |
66 | kern_return_t RetCode; |
67 | mach_msg_type_t amountType; |
68 | vm_size_t amount; |
69 | } Reply; |
70 | |
71 | Request *In0P = (Request *) InHeadP; |
72 | Request *In1P; |
73 | Reply *OutP = (Reply *) OutHeadP; |
74 | mig_external kern_return_t netfs_S_io_write |
75 | (protid_t io_object, data_t data, mach_msg_type_number_t dataCnt, loff_t offset, vm_size_t *amount); |
76 | |
77 | #if TypeCheck1 |
78 | boolean_t msgh_simple; |
79 | #endif /* TypeCheck */ |
80 | |
81 | unsigned int msgh_size; |
82 | unsigned int msgh_size_delta; |
83 | |
84 | const mach_msg_type_t offsetCheck = { |
85 | /* msgt_name = */ 11, |
86 | /* msgt_size = */ 64, |
87 | /* msgt_number = */ 1, |
88 | /* msgt_inline = */ TRUE((boolean_t) 1), |
89 | /* msgt_longform = */ FALSE((boolean_t) 0), |
90 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
91 | /* msgt_unused = */ 0 |
92 | }; |
93 | |
94 | const mach_msg_type_t amountType = { |
95 | /* msgt_name = */ 2, |
96 | /* msgt_size = */ 32, |
97 | /* msgt_number = */ 1, |
98 | /* msgt_inline = */ TRUE((boolean_t) 1), |
99 | /* msgt_longform = */ FALSE((boolean_t) 0), |
100 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
101 | /* msgt_unused = */ 0 |
102 | }; |
103 | |
104 | protid_t io_object; |
105 | |
106 | #if TypeCheck1 |
107 | msgh_size = In0P->Head.msgh_size; |
108 | msgh_simple = !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U); |
109 | if ((msgh_size < 48)) |
110 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
111 | #endif /* TypeCheck */ |
112 | |
113 | #if TypeCheck1 |
114 | if ((In0P->dataType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) || |
115 | (In0P->dataType.msgtl_name != 8) || |
116 | (In0P->dataType.msgtl_size != 8)) |
117 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
118 | #endif /* TypeCheck */ |
119 | |
120 | msgh_size_delta = (In0P->dataType.msgtl_header.msgt_inline) ? (In0P->dataType.msgtl_number + 3) & ~3 : sizeof(char *); |
121 | #if TypeCheck1 |
122 | if (msgh_size != 48 + msgh_size_delta) |
123 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
124 | #endif /* TypeCheck */ |
125 | |
126 | In1P = (Request *) ((char *) In0P + msgh_size_delta - 2048); |
127 | |
128 | #if TypeCheck1 |
129 | if (BAD_TYPECHECK(&In1P->offsetType, &offsetCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In1P->offsetType); _c.t = *(&offsetCheck); _t. w != _c.w; })) |
130 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
131 | #endif /* TypeCheck */ |
132 | |
133 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
134 | |
135 | OutP->RetCode = netfs_S_io_write(io_object, (In0P->dataType.msgtl_header.msgt_inline) ? In0P->data : *((char **)In0P->data), In0P->dataType.msgtl_number, In1P->offset, &OutP->amount); |
136 | if (OutP->RetCode == KERN_SUCCESS0) |
137 | if (!In0P->dataType.msgtl_header.msgt_inline) |
138 | __mig_deallocate(* (vm_offset_t *) In0P->data, In0P->dataType.msgtl_number); |
139 | end_using_protid_port(io_object); |
140 | if (OutP->RetCode != KERN_SUCCESS0) |
141 | return; |
142 | |
143 | OutP->Head.msgh_size = 40; |
144 | |
145 | OutP->amountType = amountType; |
146 | } |
147 | |
148 | /* Routine io_read */ |
149 | mig_internalstatic void _Xio_read |
150 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
151 | { |
152 | typedef struct { |
153 | mach_msg_header_t Head; |
154 | mach_msg_type_t offsetType; |
155 | loff_t offset; |
156 | mach_msg_type_t amountType; |
157 | vm_size_t amount; |
158 | } Request; |
159 | |
160 | typedef struct { |
161 | mach_msg_header_t Head; |
162 | mach_msg_type_t RetCodeType; |
163 | kern_return_t RetCode; |
164 | mach_msg_type_long_t dataType; |
165 | char data[2048]; |
166 | } Reply; |
167 | |
168 | Request *In0P = (Request *) InHeadP; |
169 | Reply *OutP = (Reply *) OutHeadP; |
170 | mig_external kern_return_t netfs_S_io_read |
171 | (protid_t io_object, data_t *data, mach_msg_type_number_t *dataCnt, loff_t offset, vm_size_t amount); |
172 | |
173 | boolean_t msgh_simple; |
174 | const mach_msg_type_t offsetCheck = { |
175 | /* msgt_name = */ 11, |
176 | /* msgt_size = */ 64, |
177 | /* msgt_number = */ 1, |
178 | /* msgt_inline = */ TRUE((boolean_t) 1), |
179 | /* msgt_longform = */ FALSE((boolean_t) 0), |
180 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
181 | /* msgt_unused = */ 0 |
182 | }; |
183 | |
184 | const mach_msg_type_t amountCheck = { |
185 | /* msgt_name = */ 2, |
186 | /* msgt_size = */ 32, |
187 | /* msgt_number = */ 1, |
188 | /* msgt_inline = */ TRUE((boolean_t) 1), |
189 | /* msgt_longform = */ FALSE((boolean_t) 0), |
190 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
191 | /* msgt_unused = */ 0 |
192 | }; |
193 | |
194 | const mach_msg_type_long_t dataType = { |
195 | { |
196 | /* msgt_name = */ 0, |
197 | /* msgt_size = */ 0, |
198 | /* msgt_number = */ 0, |
199 | /* msgt_inline = */ TRUE((boolean_t) 1), |
200 | /* msgt_longform = */ TRUE((boolean_t) 1), |
201 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
202 | /* msgt_unused = */ 0 |
203 | }, |
204 | /* msgtl_name = */ 8, |
205 | /* msgtl_size = */ 8, |
206 | /* msgtl_number = */ 2048, |
207 | }; |
208 | |
209 | protid_t io_object; |
210 | mach_msg_type_number_t dataCnt; |
211 | |
212 | char *dataP; |
213 | |
214 | #if TypeCheck1 |
215 | if ((In0P->Head.msgh_size != 44) || |
216 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
217 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
218 | #endif /* TypeCheck */ |
219 | |
220 | #if TypeCheck1 |
221 | if (BAD_TYPECHECK(&In0P->offsetType, &offsetCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->offsetType); _c.t = *(&offsetCheck); _t. w != _c.w; })) |
222 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
223 | #endif /* TypeCheck */ |
224 | |
225 | #if TypeCheck1 |
226 | if (BAD_TYPECHECK(&In0P->amountType, &amountCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->amountType); _c.t = *(&amountCheck); _t. w != _c.w; })) |
227 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
228 | #endif /* TypeCheck */ |
229 | |
230 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
231 | |
232 | dataP = OutP->data; |
233 | dataCnt = 2048; |
234 | |
235 | OutP->RetCode = netfs_S_io_read(io_object, &dataP, &dataCnt, In0P->offset, In0P->amount); |
236 | end_using_protid_port(io_object); |
237 | if (OutP->RetCode != KERN_SUCCESS0) |
238 | return; |
239 | |
240 | msgh_simple = TRUE((boolean_t) 1); |
241 | |
242 | OutP->dataType = dataType; |
243 | if (dataP != OutP->data) { |
244 | OutP->dataType.msgtl_header.msgt_inline = FALSE((boolean_t) 0); |
245 | OutP->dataType.msgtl_header.msgt_deallocate = TRUE((boolean_t) 1); |
246 | *((char **)OutP->data) = dataP; |
247 | msgh_simple = FALSE((boolean_t) 0); |
248 | } |
249 | |
250 | OutP->dataType.msgtl_number = dataCnt; |
251 | OutP->Head.msgh_size = 44 + ((OutP->dataType.msgtl_header.msgt_inline) ? (dataCnt + 3) & ~3 : sizeof(char *)); |
252 | |
253 | if (!msgh_simple) |
254 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
255 | } |
256 | |
257 | /* Routine io_seek */ |
258 | mig_internalstatic void _Xio_seek |
259 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
260 | { |
261 | typedef struct { |
262 | mach_msg_header_t Head; |
263 | mach_msg_type_t offsetType; |
264 | loff_t offset; |
265 | mach_msg_type_t whenceType; |
266 | int whence; |
267 | } Request; |
268 | |
269 | typedef struct { |
270 | mach_msg_header_t Head; |
271 | mach_msg_type_t RetCodeType; |
272 | kern_return_t RetCode; |
273 | mach_msg_type_t newpType; |
274 | loff_t newp; |
275 | } Reply; |
276 | |
277 | Request *In0P = (Request *) InHeadP; |
278 | Reply *OutP = (Reply *) OutHeadP; |
279 | mig_external kern_return_t netfs_S_io_seek |
280 | (protid_t io_object, loff_t offset, int whence, loff_t *newp); |
281 | |
282 | const mach_msg_type_t offsetCheck = { |
283 | /* msgt_name = */ 11, |
284 | /* msgt_size = */ 64, |
285 | /* msgt_number = */ 1, |
286 | /* msgt_inline = */ TRUE((boolean_t) 1), |
287 | /* msgt_longform = */ FALSE((boolean_t) 0), |
288 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
289 | /* msgt_unused = */ 0 |
290 | }; |
291 | |
292 | const mach_msg_type_t whenceCheck = { |
293 | /* msgt_name = */ 2, |
294 | /* msgt_size = */ 32, |
295 | /* msgt_number = */ 1, |
296 | /* msgt_inline = */ TRUE((boolean_t) 1), |
297 | /* msgt_longform = */ FALSE((boolean_t) 0), |
298 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
299 | /* msgt_unused = */ 0 |
300 | }; |
301 | |
302 | const mach_msg_type_t newpType = { |
303 | /* msgt_name = */ 11, |
304 | /* msgt_size = */ 64, |
305 | /* msgt_number = */ 1, |
306 | /* msgt_inline = */ TRUE((boolean_t) 1), |
307 | /* msgt_longform = */ FALSE((boolean_t) 0), |
308 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
309 | /* msgt_unused = */ 0 |
310 | }; |
311 | |
312 | protid_t io_object; |
313 | |
314 | #if TypeCheck1 |
315 | if ((In0P->Head.msgh_size != 44) || |
316 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
317 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
318 | #endif /* TypeCheck */ |
319 | |
320 | #if TypeCheck1 |
321 | if (BAD_TYPECHECK(&In0P->offsetType, &offsetCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->offsetType); _c.t = *(&offsetCheck); _t. w != _c.w; })) |
322 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
323 | #endif /* TypeCheck */ |
324 | |
325 | #if TypeCheck1 |
326 | if (BAD_TYPECHECK(&In0P->whenceType, &whenceCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->whenceType); _c.t = *(&whenceCheck); _t. w != _c.w; })) |
327 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
328 | #endif /* TypeCheck */ |
329 | |
330 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
331 | |
332 | OutP->RetCode = netfs_S_io_seek(io_object, In0P->offset, In0P->whence, &OutP->newp); |
333 | end_using_protid_port(io_object); |
334 | if (OutP->RetCode != KERN_SUCCESS0) |
335 | return; |
336 | |
337 | OutP->Head.msgh_size = 44; |
338 | |
339 | OutP->newpType = newpType; |
340 | } |
341 | |
342 | /* Routine io_readable */ |
343 | mig_internalstatic void _Xio_readable |
344 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
345 | { |
346 | typedef struct { |
347 | mach_msg_header_t Head; |
348 | } Request; |
349 | |
350 | typedef struct { |
351 | mach_msg_header_t Head; |
352 | mach_msg_type_t RetCodeType; |
353 | kern_return_t RetCode; |
354 | mach_msg_type_t amountType; |
355 | vm_size_t amount; |
356 | } Reply; |
357 | |
358 | Request *In0P = (Request *) InHeadP; |
359 | Reply *OutP = (Reply *) OutHeadP; |
360 | mig_external kern_return_t netfs_S_io_readable |
361 | (protid_t io_object, vm_size_t *amount); |
362 | |
363 | const mach_msg_type_t amountType = { |
364 | /* msgt_name = */ 2, |
365 | /* msgt_size = */ 32, |
366 | /* msgt_number = */ 1, |
367 | /* msgt_inline = */ TRUE((boolean_t) 1), |
368 | /* msgt_longform = */ FALSE((boolean_t) 0), |
369 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
370 | /* msgt_unused = */ 0 |
371 | }; |
372 | |
373 | protid_t io_object; |
374 | |
375 | #if TypeCheck1 |
376 | if ((In0P->Head.msgh_size != 24) || |
377 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
378 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
379 | #endif /* TypeCheck */ |
380 | |
381 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
382 | |
383 | OutP->RetCode = netfs_S_io_readable(io_object, &OutP->amount); |
384 | end_using_protid_port(io_object); |
385 | if (OutP->RetCode != KERN_SUCCESS0) |
386 | return; |
387 | |
388 | OutP->Head.msgh_size = 40; |
389 | |
390 | OutP->amountType = amountType; |
391 | } |
392 | |
393 | /* Routine io_set_all_openmodes */ |
394 | mig_internalstatic void _Xio_set_all_openmodes |
395 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
396 | { |
397 | typedef struct { |
398 | mach_msg_header_t Head; |
399 | mach_msg_type_t newbitsType; |
400 | int newbits; |
401 | } Request; |
402 | |
403 | typedef struct { |
404 | mach_msg_header_t Head; |
405 | mach_msg_type_t RetCodeType; |
406 | kern_return_t RetCode; |
407 | } Reply; |
408 | |
409 | Request *In0P = (Request *) InHeadP; |
410 | Reply *OutP = (Reply *) OutHeadP; |
411 | mig_external kern_return_t netfs_S_io_set_all_openmodes |
412 | (protid_t io_object, int newbits); |
413 | |
414 | const mach_msg_type_t newbitsCheck = { |
415 | /* msgt_name = */ 2, |
416 | /* msgt_size = */ 32, |
417 | /* msgt_number = */ 1, |
418 | /* msgt_inline = */ TRUE((boolean_t) 1), |
419 | /* msgt_longform = */ FALSE((boolean_t) 0), |
420 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
421 | /* msgt_unused = */ 0 |
422 | }; |
423 | |
424 | protid_t io_object; |
425 | |
426 | #if TypeCheck1 |
427 | if ((In0P->Head.msgh_size != 32) || |
428 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
429 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
430 | #endif /* TypeCheck */ |
431 | |
432 | #if TypeCheck1 |
433 | if (BAD_TYPECHECK(&In0P->newbitsType, &newbitsCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->newbitsType); _c.t = *(&newbitsCheck); _t .w != _c.w; })) |
434 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
435 | #endif /* TypeCheck */ |
436 | |
437 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
438 | |
439 | OutP->RetCode = netfs_S_io_set_all_openmodes(io_object, In0P->newbits); |
440 | end_using_protid_port(io_object); |
441 | } |
442 | |
443 | /* Routine io_get_openmodes */ |
444 | mig_internalstatic void _Xio_get_openmodes |
445 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
446 | { |
447 | typedef struct { |
448 | mach_msg_header_t Head; |
449 | } Request; |
450 | |
451 | typedef struct { |
452 | mach_msg_header_t Head; |
453 | mach_msg_type_t RetCodeType; |
454 | kern_return_t RetCode; |
455 | mach_msg_type_t bitsType; |
456 | int bits; |
457 | } Reply; |
458 | |
459 | Request *In0P = (Request *) InHeadP; |
460 | Reply *OutP = (Reply *) OutHeadP; |
461 | mig_external kern_return_t netfs_S_io_get_openmodes |
462 | (protid_t io_object, int *bits); |
463 | |
464 | const mach_msg_type_t bitsType = { |
465 | /* msgt_name = */ 2, |
466 | /* msgt_size = */ 32, |
467 | /* msgt_number = */ 1, |
468 | /* msgt_inline = */ TRUE((boolean_t) 1), |
469 | /* msgt_longform = */ FALSE((boolean_t) 0), |
470 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
471 | /* msgt_unused = */ 0 |
472 | }; |
473 | |
474 | protid_t io_object; |
475 | |
476 | #if TypeCheck1 |
477 | if ((In0P->Head.msgh_size != 24) || |
478 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
479 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
480 | #endif /* TypeCheck */ |
481 | |
482 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
483 | |
484 | OutP->RetCode = netfs_S_io_get_openmodes(io_object, &OutP->bits); |
485 | end_using_protid_port(io_object); |
486 | if (OutP->RetCode != KERN_SUCCESS0) |
487 | return; |
488 | |
489 | OutP->Head.msgh_size = 40; |
490 | |
491 | OutP->bitsType = bitsType; |
492 | } |
493 | |
494 | /* Routine io_set_some_openmodes */ |
495 | mig_internalstatic void _Xio_set_some_openmodes |
496 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
497 | { |
498 | typedef struct { |
499 | mach_msg_header_t Head; |
500 | mach_msg_type_t bits_to_setType; |
501 | int bits_to_set; |
502 | } Request; |
503 | |
504 | typedef struct { |
505 | mach_msg_header_t Head; |
506 | mach_msg_type_t RetCodeType; |
507 | kern_return_t RetCode; |
508 | } Reply; |
509 | |
510 | Request *In0P = (Request *) InHeadP; |
511 | Reply *OutP = (Reply *) OutHeadP; |
512 | mig_external kern_return_t netfs_S_io_set_some_openmodes |
513 | (protid_t io_object, int bits_to_set); |
514 | |
515 | const mach_msg_type_t bits_to_setCheck = { |
516 | /* msgt_name = */ 2, |
517 | /* msgt_size = */ 32, |
518 | /* msgt_number = */ 1, |
519 | /* msgt_inline = */ TRUE((boolean_t) 1), |
520 | /* msgt_longform = */ FALSE((boolean_t) 0), |
521 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
522 | /* msgt_unused = */ 0 |
523 | }; |
524 | |
525 | protid_t io_object; |
526 | |
527 | #if TypeCheck1 |
528 | if ((In0P->Head.msgh_size != 32) || |
529 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
530 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
531 | #endif /* TypeCheck */ |
532 | |
533 | #if TypeCheck1 |
534 | if (BAD_TYPECHECK(&In0P->bits_to_setType, &bits_to_setCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->bits_to_setType); _c.t = *(&bits_to_setCheck ); _t.w != _c.w; })) |
535 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
536 | #endif /* TypeCheck */ |
537 | |
538 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
539 | |
540 | OutP->RetCode = netfs_S_io_set_some_openmodes(io_object, In0P->bits_to_set); |
541 | end_using_protid_port(io_object); |
542 | } |
543 | |
544 | /* Routine io_clear_some_openmodes */ |
545 | mig_internalstatic void _Xio_clear_some_openmodes |
546 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
547 | { |
548 | typedef struct { |
549 | mach_msg_header_t Head; |
550 | mach_msg_type_t bits_to_clearType; |
551 | int bits_to_clear; |
552 | } Request; |
553 | |
554 | typedef struct { |
555 | mach_msg_header_t Head; |
556 | mach_msg_type_t RetCodeType; |
557 | kern_return_t RetCode; |
558 | } Reply; |
559 | |
560 | Request *In0P = (Request *) InHeadP; |
561 | Reply *OutP = (Reply *) OutHeadP; |
562 | mig_external kern_return_t netfs_S_io_clear_some_openmodes |
563 | (protid_t io_object, int bits_to_clear); |
564 | |
565 | const mach_msg_type_t bits_to_clearCheck = { |
566 | /* msgt_name = */ 2, |
567 | /* msgt_size = */ 32, |
568 | /* msgt_number = */ 1, |
569 | /* msgt_inline = */ TRUE((boolean_t) 1), |
570 | /* msgt_longform = */ FALSE((boolean_t) 0), |
571 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
572 | /* msgt_unused = */ 0 |
573 | }; |
574 | |
575 | protid_t io_object; |
576 | |
577 | #if TypeCheck1 |
578 | if ((In0P->Head.msgh_size != 32) || |
579 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
580 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
581 | #endif /* TypeCheck */ |
582 | |
583 | #if TypeCheck1 |
584 | if (BAD_TYPECHECK(&In0P->bits_to_clearType, &bits_to_clearCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->bits_to_clearType); _c.t = *(&bits_to_clearCheck ); _t.w != _c.w; })) |
585 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
586 | #endif /* TypeCheck */ |
587 | |
588 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
589 | |
590 | OutP->RetCode = netfs_S_io_clear_some_openmodes(io_object, In0P->bits_to_clear); |
591 | end_using_protid_port(io_object); |
592 | } |
593 | |
594 | /* Routine io_async */ |
595 | mig_internalstatic void _Xio_async |
596 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
597 | { |
598 | typedef struct { |
599 | mach_msg_header_t Head; |
600 | mach_msg_type_t notify_portType; |
601 | mach_port_t notify_port; |
602 | } Request; |
603 | |
604 | typedef struct { |
605 | mach_msg_header_t Head; |
606 | mach_msg_type_t RetCodeType; |
607 | kern_return_t RetCode; |
608 | mach_msg_type_t async_id_portType; |
609 | mach_port_t async_id_port; |
610 | } Reply; |
611 | |
612 | Request *In0P = (Request *) InHeadP; |
613 | Reply *OutP = (Reply *) OutHeadP; |
614 | mig_external kern_return_t netfs_S_io_async |
615 | (protid_t io_object, mach_port_t notify_port, mach_port_t *async_id_port, mach_msg_type_name_t *async_id_portPoly); |
616 | |
617 | boolean_t msgh_simple; |
618 | const mach_msg_type_t notify_portCheck = { |
619 | /* msgt_name = */ 17, |
620 | /* msgt_size = */ 32, |
621 | /* msgt_number = */ 1, |
622 | /* msgt_inline = */ TRUE((boolean_t) 1), |
623 | /* msgt_longform = */ FALSE((boolean_t) 0), |
624 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
625 | /* msgt_unused = */ 0 |
626 | }; |
627 | |
628 | const mach_msg_type_t async_id_portType = { |
629 | /* msgt_name = */ -1, |
630 | /* msgt_size = */ 32, |
631 | /* msgt_number = */ 1, |
632 | /* msgt_inline = */ TRUE((boolean_t) 1), |
633 | /* msgt_longform = */ FALSE((boolean_t) 0), |
634 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
635 | /* msgt_unused = */ 0 |
636 | }; |
637 | |
638 | protid_t io_object; |
639 | mach_msg_type_name_t async_id_portPoly; |
640 | |
641 | #if TypeCheck1 |
642 | if ((In0P->Head.msgh_size != 32) || |
643 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
644 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
645 | #endif /* TypeCheck */ |
646 | |
647 | #if TypeCheck1 |
648 | if (BAD_TYPECHECK(&In0P->notify_portType, ¬ify_portCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->notify_portType); _c.t = *(¬ify_portCheck ); _t.w != _c.w; })) |
649 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
650 | #endif /* TypeCheck */ |
651 | |
652 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
653 | |
654 | OutP->RetCode = netfs_S_io_async(io_object, In0P->notify_port, &OutP->async_id_port, &async_id_portPoly); |
655 | end_using_protid_port(io_object); |
656 | if (OutP->RetCode != KERN_SUCCESS0) |
657 | return; |
658 | |
659 | msgh_simple = TRUE((boolean_t) 1); |
660 | OutP->Head.msgh_size = 40; |
661 | |
662 | OutP->async_id_portType = async_id_portType; |
663 | |
664 | if (MACH_MSG_TYPE_PORT_ANY(async_id_portPoly)(((async_id_portPoly) >= 16) && ((async_id_portPoly ) <= 21))) |
665 | msgh_simple = FALSE((boolean_t) 0); |
666 | |
667 | OutP->async_id_portType.msgt_name = async_id_portPoly; |
668 | |
669 | if (!msgh_simple) |
670 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
671 | } |
672 | |
673 | /* Routine io_mod_owner */ |
674 | mig_internalstatic void _Xio_mod_owner |
675 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
676 | { |
677 | typedef struct { |
678 | mach_msg_header_t Head; |
679 | mach_msg_type_t ownerType; |
680 | pid_t owner; |
681 | } Request; |
682 | |
683 | typedef struct { |
684 | mach_msg_header_t Head; |
685 | mach_msg_type_t RetCodeType; |
686 | kern_return_t RetCode; |
687 | } Reply; |
688 | |
689 | Request *In0P = (Request *) InHeadP; |
690 | Reply *OutP = (Reply *) OutHeadP; |
691 | mig_external kern_return_t netfs_S_io_mod_owner |
692 | (protid_t io_object, pid_t owner); |
693 | |
694 | const mach_msg_type_t ownerCheck = { |
695 | /* msgt_name = */ 2, |
696 | /* msgt_size = */ 32, |
697 | /* msgt_number = */ 1, |
698 | /* msgt_inline = */ TRUE((boolean_t) 1), |
699 | /* msgt_longform = */ FALSE((boolean_t) 0), |
700 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
701 | /* msgt_unused = */ 0 |
702 | }; |
703 | |
704 | protid_t io_object; |
705 | |
706 | #if TypeCheck1 |
707 | if ((In0P->Head.msgh_size != 32) || |
708 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
709 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
710 | #endif /* TypeCheck */ |
711 | |
712 | #if TypeCheck1 |
713 | if (BAD_TYPECHECK(&In0P->ownerType, &ownerCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->ownerType); _c.t = *(&ownerCheck); _t.w != _c.w; })) |
714 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
715 | #endif /* TypeCheck */ |
716 | |
717 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
718 | |
719 | OutP->RetCode = netfs_S_io_mod_owner(io_object, In0P->owner); |
720 | end_using_protid_port(io_object); |
721 | } |
722 | |
723 | /* Routine io_get_owner */ |
724 | mig_internalstatic void _Xio_get_owner |
725 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
726 | { |
727 | typedef struct { |
728 | mach_msg_header_t Head; |
729 | } Request; |
730 | |
731 | typedef struct { |
732 | mach_msg_header_t Head; |
733 | mach_msg_type_t RetCodeType; |
734 | kern_return_t RetCode; |
735 | mach_msg_type_t ownerType; |
736 | pid_t owner; |
737 | } Reply; |
738 | |
739 | Request *In0P = (Request *) InHeadP; |
740 | Reply *OutP = (Reply *) OutHeadP; |
741 | mig_external kern_return_t netfs_S_io_get_owner |
742 | (protid_t io_object, pid_t *owner); |
743 | |
744 | const mach_msg_type_t ownerType = { |
745 | /* msgt_name = */ 2, |
746 | /* msgt_size = */ 32, |
747 | /* msgt_number = */ 1, |
748 | /* msgt_inline = */ TRUE((boolean_t) 1), |
749 | /* msgt_longform = */ FALSE((boolean_t) 0), |
750 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
751 | /* msgt_unused = */ 0 |
752 | }; |
753 | |
754 | protid_t io_object; |
755 | |
756 | #if TypeCheck1 |
757 | if ((In0P->Head.msgh_size != 24) || |
758 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
759 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
760 | #endif /* TypeCheck */ |
761 | |
762 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
763 | |
764 | OutP->RetCode = netfs_S_io_get_owner(io_object, &OutP->owner); |
765 | end_using_protid_port(io_object); |
766 | if (OutP->RetCode != KERN_SUCCESS0) |
767 | return; |
768 | |
769 | OutP->Head.msgh_size = 40; |
770 | |
771 | OutP->ownerType = ownerType; |
772 | } |
773 | |
774 | /* Routine io_get_icky_async_id */ |
775 | mig_internalstatic void _Xio_get_icky_async_id |
776 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
777 | { |
778 | typedef struct { |
779 | mach_msg_header_t Head; |
780 | } Request; |
781 | |
782 | typedef struct { |
783 | mach_msg_header_t Head; |
784 | mach_msg_type_t RetCodeType; |
785 | kern_return_t RetCode; |
786 | mach_msg_type_t icky_async_id_portType; |
787 | mach_port_t icky_async_id_port; |
788 | } Reply; |
789 | |
790 | Request *In0P = (Request *) InHeadP; |
791 | Reply *OutP = (Reply *) OutHeadP; |
792 | mig_external kern_return_t netfs_S_io_get_icky_async_id |
793 | (protid_t io_object, mach_port_t *icky_async_id_port, mach_msg_type_name_t *icky_async_id_portPoly); |
794 | |
795 | boolean_t msgh_simple; |
796 | const mach_msg_type_t icky_async_id_portType = { |
797 | /* msgt_name = */ -1, |
798 | /* msgt_size = */ 32, |
799 | /* msgt_number = */ 1, |
800 | /* msgt_inline = */ TRUE((boolean_t) 1), |
801 | /* msgt_longform = */ FALSE((boolean_t) 0), |
802 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
803 | /* msgt_unused = */ 0 |
804 | }; |
805 | |
806 | protid_t io_object; |
807 | mach_msg_type_name_t icky_async_id_portPoly; |
808 | |
809 | #if TypeCheck1 |
810 | if ((In0P->Head.msgh_size != 24) || |
811 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
812 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
813 | #endif /* TypeCheck */ |
814 | |
815 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
816 | |
817 | OutP->RetCode = netfs_S_io_get_icky_async_id(io_object, &OutP->icky_async_id_port, &icky_async_id_portPoly); |
818 | end_using_protid_port(io_object); |
819 | if (OutP->RetCode != KERN_SUCCESS0) |
820 | return; |
821 | |
822 | msgh_simple = TRUE((boolean_t) 1); |
823 | OutP->Head.msgh_size = 40; |
824 | |
825 | OutP->icky_async_id_portType = icky_async_id_portType; |
826 | |
827 | if (MACH_MSG_TYPE_PORT_ANY(icky_async_id_portPoly)(((icky_async_id_portPoly) >= 16) && ((icky_async_id_portPoly ) <= 21))) |
828 | msgh_simple = FALSE((boolean_t) 0); |
829 | |
830 | OutP->icky_async_id_portType.msgt_name = icky_async_id_portPoly; |
831 | |
832 | if (!msgh_simple) |
833 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
834 | } |
835 | |
836 | /* Routine io_select */ |
837 | mig_internalstatic void _Xio_select |
838 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
839 | { |
840 | typedef struct { |
841 | mach_msg_header_t Head; |
842 | mach_msg_type_t select_typeType; |
843 | int select_type; |
844 | } Request; |
845 | |
846 | typedef struct { |
847 | mach_msg_header_t Head; |
848 | mach_msg_type_t RetCodeType; |
849 | kern_return_t RetCode; |
850 | mach_msg_type_t select_typeType; |
851 | int select_type; |
852 | } Reply; |
853 | |
854 | Request *In0P = (Request *) InHeadP; |
855 | Reply *OutP = (Reply *) OutHeadP; |
856 | mig_external kern_return_t netfs_S_io_select |
857 | (protid_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, int *select_type); |
858 | |
859 | const mach_msg_type_t select_typeCheck = { |
860 | /* msgt_name = */ 2, |
861 | /* msgt_size = */ 32, |
862 | /* msgt_number = */ 1, |
863 | /* msgt_inline = */ TRUE((boolean_t) 1), |
864 | /* msgt_longform = */ FALSE((boolean_t) 0), |
865 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
866 | /* msgt_unused = */ 0 |
867 | }; |
868 | |
869 | const mach_msg_type_t select_typeType = { |
870 | /* msgt_name = */ 2, |
871 | /* msgt_size = */ 32, |
872 | /* msgt_number = */ 1, |
873 | /* msgt_inline = */ TRUE((boolean_t) 1), |
874 | /* msgt_longform = */ FALSE((boolean_t) 0), |
875 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
876 | /* msgt_unused = */ 0 |
877 | }; |
878 | |
879 | protid_t io_object; |
880 | |
881 | #if TypeCheck1 |
882 | if ((In0P->Head.msgh_size != 32) || |
883 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
884 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
885 | #endif /* TypeCheck */ |
886 | |
887 | #if TypeCheck1 |
888 | if (BAD_TYPECHECK(&In0P->select_typeType, &select_typeCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->select_typeType); _c.t = *(&select_typeCheck ); _t.w != _c.w; })) |
889 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
890 | #endif /* TypeCheck */ |
891 | |
892 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
893 | |
894 | OutP->RetCode = netfs_S_io_select(io_object, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &In0P->select_type); |
895 | end_using_protid_port(io_object); |
896 | if (OutP->RetCode != KERN_SUCCESS0) |
897 | return; |
898 | |
899 | OutP->Head.msgh_size = 40; |
900 | |
901 | OutP->select_typeType = select_typeType; |
902 | |
903 | OutP->select_type = In0P->select_type; |
904 | } |
905 | |
906 | /* Routine io_stat */ |
907 | mig_internalstatic void _Xio_stat |
908 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
909 | { |
910 | typedef struct { |
911 | mach_msg_header_t Head; |
912 | } Request; |
913 | |
914 | typedef struct { |
915 | mach_msg_header_t Head; |
916 | mach_msg_type_t RetCodeType; |
917 | kern_return_t RetCode; |
918 | mach_msg_type_t stat_infoType; |
919 | io_statbuf_t stat_info; |
920 | } Reply; |
921 | |
922 | Request *In0P = (Request *) InHeadP; |
923 | Reply *OutP = (Reply *) OutHeadP; |
924 | mig_external kern_return_t netfs_S_io_stat |
925 | (protid_t stat_object, io_statbuf_t *stat_info); |
926 | |
927 | const mach_msg_type_t stat_infoType = { |
928 | /* msgt_name = */ 2, |
929 | /* msgt_size = */ 32, |
930 | /* msgt_number = */ 32, |
931 | /* msgt_inline = */ TRUE((boolean_t) 1), |
932 | /* msgt_longform = */ FALSE((boolean_t) 0), |
933 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
934 | /* msgt_unused = */ 0 |
935 | }; |
936 | |
937 | protid_t stat_object; |
938 | |
939 | #if TypeCheck1 |
940 | if ((In0P->Head.msgh_size != 24) || |
941 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
942 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
943 | #endif /* TypeCheck */ |
944 | |
945 | stat_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
946 | |
947 | OutP->RetCode = netfs_S_io_stat(stat_object, &OutP->stat_info); |
948 | end_using_protid_port(stat_object); |
949 | if (OutP->RetCode != KERN_SUCCESS0) |
950 | return; |
951 | |
952 | OutP->Head.msgh_size = 164; |
953 | |
954 | OutP->stat_infoType = stat_infoType; |
955 | } |
956 | |
957 | /* SimpleRoutine io_reauthenticate */ |
958 | mig_internalstatic void _Xio_reauthenticate |
959 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
960 | { |
961 | typedef struct { |
962 | mach_msg_header_t Head; |
963 | mach_msg_type_t rendezvous2Type; |
964 | mach_port_t rendezvous2; |
965 | } Request; |
966 | |
967 | typedef struct { |
968 | mach_msg_header_t Head; |
969 | mach_msg_type_t RetCodeType; |
970 | kern_return_t RetCode; |
971 | } Reply; |
972 | |
973 | Request *In0P = (Request *) InHeadP; |
974 | Reply *OutP = (Reply *) OutHeadP; |
975 | mig_external kern_return_t netfs_S_io_reauthenticate |
976 | (protid_t auth_object, mach_port_t rendezvous2); |
977 | |
978 | const mach_msg_type_t rendezvous2Check = { |
979 | /* msgt_name = */ 17, |
980 | /* msgt_size = */ 32, |
981 | /* msgt_number = */ 1, |
982 | /* msgt_inline = */ TRUE((boolean_t) 1), |
983 | /* msgt_longform = */ FALSE((boolean_t) 0), |
984 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
985 | /* msgt_unused = */ 0 |
986 | }; |
987 | |
988 | protid_t auth_object; |
989 | |
990 | #if TypeCheck1 |
991 | if ((In0P->Head.msgh_size != 32) || |
992 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
993 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
994 | #endif /* TypeCheck */ |
995 | |
996 | #if TypeCheck1 |
997 | if (BAD_TYPECHECK(&In0P->rendezvous2Type, &rendezvous2Check)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->rendezvous2Type); _c.t = *(&rendezvous2Check ); _t.w != _c.w; })) |
998 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
999 | #endif /* TypeCheck */ |
1000 | |
1001 | auth_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1002 | |
1003 | OutP->RetCode = netfs_S_io_reauthenticate(auth_object, In0P->rendezvous2); |
1004 | end_using_protid_port(auth_object); |
1005 | } |
1006 | |
1007 | /* Routine io_restrict_auth */ |
1008 | mig_internalstatic void _Xio_restrict_auth |
1009 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1010 | { |
1011 | typedef struct { |
1012 | mach_msg_header_t Head; |
1013 | mach_msg_type_long_t uidsType; |
1014 | uid_t uids[512]; |
1015 | mach_msg_type_long_t gidsType; |
1016 | uid_t gids[512]; |
1017 | } Request; |
1018 | |
1019 | typedef struct { |
1020 | mach_msg_header_t Head; |
1021 | mach_msg_type_t RetCodeType; |
1022 | kern_return_t RetCode; |
1023 | mach_msg_type_t new_objectType; |
1024 | mach_port_t new_object; |
1025 | } Reply; |
1026 | |
1027 | Request *In0P = (Request *) InHeadP; |
1028 | Request *In1P; |
1029 | Reply *OutP = (Reply *) OutHeadP; |
1030 | mig_external kern_return_t netfs_S_io_restrict_auth |
1031 | (protid_t io_object, mach_port_t *new_object, mach_msg_type_name_t *new_objectPoly, idarray_t uids, mach_msg_type_number_t uidsCnt, idarray_t gids, mach_msg_type_number_t gidsCnt); |
1032 | |
1033 | boolean_t msgh_simple; |
1034 | unsigned int msgh_size; |
1035 | unsigned int msgh_size_delta; |
1036 | |
1037 | const mach_msg_type_t new_objectType = { |
1038 | /* msgt_name = */ -1, |
1039 | /* msgt_size = */ 32, |
1040 | /* msgt_number = */ 1, |
1041 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1042 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1043 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1044 | /* msgt_unused = */ 0 |
1045 | }; |
1046 | |
1047 | protid_t io_object; |
1048 | mach_msg_type_name_t new_objectPoly; |
1049 | |
1050 | #if TypeCheck1 |
1051 | msgh_size = In0P->Head.msgh_size; |
1052 | msgh_simple = !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U); |
Value stored to 'msgh_simple' is never read | |
1053 | if ((msgh_size < 48)) |
1054 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1055 | #endif /* TypeCheck */ |
1056 | |
1057 | #if TypeCheck1 |
1058 | if ((In0P->uidsType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) || |
1059 | (In0P->uidsType.msgtl_name != 2) || |
1060 | (In0P->uidsType.msgtl_size != 32)) |
1061 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1062 | #endif /* TypeCheck */ |
1063 | |
1064 | msgh_size_delta = (In0P->uidsType.msgtl_header.msgt_inline) ? 4 * In0P->uidsType.msgtl_number : sizeof(uid_t *); |
1065 | #if TypeCheck1 |
1066 | if (msgh_size < 48 + msgh_size_delta) |
1067 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1068 | msgh_size -= msgh_size_delta; |
1069 | #endif /* TypeCheck */ |
1070 | |
1071 | In1P = (Request *) ((char *) In0P + msgh_size_delta - 2048); |
1072 | |
1073 | #if TypeCheck1 |
1074 | if ((In1P->gidsType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) || |
1075 | (In1P->gidsType.msgtl_name != 2) || |
1076 | (In1P->gidsType.msgtl_size != 32)) |
1077 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1078 | #endif /* TypeCheck */ |
1079 | |
1080 | #if TypeCheck1 |
1081 | if (msgh_size != 48 + ((In1P->gidsType.msgtl_header.msgt_inline) ? 4 * In1P->gidsType.msgtl_number : sizeof(uid_t *))) |
1082 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1083 | #endif /* TypeCheck */ |
1084 | |
1085 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1086 | |
1087 | OutP->RetCode = netfs_S_io_restrict_auth(io_object, &OutP->new_object, &new_objectPoly, (In0P->uidsType.msgtl_header.msgt_inline) ? In0P->uids : *((uid_t **)In0P->uids), In0P->uidsType.msgtl_number, (In1P->gidsType.msgtl_header.msgt_inline) ? In1P->gids : *((uid_t **)In1P->gids), In1P->gidsType.msgtl_number); |
1088 | if (OutP->RetCode == KERN_SUCCESS0) |
1089 | if (!In1P->gidsType.msgtl_header.msgt_inline) |
1090 | __mig_deallocate(* (vm_offset_t *) In1P->gids, 4 * In1P->gidsType.msgtl_number); |
1091 | if (OutP->RetCode == KERN_SUCCESS0) |
1092 | if (!In0P->uidsType.msgtl_header.msgt_inline) |
1093 | __mig_deallocate(* (vm_offset_t *) In0P->uids, 4 * In0P->uidsType.msgtl_number); |
1094 | end_using_protid_port(io_object); |
1095 | if (OutP->RetCode != KERN_SUCCESS0) |
1096 | return; |
1097 | |
1098 | msgh_simple = TRUE((boolean_t) 1); |
1099 | OutP->Head.msgh_size = 40; |
1100 | |
1101 | OutP->new_objectType = new_objectType; |
1102 | |
1103 | if (MACH_MSG_TYPE_PORT_ANY(new_objectPoly)(((new_objectPoly) >= 16) && ((new_objectPoly) <= 21))) |
1104 | msgh_simple = FALSE((boolean_t) 0); |
1105 | |
1106 | OutP->new_objectType.msgt_name = new_objectPoly; |
1107 | |
1108 | if (!msgh_simple) |
1109 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
1110 | } |
1111 | |
1112 | /* Routine io_duplicate */ |
1113 | mig_internalstatic void _Xio_duplicate |
1114 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1115 | { |
1116 | typedef struct { |
1117 | mach_msg_header_t Head; |
1118 | } Request; |
1119 | |
1120 | typedef struct { |
1121 | mach_msg_header_t Head; |
1122 | mach_msg_type_t RetCodeType; |
1123 | kern_return_t RetCode; |
1124 | mach_msg_type_t newportType; |
1125 | mach_port_t newport; |
1126 | } Reply; |
1127 | |
1128 | Request *In0P = (Request *) InHeadP; |
1129 | Reply *OutP = (Reply *) OutHeadP; |
1130 | mig_external kern_return_t netfs_S_io_duplicate |
1131 | (protid_t io_object, mach_port_t *newport, mach_msg_type_name_t *newportPoly); |
1132 | |
1133 | boolean_t msgh_simple; |
1134 | const mach_msg_type_t newportType = { |
1135 | /* msgt_name = */ -1, |
1136 | /* msgt_size = */ 32, |
1137 | /* msgt_number = */ 1, |
1138 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1139 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1140 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1141 | /* msgt_unused = */ 0 |
1142 | }; |
1143 | |
1144 | protid_t io_object; |
1145 | mach_msg_type_name_t newportPoly; |
1146 | |
1147 | #if TypeCheck1 |
1148 | if ((In0P->Head.msgh_size != 24) || |
1149 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
1150 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1151 | #endif /* TypeCheck */ |
1152 | |
1153 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1154 | |
1155 | OutP->RetCode = netfs_S_io_duplicate(io_object, &OutP->newport, &newportPoly); |
1156 | end_using_protid_port(io_object); |
1157 | if (OutP->RetCode != KERN_SUCCESS0) |
1158 | return; |
1159 | |
1160 | msgh_simple = TRUE((boolean_t) 1); |
1161 | OutP->Head.msgh_size = 40; |
1162 | |
1163 | OutP->newportType = newportType; |
1164 | |
1165 | if (MACH_MSG_TYPE_PORT_ANY(newportPoly)(((newportPoly) >= 16) && ((newportPoly) <= 21) )) |
1166 | msgh_simple = FALSE((boolean_t) 0); |
1167 | |
1168 | OutP->newportType.msgt_name = newportPoly; |
1169 | |
1170 | if (!msgh_simple) |
1171 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
1172 | } |
1173 | |
1174 | /* Routine io_server_version */ |
1175 | mig_internalstatic void _Xio_server_version |
1176 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1177 | { |
1178 | typedef struct { |
1179 | mach_msg_header_t Head; |
1180 | } Request; |
1181 | |
1182 | typedef struct { |
1183 | mach_msg_header_t Head; |
1184 | mach_msg_type_t RetCodeType; |
1185 | kern_return_t RetCode; |
1186 | mach_msg_type_t server_nameType; |
1187 | string_t server_name; |
1188 | mach_msg_type_t server_major_versionType; |
1189 | int server_major_version; |
1190 | mach_msg_type_t server_minor_versionType; |
1191 | int server_minor_version; |
1192 | mach_msg_type_t server_edit_levelType; |
1193 | int server_edit_level; |
1194 | } Reply; |
1195 | |
1196 | Request *In0P = (Request *) InHeadP; |
1197 | Reply *OutP = (Reply *) OutHeadP; |
1198 | mig_external kern_return_t netfs_S_io_server_version |
1199 | (protid_t vers_object, string_t server_name, int *server_major_version, int *server_minor_version, int *server_edit_level); |
1200 | |
1201 | const mach_msg_type_t server_nameType = { |
1202 | /* msgt_name = */ MACH_MSG_TYPE_STRING_C12, |
1203 | /* msgt_size = */ 8, |
1204 | /* msgt_number = */ 1024, |
1205 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1206 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1207 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1208 | /* msgt_unused = */ 0 |
1209 | }; |
1210 | |
1211 | const mach_msg_type_t server_major_versionType = { |
1212 | /* msgt_name = */ 2, |
1213 | /* msgt_size = */ 32, |
1214 | /* msgt_number = */ 1, |
1215 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1216 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1217 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1218 | /* msgt_unused = */ 0 |
1219 | }; |
1220 | |
1221 | const mach_msg_type_t server_minor_versionType = { |
1222 | /* msgt_name = */ 2, |
1223 | /* msgt_size = */ 32, |
1224 | /* msgt_number = */ 1, |
1225 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1226 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1227 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1228 | /* msgt_unused = */ 0 |
1229 | }; |
1230 | |
1231 | const mach_msg_type_t server_edit_levelType = { |
1232 | /* msgt_name = */ 2, |
1233 | /* msgt_size = */ 32, |
1234 | /* msgt_number = */ 1, |
1235 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1236 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1237 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1238 | /* msgt_unused = */ 0 |
1239 | }; |
1240 | |
1241 | protid_t vers_object; |
1242 | |
1243 | #if TypeCheck1 |
1244 | if ((In0P->Head.msgh_size != 24) || |
1245 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
1246 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1247 | #endif /* TypeCheck */ |
1248 | |
1249 | vers_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1250 | |
1251 | OutP->RetCode = netfs_S_io_server_version(vers_object, OutP->server_name, &OutP->server_major_version, &OutP->server_minor_version, &OutP->server_edit_level); |
1252 | end_using_protid_port(vers_object); |
1253 | if (OutP->RetCode != KERN_SUCCESS0) |
1254 | return; |
1255 | |
1256 | OutP->Head.msgh_size = 1084; |
1257 | |
1258 | OutP->server_nameType = server_nameType; |
1259 | |
1260 | OutP->server_major_versionType = server_major_versionType; |
1261 | |
1262 | OutP->server_minor_versionType = server_minor_versionType; |
1263 | |
1264 | OutP->server_edit_levelType = server_edit_levelType; |
1265 | } |
1266 | |
1267 | /* Routine io_map */ |
1268 | mig_internalstatic void _Xio_map |
1269 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1270 | { |
1271 | typedef struct { |
1272 | mach_msg_header_t Head; |
1273 | } Request; |
1274 | |
1275 | typedef struct { |
1276 | mach_msg_header_t Head; |
1277 | mach_msg_type_t RetCodeType; |
1278 | kern_return_t RetCode; |
1279 | mach_msg_type_t memobjrdType; |
1280 | mach_port_t memobjrd; |
1281 | mach_msg_type_t memobjwtType; |
1282 | mach_port_t memobjwt; |
1283 | } Reply; |
1284 | |
1285 | Request *In0P = (Request *) InHeadP; |
1286 | Reply *OutP = (Reply *) OutHeadP; |
1287 | mig_external kern_return_t netfs_S_io_map |
1288 | (protid_t io_object, mach_port_t *memobjrd, mach_msg_type_name_t *memobjrdPoly, mach_port_t *memobjwt, mach_msg_type_name_t *memobjwtPoly); |
1289 | |
1290 | boolean_t msgh_simple; |
1291 | const mach_msg_type_t memobjrdType = { |
1292 | /* msgt_name = */ -1, |
1293 | /* msgt_size = */ 32, |
1294 | /* msgt_number = */ 1, |
1295 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1296 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1297 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1298 | /* msgt_unused = */ 0 |
1299 | }; |
1300 | |
1301 | const mach_msg_type_t memobjwtType = { |
1302 | /* msgt_name = */ -1, |
1303 | /* msgt_size = */ 32, |
1304 | /* msgt_number = */ 1, |
1305 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1306 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1307 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1308 | /* msgt_unused = */ 0 |
1309 | }; |
1310 | |
1311 | protid_t io_object; |
1312 | mach_msg_type_name_t memobjrdPoly; |
1313 | mach_msg_type_name_t memobjwtPoly; |
1314 | |
1315 | #if TypeCheck1 |
1316 | if ((In0P->Head.msgh_size != 24) || |
1317 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
1318 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1319 | #endif /* TypeCheck */ |
1320 | |
1321 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1322 | |
1323 | OutP->RetCode = netfs_S_io_map(io_object, &OutP->memobjrd, &memobjrdPoly, &OutP->memobjwt, &memobjwtPoly); |
1324 | end_using_protid_port(io_object); |
1325 | if (OutP->RetCode != KERN_SUCCESS0) |
1326 | return; |
1327 | |
1328 | msgh_simple = TRUE((boolean_t) 1); |
1329 | OutP->Head.msgh_size = 48; |
1330 | |
1331 | OutP->memobjrdType = memobjrdType; |
1332 | |
1333 | if (MACH_MSG_TYPE_PORT_ANY(memobjrdPoly)(((memobjrdPoly) >= 16) && ((memobjrdPoly) <= 21 ))) |
1334 | msgh_simple = FALSE((boolean_t) 0); |
1335 | |
1336 | OutP->memobjrdType.msgt_name = memobjrdPoly; |
1337 | |
1338 | OutP->memobjwtType = memobjwtType; |
1339 | |
1340 | if (MACH_MSG_TYPE_PORT_ANY(memobjwtPoly)(((memobjwtPoly) >= 16) && ((memobjwtPoly) <= 21 ))) |
1341 | msgh_simple = FALSE((boolean_t) 0); |
1342 | |
1343 | OutP->memobjwtType.msgt_name = memobjwtPoly; |
1344 | |
1345 | if (!msgh_simple) |
1346 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
1347 | } |
1348 | |
1349 | /* Routine io_map_cntl */ |
1350 | mig_internalstatic void _Xio_map_cntl |
1351 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1352 | { |
1353 | typedef struct { |
1354 | mach_msg_header_t Head; |
1355 | } Request; |
1356 | |
1357 | typedef struct { |
1358 | mach_msg_header_t Head; |
1359 | mach_msg_type_t RetCodeType; |
1360 | kern_return_t RetCode; |
1361 | mach_msg_type_t memobjType; |
1362 | mach_port_t memobj; |
1363 | } Reply; |
1364 | |
1365 | Request *In0P = (Request *) InHeadP; |
1366 | Reply *OutP = (Reply *) OutHeadP; |
1367 | mig_external kern_return_t netfs_S_io_map_cntl |
1368 | (protid_t io_object, mach_port_t *memobj, mach_msg_type_name_t *memobjPoly); |
1369 | |
1370 | boolean_t msgh_simple; |
1371 | const mach_msg_type_t memobjType = { |
1372 | /* msgt_name = */ -1, |
1373 | /* msgt_size = */ 32, |
1374 | /* msgt_number = */ 1, |
1375 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1376 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1377 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1378 | /* msgt_unused = */ 0 |
1379 | }; |
1380 | |
1381 | protid_t io_object; |
1382 | mach_msg_type_name_t memobjPoly; |
1383 | |
1384 | #if TypeCheck1 |
1385 | if ((In0P->Head.msgh_size != 24) || |
1386 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
1387 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1388 | #endif /* TypeCheck */ |
1389 | |
1390 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1391 | |
1392 | OutP->RetCode = netfs_S_io_map_cntl(io_object, &OutP->memobj, &memobjPoly); |
1393 | end_using_protid_port(io_object); |
1394 | if (OutP->RetCode != KERN_SUCCESS0) |
1395 | return; |
1396 | |
1397 | msgh_simple = TRUE((boolean_t) 1); |
1398 | OutP->Head.msgh_size = 40; |
1399 | |
1400 | OutP->memobjType = memobjType; |
1401 | |
1402 | if (MACH_MSG_TYPE_PORT_ANY(memobjPoly)(((memobjPoly) >= 16) && ((memobjPoly) <= 21))) |
1403 | msgh_simple = FALSE((boolean_t) 0); |
1404 | |
1405 | OutP->memobjType.msgt_name = memobjPoly; |
1406 | |
1407 | if (!msgh_simple) |
1408 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
1409 | } |
1410 | |
1411 | /* Routine io_get_conch */ |
1412 | mig_internalstatic void _Xio_get_conch |
1413 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1414 | { |
1415 | typedef struct { |
1416 | mach_msg_header_t Head; |
1417 | } Request; |
1418 | |
1419 | typedef struct { |
1420 | mach_msg_header_t Head; |
1421 | mach_msg_type_t RetCodeType; |
1422 | kern_return_t RetCode; |
1423 | } Reply; |
1424 | |
1425 | Request *In0P = (Request *) InHeadP; |
1426 | Reply *OutP = (Reply *) OutHeadP; |
1427 | mig_external kern_return_t netfs_S_io_get_conch |
1428 | (protid_t io_object); |
1429 | |
1430 | protid_t io_object; |
1431 | |
1432 | #if TypeCheck1 |
1433 | if ((In0P->Head.msgh_size != 24) || |
1434 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
1435 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1436 | #endif /* TypeCheck */ |
1437 | |
1438 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1439 | |
1440 | OutP->RetCode = netfs_S_io_get_conch(io_object); |
1441 | end_using_protid_port(io_object); |
1442 | } |
1443 | |
1444 | /* Routine io_release_conch */ |
1445 | mig_internalstatic void _Xio_release_conch |
1446 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1447 | { |
1448 | typedef struct { |
1449 | mach_msg_header_t Head; |
1450 | } Request; |
1451 | |
1452 | typedef struct { |
1453 | mach_msg_header_t Head; |
1454 | mach_msg_type_t RetCodeType; |
1455 | kern_return_t RetCode; |
1456 | } Reply; |
1457 | |
1458 | Request *In0P = (Request *) InHeadP; |
1459 | Reply *OutP = (Reply *) OutHeadP; |
1460 | mig_external kern_return_t netfs_S_io_release_conch |
1461 | (protid_t io_object); |
1462 | |
1463 | protid_t io_object; |
1464 | |
1465 | #if TypeCheck1 |
1466 | if ((In0P->Head.msgh_size != 24) || |
1467 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
1468 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1469 | #endif /* TypeCheck */ |
1470 | |
1471 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1472 | |
1473 | OutP->RetCode = netfs_S_io_release_conch(io_object); |
1474 | end_using_protid_port(io_object); |
1475 | } |
1476 | |
1477 | /* Routine io_eofnotify */ |
1478 | mig_internalstatic void _Xio_eofnotify |
1479 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1480 | { |
1481 | typedef struct { |
1482 | mach_msg_header_t Head; |
1483 | } Request; |
1484 | |
1485 | typedef struct { |
1486 | mach_msg_header_t Head; |
1487 | mach_msg_type_t RetCodeType; |
1488 | kern_return_t RetCode; |
1489 | } Reply; |
1490 | |
1491 | Request *In0P = (Request *) InHeadP; |
1492 | Reply *OutP = (Reply *) OutHeadP; |
1493 | mig_external kern_return_t netfs_S_io_eofnotify |
1494 | (protid_t io_object); |
1495 | |
1496 | protid_t io_object; |
1497 | |
1498 | #if TypeCheck1 |
1499 | if ((In0P->Head.msgh_size != 24) || |
1500 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
1501 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1502 | #endif /* TypeCheck */ |
1503 | |
1504 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1505 | |
1506 | OutP->RetCode = netfs_S_io_eofnotify(io_object); |
1507 | end_using_protid_port(io_object); |
1508 | } |
1509 | |
1510 | /* Routine io_prenotify */ |
1511 | mig_internalstatic void _Xio_prenotify |
1512 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1513 | { |
1514 | typedef struct { |
1515 | mach_msg_header_t Head; |
1516 | mach_msg_type_t write_startType; |
1517 | vm_offset_t write_start; |
1518 | mach_msg_type_t write_endType; |
1519 | vm_offset_t write_end; |
1520 | } Request; |
1521 | |
1522 | typedef struct { |
1523 | mach_msg_header_t Head; |
1524 | mach_msg_type_t RetCodeType; |
1525 | kern_return_t RetCode; |
1526 | } Reply; |
1527 | |
1528 | Request *In0P = (Request *) InHeadP; |
1529 | Reply *OutP = (Reply *) OutHeadP; |
1530 | mig_external kern_return_t netfs_S_io_prenotify |
1531 | (protid_t io_object, vm_offset_t write_start, vm_offset_t write_end); |
1532 | |
1533 | const mach_msg_type_t write_startCheck = { |
1534 | /* msgt_name = */ 2, |
1535 | /* msgt_size = */ 32, |
1536 | /* msgt_number = */ 1, |
1537 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1538 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1539 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1540 | /* msgt_unused = */ 0 |
1541 | }; |
1542 | |
1543 | const mach_msg_type_t write_endCheck = { |
1544 | /* msgt_name = */ 2, |
1545 | /* msgt_size = */ 32, |
1546 | /* msgt_number = */ 1, |
1547 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1548 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1549 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1550 | /* msgt_unused = */ 0 |
1551 | }; |
1552 | |
1553 | protid_t io_object; |
1554 | |
1555 | #if TypeCheck1 |
1556 | if ((In0P->Head.msgh_size != 40) || |
1557 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
1558 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1559 | #endif /* TypeCheck */ |
1560 | |
1561 | #if TypeCheck1 |
1562 | if (BAD_TYPECHECK(&In0P->write_startType, &write_startCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->write_startType); _c.t = *(&write_startCheck ); _t.w != _c.w; })) |
1563 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1564 | #endif /* TypeCheck */ |
1565 | |
1566 | #if TypeCheck1 |
1567 | if (BAD_TYPECHECK(&In0P->write_endType, &write_endCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->write_endType); _c.t = *(&write_endCheck ); _t.w != _c.w; })) |
1568 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1569 | #endif /* TypeCheck */ |
1570 | |
1571 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1572 | |
1573 | OutP->RetCode = netfs_S_io_prenotify(io_object, In0P->write_start, In0P->write_end); |
1574 | end_using_protid_port(io_object); |
1575 | } |
1576 | |
1577 | /* Routine io_postnotify */ |
1578 | mig_internalstatic void _Xio_postnotify |
1579 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1580 | { |
1581 | typedef struct { |
1582 | mach_msg_header_t Head; |
1583 | mach_msg_type_t write_startType; |
1584 | vm_offset_t write_start; |
1585 | mach_msg_type_t write_endType; |
1586 | vm_offset_t write_end; |
1587 | } Request; |
1588 | |
1589 | typedef struct { |
1590 | mach_msg_header_t Head; |
1591 | mach_msg_type_t RetCodeType; |
1592 | kern_return_t RetCode; |
1593 | } Reply; |
1594 | |
1595 | Request *In0P = (Request *) InHeadP; |
1596 | Reply *OutP = (Reply *) OutHeadP; |
1597 | mig_external kern_return_t netfs_S_io_postnotify |
1598 | (protid_t io_object, vm_offset_t write_start, vm_offset_t write_end); |
1599 | |
1600 | const mach_msg_type_t write_startCheck = { |
1601 | /* msgt_name = */ 2, |
1602 | /* msgt_size = */ 32, |
1603 | /* msgt_number = */ 1, |
1604 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1605 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1606 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1607 | /* msgt_unused = */ 0 |
1608 | }; |
1609 | |
1610 | const mach_msg_type_t write_endCheck = { |
1611 | /* msgt_name = */ 2, |
1612 | /* msgt_size = */ 32, |
1613 | /* msgt_number = */ 1, |
1614 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1615 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1616 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1617 | /* msgt_unused = */ 0 |
1618 | }; |
1619 | |
1620 | protid_t io_object; |
1621 | |
1622 | #if TypeCheck1 |
1623 | if ((In0P->Head.msgh_size != 40) || |
1624 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
1625 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1626 | #endif /* TypeCheck */ |
1627 | |
1628 | #if TypeCheck1 |
1629 | if (BAD_TYPECHECK(&In0P->write_startType, &write_startCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->write_startType); _c.t = *(&write_startCheck ); _t.w != _c.w; })) |
1630 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1631 | #endif /* TypeCheck */ |
1632 | |
1633 | #if TypeCheck1 |
1634 | if (BAD_TYPECHECK(&In0P->write_endType, &write_endCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->write_endType); _c.t = *(&write_endCheck ); _t.w != _c.w; })) |
1635 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1636 | #endif /* TypeCheck */ |
1637 | |
1638 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1639 | |
1640 | OutP->RetCode = netfs_S_io_postnotify(io_object, In0P->write_start, In0P->write_end); |
1641 | end_using_protid_port(io_object); |
1642 | } |
1643 | |
1644 | /* Routine io_readnotify */ |
1645 | mig_internalstatic void _Xio_readnotify |
1646 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1647 | { |
1648 | typedef struct { |
1649 | mach_msg_header_t Head; |
1650 | } Request; |
1651 | |
1652 | typedef struct { |
1653 | mach_msg_header_t Head; |
1654 | mach_msg_type_t RetCodeType; |
1655 | kern_return_t RetCode; |
1656 | } Reply; |
1657 | |
1658 | Request *In0P = (Request *) InHeadP; |
1659 | Reply *OutP = (Reply *) OutHeadP; |
1660 | mig_external kern_return_t netfs_S_io_readnotify |
1661 | (protid_t io_object); |
1662 | |
1663 | protid_t io_object; |
1664 | |
1665 | #if TypeCheck1 |
1666 | if ((In0P->Head.msgh_size != 24) || |
1667 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
1668 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1669 | #endif /* TypeCheck */ |
1670 | |
1671 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1672 | |
1673 | OutP->RetCode = netfs_S_io_readnotify(io_object); |
1674 | end_using_protid_port(io_object); |
1675 | } |
1676 | |
1677 | /* Routine io_readsleep */ |
1678 | mig_internalstatic void _Xio_readsleep |
1679 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1680 | { |
1681 | typedef struct { |
1682 | mach_msg_header_t Head; |
1683 | } Request; |
1684 | |
1685 | typedef struct { |
1686 | mach_msg_header_t Head; |
1687 | mach_msg_type_t RetCodeType; |
1688 | kern_return_t RetCode; |
1689 | } Reply; |
1690 | |
1691 | Request *In0P = (Request *) InHeadP; |
1692 | Reply *OutP = (Reply *) OutHeadP; |
1693 | mig_external kern_return_t netfs_S_io_readsleep |
1694 | (protid_t io_object); |
1695 | |
1696 | protid_t io_object; |
1697 | |
1698 | #if TypeCheck1 |
1699 | if ((In0P->Head.msgh_size != 24) || |
1700 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
1701 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1702 | #endif /* TypeCheck */ |
1703 | |
1704 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1705 | |
1706 | OutP->RetCode = netfs_S_io_readsleep(io_object); |
1707 | end_using_protid_port(io_object); |
1708 | } |
1709 | |
1710 | /* Routine io_sigio */ |
1711 | mig_internalstatic void _Xio_sigio |
1712 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1713 | { |
1714 | typedef struct { |
1715 | mach_msg_header_t Head; |
1716 | } Request; |
1717 | |
1718 | typedef struct { |
1719 | mach_msg_header_t Head; |
1720 | mach_msg_type_t RetCodeType; |
1721 | kern_return_t RetCode; |
1722 | } Reply; |
1723 | |
1724 | Request *In0P = (Request *) InHeadP; |
1725 | Reply *OutP = (Reply *) OutHeadP; |
1726 | mig_external kern_return_t netfs_S_io_sigio |
1727 | (protid_t io_object); |
1728 | |
1729 | protid_t io_object; |
1730 | |
1731 | #if TypeCheck1 |
1732 | if ((In0P->Head.msgh_size != 24) || |
1733 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
1734 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1735 | #endif /* TypeCheck */ |
1736 | |
1737 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1738 | |
1739 | OutP->RetCode = netfs_S_io_sigio(io_object); |
1740 | end_using_protid_port(io_object); |
1741 | } |
1742 | |
1743 | /* Routine io_pathconf */ |
1744 | mig_internalstatic void _Xio_pathconf |
1745 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1746 | { |
1747 | typedef struct { |
1748 | mach_msg_header_t Head; |
1749 | mach_msg_type_t nameType; |
1750 | int name; |
1751 | } Request; |
1752 | |
1753 | typedef struct { |
1754 | mach_msg_header_t Head; |
1755 | mach_msg_type_t RetCodeType; |
1756 | kern_return_t RetCode; |
1757 | mach_msg_type_t valueType; |
1758 | int value; |
1759 | } Reply; |
1760 | |
1761 | Request *In0P = (Request *) InHeadP; |
1762 | Reply *OutP = (Reply *) OutHeadP; |
1763 | mig_external kern_return_t netfs_S_io_pathconf |
1764 | (protid_t io_object, int name, int *value); |
1765 | |
1766 | const mach_msg_type_t nameCheck = { |
1767 | /* msgt_name = */ 2, |
1768 | /* msgt_size = */ 32, |
1769 | /* msgt_number = */ 1, |
1770 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1771 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1772 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1773 | /* msgt_unused = */ 0 |
1774 | }; |
1775 | |
1776 | const mach_msg_type_t valueType = { |
1777 | /* msgt_name = */ 2, |
1778 | /* msgt_size = */ 32, |
1779 | /* msgt_number = */ 1, |
1780 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1781 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1782 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1783 | /* msgt_unused = */ 0 |
1784 | }; |
1785 | |
1786 | protid_t io_object; |
1787 | |
1788 | #if TypeCheck1 |
1789 | if ((In0P->Head.msgh_size != 32) || |
1790 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
1791 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1792 | #endif /* TypeCheck */ |
1793 | |
1794 | #if TypeCheck1 |
1795 | if (BAD_TYPECHECK(&In0P->nameType, &nameCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->nameType); _c.t = *(&nameCheck); _t.w != _c.w; })) |
1796 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1797 | #endif /* TypeCheck */ |
1798 | |
1799 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1800 | |
1801 | OutP->RetCode = netfs_S_io_pathconf(io_object, In0P->name, &OutP->value); |
1802 | end_using_protid_port(io_object); |
1803 | if (OutP->RetCode != KERN_SUCCESS0) |
1804 | return; |
1805 | |
1806 | OutP->Head.msgh_size = 40; |
1807 | |
1808 | OutP->valueType = valueType; |
1809 | } |
1810 | |
1811 | /* Routine io_identity */ |
1812 | mig_internalstatic void _Xio_identity |
1813 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1814 | { |
1815 | typedef struct { |
1816 | mach_msg_header_t Head; |
1817 | } Request; |
1818 | |
1819 | typedef struct { |
1820 | mach_msg_header_t Head; |
1821 | mach_msg_type_t RetCodeType; |
1822 | kern_return_t RetCode; |
1823 | mach_msg_type_t idportType; |
1824 | mach_port_t idport; |
1825 | mach_msg_type_t fsidportType; |
1826 | mach_port_t fsidport; |
1827 | mach_msg_type_t filenoType; |
1828 | ino64_t fileno; |
1829 | } Reply; |
1830 | |
1831 | Request *In0P = (Request *) InHeadP; |
1832 | Reply *OutP = (Reply *) OutHeadP; |
1833 | mig_external kern_return_t netfs_S_io_identity |
1834 | (protid_t io_object, mach_port_t *idport, mach_msg_type_name_t *idportPoly, mach_port_t *fsidport, mach_msg_type_name_t *fsidportPoly, ino64_t *fileno); |
1835 | |
1836 | boolean_t msgh_simple; |
1837 | const mach_msg_type_t idportType = { |
1838 | /* msgt_name = */ -1, |
1839 | /* msgt_size = */ 32, |
1840 | /* msgt_number = */ 1, |
1841 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1842 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1843 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1844 | /* msgt_unused = */ 0 |
1845 | }; |
1846 | |
1847 | const mach_msg_type_t fsidportType = { |
1848 | /* msgt_name = */ -1, |
1849 | /* msgt_size = */ 32, |
1850 | /* msgt_number = */ 1, |
1851 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1852 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1853 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1854 | /* msgt_unused = */ 0 |
1855 | }; |
1856 | |
1857 | const mach_msg_type_t filenoType = { |
1858 | /* msgt_name = */ 11, |
1859 | /* msgt_size = */ 64, |
1860 | /* msgt_number = */ 1, |
1861 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1862 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1863 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1864 | /* msgt_unused = */ 0 |
1865 | }; |
1866 | |
1867 | protid_t io_object; |
1868 | mach_msg_type_name_t idportPoly; |
1869 | mach_msg_type_name_t fsidportPoly; |
1870 | |
1871 | #if TypeCheck1 |
1872 | if ((In0P->Head.msgh_size != 24) || |
1873 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
1874 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1875 | #endif /* TypeCheck */ |
1876 | |
1877 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1878 | |
1879 | OutP->RetCode = netfs_S_io_identity(io_object, &OutP->idport, &idportPoly, &OutP->fsidport, &fsidportPoly, &OutP->fileno); |
1880 | end_using_protid_port(io_object); |
1881 | if (OutP->RetCode != KERN_SUCCESS0) |
1882 | return; |
1883 | |
1884 | msgh_simple = TRUE((boolean_t) 1); |
1885 | OutP->Head.msgh_size = 60; |
1886 | |
1887 | OutP->idportType = idportType; |
1888 | |
1889 | if (MACH_MSG_TYPE_PORT_ANY(idportPoly)(((idportPoly) >= 16) && ((idportPoly) <= 21))) |
1890 | msgh_simple = FALSE((boolean_t) 0); |
1891 | |
1892 | OutP->idportType.msgt_name = idportPoly; |
1893 | |
1894 | OutP->fsidportType = fsidportType; |
1895 | |
1896 | if (MACH_MSG_TYPE_PORT_ANY(fsidportPoly)(((fsidportPoly) >= 16) && ((fsidportPoly) <= 21 ))) |
1897 | msgh_simple = FALSE((boolean_t) 0); |
1898 | |
1899 | OutP->fsidportType.msgt_name = fsidportPoly; |
1900 | |
1901 | OutP->filenoType = filenoType; |
1902 | |
1903 | if (!msgh_simple) |
1904 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
1905 | } |
1906 | |
1907 | /* Routine io_revoke */ |
1908 | mig_internalstatic void _Xio_revoke |
1909 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1910 | { |
1911 | typedef struct { |
1912 | mach_msg_header_t Head; |
1913 | } Request; |
1914 | |
1915 | typedef struct { |
1916 | mach_msg_header_t Head; |
1917 | mach_msg_type_t RetCodeType; |
1918 | kern_return_t RetCode; |
1919 | } Reply; |
1920 | |
1921 | Request *In0P = (Request *) InHeadP; |
1922 | Reply *OutP = (Reply *) OutHeadP; |
1923 | mig_external kern_return_t netfs_S_io_revoke |
1924 | (protid_t io_object); |
1925 | |
1926 | protid_t io_object; |
1927 | |
1928 | #if TypeCheck1 |
1929 | if ((In0P->Head.msgh_size != 24) || |
1930 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
1931 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1932 | #endif /* TypeCheck */ |
1933 | |
1934 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
1935 | |
1936 | OutP->RetCode = netfs_S_io_revoke(io_object); |
1937 | end_using_protid_port(io_object); |
1938 | } |
1939 | |
1940 | /* Routine io_select_timeout */ |
1941 | mig_internalstatic void _Xio_select_timeout |
1942 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1943 | { |
1944 | typedef struct { |
1945 | mach_msg_header_t Head; |
1946 | mach_msg_type_t timeoutType; |
1947 | timespec_t timeout; |
1948 | mach_msg_type_t select_typeType; |
1949 | int select_type; |
1950 | } Request; |
1951 | |
1952 | typedef struct { |
1953 | mach_msg_header_t Head; |
1954 | mach_msg_type_t RetCodeType; |
1955 | kern_return_t RetCode; |
1956 | mach_msg_type_t select_typeType; |
1957 | int select_type; |
1958 | } Reply; |
1959 | |
1960 | Request *In0P = (Request *) InHeadP; |
1961 | Reply *OutP = (Reply *) OutHeadP; |
1962 | mig_external kern_return_t netfs_S_io_select_timeout |
1963 | (protid_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, timespec_t timeout, int *select_type); |
1964 | |
1965 | const mach_msg_type_t timeoutCheck = { |
1966 | /* msgt_name = */ 2, |
1967 | /* msgt_size = */ 32, |
1968 | /* msgt_number = */ 2, |
1969 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1970 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1971 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1972 | /* msgt_unused = */ 0 |
1973 | }; |
1974 | |
1975 | const mach_msg_type_t select_typeCheck = { |
1976 | /* msgt_name = */ 2, |
1977 | /* msgt_size = */ 32, |
1978 | /* msgt_number = */ 1, |
1979 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1980 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1981 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1982 | /* msgt_unused = */ 0 |
1983 | }; |
1984 | |
1985 | const mach_msg_type_t select_typeType = { |
1986 | /* msgt_name = */ 2, |
1987 | /* msgt_size = */ 32, |
1988 | /* msgt_number = */ 1, |
1989 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1990 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1991 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1992 | /* msgt_unused = */ 0 |
1993 | }; |
1994 | |
1995 | protid_t io_object; |
1996 | |
1997 | #if TypeCheck1 |
1998 | if ((In0P->Head.msgh_size != 44) || |
1999 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
2000 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2001 | #endif /* TypeCheck */ |
2002 | |
2003 | #if TypeCheck1 |
2004 | if (BAD_TYPECHECK(&In0P->timeoutType, &timeoutCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->timeoutType); _c.t = *(&timeoutCheck); _t .w != _c.w; })) |
2005 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2006 | #endif /* TypeCheck */ |
2007 | |
2008 | #if TypeCheck1 |
2009 | if (BAD_TYPECHECK(&In0P->select_typeType, &select_typeCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->select_typeType); _c.t = *(&select_typeCheck ); _t.w != _c.w; })) |
2010 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2011 | #endif /* TypeCheck */ |
2012 | |
2013 | io_object = begin_using_protid_port(In0P->Head.msgh_request_portmsgh_local_port); |
2014 | |
2015 | OutP->RetCode = netfs_S_io_select_timeout(io_object, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->timeout, &In0P->select_type); |
2016 | end_using_protid_port(io_object); |
2017 | if (OutP->RetCode != KERN_SUCCESS0) |
2018 | return; |
2019 | |
2020 | OutP->Head.msgh_size = 40; |
2021 | |
2022 | OutP->select_typeType = select_typeType; |
2023 | |
2024 | OutP->select_type = In0P->select_type; |
2025 | } |
2026 | |
2027 | static mig_routine_t netfs_io_server_routines[] = { |
2028 | _Xio_write, |
2029 | _Xio_read, |
2030 | _Xio_seek, |
2031 | _Xio_readable, |
2032 | _Xio_set_all_openmodes, |
2033 | _Xio_get_openmodes, |
2034 | _Xio_set_some_openmodes, |
2035 | _Xio_clear_some_openmodes, |
2036 | _Xio_async, |
2037 | _Xio_mod_owner, |
2038 | _Xio_get_owner, |
2039 | _Xio_get_icky_async_id, |
2040 | _Xio_select, |
2041 | _Xio_stat, |
2042 | _Xio_reauthenticate, |
2043 | _Xio_restrict_auth, |
2044 | _Xio_duplicate, |
2045 | _Xio_server_version, |
2046 | _Xio_map, |
2047 | _Xio_map_cntl, |
2048 | _Xio_get_conch, |
2049 | _Xio_release_conch, |
2050 | _Xio_eofnotify, |
2051 | _Xio_prenotify, |
2052 | _Xio_postnotify, |
2053 | _Xio_readnotify, |
2054 | _Xio_readsleep, |
2055 | _Xio_sigio, |
2056 | _Xio_pathconf, |
2057 | _Xio_identity, |
2058 | _Xio_revoke, |
2059 | _Xio_select_timeout, |
2060 | }; |
2061 | |
2062 | mig_external boolean_t netfs_io_server |
2063 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2064 | { |
2065 | mach_msg_header_t *InP = InHeadP; |
2066 | mig_reply_header_t *OutP = (mig_reply_header_t *) OutHeadP; |
2067 | |
2068 | const mach_msg_type_t RetCodeType = { |
2069 | /* msgt_name = */ MACH_MSG_TYPE_INTEGER_322, |
2070 | /* msgt_size = */ 32, |
2071 | /* msgt_number = */ 1, |
2072 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2073 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2074 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2075 | /* msgt_unused = */ 0 |
2076 | }; |
2077 | |
2078 | mig_routine_t routine; |
2079 | |
2080 | OutP->Head.msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InP->msgh_bits), 0)((((InP->msgh_bits) & 0x000000ff)) | ((0) << 8)); |
2081 | OutP->Head.msgh_size = sizeof *OutP; |
2082 | OutP->Head.msgh_remote_port = InP->msgh_reply_portmsgh_remote_port; |
2083 | OutP->Head.msgh_local_port = MACH_PORT_NULL((mach_port_t) 0); |
2084 | OutP->Head.msgh_seqno = 0; |
2085 | OutP->Head.msgh_id = InP->msgh_id + 100; |
2086 | |
2087 | OutP->RetCodeType = RetCodeType; |
2088 | |
2089 | if ((InP->msgh_id > 21031) || (InP->msgh_id < 21000) || |
2090 | ((routine = netfs_io_server_routines[InP->msgh_id - 21000]) == 0)) { |
2091 | OutP->RetCode = MIG_BAD_ID-303; |
2092 | return FALSE((boolean_t) 0); |
2093 | } |
2094 | (*routine) (InP, &OutP->Head); |
2095 | return TRUE((boolean_t) 1); |
2096 | } |
2097 | |
2098 | mig_external mig_routine_t netfs_io_server_routine |
2099 | (const mach_msg_header_t *InHeadP) |
2100 | { |
2101 | int msgh_id; |
2102 | |
2103 | msgh_id = InHeadP->msgh_id - 21000; |
2104 | |
2105 | if ((msgh_id > 31) || (msgh_id < 0)) |
2106 | return 0; |
2107 | |
2108 | return netfs_io_server_routines[msgh_id]; |
2109 | } |
2110 |