1 | #ifndef␉_host_security_user_␊ |
2 | #define␉_host_security_user_␊ |
3 | ␊ |
4 | /* Module host_security */␊ |
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 | #ifdef AUTOTEST␊ |
17 | #ifndef FUNCTION_PTR_T␊ |
18 | #define FUNCTION_PTR_T␊ |
19 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);␊ |
20 | typedef struct {␊ |
21 | char *name;␊ |
22 | function_ptr_t function;␊ |
23 | } function_table_entry;␊ |
24 | typedef function_table_entry *function_table_t;␊ |
25 | #endif /* FUNCTION_PTR_T */␊ |
26 | #endif /* AUTOTEST */␊ |
27 | ␊ |
28 | #ifndef␉host_security_MSG_COUNT␊ |
29 | #define␉host_security_MSG_COUNT␉2␊ |
30 | #endif␉/* host_security_MSG_COUNT */␊ |
31 | ␊ |
32 | #include <mach/std_types.h>␊ |
33 | #include <mach/mig.h>␊ |
34 | #include <mach/mig.h>␊ |
35 | #include <mach/mach_types.h>␊ |
36 | ␊ |
37 | #ifdef __BeforeMigUserHeader␊ |
38 | __BeforeMigUserHeader␊ |
39 | #endif /* __BeforeMigUserHeader */␊ |
40 | ␊ |
41 | #include <sys/cdefs.h>␊ |
42 | __BEGIN_DECLS␊ |
43 | ␊ |
44 | ␊ |
45 | /* Routine host_security_create_task_token */␊ |
46 | #ifdef␉mig_external␊ |
47 | mig_external␊ |
48 | #else␊ |
49 | extern␊ |
50 | #endif␉/* mig_external */␊ |
51 | kern_return_t host_security_create_task_token␊ |
52 | (␊ |
53 | ␉host_security_t host_security,␊ |
54 | ␉task_t parent_task,␊ |
55 | ␉security_token_t sec_token,␊ |
56 | ␉audit_token_t audit_token,␊ |
57 | ␉host_t host,␊ |
58 | ␉ledger_array_t ledgers,␊ |
59 | ␉mach_msg_type_number_t ledgersCnt,␊ |
60 | ␉boolean_t inherit_memory,␊ |
61 | ␉task_t *child_task␊ |
62 | );␊ |
63 | ␊ |
64 | /* Routine host_security_set_task_token */␊ |
65 | #ifdef␉mig_external␊ |
66 | mig_external␊ |
67 | #else␊ |
68 | extern␊ |
69 | #endif␉/* mig_external */␊ |
70 | kern_return_t host_security_set_task_token␊ |
71 | (␊ |
72 | ␉host_security_t host_security,␊ |
73 | ␉task_t target_task,␊ |
74 | ␉security_token_t sec_token,␊ |
75 | ␉audit_token_t audit_token,␊ |
76 | ␉host_t host␊ |
77 | );␊ |
78 | ␊ |
79 | __END_DECLS␊ |
80 | ␊ |
81 | /********************** Caution **************************/␊ |
82 | /* The following data types should be used to calculate */␊ |
83 | /* maximum message sizes only. The actual message may be */␊ |
84 | /* smaller, and the position of the arguments within the */␊ |
85 | /* message layout may vary from what is presented here. */␊ |
86 | /* For example, if any of the arguments are variable- */␊ |
87 | /* sized, and less than the maximum is sent, the data */␊ |
88 | /* will be packed tight in the actual message to reduce */␊ |
89 | /* the presence of holes. */␊ |
90 | /********************** Caution **************************/␊ |
91 | ␊ |
92 | /* typedefs for all requests */␊ |
93 | ␊ |
94 | #ifndef __Request__host_security_subsystem__defined␊ |
95 | #define __Request__host_security_subsystem__defined␊ |
96 | ␊ |
97 | #ifdef __MigPackStructs␊ |
98 | #pragma pack(4)␊ |
99 | #endif␊ |
100 | ␉typedef struct {␊ |
101 | ␉␉mach_msg_header_t Head;␊ |
102 | ␉␉/* start of the kernel processed data */␊ |
103 | ␉␉mach_msg_body_t msgh_body;␊ |
104 | ␉␉mach_msg_port_descriptor_t parent_task;␊ |
105 | ␉␉mach_msg_port_descriptor_t host;␊ |
106 | ␉␉mach_msg_ool_ports_descriptor_t ledgers;␊ |
107 | ␉␉/* end of the kernel processed data */␊ |
108 | ␉␉NDR_record_t NDR;␊ |
109 | ␉␉security_token_t sec_token;␊ |
110 | ␉␉audit_token_t audit_token;␊ |
111 | ␉␉mach_msg_type_number_t ledgersCnt;␊ |
112 | ␉␉boolean_t inherit_memory;␊ |
113 | ␉} __Request__host_security_create_task_token_t;␊ |
114 | #ifdef __MigPackStructs␊ |
115 | #pragma pack()␊ |
116 | #endif␊ |
117 | ␊ |
118 | #ifdef __MigPackStructs␊ |
119 | #pragma pack(4)␊ |
120 | #endif␊ |
121 | ␉typedef struct {␊ |
122 | ␉␉mach_msg_header_t Head;␊ |
123 | ␉␉/* start of the kernel processed data */␊ |
124 | ␉␉mach_msg_body_t msgh_body;␊ |
125 | ␉␉mach_msg_port_descriptor_t target_task;␊ |
126 | ␉␉mach_msg_port_descriptor_t host;␊ |
127 | ␉␉/* end of the kernel processed data */␊ |
128 | ␉␉NDR_record_t NDR;␊ |
129 | ␉␉security_token_t sec_token;␊ |
130 | ␉␉audit_token_t audit_token;␊ |
131 | ␉} __Request__host_security_set_task_token_t;␊ |
132 | #ifdef __MigPackStructs␊ |
133 | #pragma pack()␊ |
134 | #endif␊ |
135 | #endif /* !__Request__host_security_subsystem__defined */␊ |
136 | ␊ |
137 | /* union of all requests */␊ |
138 | ␊ |
139 | #ifndef __RequestUnion__host_security_subsystem__defined␊ |
140 | #define __RequestUnion__host_security_subsystem__defined␊ |
141 | union __RequestUnion__host_security_subsystem {␊ |
142 | ␉__Request__host_security_create_task_token_t Request_host_security_create_task_token;␊ |
143 | ␉__Request__host_security_set_task_token_t Request_host_security_set_task_token;␊ |
144 | };␊ |
145 | #endif /* !__RequestUnion__host_security_subsystem__defined */␊ |
146 | /* typedefs for all replies */␊ |
147 | ␊ |
148 | #ifndef __Reply__host_security_subsystem__defined␊ |
149 | #define __Reply__host_security_subsystem__defined␊ |
150 | ␊ |
151 | #ifdef __MigPackStructs␊ |
152 | #pragma pack(4)␊ |
153 | #endif␊ |
154 | ␉typedef struct {␊ |
155 | ␉␉mach_msg_header_t Head;␊ |
156 | ␉␉/* start of the kernel processed data */␊ |
157 | ␉␉mach_msg_body_t msgh_body;␊ |
158 | ␉␉mach_msg_port_descriptor_t child_task;␊ |
159 | ␉␉/* end of the kernel processed data */␊ |
160 | ␉} __Reply__host_security_create_task_token_t;␊ |
161 | #ifdef __MigPackStructs␊ |
162 | #pragma pack()␊ |
163 | #endif␊ |
164 | ␊ |
165 | #ifdef __MigPackStructs␊ |
166 | #pragma pack(4)␊ |
167 | #endif␊ |
168 | ␉typedef struct {␊ |
169 | ␉␉mach_msg_header_t Head;␊ |
170 | ␉␉NDR_record_t NDR;␊ |
171 | ␉␉kern_return_t RetCode;␊ |
172 | ␉} __Reply__host_security_set_task_token_t;␊ |
173 | #ifdef __MigPackStructs␊ |
174 | #pragma pack()␊ |
175 | #endif␊ |
176 | #endif /* !__Reply__host_security_subsystem__defined */␊ |
177 | ␊ |
178 | /* union of all replies */␊ |
179 | ␊ |
180 | #ifndef __ReplyUnion__host_security_subsystem__defined␊ |
181 | #define __ReplyUnion__host_security_subsystem__defined␊ |
182 | union __ReplyUnion__host_security_subsystem {␊ |
183 | ␉__Reply__host_security_create_task_token_t Reply_host_security_create_task_token;␊ |
184 | ␉__Reply__host_security_set_task_token_t Reply_host_security_set_task_token;␊ |
185 | };␊ |
186 | #endif /* !__RequestUnion__host_security_subsystem__defined */␊ |
187 | ␊ |
188 | #ifndef subsystem_to_name_map_host_security␊ |
189 | #define subsystem_to_name_map_host_security \␊ |
190 | { "host_security_create_task_token", 600 },\␊ |
191 | { "host_security_set_task_token", 601 }␊ |
192 | #endif␊ |
193 | ␊ |
194 | #ifdef __AfterMigUserHeader␊ |
195 | __AfterMigUserHeader␊ |
196 | #endif /* __AfterMigUserHeader */␊ |
197 | ␊ |
198 | #endif␉ /* _host_security_user_ */␊ |
199 | |