1/*
2 * Copyright (c) 2003-2011 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#include <mach/std_types.defs>
25#include <mach/mach_types.defs>
26
27subsystem notify_ipc 78945668;
28serverprefix _;
29
30import <sys/types.h>;
31
32import "notify_ipc_types.h";
33
34type notify_name    = ^ array [] of MACH_MSG_TYPE_BYTE
35	ctype : caddr_t;
36
37routine _notify_server_post
38(
39	server : mach_port_t;
40	name : notify_name;
41	out status : int;
42	ServerAuditToken audit : audit_token_t
43);
44
45routine _notify_server_register_plain
46(
47	server : mach_port_t;
48	name : notify_name;
49	out token : int;
50	out status : int;
51	ServerAuditToken audit : audit_token_t
52);
53
54routine _notify_server_register_check
55(
56	server : mach_port_t;
57	name : notify_name;
58	out size : int;
59	out slot : int;
60	out token : int;
61	out status : int;
62	ServerAuditToken audit : audit_token_t
63);
64
65routine _notify_server_register_signal
66(
67	server : mach_port_t;
68	name : notify_name;
69	sig: int;
70	out token : int;
71	out status : int;
72	ServerAuditToken audit : audit_token_t
73);
74
75routine _notify_server_register_file_descriptor
76(
77	server : mach_port_t;
78	name : notify_name;
79	fileport : mach_port_move_send_t;
80	ntoken : int;
81	out token : int;
82	out status : int;
83	ServerAuditToken audit : audit_token_t
84);
85
86routine _notify_server_register_mach_port
87(
88	server : mach_port_t;
89	name : notify_name;
90	port : mach_port_move_send_t;
91	ntoken : int;
92	out token : int;
93	out status : int;
94	ServerAuditToken audit : audit_token_t
95);
96
97routine _notify_server_set_owner
98(
99	server : mach_port_t;
100	name : notify_name;
101	user : int;
102	group : int;
103	out status : int;
104	ServerAuditToken audit : audit_token_t
105);
106
107routine _notify_server_get_owner
108(
109	server : mach_port_t;
110	name : notify_name;
111	out user : int;
112	out group : int;
113	out status : int;
114	ServerAuditToken audit : audit_token_t
115);
116
117routine _notify_server_set_access
118(
119	server : mach_port_t;
120	name : notify_name;
121	mode : int;
122	out status : int;
123	ServerAuditToken audit : audit_token_t
124);
125
126routine _notify_server_get_access
127(
128	server : mach_port_t;
129	name : notify_name;
130	out mode : int;
131	out status : int;
132	ServerAuditToken audit : audit_token_t
133);
134
135routine _notify_server_release_name
136(
137	server : mach_port_t;
138	name : notify_name;
139	out status : int;
140	ServerAuditToken audit : audit_token_t
141);
142
143routine _notify_server_cancel
144(
145	server : mach_port_t;
146	token : int;
147	out status : int;
148	ServerAuditToken audit : audit_token_t
149);
150
151routine _notify_server_check
152(
153	server : mach_port_t;
154	token : int;
155	out check : int;
156	out status : int;
157	ServerAuditToken audit : audit_token_t
158);
159
160routine _notify_server_get_state
161(
162	server : mach_port_t;
163	token : int;
164	out state : uint64_t;
165	out status : int;
166	ServerAuditToken audit : audit_token_t
167);
168
169routine _notify_server_set_state
170(
171	server : mach_port_t;
172	token : int;
173	state : uint64_t;
174	out status : int;
175	ServerAuditToken audit : audit_token_t
176);
177
178skip; /* formerly _notify_server_get_val */
179
180skip; /* formerly _notify_server_set_val */
181
182routine _notify_server_monitor_file
183(
184	server : mach_port_t;
185	token : int;
186	path : notify_name;
187	flags : int;
188	out status : int;
189	ServerAuditToken audit : audit_token_t
190);
191
192routine _notify_server_suspend
193(
194	server : mach_port_t;
195	token : int;
196	out status : int;
197	ServerAuditToken audit : audit_token_t
198);
199
200routine _notify_server_resume
201(
202	server : mach_port_t;
203	token : int;
204	out status : int;
205	ServerAuditToken audit : audit_token_t
206);
207
208routine _notify_server_suspend_pid
209(
210	server : mach_port_t;
211	pid : int;
212	out status : int;
213	ServerAuditToken audit : audit_token_t
214);
215
216routine _notify_server_resume_pid
217(
218	server : mach_port_t;
219	pid : int;
220	out status : int;
221	ServerAuditToken audit : audit_token_t
222);
223
224simpleroutine _notify_server_simple_post
225(
226	server : mach_port_t;
227	name : notify_name;
228	ServerAuditToken audit : audit_token_t
229);
230
231/* Additions for version 2 - more async support */
232
233routine _notify_server_post_2
234(
235	server : mach_port_t;
236	name : notify_name;
237	out name_id : uint64_t;
238	out status : int;
239	ServerAuditToken audit : audit_token_t
240);
241
242simpleroutine _notify_server_post_3
243(
244	server : mach_port_t;
245	name_id : uint64_t;
246	ServerAuditToken audit : audit_token_t
247);
248
249simpleroutine _notify_server_post_4
250(
251	server : mach_port_t;
252	name : notify_name;
253	ServerAuditToken audit : audit_token_t
254);
255
256simpleroutine _notify_server_register_plain_2
257(
258	server : mach_port_t;
259	name : notify_name;
260	token : int;
261	ServerAuditToken audit : audit_token_t
262);
263
264routine _notify_server_register_check_2
265(
266	server : mach_port_t;
267	name : notify_name;
268	token: int;
269	out size : int;
270	out slot : int;
271	out name_id : uint64_t;
272	out status : int;
273	ServerAuditToken audit : audit_token_t
274);
275
276simpleroutine _notify_server_register_signal_2
277(
278	server : mach_port_t;
279	name : notify_name;
280	token : int;
281	sig: int;
282	ServerAuditToken audit : audit_token_t
283);
284
285simpleroutine _notify_server_register_file_descriptor_2
286(
287	server : mach_port_t;
288	name : notify_name;
289	token: int;
290	fileport : mach_port_move_send_t;
291	ServerAuditToken audit : audit_token_t
292);
293
294simpleroutine _notify_server_register_mach_port_2
295(
296	server : mach_port_t;
297	name : notify_name;
298	token: int;
299	port : mach_port_move_send_t;
300	ServerAuditToken audit : audit_token_t
301);
302
303simpleroutine _notify_server_cancel_2
304(
305	server : mach_port_t;
306	token : int;
307	ServerAuditToken audit : audit_token_t
308);
309
310routine _notify_server_get_state_2
311(
312	server : mach_port_t;
313	name_id : uint64_t;
314	out state : uint64_t;
315	out status : int;
316	ServerAuditToken audit : audit_token_t
317);
318
319routine _notify_server_get_state_3
320(
321	server : mach_port_t;
322	token : int;
323	out state : uint64_t;
324	out nid : uint64_t;
325	out status : int;
326	ServerAuditToken audit : audit_token_t
327);
328
329simpleroutine _notify_server_set_state_2
330(
331	server : mach_port_t;
332	name_id : uint64_t;
333	state : uint64_t;
334	ServerAuditToken audit : audit_token_t
335);
336
337routine _notify_server_set_state_3
338(
339	server : mach_port_t;
340	token : int;
341	state : uint64_t;
342	out nid : uint64_t;
343	out status : int;
344	ServerAuditToken audit : audit_token_t
345);
346
347simpleroutine _notify_server_monitor_file_2
348(
349	server : mach_port_t;
350	token : int;
351	path : notify_name;
352	flags : int;
353	ServerAuditToken audit : audit_token_t
354);
355
356routine _notify_server_regenerate
357(
358	server : mach_port_t;
359	name : notify_name;
360	token : int;
361	reg_type : uint32_t;
362	port : mach_port_make_send_t;
363	sig: int;
364	prev_slot: int;
365	prev_state : uint64_t;
366	prev_time : uint64_t;
367	path : notify_name;
368	path_flags: int;
369	out new_slot : int;
370	out new_name_id : uint64_t;
371	out status : int;
372	ServerAuditToken audit : audit_token_t
373);
374