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