xref: /haiku/src/add-ons/kernel/file_systems/netfs/headers/shared/Requests.h (revision 59ecfa6cb620abe17a41ad72d746d8a35f671ad6)
1 // Requests.h
2 
3 #ifndef NET_FS_REQUESTS_H
4 #define NET_FS_REQUESTS_H
5 
6 #include "AttrDirInfo.h"
7 #include "Compatibility.h"
8 #include "DebugSupport.h"
9 #include "EntryInfo.h"
10 #include "NodeInfo.h"
11 #include "Request.h"
12 #include "RequestMemberArray.h"
13 #include "ServerInfo.h"
14 #include "ServerNodeID.h"
15 
16 // request types
17 enum {
18 	CONNECTION_BROKEN_REQUEST	= -1,
19 	INIT_CONNECTION_REQUEST		= 0,
20 	INIT_CONNECTION_REPLY,
21 
22 	MOUNT_REQUEST,
23 	MOUNT_REPLY,
24 	UNMOUNT_REQUEST,
25 	READ_VNODE_REQUEST,
26 	READ_VNODE_REPLY,
27 	WRITE_STAT_REQUEST,
28 	WRITE_STAT_REPLY,
29 	CREATE_FILE_REQUEST,
30 	CREATE_FILE_REPLY,
31 	OPEN_REQUEST,
32 	OPEN_REPLY,
33 	CLOSE_REQUEST,	// common for all kinds of cookies
34 	CLOSE_REPLY,
35 	READ_REQUEST,
36 	READ_REPLY,
37 	WRITE_REQUEST,
38 	WRITE_REPLY,
39 	CREATE_LINK_REQUEST,
40 	CREATE_LINK_REPLY,
41 	UNLINK_REQUEST,
42 	UNLINK_REPLY,
43 	CREATE_SYMLINK_REQUEST,
44 	CREATE_SYMLINK_REPLY,
45 	READ_LINK_REQUEST,
46 	READ_LINK_REPLY,
47 	RENAME_REQUEST,
48 	RENAME_REPLY,
49 	MAKE_DIR_REQUEST,
50 	MAKE_DIR_REPLY,
51 	REMOVE_DIR_REQUEST,
52 	REMOVE_DIR_REPLY,
53 	OPEN_DIR_REQUEST,
54 	OPEN_DIR_REPLY,
55 	READ_DIR_REQUEST,
56 	READ_DIR_REPLY,
57 	WALK_REQUEST,
58 	WALK_REPLY,
59 	MULTI_WALK_REQUEST,
60 	MULTI_WALK_REPLY,
61 
62 	OPEN_ATTR_DIR_REQUEST,
63 	OPEN_ATTR_DIR_REPLY,
64 	READ_ATTR_DIR_REQUEST,
65 	READ_ATTR_DIR_REPLY,
66 	READ_ATTR_REQUEST,
67 	READ_ATTR_REPLY,
68 	WRITE_ATTR_REQUEST,
69 	WRITE_ATTR_REPLY,
70 	REMOVE_ATTR_REQUEST,
71 	REMOVE_ATTR_REPLY,
72 	RENAME_ATTR_REQUEST,
73 	RENAME_ATTR_REPLY,
74 	STAT_ATTR_REQUEST,
75 	STAT_ATTR_REPLY,
76 
77 	OPEN_QUERY_REQUEST,
78 	OPEN_QUERY_REPLY,
79 	READ_QUERY_REQUEST,
80 	READ_QUERY_REPLY,
81 
82 	// node monitoring notifications
83 	ENTRY_CREATED_REQUEST,
84 	ENTRY_REMOVED_REQUEST,
85 	ENTRY_MOVED_REQUEST,
86 	ENTRY_STAT_CHANGED_REQUEST,
87 	ENTRY_ATTRIBUTE_CHANGED_REQUEST,
88 
89 	// server info
90 	SERVER_INFO_REQUEST,
91 };
92 
93 struct ConnectionBrokenRequest;
94 struct InitConnectionRequest;
95 struct InitConnectionReply;
96 
97 struct MountRequest;
98 struct MountReply;
99 struct UnmountRequest;
100 struct ReadVNodeRequest;
101 struct ReadVNodeReply;
102 struct WriteStatRequest;
103 struct WriteStatReply;
104 struct CreateFileRequest;
105 struct CreateFileReply;
106 struct OpenRequest;
107 struct OpenReply;
108 struct CloseRequest;
109 struct CloseReply;
110 struct ReadRequest;
111 struct ReadReply;
112 struct WriteRequest;
113 struct WriteReply;
114 struct CreateLinkRequest;
115 struct CreateLinkReply;
116 struct UnlinkRequest;
117 struct UnlinkReply;
118 struct CreateSymlinkRequest;
119 struct CreateSymlinkReply;
120 struct ReadLinkRequest;
121 struct ReadLinkReply;
122 struct RenameRequest;
123 struct RenameReply;
124 struct RemoveDirRequest;
125 struct RemoveDirReply;
126 struct MakeDirRequest;
127 struct MakeDirReply;
128 struct OpenDirRequest;
129 struct OpenDirReply;
130 struct ReadDirRequest;
131 struct ReadDirReply;
132 struct WalkRequest;
133 struct WalkReply;
134 struct MultiWalkRequest;
135 struct MultiWalkReply;
136 
137 struct OpenAttrDirRequest;
138 struct OpenAttrDirReply;
139 struct ReadAttrDirRequest;
140 struct ReadAttrDirReply;
141 struct ReadAttrRequest;
142 struct ReadAttrReply;
143 struct WriteAttrRequest;
144 struct WriteAttrReply;
145 struct RemoveAttrRequest;
146 struct RemoveAttrReply;
147 struct RenameAttrRequest;
148 struct RenameAttrReply;
149 struct StatAttrRequest;
150 struct StatAttrReply;
151 
152 struct OpenQueryRequest;
153 struct OpenQueryReply;
154 struct ReadQueryRequest;
155 struct ReadQueryReply;
156 
157 struct NodeMonitoringRequest;
158 struct EntryCreatedRequest;
159 struct EntryRemovedRequest;
160 struct EntryMovedRequest;
161 struct StatChangedRequest;
162 struct AttributeChangedRequest;
163 
164 struct ServerInfoRequest;
165 
166 // RequestVisitor
167 class RequestVisitor {
168 public:
169 								RequestVisitor();
170 	virtual						~RequestVisitor();
171 
172 	virtual	status_t			VisitConnectionBrokenRequest(
173 									ConnectionBrokenRequest* request);
174 	virtual	status_t			VisitInitConnectionRequest(
175 									InitConnectionRequest* request);
176 	virtual	status_t			VisitInitConnectionReply(
177 									InitConnectionReply* request);
178 
179 	virtual	status_t			VisitMountRequest(MountRequest* request);
180 	virtual	status_t			VisitMountReply(MountReply* request);
181 	virtual	status_t			VisitUnmountRequest(UnmountRequest* request);
182 	virtual	status_t			VisitReadVNodeRequest(
183 									ReadVNodeRequest* request);
184 	virtual	status_t			VisitReadVNodeReply(ReadVNodeReply* request);
185 	virtual	status_t			VisitWriteStatRequest(
186 									WriteStatRequest* request);
187 	virtual	status_t			VisitWriteStatReply(WriteStatReply* request);
188 	virtual	status_t			VisitCreateFileRequest(
189 									CreateFileRequest* request);
190 	virtual	status_t			VisitCreateFileReply(CreateFileReply* request);
191 	virtual	status_t			VisitOpenRequest(OpenRequest* request);
192 	virtual	status_t			VisitOpenReply(OpenReply* request);
193 	virtual	status_t			VisitCloseRequest(CloseRequest* request);
194 	virtual	status_t			VisitCloseReply(CloseReply* request);
195 	virtual	status_t			VisitReadRequest(ReadRequest* request);
196 	virtual	status_t			VisitReadReply(ReadReply* request);
197 	virtual	status_t			VisitWriteRequest(WriteRequest* request);
198 	virtual	status_t			VisitWriteReply(WriteReply* request);
199 	virtual	status_t			VisitCreateLinkRequest(
200 									CreateLinkRequest* request);
201 	virtual	status_t			VisitCreateLinkReply(CreateLinkReply* request);
202 	virtual	status_t			VisitUnlinkRequest(UnlinkRequest* request);
203 	virtual	status_t			VisitUnlinkReply(UnlinkReply* request);
204 	virtual	status_t			VisitCreateSymlinkRequest(
205 									CreateSymlinkRequest* request);
206 	virtual	status_t			VisitCreateSymlinkReply(
207 									CreateSymlinkReply* request);
208 	virtual	status_t			VisitReadLinkRequest(ReadLinkRequest* request);
209 	virtual	status_t			VisitReadLinkReply(ReadLinkReply* request);
210 	virtual	status_t			VisitRenameRequest(RenameRequest* request);
211 	virtual	status_t			VisitRenameReply(RenameReply* request);
212 	virtual	status_t			VisitMakeDirRequest(MakeDirRequest* request);
213 	virtual	status_t			VisitMakeDirReply(MakeDirReply* request);
214 	virtual	status_t			VisitRemoveDirRequest(
215 									RemoveDirRequest* request);
216 	virtual	status_t			VisitRemoveDirReply(RemoveDirReply* request);
217 	virtual	status_t			VisitOpenDirRequest(OpenDirRequest* request);
218 	virtual	status_t			VisitOpenDirReply(OpenDirReply* request);
219 	virtual	status_t			VisitReadDirRequest(ReadDirRequest* request);
220 	virtual	status_t			VisitReadDirReply(ReadDirReply* request);
221 	virtual	status_t			VisitWalkRequest(WalkRequest* request);
222 	virtual	status_t			VisitWalkReply(WalkReply* request);
223 	virtual	status_t			VisitMultiWalkRequest(
224 									MultiWalkRequest* request);
225 	virtual	status_t			VisitMultiWalkReply(MultiWalkReply* request);
226 
227 	virtual	status_t			VisitOpenAttrDirRequest(
228 									OpenAttrDirRequest* request);
229 	virtual	status_t			VisitOpenAttrDirReply(
230 									OpenAttrDirReply* request);
231 	virtual	status_t			VisitReadAttrDirRequest(
232 									ReadAttrDirRequest* request);
233 	virtual	status_t			VisitReadAttrDirReply(
234 									ReadAttrDirReply* request);
235 	virtual	status_t			VisitReadAttrRequest(ReadAttrRequest* request);
236 	virtual	status_t			VisitReadAttrReply(ReadAttrReply* request);
237 	virtual	status_t			VisitWriteAttrRequest(
238 									WriteAttrRequest* request);
239 	virtual	status_t			VisitWriteAttrReply(WriteAttrReply* request);
240 	virtual	status_t			VisitRemoveAttrRequest(
241 									RemoveAttrRequest* request);
242 	virtual	status_t			VisitRemoveAttrReply(RemoveAttrReply* request);
243 	virtual	status_t			VisitRenameAttrRequest(
244 									RenameAttrRequest* request);
245 	virtual	status_t			VisitRenameAttrReply(RenameAttrReply* request);
246 	virtual	status_t			VisitStatAttrRequest(StatAttrRequest* request);
247 	virtual	status_t			VisitStatAttrReply(StatAttrReply* request);
248 
249 	virtual	status_t			VisitOpenQueryRequest(
250 									OpenQueryRequest* request);
251 	virtual	status_t			VisitOpenQueryReply(OpenQueryReply* request);
252 	virtual	status_t			VisitReadQueryRequest(
253 									ReadQueryRequest* request);
254 	virtual	status_t			VisitReadQueryReply(ReadQueryReply* request);
255 
256 	virtual	status_t			VisitNodeMonitoringRequest(
257 									NodeMonitoringRequest* request);
258 	virtual	status_t			VisitEntryCreatedRequest(
259 									EntryCreatedRequest* request);
260 	virtual	status_t			VisitEntryRemovedRequest(
261 									EntryRemovedRequest* request);
262 	virtual	status_t			VisitEntryMovedRequest(
263 									EntryMovedRequest* request);
264 	virtual	status_t			VisitStatChangedRequest(
265 									StatChangedRequest* request);
266 	virtual	status_t			VisitAttributeChangedRequest(
267 									AttributeChangedRequest* request);
268 
269 	virtual	status_t			VisitServerInfoRequest(
270 									ServerInfoRequest* request);
271 
272 	virtual	status_t			VisitAny(Request* request);
273 };
274 
275 // ReplyRequest
276 struct ReplyRequest : Request {
ReplyRequestReplyRequest277 	ReplyRequest(uint32 type) : Request(type) {}
278 
279 	status_t		error;
280 };
281 
282 // VolumeRequest
283 struct VolumeRequest : Request {
VolumeRequestVolumeRequest284 	VolumeRequest(uint32 type) : Request(type) {}
285 
286 	int32			volumeID;
287 };
288 
289 // ConnectionBrokenRequest
290 struct ConnectionBrokenRequest : Request {
ConnectionBrokenRequestConnectionBrokenRequest291 	ConnectionBrokenRequest() : Request(CONNECTION_BROKEN_REQUEST) {}
AcceptConnectionBrokenRequest292 	virtual status_t Accept(RequestVisitor* visitor)
293 		{ return visitor->VisitConnectionBrokenRequest(this); }
ShowAroundConnectionBrokenRequest294 	virtual void ShowAround(RequestMemberVisitor* visitor)
295 	{
296 		visitor->Visit(this, error);
297 	}
298 
299 	status_t		error;
300 };
301 
302 // InitConnectionRequest
303 struct InitConnectionRequest : Request {
InitConnectionRequestInitConnectionRequest304 	InitConnectionRequest() : Request(INIT_CONNECTION_REQUEST) {}
AcceptInitConnectionRequest305 	virtual status_t Accept(RequestVisitor* visitor)
306 		{ return visitor->VisitInitConnectionRequest(this); }
ShowAroundInitConnectionRequest307 	virtual void ShowAround(RequestMemberVisitor* visitor)
308 	{
309 		visitor->Visit(this, bigEndian);
310 	}
311 
312 	bool			bigEndian;
313 };
314 
315 // InitConnectionReply
316 struct InitConnectionReply : ReplyRequest {
InitConnectionReplyInitConnectionReply317 	InitConnectionReply() : ReplyRequest(INIT_CONNECTION_REPLY) {}
AcceptInitConnectionReply318 	virtual status_t Accept(RequestVisitor* visitor)
319 		{ return visitor->VisitInitConnectionReply(this); }
ShowAroundInitConnectionReply320 	virtual void ShowAround(RequestMemberVisitor* visitor)
321 	{
322 		visitor->Visit(this, error);
323 	}
324 };
325 
326 // MountRequest
327 struct MountRequest : Request {
MountRequestMountRequest328 	MountRequest() : Request(MOUNT_REQUEST) {}
AcceptMountRequest329 	virtual status_t Accept(RequestVisitor* visitor)
330 		{ return visitor->VisitMountRequest(this); }
ShowAroundMountRequest331 	virtual void ShowAround(RequestMemberVisitor* visitor)
332 	{
333 		visitor->Visit(this, share);
334 		visitor->Visit(this, user);
335 		visitor->Visit(this, password);
336 		visitor->Visit(this, flags);
337 	}
338 
339 	StringData		share;
340 	StringData		user;		// can be NULL, if the connection supports
341 	StringData		password;	// authentication; otherwise NULL means anonymous
342 	uint32			flags;
343 };
344 
345 // MountReply
346 struct MountReply : ReplyRequest {
MountReplyMountReply347 	MountReply() : ReplyRequest(MOUNT_REPLY) {}
AcceptMountReply348 	virtual status_t Accept(RequestVisitor* visitor)
349 		{ return visitor->VisitMountReply(this); }
ShowAroundMountReply350 	virtual void ShowAround(RequestMemberVisitor* visitor)
351 	{
352 		visitor->Visit(this, error);
353 		visitor->Visit(this, volumeID);
354 		visitor->Visit(this, sharePermissions);
355 		visitor->Visit(this, nodeInfo);
356 		visitor->Visit(this, noPermission);
357 	}
358 
359 	int32			volumeID;
360 	uint32			sharePermissions;
361 	NodeInfo		nodeInfo;
362 	bool			noPermission;	// always set (just as error)
363 };
364 
365 // UnmountRequest
366 struct UnmountRequest : VolumeRequest {
UnmountRequestUnmountRequest367 	UnmountRequest() : VolumeRequest(UNMOUNT_REQUEST) {}
AcceptUnmountRequest368 	virtual status_t Accept(RequestVisitor* visitor)
369 		{ return visitor->VisitUnmountRequest(this); }
ShowAroundUnmountRequest370 	virtual void ShowAround(RequestMemberVisitor* visitor)
371 	{
372 		visitor->Visit(this, volumeID);
373 	}
374 };
375 
376 // ReadVNodeRequest
377 struct ReadVNodeRequest : VolumeRequest {
ReadVNodeRequestReadVNodeRequest378 	ReadVNodeRequest() : VolumeRequest(READ_VNODE_REQUEST) {}
AcceptReadVNodeRequest379 	virtual status_t Accept(RequestVisitor* visitor)
380 		{ return visitor->VisitReadVNodeRequest(this); }
ShowAroundReadVNodeRequest381 	virtual void ShowAround(RequestMemberVisitor* visitor)
382 	{
383 		visitor->Visit(this, volumeID);
384 		visitor->Visit(this, nodeID);
385 	}
386 
387 	ServerNodeID		nodeID;
388 };
389 
390 // ReadVNodeReply
391 struct ReadVNodeReply : ReplyRequest {
ReadVNodeReplyReadVNodeReply392 	ReadVNodeReply() : ReplyRequest(READ_VNODE_REPLY) {}
AcceptReadVNodeReply393 	virtual status_t Accept(RequestVisitor* visitor)
394 		{ return visitor->VisitReadVNodeReply(this); }
ShowAroundReadVNodeReply395 	virtual void ShowAround(RequestMemberVisitor* visitor)
396 	{
397 		visitor->Visit(this, error);
398 		visitor->Visit(this, nodeInfo);
399 	}
400 
401 	NodeInfo		nodeInfo;
402 };
403 
404 // WriteStatRequest
405 struct WriteStatRequest : VolumeRequest {
WriteStatRequestWriteStatRequest406 	WriteStatRequest() : VolumeRequest(WRITE_STAT_REQUEST) {}
AcceptWriteStatRequest407 	virtual status_t Accept(RequestVisitor* visitor)
408 		{ return visitor->VisitWriteStatRequest(this); }
ShowAroundWriteStatRequest409 	virtual void ShowAround(RequestMemberVisitor* visitor)
410 	{
411 		visitor->Visit(this, volumeID);
412 		visitor->Visit(this, nodeID);
413 		visitor->Visit(this, nodeInfo);
414 		visitor->Visit(this, mask);
415 	}
416 
417 	ServerNodeID	nodeID;
418 	NodeInfo		nodeInfo;
419 	uint32			mask;
420 };
421 
422 // WriteStatReply
423 struct WriteStatReply : ReplyRequest {
WriteStatReplyWriteStatReply424 	WriteStatReply() : ReplyRequest(WRITE_STAT_REPLY) {}
AcceptWriteStatReply425 	virtual status_t Accept(RequestVisitor* visitor)
426 		{ return visitor->VisitWriteStatReply(this); }
ShowAroundWriteStatReply427 	virtual void ShowAround(RequestMemberVisitor* visitor)
428 	{
429 		visitor->Visit(this, error);
430 		visitor->Visit(this, nodeInfo);
431 		visitor->Visit(this, nodeInfoValid);
432 	}
433 
434 	NodeInfo		nodeInfo;
435 	bool			nodeInfoValid;
436 };
437 
438 // CreateFileRequest
439 struct CreateFileRequest : VolumeRequest {
CreateFileRequestCreateFileRequest440 	CreateFileRequest() : VolumeRequest(CREATE_FILE_REQUEST) {}
AcceptCreateFileRequest441 	virtual status_t Accept(RequestVisitor* visitor)
442 		{ return visitor->VisitCreateFileRequest(this); }
ShowAroundCreateFileRequest443 	virtual void ShowAround(RequestMemberVisitor* visitor)
444 	{
445 		visitor->Visit(this, volumeID);
446 		visitor->Visit(this, directoryID);
447 		visitor->Visit(this, name);
448 		visitor->Visit(this, openMode);
449 		visitor->Visit(this, mode);
450 	}
451 
452 	ServerNodeID	directoryID;
453 	StringData		name;
454 	int32			openMode;
455 	uint32			mode;
456 };
457 
458 // CreateFileReply
459 struct CreateFileReply : ReplyRequest {
CreateFileReplyCreateFileReply460 	CreateFileReply() : ReplyRequest(CREATE_FILE_REPLY) {}
AcceptCreateFileReply461 	virtual status_t Accept(RequestVisitor* visitor)
462 		{ return visitor->VisitCreateFileReply(this); }
ShowAroundCreateFileReply463 	virtual void ShowAround(RequestMemberVisitor* visitor)
464 	{
465 		visitor->Visit(this, error);
466 		visitor->Visit(this, entryInfo);
467 		visitor->Visit(this, cookie);
468 	}
469 
470 	EntryInfo		entryInfo;
471 	intptr_t		cookie;
472 };
473 
474 // OpenRequest
475 struct OpenRequest : VolumeRequest {
OpenRequestOpenRequest476 	OpenRequest() : VolumeRequest(OPEN_REQUEST) {}
AcceptOpenRequest477 	virtual status_t Accept(RequestVisitor* visitor)
478 		{ return visitor->VisitOpenRequest(this); }
ShowAroundOpenRequest479 	virtual void ShowAround(RequestMemberVisitor* visitor)
480 	{
481 		visitor->Visit(this, volumeID);
482 		visitor->Visit(this, nodeID);
483 		visitor->Visit(this, openMode);
484 	}
485 
486 	ServerNodeID	nodeID;
487 	int32			openMode;
488 };
489 
490 // OpenReply
491 struct OpenReply : ReplyRequest {
OpenReplyOpenReply492 	OpenReply() : ReplyRequest(OPEN_REPLY) {}
AcceptOpenReply493 	virtual status_t Accept(RequestVisitor* visitor)
494 		{ return visitor->VisitOpenReply(this); }
ShowAroundOpenReply495 	virtual void ShowAround(RequestMemberVisitor* visitor)
496 	{
497 		visitor->Visit(this, error);
498 		visitor->Visit(this, nodeInfo);
499 		visitor->Visit(this, cookie);
500 	}
501 
502 	NodeInfo		nodeInfo;
503 	intptr_t		cookie;
504 };
505 
506 // CloseRequest
507 struct CloseRequest : VolumeRequest {
CloseRequestCloseRequest508 	CloseRequest() : VolumeRequest(CLOSE_REQUEST) {}
AcceptCloseRequest509 	virtual status_t Accept(RequestVisitor* visitor)
510 		{ return visitor->VisitCloseRequest(this); }
ShowAroundCloseRequest511 	virtual void ShowAround(RequestMemberVisitor* visitor)
512 	{
513 		visitor->Visit(this, volumeID);
514 		visitor->Visit(this, cookie);
515 	}
516 
517 	intptr_t		cookie;
518 };
519 
520 // CloseReply
521 struct CloseReply : ReplyRequest {
CloseReplyCloseReply522 	CloseReply() : ReplyRequest(CLOSE_REPLY) {}
AcceptCloseReply523 	virtual status_t Accept(RequestVisitor* visitor)
524 		{ return visitor->VisitCloseReply(this); }
ShowAroundCloseReply525 	virtual void ShowAround(RequestMemberVisitor* visitor)
526 	{
527 		visitor->Visit(this, error);
528 	}
529 
530 };
531 
532 // ReadRequest
533 struct ReadRequest : VolumeRequest {
ReadRequestReadRequest534 	ReadRequest() : VolumeRequest(READ_REQUEST) {}
AcceptReadRequest535 	virtual status_t Accept(RequestVisitor* visitor)
536 		{ return visitor->VisitReadRequest(this); }
ShowAroundReadRequest537 	virtual void ShowAround(RequestMemberVisitor* visitor)
538 	{
539 		visitor->Visit(this, volumeID);
540 		visitor->Visit(this, cookie);
541 		visitor->Visit(this, pos);
542 		visitor->Visit(this, size);
543 	}
544 
545 	intptr_t		cookie;
546 	off_t			pos;
547 	int32			size;
548 };
549 
550 // ReadReply
551 struct ReadReply : ReplyRequest {
ReadReplyReadReply552 	ReadReply() : ReplyRequest(READ_REPLY) {}
AcceptReadReply553 	virtual status_t Accept(RequestVisitor* visitor)
554 		{ return visitor->VisitReadReply(this); }
ShowAroundReadReply555 	virtual void ShowAround(RequestMemberVisitor* visitor)
556 	{
557 		visitor->Visit(this, error);
558 		visitor->Visit(this, pos);
559 		visitor->Visit(this, data);
560 		visitor->Visit(this, moreToCome);
561 	}
562 
563 	off_t			pos;
564 	Data			data;
565 	bool			moreToCome;
566 };
567 
568 // WriteRequest
569 struct WriteRequest : VolumeRequest {
WriteRequestWriteRequest570 	WriteRequest() : VolumeRequest(WRITE_REQUEST) {}
AcceptWriteRequest571 	virtual status_t Accept(RequestVisitor* visitor)
572 		{ return visitor->VisitWriteRequest(this); }
ShowAroundWriteRequest573 	virtual void ShowAround(RequestMemberVisitor* visitor)
574 	{
575 		visitor->Visit(this, volumeID);
576 		visitor->Visit(this, cookie);
577 		visitor->Visit(this, pos);
578 		visitor->Visit(this, data);
579 	}
580 
581 	intptr_t		cookie;
582 	off_t			pos;
583 	Data			data;
584 };
585 
586 // WriteReply
587 struct WriteReply : ReplyRequest {
WriteReplyWriteReply588 	WriteReply() : ReplyRequest(WRITE_REPLY) {}
AcceptWriteReply589 	virtual status_t Accept(RequestVisitor* visitor)
590 		{ return visitor->VisitWriteReply(this); }
ShowAroundWriteReply591 	virtual void ShowAround(RequestMemberVisitor* visitor)
592 	{
593 		visitor->Visit(this, error);
594 	}
595 };
596 
597 // CreateLinkRequest
598 struct CreateLinkRequest : VolumeRequest {
CreateLinkRequestCreateLinkRequest599 	CreateLinkRequest() : VolumeRequest(CREATE_LINK_REQUEST) {}
AcceptCreateLinkRequest600 	virtual status_t Accept(RequestVisitor* visitor)
601 		{ return visitor->VisitCreateLinkRequest(this); }
ShowAroundCreateLinkRequest602 	virtual void ShowAround(RequestMemberVisitor* visitor)
603 	{
604 		visitor->Visit(this, volumeID);
605 		visitor->Visit(this, directoryID);
606 		visitor->Visit(this, name);
607 		visitor->Visit(this, nodeID);
608 	}
609 
610 	ServerNodeID	directoryID;
611 	StringData		name;
612 	ServerNodeID	nodeID;
613 };
614 
615 // CreateLinkReply
616 struct CreateLinkReply : ReplyRequest {
CreateLinkReplyCreateLinkReply617 	CreateLinkReply() : ReplyRequest(CREATE_LINK_REPLY) {}
AcceptCreateLinkReply618 	virtual status_t Accept(RequestVisitor* visitor)
619 		{ return visitor->VisitCreateLinkReply(this); }
ShowAroundCreateLinkReply620 	virtual void ShowAround(RequestMemberVisitor* visitor)
621 	{
622 		visitor->Visit(this, error);
623 	}
624 };
625 
626 // UnlinkRequest
627 struct UnlinkRequest : VolumeRequest {
UnlinkRequestUnlinkRequest628 	UnlinkRequest() : VolumeRequest(UNLINK_REQUEST) {}
AcceptUnlinkRequest629 	virtual status_t Accept(RequestVisitor* visitor)
630 		{ return visitor->VisitUnlinkRequest(this); }
ShowAroundUnlinkRequest631 	virtual void ShowAround(RequestMemberVisitor* visitor)
632 	{
633 		visitor->Visit(this, volumeID);
634 		visitor->Visit(this, directoryID);
635 		visitor->Visit(this, name);
636 	}
637 
638 	ServerNodeID	directoryID;
639 	StringData		name;
640 };
641 
642 // UnlinkReply
643 struct UnlinkReply : ReplyRequest {
UnlinkReplyUnlinkReply644 	UnlinkReply() : ReplyRequest(UNLINK_REPLY) {}
AcceptUnlinkReply645 	virtual status_t Accept(RequestVisitor* visitor)
646 		{ return visitor->VisitUnlinkReply(this); }
ShowAroundUnlinkReply647 	virtual void ShowAround(RequestMemberVisitor* visitor)
648 	{
649 		visitor->Visit(this, error);
650 	}
651 };
652 
653 // CreateSymlinkRequest
654 struct CreateSymlinkRequest : VolumeRequest {
CreateSymlinkRequestCreateSymlinkRequest655 	CreateSymlinkRequest() : VolumeRequest(CREATE_SYMLINK_REQUEST) {}
AcceptCreateSymlinkRequest656 	virtual status_t Accept(RequestVisitor* visitor)
657 		{ return visitor->VisitCreateSymlinkRequest(this); }
ShowAroundCreateSymlinkRequest658 	virtual void ShowAround(RequestMemberVisitor* visitor)
659 	{
660 		visitor->Visit(this, volumeID);
661 		visitor->Visit(this, directoryID);
662 		visitor->Visit(this, name);
663 		visitor->Visit(this, target);
664 	}
665 
666 	ServerNodeID	directoryID;
667 	StringData		name;
668 	StringData		target;
669 };
670 
671 // CreateSymlinkReply
672 struct CreateSymlinkReply : ReplyRequest {
CreateSymlinkReplyCreateSymlinkReply673 	CreateSymlinkReply() : ReplyRequest(CREATE_SYMLINK_REPLY) {}
AcceptCreateSymlinkReply674 	virtual status_t Accept(RequestVisitor* visitor)
675 		{ return visitor->VisitCreateSymlinkReply(this); }
ShowAroundCreateSymlinkReply676 	virtual void ShowAround(RequestMemberVisitor* visitor)
677 	{
678 		visitor->Visit(this, error);
679 	}
680 };
681 
682 // ReadLinkRequest
683 struct ReadLinkRequest : VolumeRequest {
ReadLinkRequestReadLinkRequest684 	ReadLinkRequest() : VolumeRequest(READ_LINK_REQUEST) {}
AcceptReadLinkRequest685 	virtual status_t Accept(RequestVisitor* visitor)
686 		{ return visitor->VisitReadLinkRequest(this); }
ShowAroundReadLinkRequest687 	virtual void ShowAround(RequestMemberVisitor* visitor)
688 	{
689 		visitor->Visit(this, volumeID);
690 		visitor->Visit(this, nodeID);
691 		visitor->Visit(this, maxSize);
692 	}
693 
694 	ServerNodeID	nodeID;
695 	int32			maxSize;
696 };
697 
698 // ReadLinkReply
699 struct ReadLinkReply : ReplyRequest {
ReadLinkReplyReadLinkReply700 	ReadLinkReply() : ReplyRequest(READ_LINK_REPLY) {}
AcceptReadLinkReply701 	virtual status_t Accept(RequestVisitor* visitor)
702 		{ return visitor->VisitReadLinkReply(this); }
ShowAroundReadLinkReply703 	virtual void ShowAround(RequestMemberVisitor* visitor)
704 	{
705 		visitor->Visit(this, error);
706 		visitor->Visit(this, nodeInfo);
707 		visitor->Visit(this, data);
708 	}
709 
710 	NodeInfo		nodeInfo;
711 	Data			data;
712 };
713 
714 // RenameRequest
715 struct RenameRequest : VolumeRequest {
RenameRequestRenameRequest716 	RenameRequest() : VolumeRequest(RENAME_REQUEST) {}
AcceptRenameRequest717 	virtual status_t Accept(RequestVisitor* visitor)
718 		{ return visitor->VisitRenameRequest(this); }
ShowAroundRenameRequest719 	virtual void ShowAround(RequestMemberVisitor* visitor)
720 	{
721 		visitor->Visit(this, volumeID);
722 		visitor->Visit(this, oldDirectoryID);
723 		visitor->Visit(this, oldName);
724 		visitor->Visit(this, newDirectoryID);
725 		visitor->Visit(this, newName);
726 	}
727 
728 	ServerNodeID	oldDirectoryID;
729 	StringData		oldName;
730 	ServerNodeID	newDirectoryID;
731 	StringData		newName;
732 };
733 
734 // RenameReply
735 struct RenameReply : ReplyRequest {
RenameReplyRenameReply736 	RenameReply() : ReplyRequest(RENAME_REPLY) {}
AcceptRenameReply737 	virtual status_t Accept(RequestVisitor* visitor)
738 		{ return visitor->VisitRenameReply(this); }
ShowAroundRenameReply739 	virtual void ShowAround(RequestMemberVisitor* visitor)
740 	{
741 		visitor->Visit(this, error);
742 	}
743 };
744 
745 // MakeDirRequest
746 struct MakeDirRequest : VolumeRequest {
MakeDirRequestMakeDirRequest747 	MakeDirRequest() : VolumeRequest(MAKE_DIR_REQUEST) {}
AcceptMakeDirRequest748 	virtual status_t Accept(RequestVisitor* visitor)
749 		{ return visitor->VisitMakeDirRequest(this); }
ShowAroundMakeDirRequest750 	virtual void ShowAround(RequestMemberVisitor* visitor)
751 	{
752 		visitor->Visit(this, volumeID);
753 		visitor->Visit(this, directoryID);
754 		visitor->Visit(this, name);
755 		visitor->Visit(this, mode);
756 	}
757 
758 	ServerNodeID	directoryID;
759 	StringData		name;
760 	uint32			mode;
761 };
762 
763 // MakeDirReply
764 struct MakeDirReply : ReplyRequest {
MakeDirReplyMakeDirReply765 	MakeDirReply() : ReplyRequest(MAKE_DIR_REPLY) {}
AcceptMakeDirReply766 	virtual status_t Accept(RequestVisitor* visitor)
767 		{ return visitor->VisitMakeDirReply(this); }
ShowAroundMakeDirReply768 	virtual void ShowAround(RequestMemberVisitor* visitor)
769 	{
770 		visitor->Visit(this, error);
771 	}
772 };
773 
774 // RemoveDirRequest
775 struct RemoveDirRequest : VolumeRequest {
RemoveDirRequestRemoveDirRequest776 	RemoveDirRequest() : VolumeRequest(REMOVE_DIR_REQUEST) {}
AcceptRemoveDirRequest777 	virtual status_t Accept(RequestVisitor* visitor)
778 		{ return visitor->VisitRemoveDirRequest(this); }
ShowAroundRemoveDirRequest779 	virtual void ShowAround(RequestMemberVisitor* visitor)
780 	{
781 		visitor->Visit(this, volumeID);
782 		visitor->Visit(this, directoryID);
783 		visitor->Visit(this, name);
784 	}
785 
786 	ServerNodeID	directoryID;
787 	StringData		name;
788 };
789 
790 // RemoveDirReply
791 struct RemoveDirReply : ReplyRequest {
RemoveDirReplyRemoveDirReply792 	RemoveDirReply() : ReplyRequest(REMOVE_DIR_REPLY) {}
AcceptRemoveDirReply793 	virtual status_t Accept(RequestVisitor* visitor)
794 		{ return visitor->VisitRemoveDirReply(this); }
ShowAroundRemoveDirReply795 	virtual void ShowAround(RequestMemberVisitor* visitor)
796 	{
797 		visitor->Visit(this, error);
798 	}
799 };
800 
801 // OpenDirRequest
802 struct OpenDirRequest : VolumeRequest {
OpenDirRequestOpenDirRequest803 	OpenDirRequest() : VolumeRequest(OPEN_DIR_REQUEST) {}
AcceptOpenDirRequest804 	virtual status_t Accept(RequestVisitor* visitor)
805 		{ return visitor->VisitOpenDirRequest(this); }
ShowAroundOpenDirRequest806 	virtual void ShowAround(RequestMemberVisitor* visitor)
807 	{
808 		visitor->Visit(this, volumeID);
809 		visitor->Visit(this, nodeID);
810 	}
811 
812 	ServerNodeID	nodeID;
813 };
814 
815 // OpenDirReply
816 struct OpenDirReply : ReplyRequest {
OpenDirReplyOpenDirReply817 	OpenDirReply() : ReplyRequest(OPEN_DIR_REPLY) {}
AcceptOpenDirReply818 	virtual status_t Accept(RequestVisitor* visitor)
819 		{ return visitor->VisitOpenDirReply(this); }
ShowAroundOpenDirReply820 	virtual void ShowAround(RequestMemberVisitor* visitor)
821 	{
822 		visitor->Visit(this, error);
823 		visitor->Visit(this, nodeInfo);
824 		visitor->Visit(this, cookie);
825 	}
826 
827 	NodeInfo		nodeInfo;
828 	intptr_t		cookie;
829 };
830 
831 // ReadDirRequest
832 struct ReadDirRequest : VolumeRequest {
ReadDirRequestReadDirRequest833 	ReadDirRequest() : VolumeRequest(READ_DIR_REQUEST) {}
AcceptReadDirRequest834 	virtual status_t Accept(RequestVisitor* visitor)
835 		{ return visitor->VisitReadDirRequest(this); }
ShowAroundReadDirRequest836 	virtual void ShowAround(RequestMemberVisitor* visitor)
837 	{
838 		visitor->Visit(this, volumeID);
839 		visitor->Visit(this, cookie);
840 		visitor->Visit(this, count);
841 		visitor->Visit(this, rewind);
842 	}
843 
844 	intptr_t		cookie;
845 	int32			count;
846 	bool			rewind;
847 };
848 
849 // ReadDirReply
850 struct ReadDirReply : ReplyRequest {
ReadDirReplyReadDirReply851 	ReadDirReply() : ReplyRequest(READ_DIR_REPLY) {}
AcceptReadDirReply852 	virtual status_t Accept(RequestVisitor* visitor)
853 		{ return visitor->VisitReadDirReply(this); }
ShowAroundReadDirReply854 	virtual void ShowAround(RequestMemberVisitor* visitor)
855 	{
856 		visitor->Visit(this, error);
857 		visitor->Visit(this, entryInfos);
858 		visitor->Visit(this, revision);
859 		visitor->Visit(this, done);
860 	}
861 
862 	RequestMemberArray<EntryInfo> entryInfos;
863 	int64			revision;
864 	bool			done;
865 };
866 
867 // WalkRequest
868 struct WalkRequest : VolumeRequest {
WalkRequestWalkRequest869 	WalkRequest() : VolumeRequest(WALK_REQUEST) {}
AcceptWalkRequest870 	virtual status_t Accept(RequestVisitor* visitor)
871 		{ return visitor->VisitWalkRequest(this); }
ShowAroundWalkRequest872 	virtual void ShowAround(RequestMemberVisitor* visitor)
873 	{
874 		visitor->Visit(this, volumeID);
875 		visitor->Visit(this, nodeID);
876 		visitor->Visit(this, name);
877 		visitor->Visit(this, resolveLink);
878 	}
879 
880 	ServerNodeID	nodeID;
881 	StringData		name;
882 	bool			resolveLink;
883 };
884 
885 // WalkReply
886 struct WalkReply : ReplyRequest {
WalkReplyWalkReply887 	WalkReply() : ReplyRequest(WALK_REPLY) {}
AcceptWalkReply888 	virtual status_t Accept(RequestVisitor* visitor)
889 		{ return visitor->VisitWalkReply(this); }
ShowAroundWalkReply890 	virtual void ShowAround(RequestMemberVisitor* visitor)
891 	{
892 		visitor->Visit(this, error);
893 		visitor->Visit(this, entryInfo);
894 		visitor->Visit(this, linkPath);
895 	}
896 
897 	EntryInfo		entryInfo;
898 	StringData		linkPath;
899 };
900 
901 // MulitWalkRequest
902 struct MultiWalkRequest : VolumeRequest {
MultiWalkRequestMultiWalkRequest903 	MultiWalkRequest() : VolumeRequest(MULTI_WALK_REQUEST) {}
AcceptMultiWalkRequest904 	virtual status_t Accept(RequestVisitor* visitor)
905 		{ return visitor->VisitMultiWalkRequest(this); }
ShowAroundMultiWalkRequest906 	virtual void ShowAround(RequestMemberVisitor* visitor)
907 	{
908 		visitor->Visit(this, volumeID);
909 		visitor->Visit(this, nodeID);
910 		visitor->Visit(this, names);
911 	}
912 
913 	ServerNodeID	nodeID;
914 	RequestMemberArray<StringData> names;
915 };
916 
917 // MultiWalkReply
918 struct MultiWalkReply : ReplyRequest {
MultiWalkReplyMultiWalkReply919 	MultiWalkReply() : ReplyRequest(MULTI_WALK_REPLY) {}
AcceptMultiWalkReply920 	virtual status_t Accept(RequestVisitor* visitor)
921 		{ return visitor->VisitMultiWalkReply(this); }
ShowAroundMultiWalkReply922 	virtual void ShowAround(RequestMemberVisitor* visitor)
923 	{
924 		visitor->Visit(this, error);
925 		visitor->Visit(this, entryInfos);
926 	}
927 
928 	RequestMemberArray<EntryInfo> entryInfos;
929 };
930 
931 // OpenAttrDirRequest
932 struct OpenAttrDirRequest : VolumeRequest {
OpenAttrDirRequestOpenAttrDirRequest933 	OpenAttrDirRequest() : VolumeRequest(OPEN_ATTR_DIR_REQUEST) {}
AcceptOpenAttrDirRequest934 	virtual status_t Accept(RequestVisitor* visitor)
935 		{ return visitor->VisitOpenAttrDirRequest(this); }
ShowAroundOpenAttrDirRequest936 	virtual void ShowAround(RequestMemberVisitor* visitor)
937 	{
938 		visitor->Visit(this, volumeID);
939 		visitor->Visit(this, nodeID);
940 	}
941 
942 	ServerNodeID	nodeID;
943 };
944 
945 // OpenAttrDirReply
946 struct OpenAttrDirReply : ReplyRequest {
OpenAttrDirReplyOpenAttrDirReply947 	OpenAttrDirReply() : ReplyRequest(OPEN_ATTR_DIR_REPLY) {}
AcceptOpenAttrDirReply948 	virtual status_t Accept(RequestVisitor* visitor)
949 		{ return visitor->VisitOpenAttrDirReply(this); }
ShowAroundOpenAttrDirReply950 	virtual void ShowAround(RequestMemberVisitor* visitor)
951 	{
952 		visitor->Visit(this, error);
953 		visitor->Visit(this, attrDirInfo);
954 		visitor->Visit(this, cookie);
955 	}
956 
957 	AttrDirInfo		attrDirInfo;
958 	intptr_t		cookie;
959 };
960 
961 // ReadAttrDirRequest
962 struct ReadAttrDirRequest : VolumeRequest {
ReadAttrDirRequestReadAttrDirRequest963 	ReadAttrDirRequest() : VolumeRequest(READ_ATTR_DIR_REQUEST) {}
AcceptReadAttrDirRequest964 	virtual status_t Accept(RequestVisitor* visitor)
965 		{ return visitor->VisitReadAttrDirRequest(this); }
ShowAroundReadAttrDirRequest966 	virtual void ShowAround(RequestMemberVisitor* visitor)
967 	{
968 		visitor->Visit(this, volumeID);
969 		visitor->Visit(this, cookie);
970 		visitor->Visit(this, rewind);
971 	}
972 
973 	intptr_t		cookie;
974 	int32			count;
975 	bool			rewind;
976 };
977 
978 // ReadAttrDirReply
979 struct ReadAttrDirReply : ReplyRequest {
ReadAttrDirReplyReadAttrDirReply980 	ReadAttrDirReply() : ReplyRequest(READ_ATTR_DIR_REPLY) {}
AcceptReadAttrDirReply981 	virtual status_t Accept(RequestVisitor* visitor)
982 		{ return visitor->VisitReadAttrDirReply(this); }
ShowAroundReadAttrDirReply983 	virtual void ShowAround(RequestMemberVisitor* visitor)
984 	{
985 		visitor->Visit(this, error);
986 		visitor->Visit(this, name);
987 		visitor->Visit(this, count);
988 	}
989 
990 	StringData		name;	// TODO: This should be a list.
991 	int32			count;
992 };
993 
994 // ReadAttrRequest
995 struct ReadAttrRequest : VolumeRequest {
ReadAttrRequestReadAttrRequest996 	ReadAttrRequest() : VolumeRequest(READ_ATTR_REQUEST) {}
AcceptReadAttrRequest997 	virtual status_t Accept(RequestVisitor* visitor)
998 		{ return visitor->VisitReadAttrRequest(this); }
ShowAroundReadAttrRequest999 	virtual void ShowAround(RequestMemberVisitor* visitor)
1000 	{
1001 		visitor->Visit(this, volumeID);
1002 		visitor->Visit(this, nodeID);
1003 		visitor->Visit(this, name);
1004 		visitor->Visit(this, type);
1005 		visitor->Visit(this, pos);
1006 		visitor->Visit(this, size);
1007 	}
1008 
1009 	ServerNodeID	nodeID;
1010 	StringData		name;
1011 	uint32			type;
1012 	off_t			pos;
1013 	int32			size;
1014 };
1015 
1016 // ReadAttrReply
1017 struct ReadAttrReply : ReplyRequest {
ReadAttrReplyReadAttrReply1018 	ReadAttrReply() : ReplyRequest(READ_ATTR_REPLY) {}
AcceptReadAttrReply1019 	virtual status_t Accept(RequestVisitor* visitor)
1020 		{ return visitor->VisitReadAttrReply(this); }
ShowAroundReadAttrReply1021 	virtual void ShowAround(RequestMemberVisitor* visitor)
1022 	{
1023 		visitor->Visit(this, error);
1024 		visitor->Visit(this, pos);
1025 		visitor->Visit(this, data);
1026 		visitor->Visit(this, moreToCome);
1027 	}
1028 
1029 	off_t			pos;
1030 	Data			data;
1031 	bool			moreToCome;
1032 };
1033 
1034 // WriteAttrRequest
1035 struct WriteAttrRequest : VolumeRequest {
WriteAttrRequestWriteAttrRequest1036 	WriteAttrRequest() : VolumeRequest(WRITE_ATTR_REQUEST) {}
AcceptWriteAttrRequest1037 	virtual status_t Accept(RequestVisitor* visitor)
1038 		{ return visitor->VisitWriteAttrRequest(this); }
ShowAroundWriteAttrRequest1039 	virtual void ShowAround(RequestMemberVisitor* visitor)
1040 	{
1041 		visitor->Visit(this, volumeID);
1042 		visitor->Visit(this, nodeID);
1043 		visitor->Visit(this, name);
1044 		visitor->Visit(this, type);
1045 		visitor->Visit(this, pos);
1046 		visitor->Visit(this, data);
1047 	}
1048 
1049 	ServerNodeID	nodeID;
1050 	StringData		name;
1051 	uint32			type;
1052 	off_t			pos;
1053 	Data			data;
1054 };
1055 
1056 // WriteAttrReply
1057 struct WriteAttrReply : ReplyRequest {
WriteAttrReplyWriteAttrReply1058 	WriteAttrReply() : ReplyRequest(WRITE_ATTR_REPLY) {}
AcceptWriteAttrReply1059 	virtual status_t Accept(RequestVisitor* visitor)
1060 		{ return visitor->VisitWriteAttrReply(this); }
ShowAroundWriteAttrReply1061 	virtual void ShowAround(RequestMemberVisitor* visitor)
1062 	{
1063 		visitor->Visit(this, error);
1064 	}
1065 };
1066 
1067 // RemoveAttrRequest
1068 struct RemoveAttrRequest : VolumeRequest {
RemoveAttrRequestRemoveAttrRequest1069 	RemoveAttrRequest() : VolumeRequest(REMOVE_ATTR_REQUEST) {}
AcceptRemoveAttrRequest1070 	virtual status_t Accept(RequestVisitor* visitor)
1071 		{ return visitor->VisitRemoveAttrRequest(this); }
ShowAroundRemoveAttrRequest1072 	virtual void ShowAround(RequestMemberVisitor* visitor)
1073 	{
1074 		visitor->Visit(this, volumeID);
1075 		visitor->Visit(this, nodeID);
1076 		visitor->Visit(this, name);
1077 	}
1078 
1079 	ServerNodeID	nodeID;
1080 	StringData		name;
1081 };
1082 
1083 // RemoveAttrReply
1084 struct RemoveAttrReply : ReplyRequest {
RemoveAttrReplyRemoveAttrReply1085 	RemoveAttrReply() : ReplyRequest(REMOVE_ATTR_REPLY) {}
AcceptRemoveAttrReply1086 	virtual status_t Accept(RequestVisitor* visitor)
1087 		{ return visitor->VisitRemoveAttrReply(this); }
ShowAroundRemoveAttrReply1088 	virtual void ShowAround(RequestMemberVisitor* visitor)
1089 	{
1090 		visitor->Visit(this, error);
1091 	}
1092 };
1093 
1094 // RenameAttrRequest
1095 struct RenameAttrRequest : VolumeRequest {
RenameAttrRequestRenameAttrRequest1096 	RenameAttrRequest() : VolumeRequest(RENAME_ATTR_REQUEST) {}
AcceptRenameAttrRequest1097 	virtual status_t Accept(RequestVisitor* visitor)
1098 		{ return visitor->VisitRenameAttrRequest(this); }
ShowAroundRenameAttrRequest1099 	virtual void ShowAround(RequestMemberVisitor* visitor)
1100 	{
1101 		visitor->Visit(this, volumeID);
1102 		visitor->Visit(this, nodeID);
1103 		visitor->Visit(this, oldName);
1104 		visitor->Visit(this, newName);
1105 	}
1106 
1107 	ServerNodeID	nodeID;
1108 	StringData		oldName;
1109 	StringData		newName;
1110 };
1111 
1112 // RenameAttrReply
1113 struct RenameAttrReply : ReplyRequest {
RenameAttrReplyRenameAttrReply1114 	RenameAttrReply() : ReplyRequest(RENAME_ATTR_REPLY) {}
AcceptRenameAttrReply1115 	virtual status_t Accept(RequestVisitor* visitor)
1116 		{ return visitor->VisitRenameAttrReply(this); }
ShowAroundRenameAttrReply1117 	virtual void ShowAround(RequestMemberVisitor* visitor)
1118 	{
1119 		visitor->Visit(this, error);
1120 	}
1121 };
1122 
1123 // StatAttrRequest
1124 struct StatAttrRequest : VolumeRequest {
StatAttrRequestStatAttrRequest1125 	StatAttrRequest() : VolumeRequest(STAT_ATTR_REQUEST) {}
AcceptStatAttrRequest1126 	virtual status_t Accept(RequestVisitor* visitor)
1127 		{ return visitor->VisitStatAttrRequest(this); }
ShowAroundStatAttrRequest1128 	virtual void ShowAround(RequestMemberVisitor* visitor)
1129 	{
1130 		visitor->Visit(this, volumeID);
1131 		visitor->Visit(this, nodeID);
1132 		visitor->Visit(this, name);
1133 	}
1134 
1135 	ServerNodeID	nodeID;
1136 	StringData		name;
1137 };
1138 
1139 // StatAttrReply
1140 struct StatAttrReply : ReplyRequest {
StatAttrReplyStatAttrReply1141 	StatAttrReply() : ReplyRequest(STAT_ATTR_REPLY) {}
AcceptStatAttrReply1142 	virtual status_t Accept(RequestVisitor* visitor)
1143 		{ return visitor->VisitStatAttrReply(this); }
ShowAroundStatAttrReply1144 	virtual void ShowAround(RequestMemberVisitor* visitor)
1145 	{
1146 		visitor->Visit(this, error);
1147 		visitor->Visit(this, attrInfo);
1148 	}
1149 
1150 	AttributeInfo	attrInfo;
1151 };
1152 
1153 // OpenQueryRequest
1154 struct OpenQueryRequest : Request {
OpenQueryRequestOpenQueryRequest1155 	OpenQueryRequest() : Request(OPEN_QUERY_REQUEST) {}
AcceptOpenQueryRequest1156 	virtual status_t Accept(RequestVisitor* visitor)
1157 		{ return visitor->VisitOpenQueryRequest(this); }
ShowAroundOpenQueryRequest1158 	virtual void ShowAround(RequestMemberVisitor* visitor)
1159 	{
1160 		visitor->Visit(this, queryString);
1161 		visitor->Visit(this, flags);
1162 		visitor->Visit(this, port);
1163 		visitor->Visit(this, token);
1164 	}
1165 
1166 	StringData		queryString;
1167 	uint32			flags;
1168 	int32			port;
1169 	int32			token;
1170 };
1171 
1172 // OpenQueryReply
1173 struct OpenQueryReply : ReplyRequest {
OpenQueryReplyOpenQueryReply1174 	OpenQueryReply() : ReplyRequest(OPEN_QUERY_REPLY) {}
AcceptOpenQueryReply1175 	virtual status_t Accept(RequestVisitor* visitor)
1176 		{ return visitor->VisitOpenQueryReply(this); }
ShowAroundOpenQueryReply1177 	virtual void ShowAround(RequestMemberVisitor* visitor)
1178 	{
1179 		visitor->Visit(this, error);
1180 		visitor->Visit(this, cookie);
1181 	}
1182 
1183 	intptr_t		cookie;
1184 };
1185 
1186 // ReadQueryRequest
1187 struct ReadQueryRequest : Request {
ReadQueryRequestReadQueryRequest1188 	ReadQueryRequest() : Request(READ_QUERY_REQUEST) {}
AcceptReadQueryRequest1189 	virtual status_t Accept(RequestVisitor* visitor)
1190 		{ return visitor->VisitReadQueryRequest(this); }
ShowAroundReadQueryRequest1191 	virtual void ShowAround(RequestMemberVisitor* visitor)
1192 	{
1193 		visitor->Visit(this, cookie);
1194 	}
1195 
1196 	intptr_t		cookie;
1197 	int32			count;
1198 };
1199 
1200 // ReadQueryReply
1201 struct ReadQueryReply : ReplyRequest {
ReadQueryReplyReadQueryReply1202 	ReadQueryReply() : ReplyRequest(READ_QUERY_REPLY) {}
AcceptReadQueryReply1203 	virtual status_t Accept(RequestVisitor* visitor)
1204 		{ return visitor->VisitReadQueryReply(this); }
ShowAroundReadQueryReply1205 	virtual void ShowAround(RequestMemberVisitor* visitor)
1206 	{
1207 		visitor->Visit(this, error);
1208 		visitor->Visit(this, clientVolumeIDs);
1209 		visitor->Visit(this, dirInfo);
1210 		visitor->Visit(this, entryInfo);
1211 		visitor->Visit(this, count);
1212 	}
1213 
1214 	RequestMemberArray<int32>	clientVolumeIDs;
1215 	NodeInfo					dirInfo;	// TODO: This should be a list.
1216 	EntryInfo					entryInfo;	//
1217 	int32						count;
1218 };
1219 
1220 // NodeMonitoringRequest
1221 struct NodeMonitoringRequest : VolumeRequest {
NodeMonitoringRequestNodeMonitoringRequest1222 	NodeMonitoringRequest(uint32 type) : VolumeRequest(type) {}
1223 
1224 	int32			opcode;
1225 	int64			revision;
1226 	ServerNodeID	nodeID;
1227 	bool			queryUpdate;	// true, if this is a query update
1228 	int32			port;			// for query updates
1229 	int32			token;			//
1230 };
1231 
1232 // EntryCreatedRequest
1233 struct EntryCreatedRequest : NodeMonitoringRequest {
EntryCreatedRequestEntryCreatedRequest1234 	EntryCreatedRequest() : NodeMonitoringRequest(ENTRY_CREATED_REQUEST) {}
AcceptEntryCreatedRequest1235 	virtual status_t Accept(RequestVisitor* visitor)
1236 		{ return visitor->VisitEntryCreatedRequest(this); }
ShowAroundEntryCreatedRequest1237 	virtual void ShowAround(RequestMemberVisitor* visitor)
1238 	{
1239 		visitor->Visit(this, volumeID);
1240 		visitor->Visit(this, opcode);
1241 		visitor->Visit(this, revision);
1242 		visitor->Visit(this, nodeID);
1243 		visitor->Visit(this, queryUpdate);
1244 		visitor->Visit(this, port);
1245 		visitor->Visit(this, token);
1246 		visitor->Visit(this, directoryID);
1247 		visitor->Visit(this, name);
1248 		visitor->Visit(this, entryInfo);
1249 		visitor->Visit(this, entryInfoValid);
1250 	}
1251 
1252 	ServerNodeID	directoryID;
1253 	StringData		name;
1254 	EntryInfo		entryInfo;
1255 	bool			entryInfoValid;
1256 };
1257 
1258 // EntryRemovedRequest
1259 struct EntryRemovedRequest : NodeMonitoringRequest {
EntryRemovedRequestEntryRemovedRequest1260 	EntryRemovedRequest() : NodeMonitoringRequest(ENTRY_REMOVED_REQUEST) {}
AcceptEntryRemovedRequest1261 	virtual status_t Accept(RequestVisitor* visitor)
1262 		{ return visitor->VisitEntryRemovedRequest(this); }
ShowAroundEntryRemovedRequest1263 	virtual void ShowAround(RequestMemberVisitor* visitor)
1264 	{
1265 		visitor->Visit(this, volumeID);
1266 		visitor->Visit(this, opcode);
1267 		visitor->Visit(this, revision);
1268 		visitor->Visit(this, nodeID);
1269 		visitor->Visit(this, queryUpdate);
1270 		visitor->Visit(this, port);
1271 		visitor->Visit(this, token);
1272 		visitor->Visit(this, directoryID);
1273 		visitor->Visit(this, name);
1274 	}
1275 
1276 	ServerNodeID	directoryID;
1277 	StringData		name;
1278 };
1279 
1280 // EntryMovedRequest
1281 struct EntryMovedRequest : NodeMonitoringRequest {
EntryMovedRequestEntryMovedRequest1282 	EntryMovedRequest() : NodeMonitoringRequest(ENTRY_MOVED_REQUEST) {}
AcceptEntryMovedRequest1283 	virtual status_t Accept(RequestVisitor* visitor)
1284 		{ return visitor->VisitEntryMovedRequest(this); }
ShowAroundEntryMovedRequest1285 	virtual void ShowAround(RequestMemberVisitor* visitor)
1286 	{
1287 		visitor->Visit(this, volumeID);
1288 		visitor->Visit(this, opcode);
1289 		visitor->Visit(this, revision);
1290 		visitor->Visit(this, nodeID);
1291 		visitor->Visit(this, queryUpdate);
1292 		visitor->Visit(this, port);
1293 		visitor->Visit(this, token);
1294 		visitor->Visit(this, fromDirectoryID);
1295 		visitor->Visit(this, toDirectoryID);
1296 		visitor->Visit(this, fromName);
1297 		visitor->Visit(this, toName);
1298 		visitor->Visit(this, entryInfo);
1299 		visitor->Visit(this, entryInfoValid);
1300 	}
1301 
1302 	ServerNodeID	fromDirectoryID;
1303 	ServerNodeID	toDirectoryID;
1304 	StringData		fromName;
1305 	StringData		toName;
1306 	EntryInfo		entryInfo;
1307 	bool			entryInfoValid;
1308 };
1309 
1310 // StatChangedRequest
1311 struct StatChangedRequest : NodeMonitoringRequest {
StatChangedRequestStatChangedRequest1312 	StatChangedRequest() : NodeMonitoringRequest(ENTRY_STAT_CHANGED_REQUEST) {}
AcceptStatChangedRequest1313 	virtual status_t Accept(RequestVisitor* visitor)
1314 		{ return visitor->VisitStatChangedRequest(this); }
ShowAroundStatChangedRequest1315 	virtual void ShowAround(RequestMemberVisitor* visitor)
1316 	{
1317 		visitor->Visit(this, volumeID);
1318 		visitor->Visit(this, opcode);
1319 		visitor->Visit(this, revision);
1320 		visitor->Visit(this, nodeID);
1321 		visitor->Visit(this, queryUpdate);
1322 		visitor->Visit(this, port);
1323 		visitor->Visit(this, token);
1324 		visitor->Visit(this, nodeInfo);
1325 	}
1326 
1327 	NodeInfo		nodeInfo;
1328 };
1329 
1330 // AttributeChangedRequest
1331 struct AttributeChangedRequest : NodeMonitoringRequest {
AttributeChangedRequestAttributeChangedRequest1332 	AttributeChangedRequest()
1333 		: NodeMonitoringRequest(ENTRY_ATTRIBUTE_CHANGED_REQUEST) {}
AcceptAttributeChangedRequest1334 	virtual status_t Accept(RequestVisitor* visitor)
1335 		{ return visitor->VisitAttributeChangedRequest(this); }
ShowAroundAttributeChangedRequest1336 	virtual void ShowAround(RequestMemberVisitor* visitor)
1337 	{
1338 		visitor->Visit(this, volumeID);
1339 		visitor->Visit(this, opcode);
1340 		visitor->Visit(this, revision);
1341 		visitor->Visit(this, nodeID);
1342 		visitor->Visit(this, queryUpdate);
1343 		visitor->Visit(this, port);
1344 		visitor->Visit(this, token);
1345 		visitor->Visit(this, attrDirInfo);
1346 		visitor->Visit(this, attrInfo);
1347 		visitor->Visit(this, valid);
1348 		visitor->Visit(this, removed);
1349 	}
1350 
1351 	AttrDirInfo		attrDirInfo;
1352 	AttributeInfo	attrInfo;
1353 	bool			valid;
1354 	bool			removed;
1355 };
1356 
1357 // ServerInfoRequest
1358 struct ServerInfoRequest : Request {
ServerInfoRequestServerInfoRequest1359 	ServerInfoRequest() : Request(SERVER_INFO_REQUEST) {}
AcceptServerInfoRequest1360 	virtual status_t Accept(RequestVisitor* visitor)
1361 		{ return visitor->VisitServerInfoRequest(this); }
ShowAroundServerInfoRequest1362 	virtual void ShowAround(RequestMemberVisitor* visitor)
1363 	{
1364 		visitor->Visit(this, serverInfo);
1365 	}
1366 
1367 	ServerInfo		serverInfo;
1368 };
1369 
1370 #endif	// NET_FS_REQUESTS_H
1371