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