1#ifndef _notify_user_
2#define _notify_user_
3
4/* Module notify */
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
26extern "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#if (__MigKernelSpecificCode) || (_MIG_KERNEL_SPECIFIC_CODE_)
39#include <kern/ipc_mig.h>
40#endif /* __MigKernelSpecificCode */
41
42#ifdef AUTOTEST
43#ifndef FUNCTION_PTR_T
44#define FUNCTION_PTR_T
45typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
46typedef struct {
47 char *name;
48 function_ptr_t function;
49} function_table_entry;
50typedef function_table_entry *function_table_t;
51#endif /* FUNCTION_PTR_T */
52#endif /* AUTOTEST */
53
54#ifndef notify_MSG_COUNT
55#define notify_MSG_COUNT 9
56#endif /* notify_MSG_COUNT */
57
58#include <mach/std_types.h>
59#include <mach/mig.h>
60
61#ifdef __BeforeMigUserHeader
62__BeforeMigUserHeader
63#endif /* __BeforeMigUserHeader */
64
65#include <sys/cdefs.h>
66__BEGIN_DECLS
67
68
69/* SimpleRoutine mach_notify_port_deleted */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t mach_notify_port_deleted
76(
77 mach_port_t notify,
78 mach_port_name_t name
79);
80
81/* SimpleRoutine mach_notify_send_possible */
82#ifdef mig_external
83mig_external
84#else
85extern
86#endif /* mig_external */
87kern_return_t mach_notify_send_possible
88(
89 mach_port_t notify,
90 mach_port_name_t name
91);
92
93/* SimpleRoutine mach_notify_port_destroyed */
94#ifdef mig_external
95mig_external
96#else
97extern
98#endif /* mig_external */
99kern_return_t mach_notify_port_destroyed
100(
101 mach_port_t notify,
102 mach_port_t rights
103);
104
105/* SimpleRoutine mach_notify_no_senders */
106#ifdef mig_external
107mig_external
108#else
109extern
110#endif /* mig_external */
111kern_return_t mach_notify_no_senders
112(
113 mach_port_t notify,
114 mach_port_mscount_t mscount
115);
116
117/* SimpleRoutine mach_notify_send_once */
118#ifdef mig_external
119mig_external
120#else
121extern
122#endif /* mig_external */
123kern_return_t mach_notify_send_once
124(
125 mach_port_t notify
126);
127
128/* SimpleRoutine mach_notify_dead_name */
129#ifdef mig_external
130mig_external
131#else
132extern
133#endif /* mig_external */
134kern_return_t mach_notify_dead_name
135(
136 mach_port_t notify,
137 mach_port_name_t name
138);
139
140__END_DECLS
141
142/********************** Caution **************************/
143/* The following data types should be used to calculate */
144/* maximum message sizes only. The actual message may be */
145/* smaller, and the position of the arguments within the */
146/* message layout may vary from what is presented here. */
147/* For example, if any of the arguments are variable- */
148/* sized, and less than the maximum is sent, the data */
149/* will be packed tight in the actual message to reduce */
150/* the presence of holes. */
151/********************** Caution **************************/
152
153/* typedefs for all requests */
154
155#ifndef __Request__notify_subsystem__defined
156#define __Request__notify_subsystem__defined
157
158#ifdef __MigPackStructs
159#pragma pack(4)
160#endif
161 typedef struct {
162 mach_msg_header_t Head;
163 NDR_record_t NDR;
164 mach_port_name_t name;
165 } __Request__mach_notify_port_deleted_t __attribute__((unused));
166#ifdef __MigPackStructs
167#pragma pack()
168#endif
169
170#ifdef __MigPackStructs
171#pragma pack(4)
172#endif
173 typedef struct {
174 mach_msg_header_t Head;
175 NDR_record_t NDR;
176 mach_port_name_t name;
177 } __Request__mach_notify_send_possible_t __attribute__((unused));
178#ifdef __MigPackStructs
179#pragma pack()
180#endif
181
182#ifdef __MigPackStructs
183#pragma pack(4)
184#endif
185 typedef struct {
186 mach_msg_header_t Head;
187 /* start of the kernel processed data */
188 mach_msg_body_t msgh_body;
189 mach_msg_port_descriptor_t rights;
190 /* end of the kernel processed data */
191 } __Request__mach_notify_port_destroyed_t __attribute__((unused));
192#ifdef __MigPackStructs
193#pragma pack()
194#endif
195
196#ifdef __MigPackStructs
197#pragma pack(4)
198#endif
199 typedef struct {
200 mach_msg_header_t Head;
201 NDR_record_t NDR;
202 mach_port_mscount_t mscount;
203 } __Request__mach_notify_no_senders_t __attribute__((unused));
204#ifdef __MigPackStructs
205#pragma pack()
206#endif
207
208#ifdef __MigPackStructs
209#pragma pack(4)
210#endif
211 typedef struct {
212 mach_msg_header_t Head;
213 } __Request__mach_notify_send_once_t __attribute__((unused));
214#ifdef __MigPackStructs
215#pragma pack()
216#endif
217
218#ifdef __MigPackStructs
219#pragma pack(4)
220#endif
221 typedef struct {
222 mach_msg_header_t Head;
223 NDR_record_t NDR;
224 mach_port_name_t name;
225 } __Request__mach_notify_dead_name_t __attribute__((unused));
226#ifdef __MigPackStructs
227#pragma pack()
228#endif
229#endif /* !__Request__notify_subsystem__defined */
230
231/* union of all requests */
232
233#ifndef __RequestUnion__notify_subsystem__defined
234#define __RequestUnion__notify_subsystem__defined
235union __RequestUnion__notify_subsystem {
236 __Request__mach_notify_port_deleted_t Request_mach_notify_port_deleted;
237 __Request__mach_notify_send_possible_t Request_mach_notify_send_possible;
238 __Request__mach_notify_port_destroyed_t Request_mach_notify_port_destroyed;
239 __Request__mach_notify_no_senders_t Request_mach_notify_no_senders;
240 __Request__mach_notify_send_once_t Request_mach_notify_send_once;
241 __Request__mach_notify_dead_name_t Request_mach_notify_dead_name;
242};
243#endif /* !__RequestUnion__notify_subsystem__defined */
244/* typedefs for all replies */
245
246#ifndef __Reply__notify_subsystem__defined
247#define __Reply__notify_subsystem__defined
248
249#ifdef __MigPackStructs
250#pragma pack(4)
251#endif
252 typedef struct {
253 mach_msg_header_t Head;
254 NDR_record_t NDR;
255 kern_return_t RetCode;
256 } __Reply__mach_notify_port_deleted_t __attribute__((unused));
257#ifdef __MigPackStructs
258#pragma pack()
259#endif
260
261#ifdef __MigPackStructs
262#pragma pack(4)
263#endif
264 typedef struct {
265 mach_msg_header_t Head;
266 NDR_record_t NDR;
267 kern_return_t RetCode;
268 } __Reply__mach_notify_send_possible_t __attribute__((unused));
269#ifdef __MigPackStructs
270#pragma pack()
271#endif
272
273#ifdef __MigPackStructs
274#pragma pack(4)
275#endif
276 typedef struct {
277 mach_msg_header_t Head;
278 NDR_record_t NDR;
279 kern_return_t RetCode;
280 } __Reply__mach_notify_port_destroyed_t __attribute__((unused));
281#ifdef __MigPackStructs
282#pragma pack()
283#endif
284
285#ifdef __MigPackStructs
286#pragma pack(4)
287#endif
288 typedef struct {
289 mach_msg_header_t Head;
290 NDR_record_t NDR;
291 kern_return_t RetCode;
292 } __Reply__mach_notify_no_senders_t __attribute__((unused));
293#ifdef __MigPackStructs
294#pragma pack()
295#endif
296
297#ifdef __MigPackStructs
298#pragma pack(4)
299#endif
300 typedef struct {
301 mach_msg_header_t Head;
302 NDR_record_t NDR;
303 kern_return_t RetCode;
304 } __Reply__mach_notify_send_once_t __attribute__((unused));
305#ifdef __MigPackStructs
306#pragma pack()
307#endif
308
309#ifdef __MigPackStructs
310#pragma pack(4)
311#endif
312 typedef struct {
313 mach_msg_header_t Head;
314 NDR_record_t NDR;
315 kern_return_t RetCode;
316 } __Reply__mach_notify_dead_name_t __attribute__((unused));
317#ifdef __MigPackStructs
318#pragma pack()
319#endif
320#endif /* !__Reply__notify_subsystem__defined */
321
322/* union of all replies */
323
324#ifndef __ReplyUnion__notify_subsystem__defined
325#define __ReplyUnion__notify_subsystem__defined
326union __ReplyUnion__notify_subsystem {
327 __Reply__mach_notify_port_deleted_t Reply_mach_notify_port_deleted;
328 __Reply__mach_notify_send_possible_t Reply_mach_notify_send_possible;
329 __Reply__mach_notify_port_destroyed_t Reply_mach_notify_port_destroyed;
330 __Reply__mach_notify_no_senders_t Reply_mach_notify_no_senders;
331 __Reply__mach_notify_send_once_t Reply_mach_notify_send_once;
332 __Reply__mach_notify_dead_name_t Reply_mach_notify_dead_name;
333};
334#endif /* !__RequestUnion__notify_subsystem__defined */
335
336#ifndef subsystem_to_name_map_notify
337#define subsystem_to_name_map_notify \
338 { "mach_notify_port_deleted", 65 },\
339 { "mach_notify_send_possible", 66 },\
340 { "mach_notify_port_destroyed", 69 },\
341 { "mach_notify_no_senders", 70 },\
342 { "mach_notify_send_once", 71 },\
343 { "mach_notify_dead_name", 72 }
344#endif
345
346#ifdef __AfterMigUserHeader
347__AfterMigUserHeader
348#endif /* __AfterMigUserHeader */
349
350#endif /* _notify_user_ */
351