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