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