2009-05-15 Geoff Norton <gnorton@novell.com>
[mono-project.git] / mono / io-layer / daemon-messages.h
blob237e951b5e6abf9561d82a99e64eec4cf3090abf
1 /*
2 * daemon-messages.h: Communications to and from the handle daemon
4 * Author:
5 * Dick Porter (dick@ximian.com)
7 * (C) 2002 Ximian, Inc.
8 */
10 #ifndef _WAPI_DAEMON_MESSAGES_H_
11 #define _WAPI_DAEMON_MESSAGES_H_
13 #include <mono/io-layer/wapi-private.h>
15 typedef enum {
16 WapiHandleRequestType_Error,
17 WapiHandleRequestType_New,
18 WapiHandleRequestType_Open,
19 WapiHandleRequestType_Close,
20 WapiHandleRequestType_Scratch,
21 WapiHandleRequestType_ScratchFree,
22 WapiHandleRequestType_ProcessFork,
23 WapiHandleRequestType_ProcessKill,
24 WapiHandleRequestType_GetOrSetShare,
25 WapiHandleRequestType_SetShare
26 } WapiHandleRequestType;
28 typedef struct
30 WapiHandleType type;
31 } WapiHandleRequest_New;
33 typedef struct
35 guint32 handle;
36 } WapiHandleRequest_Open;
38 typedef struct
40 guint32 handle;
41 } WapiHandleRequest_Close;
43 typedef struct
45 guint32 length;
46 } WapiHandleRequest_Scratch;
48 typedef struct
50 guint32 idx;
51 } WapiHandleRequest_ScratchFree;
53 typedef struct
55 guint32 cmd;
56 guint32 env;
57 guint32 dir;
58 guint32 stdin_handle;
59 guint32 stdout_handle;
60 guint32 stderr_handle;
61 gboolean inherit;
62 guint32 flags;
63 } WapiHandleRequest_ProcessFork;
65 typedef struct {
66 pid_t pid;
67 gint32 signo;
68 } WapiHandleRequest_ProcessKill;
70 typedef struct
72 dev_t device;
73 ino_t inode;
74 guint32 new_sharemode;
75 guint32 new_access;
76 } WapiHandleRequest_GetOrSetShare;
78 typedef struct
80 dev_t device;
81 ino_t inode;
82 guint32 sharemode;
83 guint32 access;
84 } WapiHandleRequest_SetShare;
86 typedef struct
88 WapiHandleRequestType type;
89 union
91 WapiHandleRequest_New new;
92 WapiHandleRequest_Open open;
93 WapiHandleRequest_Close close;
94 WapiHandleRequest_Scratch scratch;
95 WapiHandleRequest_ScratchFree scratch_free;
96 WapiHandleRequest_ProcessFork process_fork;
97 WapiHandleRequest_ProcessKill process_kill;
98 WapiHandleRequest_GetOrSetShare get_or_set_share;
99 WapiHandleRequest_SetShare set_share;
100 } u;
101 } WapiHandleRequest;
103 typedef enum {
104 WapiHandleResponseType_Error,
105 WapiHandleResponseType_New,
106 WapiHandleResponseType_Open,
107 WapiHandleResponseType_Close,
108 WapiHandleResponseType_Scratch,
109 WapiHandleResponseType_ScratchFree,
110 WapiHandleResponseType_ProcessFork,
111 WapiHandleResponseType_ProcessKill,
112 WapiHandleResponseType_GetOrSetShare,
113 WapiHandleResponseType_SetShare
114 } WapiHandleResponseType;
116 typedef struct
118 guint32 reason;
119 } WapiHandleResponse_Error;
121 typedef struct
123 WapiHandleType type;
124 guint32 handle;
125 } WapiHandleResponse_New;
127 typedef struct
129 WapiHandleType type;
130 guint32 handle;
131 } WapiHandleResponse_Open;
133 typedef struct
135 gboolean destroy;
136 } WapiHandleResponse_Close;
138 typedef struct
140 guint32 idx;
141 gboolean remap;
142 } WapiHandleResponse_Scratch;
144 typedef struct
146 guint32 dummy;
147 } WapiHandleResponse_ScratchFree;
149 typedef struct
151 guint32 process_handle;
152 guint32 thread_handle;
153 guint32 pid;
154 guint32 tid;
155 } WapiHandleResponse_ProcessFork;
157 typedef struct
159 guint32 err;
160 } WapiHandleResponse_ProcessKill;
162 typedef struct
164 gboolean exists;
165 guint32 sharemode;
166 guint32 access;
167 } WapiHandleResponse_GetOrSetShare;
169 typedef struct
171 guint32 dummy;
172 } WapiHandleResponse_SetShare;
174 typedef struct
176 WapiHandleResponseType type;
177 union
179 WapiHandleResponse_Error error;
180 WapiHandleResponse_New new;
181 WapiHandleResponse_Open open;
182 WapiHandleResponse_Close close;
183 WapiHandleResponse_Scratch scratch;
184 WapiHandleResponse_ScratchFree scratch_free;
185 WapiHandleResponse_ProcessFork process_fork;
186 WapiHandleResponse_ProcessKill process_kill;
187 WapiHandleResponse_GetOrSetShare get_or_set_share;
188 WapiHandleResponse_SetShare set_share;
189 } u;
190 } WapiHandleResponse;
192 extern void _wapi_daemon_request_response (int fd, WapiHandleRequest *req,
193 WapiHandleResponse *resp);
194 extern void _wapi_daemon_request_response_with_fds (int fd,
195 WapiHandleRequest *req,
196 WapiHandleResponse *resp,
197 int in_fd, int out_fd,
198 int err_fd);
199 extern int _wapi_daemon_request (int fd, WapiHandleRequest *req, int *fds,
200 gboolean *has_fds);
201 extern int _wapi_daemon_response (int fd, WapiHandleResponse *resp);
203 #endif /* _WAPI_DAEMON_MESSAGES_H_ */