xref: /haiku/src/add-ons/kernel/file_systems/nfs4/RPCCallbackRequest.h (revision cf2f912782a453abaad723df61bc380e137e7493)
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 RPCCALLBACKREQUEST_H
9 #define RPCCALLBACKREQUEST_H
10 
11 
12 #include "RPCDefs.h"
13 #include "XDR.h"
14 
15 
16 namespace RPC {
17 
18 class CallbackRequest {
19 public:
20 								CallbackRequest(void* buffer, int size);
21 								~CallbackRequest();
22 
23 	inline	uint32				XID();
24 	inline	uint32				ID();
25 
26 	inline	uint32				Procedure();
27 
28 	inline	status_t			Error();
29 	inline	AcceptStat			RPCError();
30 
31 	inline	XDR::ReadStream&	Stream();
32 
33 private:
34 			uint32				fXID;
35 			uint32				fID;
36 
37 			uint32				fProcedure;
38 
39 			status_t			fError;
40 			AcceptStat			fRPCError;
41 
42 			XDR::ReadStream		fStream;
43 			void*				fBuffer;
44 };
45 
46 
47 inline uint32
48 CallbackRequest::XID()
49 {
50 	return fXID;
51 }
52 
53 
54 inline uint32
55 CallbackRequest::ID()
56 {
57 	return fID;
58 }
59 
60 
61 inline uint32
62 CallbackRequest::Procedure()
63 {
64 	return fProcedure;
65 }
66 
67 
68 inline status_t
69 CallbackRequest::Error()
70 {
71 	return fError;
72 }
73 
74 
75 inline AcceptStat
76 CallbackRequest::RPCError()
77 {
78 	return fRPCError;
79 }
80 
81 
82 inline XDR::ReadStream&
83 CallbackRequest::Stream()
84 {
85 	return fStream;
86 }
87 
88 
89 }		// namespace RPC
90 
91 
92 #endif	// RPCCALLBACKREQUEST_H
93 
94