Bug Summary

File:obj-scan-build/libnetfs/fsysServer.c
Location:line 412, column 2
Description:Value stored to 'msgh_simple' is never read

Annotated Source Code

1/* Module fsys */
2
3#ifndef _GNU_SOURCE1
4#define _GNU_SOURCE1 1
5#endif
6
7#define EXPORT_BOOLEAN
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/message.h>
11#include <mach/mig_errors.h>
12#include <mach/mig_support.h>
13
14#ifndef mig_internalstatic
15#define mig_internalstatic static
16#endif
17
18#ifndef mig_external
19#define mig_external
20#endif
21
22#ifndef TypeCheck1
23#define TypeCheck1 1
24#endif
25
26#ifndef UseExternRCSId1
27#define UseExternRCSId1 1
28#endif
29
30#define BAD_TYPECHECK(type, check)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t =
*(type); _c.t = *(check); _t.w != _c.w; })
({\
31 union { mach_msg_type_t t; unsigned32_t w; } _t, _c;\
32 _t.t = *(type); _c.t = *(check); _t.w != _c.w; })
33#define msgh_request_portmsgh_local_port msgh_local_port
34#define MACH_MSGH_BITS_REQUEST(bits)(((bits) & 0x0000ff00) >> 8) MACH_MSGH_BITS_LOCAL(bits)(((bits) & 0x0000ff00) >> 8)
35#define msgh_reply_portmsgh_remote_port msgh_remote_port
36#define MACH_MSGH_BITS_REPLY(bits)((bits) & 0x000000ff) MACH_MSGH_BITS_REMOTE(bits)((bits) & 0x000000ff)
37
38#include <mach/std_types.h>
39#include <mach/mach_types.h>
40#include <device/device_types.h>
41#include <device/net_status.h>
42#include <sys/types.h>
43#include <sys/stat.h>
44#include <sys/statfs.h>
45#include <sys/resource.h>
46#include <sys/utsname.h>
47#include <hurd/hurd_types.h>
48#include "libnetfs/netfs.h"
49#include "libnetfs/priv.h"
50
51/* Routine fsys_startup */
52mig_internalstatic void _Xfsys_startup
53 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
54{
55 typedef struct {
56 mach_msg_header_t Head;
57 mach_msg_type_t openflagsType;
58 int openflags;
59 mach_msg_type_t control_portType;
60 mach_port_t control_port;
61 } Request;
62
63 typedef struct {
64 mach_msg_header_t Head;
65 mach_msg_type_t RetCodeType;
66 kern_return_t RetCode;
67 mach_msg_type_t realnodeType;
68 mach_port_t realnode;
69 } Reply;
70
71 Request *In0P = (Request *) InHeadP;
72 Reply *OutP = (Reply *) OutHeadP;
73 mig_external kern_return_t netfs_S_fsys_startup
74 (mach_port_t bootstrap, mach_port_t reply, mach_msg_type_name_t replyPoly, int openflags, mach_port_t control_port, mach_port_t *realnode, mach_msg_type_name_t *realnodePoly);
75
76 boolean_t msgh_simple;
77 const mach_msg_type_t openflagsCheck = {
78 /* msgt_name = */ 2,
79 /* msgt_size = */ 32,
80 /* msgt_number = */ 1,
81 /* msgt_inline = */ TRUE((boolean_t) 1),
82 /* msgt_longform = */ FALSE((boolean_t) 0),
83 /* msgt_deallocate = */ FALSE((boolean_t) 0),
84 /* msgt_unused = */ 0
85 };
86
87 const mach_msg_type_t control_portCheck = {
88 /* msgt_name = */ 17,
89 /* msgt_size = */ 32,
90 /* msgt_number = */ 1,
91 /* msgt_inline = */ TRUE((boolean_t) 1),
92 /* msgt_longform = */ FALSE((boolean_t) 0),
93 /* msgt_deallocate = */ FALSE((boolean_t) 0),
94 /* msgt_unused = */ 0
95 };
96
97 const mach_msg_type_t realnodeType = {
98 /* msgt_name = */ -1,
99 /* msgt_size = */ 32,
100 /* msgt_number = */ 1,
101 /* msgt_inline = */ TRUE((boolean_t) 1),
102 /* msgt_longform = */ FALSE((boolean_t) 0),
103 /* msgt_deallocate = */ FALSE((boolean_t) 0),
104 /* msgt_unused = */ 0
105 };
106
107 mach_msg_type_name_t realnodePoly;
108
109#if TypeCheck1
110 if ((In0P->Head.msgh_size != 40) ||
111 !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U))
112 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
113#endif /* TypeCheck */
114
115#if TypeCheck1
116 if (BAD_TYPECHECK(&In0P->openflagsType, &openflagsCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t =
*(&In0P->openflagsType); _c.t = *(&openflagsCheck
); _t.w != _c.w; })
)
117 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
118#endif /* TypeCheck */
119
120#if TypeCheck1
121 if (BAD_TYPECHECK(&In0P->control_portType, &control_portCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t =
*(&In0P->control_portType); _c.t = *(&control_portCheck
); _t.w != _c.w; })
)
122 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
123#endif /* TypeCheck */
124
125 OutP->RetCode = netfs_S_fsys_startup(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->openflags, In0P->control_port, &OutP->realnode, &realnodePoly);
126 if (OutP->RetCode != KERN_SUCCESS0)
127 return;
128
129 msgh_simple = TRUE((boolean_t) 1);
130 OutP->Head.msgh_size = 40;
131
132 OutP->realnodeType = realnodeType;
133
134 if (MACH_MSG_TYPE_PORT_ANY(realnodePoly)(((realnodePoly) >= 16) && ((realnodePoly) <= 21
))
)
135 msgh_simple = FALSE((boolean_t) 0);
136
137 OutP->realnodeType.msgt_name = realnodePoly;
138
139 if (!msgh_simple)
140 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U;
141}
142
143/* Routine fsys_goaway */
144mig_internalstatic void _Xfsys_goaway
145 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
146{
147 typedef struct {
148 mach_msg_header_t Head;
149 mach_msg_type_t flagsType;
150 int flags;
151 } Request;
152
153 typedef struct {
154 mach_msg_header_t Head;
155 mach_msg_type_t RetCodeType;
156 kern_return_t RetCode;
157 } Reply;
158
159 Request *In0P = (Request *) InHeadP;
160 Reply *OutP = (Reply *) OutHeadP;
161 mig_external kern_return_t netfs_S_fsys_goaway
162 (control_t fsys, mach_port_t reply, mach_msg_type_name_t replyPoly, int flags);
163
164 const mach_msg_type_t flagsCheck = {
165 /* msgt_name = */ 2,
166 /* msgt_size = */ 32,
167 /* msgt_number = */ 1,
168 /* msgt_inline = */ TRUE((boolean_t) 1),
169 /* msgt_longform = */ FALSE((boolean_t) 0),
170 /* msgt_deallocate = */ FALSE((boolean_t) 0),
171 /* msgt_unused = */ 0
172 };
173
174 control_t fsys;
175
176#if TypeCheck1
177 if ((In0P->Head.msgh_size != 32) ||
178 (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U))
179 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
180#endif /* TypeCheck */
181
182#if TypeCheck1
183 if (BAD_TYPECHECK(&In0P->flagsType, &flagsCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t =
*(&In0P->flagsType); _c.t = *(&flagsCheck); _t.w !=
_c.w; })
)
184 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
185#endif /* TypeCheck */
186
187 fsys = begin_using_control_port(In0P->Head.msgh_request_portmsgh_local_port);
188
189 OutP->RetCode = netfs_S_fsys_goaway(fsys, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->flags);
190 end_using_control_port(fsys);
191}
192
193/* Routine fsys_getroot */
194mig_internalstatic void _Xfsys_getroot
195 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
196{
197 typedef struct {
198 mach_msg_header_t Head;
199 mach_msg_type_t dotdot_nodeType;
200 mach_port_t dotdot_node;
201 mach_msg_type_long_t gen_uidsType;
202 uid_t gen_uids[512];
203 mach_msg_type_long_t gen_gidsType;
204 uid_t gen_gids[512];
205 mach_msg_type_t flagsType;
206 int flags;
207 } Request;
208
209 typedef struct {
210 mach_msg_header_t Head;
211 mach_msg_type_t RetCodeType;
212 kern_return_t RetCode;
213 mach_msg_type_t do_retryType;
214 retry_type do_retry;
215 mach_msg_type_t retry_nameType;
216 string_t retry_name;
217 mach_msg_type_t fileType;
218 mach_port_t file;
219 } Reply;
220
221 Request *In0P = (Request *) InHeadP;
222 Request *In1P;
223 Request *In2P;
224 Reply *OutP = (Reply *) OutHeadP;
225 mig_external kern_return_t netfs_S_fsys_getroot
226 (control_t fsys, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t dotdot_node, idarray_t gen_uids, mach_msg_type_number_t gen_uidsCnt, idarray_t gen_gids, mach_msg_type_number_t gen_gidsCnt, int flags, retry_type *do_retry, string_t retry_name, mach_port_t *file, mach_msg_type_name_t *filePoly);
227
228 boolean_t msgh_simple;
229 unsigned int msgh_size;
230 unsigned int msgh_size_delta;
231
232 const mach_msg_type_t dotdot_nodeCheck = {
233 /* msgt_name = */ 17,
234 /* msgt_size = */ 32,
235 /* msgt_number = */ 1,
236 /* msgt_inline = */ TRUE((boolean_t) 1),
237 /* msgt_longform = */ FALSE((boolean_t) 0),
238 /* msgt_deallocate = */ FALSE((boolean_t) 0),
239 /* msgt_unused = */ 0
240 };
241
242 const mach_msg_type_t flagsCheck = {
243 /* msgt_name = */ 2,
244 /* msgt_size = */ 32,
245 /* msgt_number = */ 1,
246 /* msgt_inline = */ TRUE((boolean_t) 1),
247 /* msgt_longform = */ FALSE((boolean_t) 0),
248 /* msgt_deallocate = */ FALSE((boolean_t) 0),
249 /* msgt_unused = */ 0
250 };
251
252 const mach_msg_type_t do_retryType = {
253 /* msgt_name = */ 2,
254 /* msgt_size = */ 32,
255 /* msgt_number = */ 1,
256 /* msgt_inline = */ TRUE((boolean_t) 1),
257 /* msgt_longform = */ FALSE((boolean_t) 0),
258 /* msgt_deallocate = */ FALSE((boolean_t) 0),
259 /* msgt_unused = */ 0
260 };
261
262 const mach_msg_type_t retry_nameType = {
263 /* msgt_name = */ MACH_MSG_TYPE_STRING_C12,
264 /* msgt_size = */ 8,
265 /* msgt_number = */ 1024,
266 /* msgt_inline = */ TRUE((boolean_t) 1),
267 /* msgt_longform = */ FALSE((boolean_t) 0),
268 /* msgt_deallocate = */ FALSE((boolean_t) 0),
269 /* msgt_unused = */ 0
270 };
271
272 const mach_msg_type_t fileType = {
273 /* msgt_name = */ -1,
274 /* msgt_size = */ 32,
275 /* msgt_number = */ 1,
276 /* msgt_inline = */ TRUE((boolean_t) 1),
277 /* msgt_longform = */ FALSE((boolean_t) 0),
278 /* msgt_deallocate = */ FALSE((boolean_t) 0),
279 /* msgt_unused = */ 0
280 };
281
282 control_t fsys;
283 mach_msg_type_name_t filePoly;
284
285#if TypeCheck1
286 msgh_size = In0P->Head.msgh_size;
287 if ((msgh_size < 64) ||
288 !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U))
289 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
290#endif /* TypeCheck */
291
292#if TypeCheck1
293 if (BAD_TYPECHECK(&In0P->dotdot_nodeType, &dotdot_nodeCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t =
*(&In0P->dotdot_nodeType); _c.t = *(&dotdot_nodeCheck
); _t.w != _c.w; })
)
294 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
295#endif /* TypeCheck */
296
297#if TypeCheck1
298 if ((In0P->gen_uidsType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) ||
299 (In0P->gen_uidsType.msgtl_name != 2) ||
300 (In0P->gen_uidsType.msgtl_size != 32))
301 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
302#endif /* TypeCheck */
303
304 msgh_size_delta = (In0P->gen_uidsType.msgtl_header.msgt_inline) ? 4 * In0P->gen_uidsType.msgtl_number : sizeof(uid_t *);
305#if TypeCheck1
306 if (msgh_size < 64 + msgh_size_delta)
307 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
308 msgh_size -= msgh_size_delta;
309#endif /* TypeCheck */
310
311 In1P = (Request *) ((char *) In0P + msgh_size_delta - 2048);
312
313#if TypeCheck1
314 if ((In1P->gen_gidsType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) ||
315 (In1P->gen_gidsType.msgtl_name != 2) ||
316 (In1P->gen_gidsType.msgtl_size != 32))
317 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
318#endif /* TypeCheck */
319
320 msgh_size_delta = (In1P->gen_gidsType.msgtl_header.msgt_inline) ? 4 * In1P->gen_gidsType.msgtl_number : sizeof(uid_t *);
321#if TypeCheck1
322 if (msgh_size != 64 + msgh_size_delta)
323 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
324#endif /* TypeCheck */
325
326 In2P = (Request *) ((char *) In1P + msgh_size_delta - 2048);
327
328#if TypeCheck1
329 if (BAD_TYPECHECK(&In2P->flagsType, &flagsCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t =
*(&In2P->flagsType); _c.t = *(&flagsCheck); _t.w !=
_c.w; })
)
330 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
331#endif /* TypeCheck */
332
333 fsys = begin_using_control_port(In0P->Head.msgh_request_portmsgh_local_port);
334
335 OutP->RetCode = netfs_S_fsys_getroot(fsys, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->dotdot_node, (In0P->gen_uidsType.msgtl_header.msgt_inline) ? In0P->gen_uids : *((uid_t **)In0P->gen_uids), In0P->gen_uidsType.msgtl_number, (In1P->gen_gidsType.msgtl_header.msgt_inline) ? In1P->gen_gids : *((uid_t **)In1P->gen_gids), In1P->gen_gidsType.msgtl_number, In2P->flags, &OutP->do_retry, OutP->retry_name, &OutP->file, &filePoly);
336 if (OutP->RetCode == KERN_SUCCESS0)
337 if (!In1P->gen_gidsType.msgtl_header.msgt_inline)
338 __mig_deallocate(* (vm_offset_t *) In1P->gen_gids, 4 * In1P->gen_gidsType.msgtl_number);
339 if (OutP->RetCode == KERN_SUCCESS0)
340 if (!In0P->gen_uidsType.msgtl_header.msgt_inline)
341 __mig_deallocate(* (vm_offset_t *) In0P->gen_uids, 4 * In0P->gen_uidsType.msgtl_number);
342 end_using_control_port(fsys);
343 if (OutP->RetCode != KERN_SUCCESS0)
344 return;
345
346 msgh_simple = TRUE((boolean_t) 1);
347 OutP->Head.msgh_size = 1076;
348
349 OutP->do_retryType = do_retryType;
350
351 OutP->retry_nameType = retry_nameType;
352
353 OutP->fileType = fileType;
354
355 if (MACH_MSG_TYPE_PORT_ANY(filePoly)(((filePoly) >= 16) && ((filePoly) <= 21)))
356 msgh_simple = FALSE((boolean_t) 0);
357
358 OutP->fileType.msgt_name = filePoly;
359
360 if (!msgh_simple)
361 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U;
362}
363
364/* Routine fsys_getfile */
365mig_internalstatic void _Xfsys_getfile
366 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
367{
368 typedef struct {
369 mach_msg_header_t Head;
370 mach_msg_type_long_t gen_uidsType;
371 uid_t gen_uids[512];
372 mach_msg_type_long_t gen_gidsType;
373 uid_t gen_gids[512];
374 mach_msg_type_long_t filehandleType;
375 char filehandle[2048];
376 } Request;
377
378 typedef struct {
379 mach_msg_header_t Head;
380 mach_msg_type_t RetCodeType;
381 kern_return_t RetCode;
382 mach_msg_type_t fileType;
383 mach_port_t file;
384 } Reply;
385
386 Request *In0P = (Request *) InHeadP;
387 Request *In1P;
388 Request *In2P;
389 Reply *OutP = (Reply *) OutHeadP;
390 mig_external kern_return_t netfs_S_fsys_getfile
391 (control_t fsys, mach_port_t reply, mach_msg_type_name_t replyPoly, idarray_t gen_uids, mach_msg_type_number_t gen_uidsCnt, idarray_t gen_gids, mach_msg_type_number_t gen_gidsCnt, data_t filehandle, mach_msg_type_number_t filehandleCnt, mach_port_t *file, mach_msg_type_name_t *filePoly);
392
393 boolean_t msgh_simple;
394 unsigned int msgh_size;
395 unsigned int msgh_size_delta;
396
397 const mach_msg_type_t fileType = {
398 /* msgt_name = */ -1,
399 /* msgt_size = */ 32,
400 /* msgt_number = */ 1,
401 /* msgt_inline = */ TRUE((boolean_t) 1),
402 /* msgt_longform = */ FALSE((boolean_t) 0),
403 /* msgt_deallocate = */ FALSE((boolean_t) 0),
404 /* msgt_unused = */ 0
405 };
406
407 control_t fsys;
408 mach_msg_type_name_t filePoly;
409
410#if TypeCheck1
411 msgh_size = In0P->Head.msgh_size;
412 msgh_simple = !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U);
Value stored to 'msgh_simple' is never read
413 if ((msgh_size < 60))
414 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
415#endif /* TypeCheck */
416
417#if TypeCheck1
418 if ((In0P->gen_uidsType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) ||
419 (In0P->gen_uidsType.msgtl_name != 2) ||
420 (In0P->gen_uidsType.msgtl_size != 32))
421 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
422#endif /* TypeCheck */
423
424 msgh_size_delta = (In0P->gen_uidsType.msgtl_header.msgt_inline) ? 4 * In0P->gen_uidsType.msgtl_number : sizeof(uid_t *);
425#if TypeCheck1
426 if (msgh_size < 60 + msgh_size_delta)
427 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
428 msgh_size -= msgh_size_delta;
429#endif /* TypeCheck */
430
431 In1P = (Request *) ((char *) In0P + msgh_size_delta - 2048);
432
433#if TypeCheck1
434 if ((In1P->gen_gidsType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) ||
435 (In1P->gen_gidsType.msgtl_name != 2) ||
436 (In1P->gen_gidsType.msgtl_size != 32))
437 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
438#endif /* TypeCheck */
439
440 msgh_size_delta = (In1P->gen_gidsType.msgtl_header.msgt_inline) ? 4 * In1P->gen_gidsType.msgtl_number : sizeof(uid_t *);
441#if TypeCheck1
442 if (msgh_size < 60 + msgh_size_delta)
443 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
444 msgh_size -= msgh_size_delta;
445#endif /* TypeCheck */
446
447 In2P = (Request *) ((char *) In1P + msgh_size_delta - 2048);
448
449#if TypeCheck1
450 if ((In2P->filehandleType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) ||
451 (In2P->filehandleType.msgtl_name != 8) ||
452 (In2P->filehandleType.msgtl_size != 8))
453 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
454#endif /* TypeCheck */
455
456#if TypeCheck1
457 if (msgh_size != 60 + ((In2P->filehandleType.msgtl_header.msgt_inline) ? (In2P->filehandleType.msgtl_number + 3) & ~3 : sizeof(char *)))
458 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
459#endif /* TypeCheck */
460
461 fsys = begin_using_control_port(In0P->Head.msgh_request_portmsgh_local_port);
462
463 OutP->RetCode = netfs_S_fsys_getfile(fsys, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), (In0P->gen_uidsType.msgtl_header.msgt_inline) ? In0P->gen_uids : *((uid_t **)In0P->gen_uids), In0P->gen_uidsType.msgtl_number, (In1P->gen_gidsType.msgtl_header.msgt_inline) ? In1P->gen_gids : *((uid_t **)In1P->gen_gids), In1P->gen_gidsType.msgtl_number, (In2P->filehandleType.msgtl_header.msgt_inline) ? In2P->filehandle : *((char **)In2P->filehandle), In2P->filehandleType.msgtl_number, &OutP->file, &filePoly);
464 if (OutP->RetCode == KERN_SUCCESS0)
465 if (!In2P->filehandleType.msgtl_header.msgt_inline)
466 __mig_deallocate(* (vm_offset_t *) In2P->filehandle, In2P->filehandleType.msgtl_number);
467 if (OutP->RetCode == KERN_SUCCESS0)
468 if (!In1P->gen_gidsType.msgtl_header.msgt_inline)
469 __mig_deallocate(* (vm_offset_t *) In1P->gen_gids, 4 * In1P->gen_gidsType.msgtl_number);
470 if (OutP->RetCode == KERN_SUCCESS0)
471 if (!In0P->gen_uidsType.msgtl_header.msgt_inline)
472 __mig_deallocate(* (vm_offset_t *) In0P->gen_uids, 4 * In0P->gen_uidsType.msgtl_number);
473 end_using_control_port(fsys);
474 if (OutP->RetCode != KERN_SUCCESS0)
475 return;
476
477 msgh_simple = TRUE((boolean_t) 1);
478 OutP->Head.msgh_size = 40;
479
480 OutP->fileType = fileType;
481
482 if (MACH_MSG_TYPE_PORT_ANY(filePoly)(((filePoly) >= 16) && ((filePoly) <= 21)))
483 msgh_simple = FALSE((boolean_t) 0);
484
485 OutP->fileType.msgt_name = filePoly;
486
487 if (!msgh_simple)
488 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U;
489}
490
491/* Routine fsys_syncfs */
492mig_internalstatic void _Xfsys_syncfs
493 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
494{
495 typedef struct {
496 mach_msg_header_t Head;
497 mach_msg_type_t waitType;
498 int wait;
499 mach_msg_type_t do_childrenType;
500 int do_children;
501 } Request;
502
503 typedef struct {
504 mach_msg_header_t Head;
505 mach_msg_type_t RetCodeType;
506 kern_return_t RetCode;
507 } Reply;
508
509 Request *In0P = (Request *) InHeadP;
510 Reply *OutP = (Reply *) OutHeadP;
511 mig_external kern_return_t netfs_S_fsys_syncfs
512 (control_t fsys, mach_port_t reply, mach_msg_type_name_t replyPoly, int wait, int do_children);
513
514 const mach_msg_type_t waitCheck = {
515 /* msgt_name = */ 2,
516 /* msgt_size = */ 32,
517 /* msgt_number = */ 1,
518 /* msgt_inline = */ TRUE((boolean_t) 1),
519 /* msgt_longform = */ FALSE((boolean_t) 0),
520 /* msgt_deallocate = */ FALSE((boolean_t) 0),
521 /* msgt_unused = */ 0
522 };
523
524 const mach_msg_type_t do_childrenCheck = {
525 /* msgt_name = */ 2,
526 /* msgt_size = */ 32,
527 /* msgt_number = */ 1,
528 /* msgt_inline = */ TRUE((boolean_t) 1),
529 /* msgt_longform = */ FALSE((boolean_t) 0),
530 /* msgt_deallocate = */ FALSE((boolean_t) 0),
531 /* msgt_unused = */ 0
532 };
533
534 control_t fsys;
535
536#if TypeCheck1
537 if ((In0P->Head.msgh_size != 40) ||
538 (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U))
539 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
540#endif /* TypeCheck */
541
542#if TypeCheck1
543 if (BAD_TYPECHECK(&In0P->waitType, &waitCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t =
*(&In0P->waitType); _c.t = *(&waitCheck); _t.w !=
_c.w; })
)
544 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
545#endif /* TypeCheck */
546
547#if TypeCheck1
548 if (BAD_TYPECHECK(&In0P->do_childrenType, &do_childrenCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t =
*(&In0P->do_childrenType); _c.t = *(&do_childrenCheck
); _t.w != _c.w; })
)
549 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
550#endif /* TypeCheck */
551
552 fsys = begin_using_control_port(In0P->Head.msgh_request_portmsgh_local_port);
553
554 OutP->RetCode = netfs_S_fsys_syncfs(fsys, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->wait, In0P->do_children);
555 end_using_control_port(fsys);
556}
557
558/* Routine fsys_set_options */
559mig_internalstatic void _Xfsys_set_options
560 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
561{
562 typedef struct {
563 mach_msg_header_t Head;
564 mach_msg_type_long_t optionsType;
565 char options[2048];
566 mach_msg_type_t do_childrenType;
567 int do_children;
568 } Request;
569
570 typedef struct {
571 mach_msg_header_t Head;
572 mach_msg_type_t RetCodeType;
573 kern_return_t RetCode;
574 } Reply;
575
576 Request *In0P = (Request *) InHeadP;
577 Request *In1P;
578 Reply *OutP = (Reply *) OutHeadP;
579 mig_external kern_return_t netfs_S_fsys_set_options
580 (control_t fsys, mach_port_t reply, mach_msg_type_name_t replyPoly, data_t options, mach_msg_type_number_t optionsCnt, int do_children);
581
582#if TypeCheck1
583 boolean_t msgh_simple;
584#endif /* TypeCheck */
585
586 unsigned int msgh_size;
587 unsigned int msgh_size_delta;
588
589 const mach_msg_type_t do_childrenCheck = {
590 /* msgt_name = */ 2,
591 /* msgt_size = */ 32,
592 /* msgt_number = */ 1,
593 /* msgt_inline = */ TRUE((boolean_t) 1),
594 /* msgt_longform = */ FALSE((boolean_t) 0),
595 /* msgt_deallocate = */ FALSE((boolean_t) 0),
596 /* msgt_unused = */ 0
597 };
598
599 control_t fsys;
600
601#if TypeCheck1
602 msgh_size = In0P->Head.msgh_size;
603 msgh_simple = !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U);
604 if ((msgh_size < 44))
605 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
606#endif /* TypeCheck */
607
608#if TypeCheck1
609 if ((In0P->optionsType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) ||
610 (In0P->optionsType.msgtl_name != 8) ||
611 (In0P->optionsType.msgtl_size != 8))
612 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
613#endif /* TypeCheck */
614
615 msgh_size_delta = (In0P->optionsType.msgtl_header.msgt_inline) ? (In0P->optionsType.msgtl_number + 3) & ~3 : sizeof(char *);
616#if TypeCheck1
617 if (msgh_size != 44 + msgh_size_delta)
618 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
619#endif /* TypeCheck */
620
621 In1P = (Request *) ((char *) In0P + msgh_size_delta - 2048);
622
623#if TypeCheck1
624 if (BAD_TYPECHECK(&In1P->do_childrenType, &do_childrenCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t =
*(&In1P->do_childrenType); _c.t = *(&do_childrenCheck
); _t.w != _c.w; })
)
625 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
626#endif /* TypeCheck */
627
628 fsys = begin_using_control_port(In0P->Head.msgh_request_portmsgh_local_port);
629
630 OutP->RetCode = netfs_S_fsys_set_options(fsys, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), (In0P->optionsType.msgtl_header.msgt_inline) ? In0P->options : *((char **)In0P->options), In0P->optionsType.msgtl_number, In1P->do_children);
631 if (OutP->RetCode == KERN_SUCCESS0)
632 if (!In0P->optionsType.msgtl_header.msgt_inline)
633 __mig_deallocate(* (vm_offset_t *) In0P->options, In0P->optionsType.msgtl_number);
634 end_using_control_port(fsys);
635}
636
637/* Routine fsys_getpriv */
638mig_internalstatic void _Xfsys_getpriv
639 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
640{
641 typedef struct {
642 mach_msg_header_t Head;
643 } Request;
644
645 typedef struct {
646 mach_msg_header_t Head;
647 mach_msg_type_t RetCodeType;
648 kern_return_t RetCode;
649 mach_msg_type_t host_privType;
650 mach_port_t host_priv;
651 mach_msg_type_t device_masterType;
652 mach_port_t device_master;
653 mach_msg_type_t fstaskType;
654 mach_port_t fstask;
655 } Reply;
656
657 Request *In0P = (Request *) InHeadP;
658 Reply *OutP = (Reply *) OutHeadP;
659 mig_external kern_return_t netfs_S_fsys_getpriv
660 (control_t fsys, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t *host_priv, mach_msg_type_name_t *host_privPoly, mach_port_t *device_master, mach_msg_type_name_t *device_masterPoly, mach_port_t *fstask, mach_msg_type_name_t *fstaskPoly);
661
662 boolean_t msgh_simple;
663 const mach_msg_type_t host_privType = {
664 /* msgt_name = */ -1,
665 /* msgt_size = */ 32,
666 /* msgt_number = */ 1,
667 /* msgt_inline = */ TRUE((boolean_t) 1),
668 /* msgt_longform = */ FALSE((boolean_t) 0),
669 /* msgt_deallocate = */ FALSE((boolean_t) 0),
670 /* msgt_unused = */ 0
671 };
672
673 const mach_msg_type_t device_masterType = {
674 /* msgt_name = */ -1,
675 /* msgt_size = */ 32,
676 /* msgt_number = */ 1,
677 /* msgt_inline = */ TRUE((boolean_t) 1),
678 /* msgt_longform = */ FALSE((boolean_t) 0),
679 /* msgt_deallocate = */ FALSE((boolean_t) 0),
680 /* msgt_unused = */ 0
681 };
682
683 const mach_msg_type_t fstaskType = {
684 /* msgt_name = */ -1,
685 /* msgt_size = */ 32,
686 /* msgt_number = */ 1,
687 /* msgt_inline = */ TRUE((boolean_t) 1),
688 /* msgt_longform = */ FALSE((boolean_t) 0),
689 /* msgt_deallocate = */ FALSE((boolean_t) 0),
690 /* msgt_unused = */ 0
691 };
692
693 control_t fsys;
694 mach_msg_type_name_t host_privPoly;
695 mach_msg_type_name_t device_masterPoly;
696 mach_msg_type_name_t fstaskPoly;
697
698#if TypeCheck1
699 if ((In0P->Head.msgh_size != 24) ||
700 (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U))
701 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
702#endif /* TypeCheck */
703
704 fsys = begin_using_control_port(In0P->Head.msgh_request_portmsgh_local_port);
705
706 OutP->RetCode = netfs_S_fsys_getpriv(fsys, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->host_priv, &host_privPoly, &OutP->device_master, &device_masterPoly, &OutP->fstask, &fstaskPoly);
707 end_using_control_port(fsys);
708 if (OutP->RetCode != KERN_SUCCESS0)
709 return;
710
711 msgh_simple = TRUE((boolean_t) 1);
712 OutP->Head.msgh_size = 56;
713
714 OutP->host_privType = host_privType;
715
716 if (MACH_MSG_TYPE_PORT_ANY(host_privPoly)(((host_privPoly) >= 16) && ((host_privPoly) <=
21))
)
717 msgh_simple = FALSE((boolean_t) 0);
718
719 OutP->host_privType.msgt_name = host_privPoly;
720
721 OutP->device_masterType = device_masterType;
722
723 if (MACH_MSG_TYPE_PORT_ANY(device_masterPoly)(((device_masterPoly) >= 16) && ((device_masterPoly
) <= 21))
)
724 msgh_simple = FALSE((boolean_t) 0);
725
726 OutP->device_masterType.msgt_name = device_masterPoly;
727
728 OutP->fstaskType = fstaskType;
729
730 if (MACH_MSG_TYPE_PORT_ANY(fstaskPoly)(((fstaskPoly) >= 16) && ((fstaskPoly) <= 21)))
731 msgh_simple = FALSE((boolean_t) 0);
732
733 OutP->fstaskType.msgt_name = fstaskPoly;
734
735 if (!msgh_simple)
736 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U;
737}
738
739/* Routine fsys_init */
740mig_internalstatic void _Xfsys_init
741 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
742{
743 typedef struct {
744 mach_msg_header_t Head;
745 mach_msg_type_t proc_serverType;
746 mach_port_t proc_server;
747 mach_msg_type_t auth_handleType;
748 auth_t auth_handle;
749 } Request;
750
751 typedef struct {
752 mach_msg_header_t Head;
753 mach_msg_type_t RetCodeType;
754 kern_return_t RetCode;
755 } Reply;
756
757 Request *In0P = (Request *) InHeadP;
758 Reply *OutP = (Reply *) OutHeadP;
759 mig_external kern_return_t netfs_S_fsys_init
760 (control_t fsys, mach_port_t reply_port, mach_msg_type_name_t reply_portPoly, mach_port_t proc_server, auth_t auth_handle);
761
762 const mach_msg_type_t proc_serverCheck = {
763 /* msgt_name = */ 17,
764 /* msgt_size = */ 32,
765 /* msgt_number = */ 1,
766 /* msgt_inline = */ TRUE((boolean_t) 1),
767 /* msgt_longform = */ FALSE((boolean_t) 0),
768 /* msgt_deallocate = */ FALSE((boolean_t) 0),
769 /* msgt_unused = */ 0
770 };
771
772 const mach_msg_type_t auth_handleCheck = {
773 /* msgt_name = */ 17,
774 /* msgt_size = */ 32,
775 /* msgt_number = */ 1,
776 /* msgt_inline = */ TRUE((boolean_t) 1),
777 /* msgt_longform = */ FALSE((boolean_t) 0),
778 /* msgt_deallocate = */ FALSE((boolean_t) 0),
779 /* msgt_unused = */ 0
780 };
781
782 control_t fsys;
783
784#if TypeCheck1
785 if ((In0P->Head.msgh_size != 40) ||
786 !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U))
787 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
788#endif /* TypeCheck */
789
790#if TypeCheck1
791 if (BAD_TYPECHECK(&In0P->proc_serverType, &proc_serverCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t =
*(&In0P->proc_serverType); _c.t = *(&proc_serverCheck
); _t.w != _c.w; })
)
792 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
793#endif /* TypeCheck */
794
795#if TypeCheck1
796 if (BAD_TYPECHECK(&In0P->auth_handleType, &auth_handleCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t =
*(&In0P->auth_handleType); _c.t = *(&auth_handleCheck
); _t.w != _c.w; })
)
797 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
798#endif /* TypeCheck */
799
800 fsys = begin_using_control_port(In0P->Head.msgh_request_portmsgh_local_port);
801
802 OutP->RetCode = netfs_S_fsys_init(fsys, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->proc_server, In0P->auth_handle);
803 end_using_control_port(fsys);
804}
805
806/* Routine fsys_forward */
807mig_internalstatic void _Xfsys_forward
808 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
809{
810 typedef struct {
811 mach_msg_header_t Head;
812 mach_msg_type_t requestorType;
813 mach_port_t requestor;
814 mach_msg_type_long_t argvType;
815 char argv[2048];
816 } Request;
817
818 typedef struct {
819 mach_msg_header_t Head;
820 mach_msg_type_t RetCodeType;
821 kern_return_t RetCode;
822 } Reply;
823
824 Request *In0P = (Request *) InHeadP;
825 Reply *OutP = (Reply *) OutHeadP;
826 mig_external kern_return_t netfs_S_fsys_forward
827 (mach_port_t server, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t requestor, data_t argv, mach_msg_type_number_t argvCnt);
828
829 unsigned int msgh_size;
830
831 const mach_msg_type_t requestorCheck = {
832 /* msgt_name = */ 17,
833 /* msgt_size = */ 32,
834 /* msgt_number = */ 1,
835 /* msgt_inline = */ TRUE((boolean_t) 1),
836 /* msgt_longform = */ FALSE((boolean_t) 0),
837 /* msgt_deallocate = */ FALSE((boolean_t) 0),
838 /* msgt_unused = */ 0
839 };
840
841#if TypeCheck1
842 msgh_size = In0P->Head.msgh_size;
843 if ((msgh_size < 44) ||
844 !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U))
845 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
846#endif /* TypeCheck */
847
848#if TypeCheck1
849 if (BAD_TYPECHECK(&In0P->requestorType, &requestorCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t =
*(&In0P->requestorType); _c.t = *(&requestorCheck
); _t.w != _c.w; })
)
850 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
851#endif /* TypeCheck */
852
853#if TypeCheck1
854 if ((In0P->argvType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) ||
855 (In0P->argvType.msgtl_name != 8) ||
856 (In0P->argvType.msgtl_size != 8))
857 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
858#endif /* TypeCheck */
859
860#if TypeCheck1
861 if (msgh_size != 44 + ((In0P->argvType.msgtl_header.msgt_inline) ? (In0P->argvType.msgtl_number + 3) & ~3 : sizeof(char *)))
862 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
863#endif /* TypeCheck */
864
865 OutP->RetCode = netfs_S_fsys_forward(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->requestor, (In0P->argvType.msgtl_header.msgt_inline) ? In0P->argv : *((char **)In0P->argv), In0P->argvType.msgtl_number);
866 if (OutP->RetCode == KERN_SUCCESS0)
867 if (!In0P->argvType.msgtl_header.msgt_inline)
868 __mig_deallocate(* (vm_offset_t *) In0P->argv, In0P->argvType.msgtl_number);
869}
870
871/* Routine fsys_get_options */
872mig_internalstatic void _Xfsys_get_options
873 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
874{
875 typedef struct {
876 mach_msg_header_t Head;
877 } Request;
878
879 typedef struct {
880 mach_msg_header_t Head;
881 mach_msg_type_t RetCodeType;
882 kern_return_t RetCode;
883 mach_msg_type_long_t optionsType;
884 char options[2048];
885 } Reply;
886
887 Request *In0P = (Request *) InHeadP;
888 Reply *OutP = (Reply *) OutHeadP;
889 mig_external kern_return_t netfs_S_fsys_get_options
890 (control_t server, mach_port_t reply, mach_msg_type_name_t replyPoly, data_t *options, mach_msg_type_number_t *optionsCnt);
891
892 boolean_t msgh_simple;
893 const mach_msg_type_long_t optionsType = {
894 {
895 /* msgt_name = */ 0,
896 /* msgt_size = */ 0,
897 /* msgt_number = */ 0,
898 /* msgt_inline = */ TRUE((boolean_t) 1),
899 /* msgt_longform = */ TRUE((boolean_t) 1),
900 /* msgt_deallocate = */ FALSE((boolean_t) 0),
901 /* msgt_unused = */ 0
902 },
903 /* msgtl_name = */ 8,
904 /* msgtl_size = */ 8,
905 /* msgtl_number = */ 2048,
906 };
907
908 control_t server;
909 mach_msg_type_number_t optionsCnt;
910
911 char *optionsP;
912
913#if TypeCheck1
914 if ((In0P->Head.msgh_size != 24) ||
915 (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U))
916 { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; }
917#endif /* TypeCheck */
918
919 server = begin_using_control_port(In0P->Head.msgh_request_portmsgh_local_port);
920
921 optionsP = OutP->options;
922 optionsCnt = 2048;
923
924 OutP->RetCode = netfs_S_fsys_get_options(server, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &optionsP, &optionsCnt);
925 end_using_control_port(server);
926 if (OutP->RetCode != KERN_SUCCESS0)
927 return;
928
929 msgh_simple = TRUE((boolean_t) 1);
930
931 OutP->optionsType = optionsType;
932 if (optionsP != OutP->options) {
933 OutP->optionsType.msgtl_header.msgt_inline = FALSE((boolean_t) 0);
934 OutP->optionsType.msgtl_header.msgt_deallocate = TRUE((boolean_t) 1);
935 *((char **)OutP->options) = optionsP;
936 msgh_simple = FALSE((boolean_t) 0);
937 }
938
939 OutP->optionsType.msgtl_number = optionsCnt;
940 OutP->Head.msgh_size = 44 + ((OutP->optionsType.msgtl_header.msgt_inline) ? (optionsCnt + 3) & ~3 : sizeof(char *));
941
942 if (!msgh_simple)
943 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U;
944}
945
946mig_routine_t netfs_fsys_server_routines[] = {
947 _Xfsys_startup,
948 _Xfsys_goaway,
949 _Xfsys_getroot,
950 _Xfsys_getfile,
951 _Xfsys_syncfs,
952 _Xfsys_set_options,
953 _Xfsys_getpriv,
954 _Xfsys_init,
955 _Xfsys_forward,
956 _Xfsys_get_options,
957 0,
958 0,
959};
960
961mig_external boolean_t netfs_fsys_server
962 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
963{
964 mach_msg_header_t *InP = InHeadP;
965 mig_reply_header_t *OutP = (mig_reply_header_t *) OutHeadP;
966
967 const mach_msg_type_t RetCodeType = {
968 /* msgt_name = */ MACH_MSG_TYPE_INTEGER_322,
969 /* msgt_size = */ 32,
970 /* msgt_number = */ 1,
971 /* msgt_inline = */ TRUE((boolean_t) 1),
972 /* msgt_longform = */ FALSE((boolean_t) 0),
973 /* msgt_deallocate = */ FALSE((boolean_t) 0),
974 /* msgt_unused = */ 0
975 };
976
977 mig_routine_t routine;
978
979 OutP->Head.msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InP->msgh_bits), 0)((((InP->msgh_bits) & 0x000000ff)) | ((0) << 8));
980 OutP->Head.msgh_size = sizeof *OutP;
981 OutP->Head.msgh_remote_port = InP->msgh_reply_portmsgh_remote_port;
982 OutP->Head.msgh_local_port = MACH_PORT_NULL((mach_port_t) 0);
983 OutP->Head.msgh_seqno = 0;
984 OutP->Head.msgh_id = InP->msgh_id + 100;
985
986 OutP->RetCodeType = RetCodeType;
987
988 if ((InP->msgh_id > 22011) || (InP->msgh_id < 22000) ||
989 ((routine = netfs_fsys_server_routines[InP->msgh_id - 22000]) == 0)) {
990 OutP->RetCode = MIG_BAD_ID-303;
991 return FALSE((boolean_t) 0);
992 }
993 (*routine) (InP, &OutP->Head);
994 return TRUE((boolean_t) 1);
995}
996
997mig_external mig_routine_t netfs_fsys_server_routine
998 (const mach_msg_header_t *InHeadP)
999{
1000 int msgh_id;
1001
1002 msgh_id = InHeadP->msgh_id - 22000;
1003
1004 if ((msgh_id > 11) || (msgh_id < 0))
1005 return 0;
1006
1007 return netfs_fsys_server_routines[msgh_id];
1008}
1009