1 | #ifndef _mach_voucher_attr_control_server_ |
2 | #define _mach_voucher_attr_control_server_ |
3 | |
4 | /* Module mach_voucher_attr_control */ |
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 | extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); |
29 | #ifdef __cplusplus |
30 | } |
31 | #endif |
32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ |
33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ |
34 | #endif /* __has_include */ |
35 | |
36 | /* END MIG_STRNCPY_ZEROFILL CODE */ |
37 | |
38 | |
39 | #ifdef AUTOTEST |
40 | #ifndef FUNCTION_PTR_T |
41 | #define FUNCTION_PTR_T |
42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); |
43 | typedef struct { |
44 | char *name; |
45 | function_ptr_t function; |
46 | } function_table_entry; |
47 | typedef function_table_entry *function_table_t; |
48 | #endif /* FUNCTION_PTR_T */ |
49 | #endif /* AUTOTEST */ |
50 | |
51 | #ifndef mach_voucher_attr_control_MSG_COUNT |
52 | #define mach_voucher_attr_control_MSG_COUNT 2 |
53 | #endif /* mach_voucher_attr_control_MSG_COUNT */ |
54 | |
55 | #include <mach/std_types.h> |
56 | #include <mach/mig.h> |
57 | #include <ipc/ipc_voucher.h> |
58 | #include <kern/ipc_kobject.h> |
59 | #include <kern/ipc_tt.h> |
60 | #include <kern/ipc_host.h> |
61 | #include <kern/ipc_sync.h> |
62 | #include <kern/ledger.h> |
63 | #include <kern/processor.h> |
64 | #include <kern/sync_lock.h> |
65 | #include <kern/sync_sema.h> |
66 | #include <vm/memory_object.h> |
67 | #include <vm/vm_map.h> |
68 | #include <kern/ipc_mig.h> |
69 | #include <mach/mig.h> |
70 | #include <mach/mach_types.h> |
71 | |
72 | #ifdef __BeforeMigServerHeader |
73 | __BeforeMigServerHeader |
74 | #endif /* __BeforeMigServerHeader */ |
75 | |
76 | |
77 | /* Routine mach_voucher_attr_control_get_values */ |
78 | #ifdef mig_external |
79 | mig_external |
80 | #else |
81 | extern |
82 | #endif /* mig_external */ |
83 | kern_return_t mach_voucher_attr_control_get_values |
84 | ( |
85 | ipc_voucher_attr_control_t control, |
86 | ipc_voucher_t voucher, |
87 | mach_voucher_attr_value_handle_array_t value_handles, |
88 | mach_msg_type_number_t *value_handlesCnt |
89 | ); |
90 | |
91 | /* Routine mach_voucher_attr_control_create_mach_voucher */ |
92 | #ifdef mig_external |
93 | mig_external |
94 | #else |
95 | extern |
96 | #endif /* mig_external */ |
97 | kern_return_t mach_voucher_attr_control_create_mach_voucher |
98 | ( |
99 | ipc_voucher_attr_control_t control, |
100 | mach_voucher_attr_raw_recipe_array_t recipes, |
101 | mach_msg_type_number_t recipesCnt, |
102 | ipc_voucher_t *voucher |
103 | ); |
104 | |
105 | #ifdef mig_external |
106 | mig_external |
107 | #else |
108 | extern |
109 | #endif /* mig_external */ |
110 | boolean_t mach_voucher_attr_control_server( |
111 | mach_msg_header_t *InHeadP, |
112 | mach_msg_header_t *OutHeadP); |
113 | |
114 | #ifdef mig_external |
115 | mig_external |
116 | #else |
117 | extern |
118 | #endif /* mig_external */ |
119 | mig_routine_t mach_voucher_attr_control_server_routine( |
120 | mach_msg_header_t *InHeadP); |
121 | |
122 | |
123 | /* Description of this subsystem, for use in direct RPC */ |
124 | extern const struct mach_voucher_attr_control_subsystem { |
125 | mig_server_routine_t server; /* Server routine */ |
126 | mach_msg_id_t start; /* Min routine number */ |
127 | mach_msg_id_t end; /* Max routine number + 1 */ |
128 | unsigned int maxsize; /* Max msg size */ |
129 | vm_address_t reserved; /* Reserved */ |
130 | struct routine_descriptor /*Array of routine descriptors */ |
131 | routine[2]; |
132 | } mach_voucher_attr_control_subsystem; |
133 | |
134 | /* typedefs for all requests */ |
135 | |
136 | #ifndef __Request__mach_voucher_attr_control_subsystem__defined |
137 | #define __Request__mach_voucher_attr_control_subsystem__defined |
138 | |
139 | #ifdef __MigPackStructs |
140 | #pragma pack(4) |
141 | #endif |
142 | typedef struct { |
143 | mach_msg_header_t Head; |
144 | /* start of the kernel processed data */ |
145 | mach_msg_body_t msgh_body; |
146 | mach_msg_port_descriptor_t voucher; |
147 | /* end of the kernel processed data */ |
148 | NDR_record_t NDR; |
149 | mach_msg_type_number_t value_handlesCnt; |
150 | } __Request__mach_voucher_attr_control_get_values_t __attribute__((unused)); |
151 | #ifdef __MigPackStructs |
152 | #pragma pack() |
153 | #endif |
154 | |
155 | #ifdef __MigPackStructs |
156 | #pragma pack(4) |
157 | #endif |
158 | typedef struct { |
159 | mach_msg_header_t Head; |
160 | NDR_record_t NDR; |
161 | mach_msg_type_number_t recipesCnt; |
162 | uint8_t recipes[5120]; |
163 | } __Request__mach_voucher_attr_control_create_mach_voucher_t __attribute__((unused)); |
164 | #ifdef __MigPackStructs |
165 | #pragma pack() |
166 | #endif |
167 | #endif /* !__Request__mach_voucher_attr_control_subsystem__defined */ |
168 | |
169 | |
170 | /* union of all requests */ |
171 | |
172 | #ifndef __RequestUnion__mach_voucher_attr_control_subsystem__defined |
173 | #define __RequestUnion__mach_voucher_attr_control_subsystem__defined |
174 | union __RequestUnion__mach_voucher_attr_control_subsystem { |
175 | __Request__mach_voucher_attr_control_get_values_t Request_mach_voucher_attr_control_get_values; |
176 | __Request__mach_voucher_attr_control_create_mach_voucher_t Request_mach_voucher_attr_control_create_mach_voucher; |
177 | }; |
178 | #endif /* __RequestUnion__mach_voucher_attr_control_subsystem__defined */ |
179 | /* typedefs for all replies */ |
180 | |
181 | #ifndef __Reply__mach_voucher_attr_control_subsystem__defined |
182 | #define __Reply__mach_voucher_attr_control_subsystem__defined |
183 | |
184 | #ifdef __MigPackStructs |
185 | #pragma pack(4) |
186 | #endif |
187 | typedef struct { |
188 | mach_msg_header_t Head; |
189 | NDR_record_t NDR; |
190 | kern_return_t RetCode; |
191 | mach_msg_type_number_t value_handlesCnt; |
192 | mach_voucher_attr_value_handle_t value_handles[4]; |
193 | } __Reply__mach_voucher_attr_control_get_values_t __attribute__((unused)); |
194 | #ifdef __MigPackStructs |
195 | #pragma pack() |
196 | #endif |
197 | |
198 | #ifdef __MigPackStructs |
199 | #pragma pack(4) |
200 | #endif |
201 | typedef struct { |
202 | mach_msg_header_t Head; |
203 | /* start of the kernel processed data */ |
204 | mach_msg_body_t msgh_body; |
205 | mach_msg_port_descriptor_t voucher; |
206 | /* end of the kernel processed data */ |
207 | } __Reply__mach_voucher_attr_control_create_mach_voucher_t __attribute__((unused)); |
208 | #ifdef __MigPackStructs |
209 | #pragma pack() |
210 | #endif |
211 | #endif /* !__Reply__mach_voucher_attr_control_subsystem__defined */ |
212 | |
213 | |
214 | /* union of all replies */ |
215 | |
216 | #ifndef __ReplyUnion__mach_voucher_attr_control_subsystem__defined |
217 | #define __ReplyUnion__mach_voucher_attr_control_subsystem__defined |
218 | union __ReplyUnion__mach_voucher_attr_control_subsystem { |
219 | __Reply__mach_voucher_attr_control_get_values_t Reply_mach_voucher_attr_control_get_values; |
220 | __Reply__mach_voucher_attr_control_create_mach_voucher_t Reply_mach_voucher_attr_control_create_mach_voucher; |
221 | }; |
222 | #endif /* __RequestUnion__mach_voucher_attr_control_subsystem__defined */ |
223 | |
224 | #ifndef subsystem_to_name_map_mach_voucher_attr_control |
225 | #define subsystem_to_name_map_mach_voucher_attr_control \ |
226 | { "mach_voucher_attr_control_get_values", 5600 },\ |
227 | { "mach_voucher_attr_control_create_mach_voucher", 5601 } |
228 | #endif |
229 | |
230 | #ifdef __AfterMigServerHeader |
231 | __AfterMigServerHeader |
232 | #endif /* __AfterMigServerHeader */ |
233 | |
234 | #endif /* _mach_voucher_attr_control_server_ */ |
235 | |