Bug Summary

File:obj-scan-build/libnetfs/ioServer.c
Location:line 953, column 12
Description:Value stored to 'msgh_simple' during its initialization is never read

Annotated Source Code

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