jailbreak_daemonServer.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. #ifndef _jailbreak_daemon_server_
  2. #define _jailbreak_daemon_server_
  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 __BeforeMigServerHeader
  72. __BeforeMigServerHeader
  73. #endif /* __BeforeMigServerHeader */
  74. /* Routine call */
  75. #ifdef mig_external
  76. mig_external
  77. #else
  78. extern
  79. #endif /* mig_external */
  80. kern_return_t jbd_call
  81. (
  82. mach_port_t server_port,
  83. uint8_t command,
  84. uint32_t pid
  85. );
  86. #ifdef mig_external
  87. mig_external
  88. #else
  89. extern
  90. #endif /* mig_external */
  91. boolean_t jailbreak_daemon_server(
  92. mach_msg_header_t *InHeadP,
  93. mach_msg_header_t *OutHeadP);
  94. #ifdef mig_external
  95. mig_external
  96. #else
  97. extern
  98. #endif /* mig_external */
  99. mig_routine_t jailbreak_daemon_server_routine(
  100. mach_msg_header_t *InHeadP);
  101. /* Description of this subsystem, for use in direct RPC */
  102. extern const struct jbd_jailbreak_daemon_subsystem {
  103. mig_server_routine_t server; /* Server routine */
  104. mach_msg_id_t start; /* Min routine number */
  105. mach_msg_id_t end; /* Max routine number + 1 */
  106. unsigned int maxsize; /* Max msg size */
  107. vm_address_t reserved; /* Reserved */
  108. struct routine_descriptor /*Array of routine descriptors */
  109. routine[1];
  110. } jbd_jailbreak_daemon_subsystem;
  111. /* typedefs for all requests */
  112. #ifndef __Request__jailbreak_daemon_subsystem__defined
  113. #define __Request__jailbreak_daemon_subsystem__defined
  114. #ifdef __MigPackStructs
  115. #pragma pack(4)
  116. #endif
  117. typedef struct {
  118. mach_msg_header_t Head;
  119. NDR_record_t NDR;
  120. uint8_t command;
  121. char commandPad[3];
  122. uint32_t pid;
  123. } __Request__call_t __attribute__((unused));
  124. #ifdef __MigPackStructs
  125. #pragma pack()
  126. #endif
  127. #endif /* !__Request__jailbreak_daemon_subsystem__defined */
  128. /* union of all requests */
  129. #ifndef __RequestUnion__jbd_jailbreak_daemon_subsystem__defined
  130. #define __RequestUnion__jbd_jailbreak_daemon_subsystem__defined
  131. union __RequestUnion__jbd_jailbreak_daemon_subsystem {
  132. __Request__call_t Request_call;
  133. };
  134. #endif /* __RequestUnion__jbd_jailbreak_daemon_subsystem__defined */
  135. /* typedefs for all replies */
  136. #ifndef __Reply__jailbreak_daemon_subsystem__defined
  137. #define __Reply__jailbreak_daemon_subsystem__defined
  138. #ifdef __MigPackStructs
  139. #pragma pack(4)
  140. #endif
  141. typedef struct {
  142. mach_msg_header_t Head;
  143. NDR_record_t NDR;
  144. kern_return_t RetCode;
  145. } __Reply__call_t __attribute__((unused));
  146. #ifdef __MigPackStructs
  147. #pragma pack()
  148. #endif
  149. #endif /* !__Reply__jailbreak_daemon_subsystem__defined */
  150. /* union of all replies */
  151. #ifndef __ReplyUnion__jbd_jailbreak_daemon_subsystem__defined
  152. #define __ReplyUnion__jbd_jailbreak_daemon_subsystem__defined
  153. union __ReplyUnion__jbd_jailbreak_daemon_subsystem {
  154. __Reply__call_t Reply_call;
  155. };
  156. #endif /* __RequestUnion__jbd_jailbreak_daemon_subsystem__defined */
  157. #ifndef subsystem_to_name_map_jailbreak_daemon
  158. #define subsystem_to_name_map_jailbreak_daemon \
  159. { "call", 500 }
  160. #endif
  161. #ifdef __AfterMigServerHeader
  162. __AfterMigServerHeader
  163. #endif /* __AfterMigServerHeader */
  164. #endif /* _jailbreak_daemon_server_ */