1#ifndef _vfs_nspace_user_
2#define _vfs_nspace_user_
3
4/* Module vfs_nspace */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS_CSTRING_ATTR
29#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS_CSTRING_COUNTEDBY_ATTR(C) __unsafe_indexable
30#endif
31 extern int mig_strncpy_zerofill(char * dest, const char * src, int len) __attribute__((weak_import));
32#ifdef __cplusplus
33}
34#endif
35#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
36#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
37#endif /* __has_include */
38
39/* END MIG_STRNCPY_ZEROFILL CODE */
40
41
42#ifdef AUTOTEST
43#ifndef FUNCTION_PTR_T
44#define FUNCTION_PTR_T
45typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
46typedef struct {
47 char * name;
48 function_ptr_t function;
49} function_table_entry;
50typedef function_table_entry *function_table_t;
51#endif /* FUNCTION_PTR_T */
52#endif /* AUTOTEST */
53
54#ifndef vfs_nspace_MSG_COUNT
55#define vfs_nspace_MSG_COUNT 8
56#endif /* vfs_nspace_MSG_COUNT */
57
58#include <Availability.h>
59#include <mach/std_types.h>
60#include <mach/mig.h>
61#include <mach/mig.h>
62#include <mach/mach_types.h>
63
64#ifdef __BeforeMigUserHeader
65__BeforeMigUserHeader
66#endif /* __BeforeMigUserHeader */
67
68#include <sys/cdefs.h>
69__BEGIN_DECLS
70
71
72/* Routine nspace_handle */
73#ifdef mig_external
74mig_external
75#else
76extern
77#endif /* mig_external */
78kern_return_t send_nspace_handle
79(
80 mach_port_t nspace_handler_port,
81 uint32_t pid,
82 vfs_path_t path,
83 int *handler_error
84);
85
86/* Routine nspace_resolve_cancel */
87#ifdef mig_external
88mig_external
89#else
90extern
91#endif /* mig_external */
92kern_return_t send_nspace_resolve_cancel
93(
94 mach_port_t nspace_handler_port,
95 uint32_t req_id
96);
97
98/* Routine nspace_resolve_path */
99#ifdef mig_external
100mig_external
101#else
102extern
103#endif /* mig_external */
104kern_return_t send_nspace_resolve_path
105(
106 mach_port_t nspace_handler_port,
107 uint32_t req_id,
108 uint32_t pid,
109 uint32_t op,
110 nspace_path_t path,
111 int *xxx_rdar44371223
112);
113
114/* Routine vfs_resolve_file */
115#ifdef mig_external
116mig_external
117#else
118extern
119#endif /* mig_external */
120kern_return_t send_vfs_resolve_file
121(
122 mach_port_t nspace_handler_port,
123 uint32_t req_id,
124 uint32_t pid,
125 uint32_t op,
126 int64_t offset,
127 int64_t size,
128 nspace_path_t path
129);
130
131/* Routine vfs_resolve_dir */
132#ifdef mig_external
133mig_external
134#else
135extern
136#endif /* mig_external */
137kern_return_t send_vfs_resolve_dir
138(
139 mach_port_t nspace_handler_port,
140 uint32_t req_id,
141 uint32_t pid,
142 uint32_t op,
143 nspace_name_t file_name,
144 nspace_path_t path
145);
146
147/* Routine vfs_resolve_file_with_audit_token */
148#ifdef mig_external
149mig_external
150#else
151extern
152#endif /* mig_external */
153kern_return_t send_vfs_resolve_file_with_audit_token
154(
155 mach_port_t nspace_handler_port,
156 uint32_t req_id,
157 uint32_t op,
158 int64_t offset,
159 int64_t size,
160 nspace_path_t path,
161 audit_token_t req_atoken
162);
163
164/* Routine vfs_resolve_dir_with_audit_token */
165#ifdef mig_external
166mig_external
167#else
168extern
169#endif /* mig_external */
170kern_return_t send_vfs_resolve_dir_with_audit_token
171(
172 mach_port_t nspace_handler_port,
173 uint32_t req_id,
174 uint32_t op,
175 nspace_name_t file_name,
176 nspace_path_t path,
177 audit_token_t req_atoken
178);
179
180/* Routine vfs_resolve_reparent_with_audit_token */
181#ifdef mig_external
182mig_external
183#else
184extern
185#endif /* mig_external */
186kern_return_t send_vfs_resolve_reparent_with_audit_token
187(
188 mach_port_t nspace_handler_port,
189 uint32_t req_id,
190 uint32_t op,
191 nspace_path_t path,
192 nspace_path_t dest_path,
193 audit_token_t req_atoken
194);
195
196__END_DECLS
197
198/********************** Caution **************************/
199/* The following data types should be used to calculate */
200/* maximum message sizes only. The actual message may be */
201/* smaller, and the position of the arguments within the */
202/* message layout may vary from what is presented here. */
203/* For example, if any of the arguments are variable- */
204/* sized, and less than the maximum is sent, the data */
205/* will be packed tight in the actual message to reduce */
206/* the presence of holes. */
207/********************** Caution **************************/
208
209/* typedefs for all requests */
210
211#ifndef __Request__vfs_nspace_subsystem__defined
212#define __Request__vfs_nspace_subsystem__defined
213
214#ifdef __MigPackStructs
215#pragma pack(push, 4)
216#endif
217 typedef struct {
218 mach_msg_header_t Head;
219 NDR_record_t NDR;
220 uint32_t pid;
221 vfs_path_t path;
222 } __Request__nspace_handle_t __attribute__((unused));
223#ifdef __MigPackStructs
224#pragma pack(pop)
225#endif
226
227#ifdef __MigPackStructs
228#pragma pack(push, 4)
229#endif
230 typedef struct {
231 mach_msg_header_t Head;
232 NDR_record_t NDR;
233 uint32_t req_id;
234 } __Request__nspace_resolve_cancel_t __attribute__((unused));
235#ifdef __MigPackStructs
236#pragma pack(pop)
237#endif
238
239#ifdef __MigPackStructs
240#pragma pack(push, 4)
241#endif
242 typedef struct {
243 mach_msg_header_t Head;
244 NDR_record_t NDR;
245 uint32_t req_id;
246 uint32_t pid;
247 uint32_t op;
248 nspace_path_t path;
249 } __Request__nspace_resolve_path_t __attribute__((unused));
250#ifdef __MigPackStructs
251#pragma pack(pop)
252#endif
253
254#ifdef __MigPackStructs
255#pragma pack(push, 4)
256#endif
257 typedef struct {
258 mach_msg_header_t Head;
259 NDR_record_t NDR;
260 uint32_t req_id;
261 uint32_t pid;
262 uint32_t op;
263 int64_t offset;
264 int64_t size;
265 nspace_path_t path;
266 } __Request__vfs_resolve_file_t __attribute__((unused));
267#ifdef __MigPackStructs
268#pragma pack(pop)
269#endif
270
271#ifdef __MigPackStructs
272#pragma pack(push, 4)
273#endif
274 typedef struct {
275 mach_msg_header_t Head;
276 NDR_record_t NDR;
277 uint32_t req_id;
278 uint32_t pid;
279 uint32_t op;
280 nspace_name_t file_name;
281 nspace_path_t path;
282 } __Request__vfs_resolve_dir_t __attribute__((unused));
283#ifdef __MigPackStructs
284#pragma pack(pop)
285#endif
286
287#ifdef __MigPackStructs
288#pragma pack(push, 4)
289#endif
290 typedef struct {
291 mach_msg_header_t Head;
292 NDR_record_t NDR;
293 uint32_t req_id;
294 uint32_t op;
295 int64_t offset;
296 int64_t size;
297 nspace_path_t path;
298 audit_token_t req_atoken;
299 } __Request__vfs_resolve_file_with_audit_token_t __attribute__((unused));
300#ifdef __MigPackStructs
301#pragma pack(pop)
302#endif
303
304#ifdef __MigPackStructs
305#pragma pack(push, 4)
306#endif
307 typedef struct {
308 mach_msg_header_t Head;
309 NDR_record_t NDR;
310 uint32_t req_id;
311 uint32_t op;
312 nspace_name_t file_name;
313 nspace_path_t path;
314 audit_token_t req_atoken;
315 } __Request__vfs_resolve_dir_with_audit_token_t __attribute__((unused));
316#ifdef __MigPackStructs
317#pragma pack(pop)
318#endif
319
320#ifdef __MigPackStructs
321#pragma pack(push, 4)
322#endif
323 typedef struct {
324 mach_msg_header_t Head;
325 NDR_record_t NDR;
326 uint32_t req_id;
327 uint32_t op;
328 nspace_path_t path;
329 nspace_path_t dest_path;
330 audit_token_t req_atoken;
331 } __Request__vfs_resolve_reparent_with_audit_token_t __attribute__((unused));
332#ifdef __MigPackStructs
333#pragma pack(pop)
334#endif
335#endif /* !__Request__vfs_nspace_subsystem__defined */
336
337/* union of all requests */
338
339#ifndef __RequestUnion__send_vfs_nspace_subsystem__defined
340#define __RequestUnion__send_vfs_nspace_subsystem__defined
341union __RequestUnion__send_vfs_nspace_subsystem {
342 __Request__nspace_handle_t Request_send_nspace_handle;
343 __Request__nspace_resolve_cancel_t Request_send_nspace_resolve_cancel;
344 __Request__nspace_resolve_path_t Request_send_nspace_resolve_path;
345 __Request__vfs_resolve_file_t Request_send_vfs_resolve_file;
346 __Request__vfs_resolve_dir_t Request_send_vfs_resolve_dir;
347 __Request__vfs_resolve_file_with_audit_token_t Request_send_vfs_resolve_file_with_audit_token;
348 __Request__vfs_resolve_dir_with_audit_token_t Request_send_vfs_resolve_dir_with_audit_token;
349 __Request__vfs_resolve_reparent_with_audit_token_t Request_send_vfs_resolve_reparent_with_audit_token;
350};
351#endif /* !__RequestUnion__send_vfs_nspace_subsystem__defined */
352/* typedefs for all replies */
353
354#ifndef __Reply__vfs_nspace_subsystem__defined
355#define __Reply__vfs_nspace_subsystem__defined
356
357#ifdef __MigPackStructs
358#pragma pack(push, 4)
359#endif
360 typedef struct {
361 mach_msg_header_t Head;
362 NDR_record_t NDR;
363 kern_return_t RetCode;
364 int handler_error;
365 } __Reply__nspace_handle_t __attribute__((unused));
366#ifdef __MigPackStructs
367#pragma pack(pop)
368#endif
369
370#ifdef __MigPackStructs
371#pragma pack(push, 4)
372#endif
373 typedef struct {
374 mach_msg_header_t Head;
375 NDR_record_t NDR;
376 kern_return_t RetCode;
377 } __Reply__nspace_resolve_cancel_t __attribute__((unused));
378#ifdef __MigPackStructs
379#pragma pack(pop)
380#endif
381
382#ifdef __MigPackStructs
383#pragma pack(push, 4)
384#endif
385 typedef struct {
386 mach_msg_header_t Head;
387 NDR_record_t NDR;
388 kern_return_t RetCode;
389 int xxx_rdar44371223;
390 } __Reply__nspace_resolve_path_t __attribute__((unused));
391#ifdef __MigPackStructs
392#pragma pack(pop)
393#endif
394
395#ifdef __MigPackStructs
396#pragma pack(push, 4)
397#endif
398 typedef struct {
399 mach_msg_header_t Head;
400 NDR_record_t NDR;
401 kern_return_t RetCode;
402 } __Reply__vfs_resolve_file_t __attribute__((unused));
403#ifdef __MigPackStructs
404#pragma pack(pop)
405#endif
406
407#ifdef __MigPackStructs
408#pragma pack(push, 4)
409#endif
410 typedef struct {
411 mach_msg_header_t Head;
412 NDR_record_t NDR;
413 kern_return_t RetCode;
414 } __Reply__vfs_resolve_dir_t __attribute__((unused));
415#ifdef __MigPackStructs
416#pragma pack(pop)
417#endif
418
419#ifdef __MigPackStructs
420#pragma pack(push, 4)
421#endif
422 typedef struct {
423 mach_msg_header_t Head;
424 NDR_record_t NDR;
425 kern_return_t RetCode;
426 } __Reply__vfs_resolve_file_with_audit_token_t __attribute__((unused));
427#ifdef __MigPackStructs
428#pragma pack(pop)
429#endif
430
431#ifdef __MigPackStructs
432#pragma pack(push, 4)
433#endif
434 typedef struct {
435 mach_msg_header_t Head;
436 NDR_record_t NDR;
437 kern_return_t RetCode;
438 } __Reply__vfs_resolve_dir_with_audit_token_t __attribute__((unused));
439#ifdef __MigPackStructs
440#pragma pack(pop)
441#endif
442
443#ifdef __MigPackStructs
444#pragma pack(push, 4)
445#endif
446 typedef struct {
447 mach_msg_header_t Head;
448 NDR_record_t NDR;
449 kern_return_t RetCode;
450 } __Reply__vfs_resolve_reparent_with_audit_token_t __attribute__((unused));
451#ifdef __MigPackStructs
452#pragma pack(pop)
453#endif
454#endif /* !__Reply__vfs_nspace_subsystem__defined */
455
456/* union of all replies */
457
458#ifndef __ReplyUnion__send_vfs_nspace_subsystem__defined
459#define __ReplyUnion__send_vfs_nspace_subsystem__defined
460union __ReplyUnion__send_vfs_nspace_subsystem {
461 __Reply__nspace_handle_t Reply_send_nspace_handle;
462 __Reply__nspace_resolve_cancel_t Reply_send_nspace_resolve_cancel;
463 __Reply__nspace_resolve_path_t Reply_send_nspace_resolve_path;
464 __Reply__vfs_resolve_file_t Reply_send_vfs_resolve_file;
465 __Reply__vfs_resolve_dir_t Reply_send_vfs_resolve_dir;
466 __Reply__vfs_resolve_file_with_audit_token_t Reply_send_vfs_resolve_file_with_audit_token;
467 __Reply__vfs_resolve_dir_with_audit_token_t Reply_send_vfs_resolve_dir_with_audit_token;
468 __Reply__vfs_resolve_reparent_with_audit_token_t Reply_send_vfs_resolve_reparent_with_audit_token;
469};
470#endif /* !__RequestUnion__send_vfs_nspace_subsystem__defined */
471
472#ifndef subsystem_to_name_map_vfs_nspace
473#define subsystem_to_name_map_vfs_nspace \
474 { "nspace_handle", 867800 },\
475 { "nspace_resolve_cancel", 867801 },\
476 { "nspace_resolve_path", 867802 },\
477 { "vfs_resolve_file", 867803 },\
478 { "vfs_resolve_dir", 867804 },\
479 { "vfs_resolve_file_with_audit_token", 867805 },\
480 { "vfs_resolve_dir_with_audit_token", 867806 },\
481 { "vfs_resolve_reparent_with_audit_token", 867807 }
482#endif
483
484#ifdef __AfterMigUserHeader
485__AfterMigUserHeader
486#endif /* __AfterMigUserHeader */
487
488#endif /* _vfs_nspace_user_ */
489