1 | #ifndef _UNDRequest_user_ |
2 | #define _UNDRequest_user_ |
3 | |
4 | /* Module UNDRequest */ |
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 UNDRequest_MSG_COUNT |
58 | #define UNDRequest_MSG_COUNT 8 |
59 | #endif /* UNDRequest_MSG_COUNT */ |
60 | |
61 | #include <Availability.h> |
62 | #include <mach/std_types.h> |
63 | #include <mach/mig.h> |
64 | #include <UserNotification/UNDTypes.h> |
65 | |
66 | #ifdef __BeforeMigUserHeader |
67 | __BeforeMigUserHeader |
68 | #endif /* __BeforeMigUserHeader */ |
69 | |
70 | #include <sys/cdefs.h> |
71 | __BEGIN_DECLS |
72 | |
73 | |
74 | /* SimpleRoutine UNDExecute_rpc */ |
75 | #ifdef mig_external |
76 | mig_external |
77 | #else |
78 | extern |
79 | #endif /* mig_external */ |
80 | kern_return_t UNDExecute_rpc |
81 | ( |
82 | UNDServerRef server, |
83 | UNDPath executionPath, |
84 | int uid, |
85 | int gid |
86 | ); |
87 | |
88 | /* SimpleRoutine UNDDisplayNoticeFromBundle_rpc */ |
89 | #ifdef mig_external |
90 | mig_external |
91 | #else |
92 | extern |
93 | #endif /* mig_external */ |
94 | kern_return_t UNDDisplayNoticeFromBundle_rpc |
95 | ( |
96 | UNDServerRef server, |
97 | mach_port_t reply, |
98 | UNDPath bundlePath, |
99 | UNDPath fileName, |
100 | UNDPath fileExtension, |
101 | UNDKey messageKey |
102 | ); |
103 | |
104 | /* SimpleRoutine UNDDisplayAlertFromBundle_rpc */ |
105 | #ifdef mig_external |
106 | mig_external |
107 | #else |
108 | extern |
109 | #endif /* mig_external */ |
110 | kern_return_t UNDDisplayAlertFromBundle_rpc |
111 | ( |
112 | UNDServerRef server, |
113 | mach_port_t reply, |
114 | UNDPath bundlePath, |
115 | UNDKey fileName, |
116 | UNDKey fileExtension, |
117 | UNDKey messageKey |
118 | ); |
119 | |
120 | /* SimpleRoutine UNDDisplayCustomFromBundle_rpc */ |
121 | #ifdef mig_external |
122 | mig_external |
123 | #else |
124 | extern |
125 | #endif /* mig_external */ |
126 | kern_return_t UNDDisplayCustomFromBundle_rpc |
127 | ( |
128 | UNDServerRef server, |
129 | mach_port_t reply, |
130 | UNDPath bundlePath, |
131 | UNDKey fileName, |
132 | UNDKey fileExtension, |
133 | UNDKey messageKey, |
134 | UNDPath tokenKey |
135 | ); |
136 | |
137 | /* SimpleRoutine UNDCancelNotification_rpc */ |
138 | #ifdef mig_external |
139 | mig_external |
140 | #else |
141 | extern |
142 | #endif /* mig_external */ |
143 | kern_return_t UNDCancelNotification_rpc |
144 | ( |
145 | UNDServerRef server, |
146 | int userLandNotificationKey |
147 | ); |
148 | |
149 | /* SimpleRoutine UNDDisplayNoticeSimple_rpc */ |
150 | #ifdef mig_external |
151 | mig_external |
152 | #else |
153 | extern |
154 | #endif /* mig_external */ |
155 | kern_return_t UNDDisplayNoticeSimple_rpc |
156 | ( |
157 | UNDServerRef server, |
158 | int rpctimeout, |
159 | unsigned flags, |
160 | UNDLabel iconPath, |
161 | UNDLabel soundPath, |
162 | UNDLabel localizationPath, |
163 | UNDLabel , |
164 | UNDMessage message, |
165 | UNDLabel defaultButtonTitle |
166 | ); |
167 | |
168 | /* Routine UNDDisplayAlertSimple_rpc */ |
169 | #ifdef mig_external |
170 | mig_external |
171 | #else |
172 | extern |
173 | #endif /* mig_external */ |
174 | kern_return_t UNDDisplayAlertSimple_rpc |
175 | ( |
176 | UNDServerRef server, |
177 | int rpctimeout, |
178 | unsigned flags, |
179 | UNDLabel iconPath, |
180 | UNDLabel soundPath, |
181 | UNDLabel localizationPath, |
182 | UNDLabel , |
183 | UNDMessage message, |
184 | UNDLabel defaultButtonTitle, |
185 | UNDLabel alternateButtonTitle, |
186 | UNDLabel otherButtonTitle, |
187 | unsigned *response |
188 | ); |
189 | |
190 | __END_DECLS |
191 | |
192 | /********************** Caution **************************/ |
193 | /* The following data types should be used to calculate */ |
194 | /* maximum message sizes only. The actual message may be */ |
195 | /* smaller, and the position of the arguments within the */ |
196 | /* message layout may vary from what is presented here. */ |
197 | /* For example, if any of the arguments are variable- */ |
198 | /* sized, and less than the maximum is sent, the data */ |
199 | /* will be packed tight in the actual message to reduce */ |
200 | /* the presence of holes. */ |
201 | /********************** Caution **************************/ |
202 | |
203 | /* typedefs for all requests */ |
204 | |
205 | #ifndef __Request__UNDRequest_subsystem__defined |
206 | #define __Request__UNDRequest_subsystem__defined |
207 | |
208 | #ifdef __MigPackStructs |
209 | #pragma pack(push, 4) |
210 | #endif |
211 | typedef struct { |
212 | mach_msg_header_t Head; |
213 | NDR_record_t NDR; |
214 | mach_msg_type_number_t executionPathOffset; /* MiG doesn't use it */ |
215 | mach_msg_type_number_t executionPathCnt; |
216 | char executionPath[1024]; |
217 | int uid; |
218 | int gid; |
219 | } __Request__UNDExecute_rpc_t __attribute__((unused)); |
220 | #ifdef __MigPackStructs |
221 | #pragma pack(pop) |
222 | #endif |
223 | |
224 | #ifdef __MigPackStructs |
225 | #pragma pack(push, 4) |
226 | #endif |
227 | typedef struct { |
228 | mach_msg_header_t Head; |
229 | /* start of the kernel processed data */ |
230 | mach_msg_body_t msgh_body; |
231 | mach_msg_port_descriptor_t reply; |
232 | /* end of the kernel processed data */ |
233 | NDR_record_t NDR; |
234 | mach_msg_type_number_t bundlePathOffset; /* MiG doesn't use it */ |
235 | mach_msg_type_number_t bundlePathCnt; |
236 | char bundlePath[1024]; |
237 | mach_msg_type_number_t fileNameOffset; /* MiG doesn't use it */ |
238 | mach_msg_type_number_t fileNameCnt; |
239 | char fileName[1024]; |
240 | mach_msg_type_number_t fileExtensionOffset; /* MiG doesn't use it */ |
241 | mach_msg_type_number_t fileExtensionCnt; |
242 | char fileExtension[1024]; |
243 | mach_msg_type_number_t messageKeyOffset; /* MiG doesn't use it */ |
244 | mach_msg_type_number_t messageKeyCnt; |
245 | char messageKey[128]; |
246 | } __Request__UNDDisplayNoticeFromBundle_rpc_t __attribute__((unused)); |
247 | #ifdef __MigPackStructs |
248 | #pragma pack(pop) |
249 | #endif |
250 | |
251 | #ifdef __MigPackStructs |
252 | #pragma pack(push, 4) |
253 | #endif |
254 | typedef struct { |
255 | mach_msg_header_t Head; |
256 | /* start of the kernel processed data */ |
257 | mach_msg_body_t msgh_body; |
258 | mach_msg_port_descriptor_t reply; |
259 | /* end of the kernel processed data */ |
260 | NDR_record_t NDR; |
261 | mach_msg_type_number_t bundlePathOffset; /* MiG doesn't use it */ |
262 | mach_msg_type_number_t bundlePathCnt; |
263 | char bundlePath[1024]; |
264 | mach_msg_type_number_t fileNameOffset; /* MiG doesn't use it */ |
265 | mach_msg_type_number_t fileNameCnt; |
266 | char fileName[128]; |
267 | mach_msg_type_number_t fileExtensionOffset; /* MiG doesn't use it */ |
268 | mach_msg_type_number_t fileExtensionCnt; |
269 | char fileExtension[128]; |
270 | mach_msg_type_number_t messageKeyOffset; /* MiG doesn't use it */ |
271 | mach_msg_type_number_t messageKeyCnt; |
272 | char messageKey[128]; |
273 | } __Request__UNDDisplayAlertFromBundle_rpc_t __attribute__((unused)); |
274 | #ifdef __MigPackStructs |
275 | #pragma pack(pop) |
276 | #endif |
277 | |
278 | #ifdef __MigPackStructs |
279 | #pragma pack(push, 4) |
280 | #endif |
281 | typedef struct { |
282 | mach_msg_header_t Head; |
283 | /* start of the kernel processed data */ |
284 | mach_msg_body_t msgh_body; |
285 | mach_msg_port_descriptor_t reply; |
286 | /* end of the kernel processed data */ |
287 | NDR_record_t NDR; |
288 | mach_msg_type_number_t bundlePathOffset; /* MiG doesn't use it */ |
289 | mach_msg_type_number_t bundlePathCnt; |
290 | char bundlePath[1024]; |
291 | mach_msg_type_number_t fileNameOffset; /* MiG doesn't use it */ |
292 | mach_msg_type_number_t fileNameCnt; |
293 | char fileName[128]; |
294 | mach_msg_type_number_t fileExtensionOffset; /* MiG doesn't use it */ |
295 | mach_msg_type_number_t fileExtensionCnt; |
296 | char fileExtension[128]; |
297 | mach_msg_type_number_t messageKeyOffset; /* MiG doesn't use it */ |
298 | mach_msg_type_number_t messageKeyCnt; |
299 | char messageKey[128]; |
300 | mach_msg_type_number_t tokenKeyOffset; /* MiG doesn't use it */ |
301 | mach_msg_type_number_t tokenKeyCnt; |
302 | char tokenKey[1024]; |
303 | } __Request__UNDDisplayCustomFromBundle_rpc_t __attribute__((unused)); |
304 | #ifdef __MigPackStructs |
305 | #pragma pack(pop) |
306 | #endif |
307 | |
308 | #ifdef __MigPackStructs |
309 | #pragma pack(push, 4) |
310 | #endif |
311 | typedef struct { |
312 | mach_msg_header_t Head; |
313 | NDR_record_t NDR; |
314 | int userLandNotificationKey; |
315 | } __Request__UNDCancelNotification_rpc_t __attribute__((unused)); |
316 | #ifdef __MigPackStructs |
317 | #pragma pack(pop) |
318 | #endif |
319 | |
320 | #ifdef __MigPackStructs |
321 | #pragma pack(push, 4) |
322 | #endif |
323 | typedef struct { |
324 | mach_msg_header_t Head; |
325 | NDR_record_t NDR; |
326 | int rpctimeout; |
327 | unsigned flags; |
328 | mach_msg_type_number_t iconPathOffset; /* MiG doesn't use it */ |
329 | mach_msg_type_number_t iconPathCnt; |
330 | char iconPath[128]; |
331 | mach_msg_type_number_t soundPathOffset; /* MiG doesn't use it */ |
332 | mach_msg_type_number_t soundPathCnt; |
333 | char soundPath[128]; |
334 | mach_msg_type_number_t localizationPathOffset; /* MiG doesn't use it */ |
335 | mach_msg_type_number_t localizationPathCnt; |
336 | char localizationPath[128]; |
337 | mach_msg_type_number_t ; /* MiG doesn't use it */ |
338 | mach_msg_type_number_t ; |
339 | char [128]; |
340 | mach_msg_type_number_t messageOffset; /* MiG doesn't use it */ |
341 | mach_msg_type_number_t messageCnt; |
342 | char message[1024]; |
343 | mach_msg_type_number_t defaultButtonTitleOffset; /* MiG doesn't use it */ |
344 | mach_msg_type_number_t defaultButtonTitleCnt; |
345 | char defaultButtonTitle[128]; |
346 | } __Request__UNDDisplayNoticeSimple_rpc_t __attribute__((unused)); |
347 | #ifdef __MigPackStructs |
348 | #pragma pack(pop) |
349 | #endif |
350 | |
351 | #ifdef __MigPackStructs |
352 | #pragma pack(push, 4) |
353 | #endif |
354 | typedef struct { |
355 | mach_msg_header_t Head; |
356 | NDR_record_t NDR; |
357 | int rpctimeout; |
358 | unsigned flags; |
359 | mach_msg_type_number_t iconPathOffset; /* MiG doesn't use it */ |
360 | mach_msg_type_number_t iconPathCnt; |
361 | char iconPath[128]; |
362 | mach_msg_type_number_t soundPathOffset; /* MiG doesn't use it */ |
363 | mach_msg_type_number_t soundPathCnt; |
364 | char soundPath[128]; |
365 | mach_msg_type_number_t localizationPathOffset; /* MiG doesn't use it */ |
366 | mach_msg_type_number_t localizationPathCnt; |
367 | char localizationPath[128]; |
368 | mach_msg_type_number_t ; /* MiG doesn't use it */ |
369 | mach_msg_type_number_t ; |
370 | char [128]; |
371 | mach_msg_type_number_t messageOffset; /* MiG doesn't use it */ |
372 | mach_msg_type_number_t messageCnt; |
373 | char message[1024]; |
374 | mach_msg_type_number_t defaultButtonTitleOffset; /* MiG doesn't use it */ |
375 | mach_msg_type_number_t defaultButtonTitleCnt; |
376 | char defaultButtonTitle[128]; |
377 | mach_msg_type_number_t alternateButtonTitleOffset; /* MiG doesn't use it */ |
378 | mach_msg_type_number_t alternateButtonTitleCnt; |
379 | char alternateButtonTitle[128]; |
380 | mach_msg_type_number_t otherButtonTitleOffset; /* MiG doesn't use it */ |
381 | mach_msg_type_number_t otherButtonTitleCnt; |
382 | char otherButtonTitle[128]; |
383 | } __Request__UNDDisplayAlertSimple_rpc_t __attribute__((unused)); |
384 | #ifdef __MigPackStructs |
385 | #pragma pack(pop) |
386 | #endif |
387 | #endif /* !__Request__UNDRequest_subsystem__defined */ |
388 | |
389 | /* union of all requests */ |
390 | |
391 | #ifndef __RequestUnion__UNDRequest_subsystem__defined |
392 | #define __RequestUnion__UNDRequest_subsystem__defined |
393 | union __RequestUnion__UNDRequest_subsystem { |
394 | __Request__UNDExecute_rpc_t Request_UNDExecute_rpc; |
395 | __Request__UNDDisplayNoticeFromBundle_rpc_t Request_UNDDisplayNoticeFromBundle_rpc; |
396 | __Request__UNDDisplayAlertFromBundle_rpc_t Request_UNDDisplayAlertFromBundle_rpc; |
397 | __Request__UNDDisplayCustomFromBundle_rpc_t Request_UNDDisplayCustomFromBundle_rpc; |
398 | __Request__UNDCancelNotification_rpc_t Request_UNDCancelNotification_rpc; |
399 | __Request__UNDDisplayNoticeSimple_rpc_t Request_UNDDisplayNoticeSimple_rpc; |
400 | __Request__UNDDisplayAlertSimple_rpc_t Request_UNDDisplayAlertSimple_rpc; |
401 | }; |
402 | #endif /* !__RequestUnion__UNDRequest_subsystem__defined */ |
403 | /* typedefs for all replies */ |
404 | |
405 | #ifndef __Reply__UNDRequest_subsystem__defined |
406 | #define __Reply__UNDRequest_subsystem__defined |
407 | |
408 | #ifdef __MigPackStructs |
409 | #pragma pack(push, 4) |
410 | #endif |
411 | typedef struct { |
412 | mach_msg_header_t Head; |
413 | NDR_record_t NDR; |
414 | kern_return_t RetCode; |
415 | } __Reply__UNDExecute_rpc_t __attribute__((unused)); |
416 | #ifdef __MigPackStructs |
417 | #pragma pack(pop) |
418 | #endif |
419 | |
420 | #ifdef __MigPackStructs |
421 | #pragma pack(push, 4) |
422 | #endif |
423 | typedef struct { |
424 | mach_msg_header_t Head; |
425 | NDR_record_t NDR; |
426 | kern_return_t RetCode; |
427 | } __Reply__UNDDisplayNoticeFromBundle_rpc_t __attribute__((unused)); |
428 | #ifdef __MigPackStructs |
429 | #pragma pack(pop) |
430 | #endif |
431 | |
432 | #ifdef __MigPackStructs |
433 | #pragma pack(push, 4) |
434 | #endif |
435 | typedef struct { |
436 | mach_msg_header_t Head; |
437 | NDR_record_t NDR; |
438 | kern_return_t RetCode; |
439 | } __Reply__UNDDisplayAlertFromBundle_rpc_t __attribute__((unused)); |
440 | #ifdef __MigPackStructs |
441 | #pragma pack(pop) |
442 | #endif |
443 | |
444 | #ifdef __MigPackStructs |
445 | #pragma pack(push, 4) |
446 | #endif |
447 | typedef struct { |
448 | mach_msg_header_t Head; |
449 | NDR_record_t NDR; |
450 | kern_return_t RetCode; |
451 | } __Reply__UNDDisplayCustomFromBundle_rpc_t __attribute__((unused)); |
452 | #ifdef __MigPackStructs |
453 | #pragma pack(pop) |
454 | #endif |
455 | |
456 | #ifdef __MigPackStructs |
457 | #pragma pack(push, 4) |
458 | #endif |
459 | typedef struct { |
460 | mach_msg_header_t Head; |
461 | NDR_record_t NDR; |
462 | kern_return_t RetCode; |
463 | } __Reply__UNDCancelNotification_rpc_t __attribute__((unused)); |
464 | #ifdef __MigPackStructs |
465 | #pragma pack(pop) |
466 | #endif |
467 | |
468 | #ifdef __MigPackStructs |
469 | #pragma pack(push, 4) |
470 | #endif |
471 | typedef struct { |
472 | mach_msg_header_t Head; |
473 | NDR_record_t NDR; |
474 | kern_return_t RetCode; |
475 | } __Reply__UNDDisplayNoticeSimple_rpc_t __attribute__((unused)); |
476 | #ifdef __MigPackStructs |
477 | #pragma pack(pop) |
478 | #endif |
479 | |
480 | #ifdef __MigPackStructs |
481 | #pragma pack(push, 4) |
482 | #endif |
483 | typedef struct { |
484 | mach_msg_header_t Head; |
485 | NDR_record_t NDR; |
486 | kern_return_t RetCode; |
487 | unsigned response; |
488 | } __Reply__UNDDisplayAlertSimple_rpc_t __attribute__((unused)); |
489 | #ifdef __MigPackStructs |
490 | #pragma pack(pop) |
491 | #endif |
492 | #endif /* !__Reply__UNDRequest_subsystem__defined */ |
493 | |
494 | /* union of all replies */ |
495 | |
496 | #ifndef __ReplyUnion__UNDRequest_subsystem__defined |
497 | #define __ReplyUnion__UNDRequest_subsystem__defined |
498 | union __ReplyUnion__UNDRequest_subsystem { |
499 | __Reply__UNDExecute_rpc_t Reply_UNDExecute_rpc; |
500 | __Reply__UNDDisplayNoticeFromBundle_rpc_t Reply_UNDDisplayNoticeFromBundle_rpc; |
501 | __Reply__UNDDisplayAlertFromBundle_rpc_t Reply_UNDDisplayAlertFromBundle_rpc; |
502 | __Reply__UNDDisplayCustomFromBundle_rpc_t Reply_UNDDisplayCustomFromBundle_rpc; |
503 | __Reply__UNDCancelNotification_rpc_t Reply_UNDCancelNotification_rpc; |
504 | __Reply__UNDDisplayNoticeSimple_rpc_t Reply_UNDDisplayNoticeSimple_rpc; |
505 | __Reply__UNDDisplayAlertSimple_rpc_t Reply_UNDDisplayAlertSimple_rpc; |
506 | }; |
507 | #endif /* !__RequestUnion__UNDRequest_subsystem__defined */ |
508 | |
509 | #ifndef subsystem_to_name_map_UNDRequest |
510 | #define subsystem_to_name_map_UNDRequest \ |
511 | { "UNDExecute_rpc", 6000 },\ |
512 | { "UNDDisplayNoticeFromBundle_rpc", 6001 },\ |
513 | { "UNDDisplayAlertFromBundle_rpc", 6002 },\ |
514 | { "UNDDisplayCustomFromBundle_rpc", 6003 },\ |
515 | { "UNDCancelNotification_rpc", 6005 },\ |
516 | { "UNDDisplayNoticeSimple_rpc", 6006 },\ |
517 | { "UNDDisplayAlertSimple_rpc", 6007 } |
518 | #endif |
519 | |
520 | #ifdef __AfterMigUserHeader |
521 | __AfterMigUserHeader |
522 | #endif /* __AfterMigUserHeader */ |
523 | |
524 | #endif /* _UNDRequest_user_ */ |
525 | |