jailbreak_daemonUser.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. #ifndef _jailbreak_daemon_user_
  2. #define _jailbreak_daemon_user_
  3. /* Module jailbreak_daemon */
  4. #include <string.h>
  5. #include <mach/ndr.h>
  6. #include <mach/boolean.h>
  7. #include <mach/kern_return.h>
  8. #include <mach/notify.h>
  9. #include <mach/mach_types.h>
  10. #include <mach/message.h>
  11. #include <mach/mig_errors.h>
  12. #include <mach/port.h>
  13. /* BEGIN VOUCHER CODE */
  14. #ifndef KERNEL
  15. #if defined(__has_include)
  16. #if __has_include(<mach/mig_voucher_support.h>)
  17. #ifndef USING_VOUCHERS
  18. #define USING_VOUCHERS
  19. #endif
  20. #ifndef __VOUCHER_FORWARD_TYPE_DECLS__
  21. #define __VOUCHER_FORWARD_TYPE_DECLS__
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. extern boolean_t voucher_mach_msg_set(mach_msg_header_t *msg) __attribute__((weak_import));
  26. #ifdef __cplusplus
  27. }
  28. #endif
  29. #endif // __VOUCHER_FORWARD_TYPE_DECLS__
  30. #endif // __has_include(<mach/mach_voucher_types.h>)
  31. #endif // __has_include
  32. #endif // !KERNEL
  33. /* END VOUCHER CODE */
  34. /* BEGIN MIG_STRNCPY_ZEROFILL CODE */
  35. #if defined(__has_include)
  36. #if __has_include(<mach/mig_strncpy_zerofill_support.h>)
  37. #ifndef USING_MIG_STRNCPY_ZEROFILL
  38. #define USING_MIG_STRNCPY_ZEROFILL
  39. #endif
  40. #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
  41. #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
  50. #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
  51. #endif /* __has_include */
  52. /* END MIG_STRNCPY_ZEROFILL CODE */
  53. #ifdef AUTOTEST
  54. #ifndef FUNCTION_PTR_T
  55. #define FUNCTION_PTR_T
  56. typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
  57. typedef struct {
  58. char *name;
  59. function_ptr_t function;
  60. } function_table_entry;
  61. typedef function_table_entry *function_table_t;
  62. #endif /* FUNCTION_PTR_T */
  63. #endif /* AUTOTEST */
  64. #ifndef jailbreak_daemon_MSG_COUNT
  65. #define jailbreak_daemon_MSG_COUNT 1
  66. #endif /* jailbreak_daemon_MSG_COUNT */
  67. #include <mach/std_types.h>
  68. #include <mach/mig.h>
  69. #include <mach/mig.h>
  70. #include <mach/mach_types.h>
  71. #ifdef __BeforeMigUserHeader
  72. __BeforeMigUserHeader
  73. #endif /* __BeforeMigUserHeader */
  74. #include <sys/cdefs.h>
  75. __BEGIN_DECLS
  76. /* Routine call */
  77. #ifdef mig_external
  78. mig_external
  79. #else
  80. extern
  81. #endif /* mig_external */
  82. kern_return_t jbd_call
  83. (
  84. mach_port_t server_port,
  85. uint8_t command,
  86. uint32_t pid
  87. );
  88. __END_DECLS
  89. /********************** Caution **************************/
  90. /* The following data types should be used to calculate */
  91. /* maximum message sizes only. The actual message may be */
  92. /* smaller, and the position of the arguments within the */
  93. /* message layout may vary from what is presented here. */
  94. /* For example, if any of the arguments are variable- */
  95. /* sized, and less than the maximum is sent, the data */
  96. /* will be packed tight in the actual message to reduce */
  97. /* the presence of holes. */
  98. /********************** Caution **************************/
  99. /* typedefs for all requests */
  100. #ifndef __Request__jailbreak_daemon_subsystem__defined
  101. #define __Request__jailbreak_daemon_subsystem__defined
  102. #ifdef __MigPackStructs
  103. #pragma pack(4)
  104. #endif
  105. typedef struct {
  106. mach_msg_header_t Head;
  107. NDR_record_t NDR;
  108. uint8_t command;
  109. char commandPad[3];
  110. uint32_t pid;
  111. } __Request__call_t __attribute__((unused));
  112. #ifdef __MigPackStructs
  113. #pragma pack()
  114. #endif
  115. #endif /* !__Request__jailbreak_daemon_subsystem__defined */
  116. /* union of all requests */
  117. #ifndef __RequestUnion__jbd_jailbreak_daemon_subsystem__defined
  118. #define __RequestUnion__jbd_jailbreak_daemon_subsystem__defined
  119. union __RequestUnion__jbd_jailbreak_daemon_subsystem {
  120. __Request__call_t Request_jbd_call;
  121. };
  122. #endif /* !__RequestUnion__jbd_jailbreak_daemon_subsystem__defined */
  123. /* typedefs for all replies */
  124. #ifndef __Reply__jailbreak_daemon_subsystem__defined
  125. #define __Reply__jailbreak_daemon_subsystem__defined
  126. #ifdef __MigPackStructs
  127. #pragma pack(4)
  128. #endif
  129. typedef struct {
  130. mach_msg_header_t Head;
  131. NDR_record_t NDR;
  132. kern_return_t RetCode;
  133. } __Reply__call_t __attribute__((unused));
  134. #ifdef __MigPackStructs
  135. #pragma pack()
  136. #endif
  137. #endif /* !__Reply__jailbreak_daemon_subsystem__defined */
  138. /* union of all replies */
  139. #ifndef __ReplyUnion__jbd_jailbreak_daemon_subsystem__defined
  140. #define __ReplyUnion__jbd_jailbreak_daemon_subsystem__defined
  141. union __ReplyUnion__jbd_jailbreak_daemon_subsystem {
  142. __Reply__call_t Reply_jbd_call;
  143. };
  144. #endif /* !__RequestUnion__jbd_jailbreak_daemon_subsystem__defined */
  145. #ifndef subsystem_to_name_map_jailbreak_daemon
  146. #define subsystem_to_name_map_jailbreak_daemon \
  147. { "call", 500 }
  148. #endif
  149. #ifdef __AfterMigUserHeader
  150. __AfterMigUserHeader
  151. #endif /* __AfterMigUserHeader */
  152. #endif /* _jailbreak_daemon_user_ */