1 | #ifndef _lockd_mach_user_ |
2 | #define _lockd_mach_user_ |
3 | |
4 | /* Module lockd_mach */ |
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 lockd_mach_MSG_COUNT |
58 | #define lockd_mach_MSG_COUNT 3 |
59 | #endif /* lockd_mach_MSG_COUNT */ |
60 | |
61 | #include <Availability.h> |
62 | #include <mach/std_types.h> |
63 | #include <mach/mig.h> |
64 | #include <mach/mig.h> |
65 | #include <mach/mach_types.h> |
66 | #include <lockd/lockd_mach_types.h> |
67 | |
68 | #ifdef __BeforeMigUserHeader |
69 | __BeforeMigUserHeader |
70 | #endif /* __BeforeMigUserHeader */ |
71 | |
72 | #include <sys/cdefs.h> |
73 | __BEGIN_DECLS |
74 | |
75 | |
76 | /* SimpleRoutine lockd_request */ |
77 | #ifdef mig_external |
78 | mig_external |
79 | #else |
80 | extern |
81 | #endif /* mig_external */ |
82 | kern_return_t lockd_request |
83 | ( |
84 | mach_port_t server, |
85 | uint32_t vers, |
86 | uint32_t flags, |
87 | uint64_t xid, |
88 | int64_t flk_start, |
89 | int64_t flk_len, |
90 | int32_t flk_pid, |
91 | int32_t flk_type, |
92 | int32_t flk_whence, |
93 | sock_storage sock_address, |
94 | xcred cred, |
95 | uint32_t fh_len, |
96 | nfs_handle fh |
97 | ); |
98 | |
99 | /* Routine lockd_ping */ |
100 | #ifdef mig_external |
101 | mig_external |
102 | #else |
103 | extern |
104 | #endif /* mig_external */ |
105 | kern_return_t lockd_ping |
106 | ( |
107 | mach_port_t server |
108 | ); |
109 | |
110 | /* SimpleRoutine lockd_shutdown */ |
111 | #ifdef mig_external |
112 | mig_external |
113 | #else |
114 | extern |
115 | #endif /* mig_external */ |
116 | kern_return_t lockd_shutdown |
117 | ( |
118 | mach_port_t server |
119 | ); |
120 | |
121 | __END_DECLS |
122 | |
123 | /********************** Caution **************************/ |
124 | /* The following data types should be used to calculate */ |
125 | /* maximum message sizes only. The actual message may be */ |
126 | /* smaller, and the position of the arguments within the */ |
127 | /* message layout may vary from what is presented here. */ |
128 | /* For example, if any of the arguments are variable- */ |
129 | /* sized, and less than the maximum is sent, the data */ |
130 | /* will be packed tight in the actual message to reduce */ |
131 | /* the presence of holes. */ |
132 | /********************** Caution **************************/ |
133 | |
134 | /* typedefs for all requests */ |
135 | |
136 | #ifndef __Request__lockd_mach_subsystem__defined |
137 | #define __Request__lockd_mach_subsystem__defined |
138 | |
139 | #ifdef __MigPackStructs |
140 | #pragma pack(push, 4) |
141 | #endif |
142 | typedef struct { |
143 | mach_msg_header_t Head; |
144 | NDR_record_t NDR; |
145 | uint32_t vers; |
146 | uint32_t flags; |
147 | uint64_t xid; |
148 | int64_t flk_start; |
149 | int64_t flk_len; |
150 | int32_t flk_pid; |
151 | int32_t flk_type; |
152 | int32_t flk_whence; |
153 | sock_storage sock_address; |
154 | xcred cred; |
155 | uint32_t fh_len; |
156 | nfs_handle fh; |
157 | } __Request__lockd_request_t __attribute__((unused)); |
158 | #ifdef __MigPackStructs |
159 | #pragma pack(pop) |
160 | #endif |
161 | |
162 | #ifdef __MigPackStructs |
163 | #pragma pack(push, 4) |
164 | #endif |
165 | typedef struct { |
166 | mach_msg_header_t Head; |
167 | } __Request__lockd_ping_t __attribute__((unused)); |
168 | #ifdef __MigPackStructs |
169 | #pragma pack(pop) |
170 | #endif |
171 | |
172 | #ifdef __MigPackStructs |
173 | #pragma pack(push, 4) |
174 | #endif |
175 | typedef struct { |
176 | mach_msg_header_t Head; |
177 | } __Request__lockd_shutdown_t __attribute__((unused)); |
178 | #ifdef __MigPackStructs |
179 | #pragma pack(pop) |
180 | #endif |
181 | #endif /* !__Request__lockd_mach_subsystem__defined */ |
182 | |
183 | /* union of all requests */ |
184 | |
185 | #ifndef __RequestUnion__lockd_mach_subsystem__defined |
186 | #define __RequestUnion__lockd_mach_subsystem__defined |
187 | union __RequestUnion__lockd_mach_subsystem { |
188 | __Request__lockd_request_t Request_lockd_request; |
189 | __Request__lockd_ping_t Request_lockd_ping; |
190 | __Request__lockd_shutdown_t Request_lockd_shutdown; |
191 | }; |
192 | #endif /* !__RequestUnion__lockd_mach_subsystem__defined */ |
193 | /* typedefs for all replies */ |
194 | |
195 | #ifndef __Reply__lockd_mach_subsystem__defined |
196 | #define __Reply__lockd_mach_subsystem__defined |
197 | |
198 | #ifdef __MigPackStructs |
199 | #pragma pack(push, 4) |
200 | #endif |
201 | typedef struct { |
202 | mach_msg_header_t Head; |
203 | NDR_record_t NDR; |
204 | kern_return_t RetCode; |
205 | } __Reply__lockd_request_t __attribute__((unused)); |
206 | #ifdef __MigPackStructs |
207 | #pragma pack(pop) |
208 | #endif |
209 | |
210 | #ifdef __MigPackStructs |
211 | #pragma pack(push, 4) |
212 | #endif |
213 | typedef struct { |
214 | mach_msg_header_t Head; |
215 | NDR_record_t NDR; |
216 | kern_return_t RetCode; |
217 | } __Reply__lockd_ping_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 | kern_return_t RetCode; |
229 | } __Reply__lockd_shutdown_t __attribute__((unused)); |
230 | #ifdef __MigPackStructs |
231 | #pragma pack(pop) |
232 | #endif |
233 | #endif /* !__Reply__lockd_mach_subsystem__defined */ |
234 | |
235 | /* union of all replies */ |
236 | |
237 | #ifndef __ReplyUnion__lockd_mach_subsystem__defined |
238 | #define __ReplyUnion__lockd_mach_subsystem__defined |
239 | union __ReplyUnion__lockd_mach_subsystem { |
240 | __Reply__lockd_request_t Reply_lockd_request; |
241 | __Reply__lockd_ping_t Reply_lockd_ping; |
242 | __Reply__lockd_shutdown_t Reply_lockd_shutdown; |
243 | }; |
244 | #endif /* !__RequestUnion__lockd_mach_subsystem__defined */ |
245 | |
246 | #ifndef subsystem_to_name_map_lockd_mach |
247 | #define subsystem_to_name_map_lockd_mach \ |
248 | { "lockd_request", 1023 },\ |
249 | { "lockd_ping", 1024 },\ |
250 | { "lockd_shutdown", 1025 } |
251 | #endif |
252 | |
253 | #ifdef __AfterMigUserHeader |
254 | __AfterMigUserHeader |
255 | #endif /* __AfterMigUserHeader */ |
256 | |
257 | #endif /* _lockd_mach_user_ */ |
258 | |