1/*
2 * Copyright 2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Pawe�� Dziepak, pdziepak@quarnos.org
7 */
8#ifndef REQUESTINTERPRETER_H
9#define REQUESTINTERPRETER_H
10
11
12#include <SupportDefs.h>
13
14#include "FileInfo.h"
15#include "NFS4Defs.h"
16#include "RPCCallbackRequest.h"
17
18
19class RequestInterpreter {
20public:
21						RequestInterpreter(RPC::CallbackRequest* request);
22						~RequestInterpreter();
23
24	inline	uint32		OperationCount();
25	inline	uint32		Operation();
26
27			status_t	GetAttr(FileHandle* handle, int* mask);
28			status_t	Recall(FileHandle* handle, bool& truncate,
29							uint32* stateSeq, uint32* stateID);
30
31private:
32			uint32		fOperationCount;
33			uint32		fLastOperation;
34
35			RPC::CallbackRequest*	fRequest;
36};
37
38
39inline uint32
40RequestInterpreter::OperationCount()
41{
42	return fOperationCount;
43}
44
45
46inline uint32
47RequestInterpreter::Operation()
48{
49	fLastOperation = fRequest->Stream().GetUInt();
50	return fLastOperation;
51}
52
53
54#endif	// REQUESTINTERPRETER_H
55
56