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