nfs4: Add stub RPC reply code
RPC::Reply interprets incoming RPC replies. Currently only XID is read.
This commit is contained in:
parent
313da82b9f
commit
da59bc46d9
@ -7,5 +7,6 @@ KernelAddon nfs4 :
|
||||
kernel_interface.cpp
|
||||
RPCAuth.cpp
|
||||
RPCCall.cpp
|
||||
RPCReply.cpp
|
||||
XDR.cpp
|
||||
;
|
||||
|
38
src/add-ons/kernel/file_systems/nfs4/RPCReply.cpp
Normal file
38
src/add-ons/kernel/file_systems/nfs4/RPCReply.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2012 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Paweł Dziepak, pdziepak@quarnos.org
|
||||
*/
|
||||
|
||||
|
||||
#include "RPCReply.h"
|
||||
|
||||
#include <util/kernel_cpp.h>
|
||||
|
||||
|
||||
using namespace RPC;
|
||||
|
||||
|
||||
Reply::Reply(void *buffer, int size)
|
||||
:
|
||||
fError(B_OK),
|
||||
fStream(buffer, size),
|
||||
fBuffer(buffer)
|
||||
{
|
||||
fXID = fStream.GetUInt();
|
||||
#if 0
|
||||
int32 type = fStream.GetInt();
|
||||
int32 state = fStream.GetInt();
|
||||
int32 auth = fStream.GetInt();
|
||||
fStream.GetOpaque(NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reply::~Reply()
|
||||
{
|
||||
free(fBuffer);
|
||||
}
|
||||
|
60
src/add-ons/kernel/file_systems/nfs4/RPCReply.h
Normal file
60
src/add-ons/kernel/file_systems/nfs4/RPCReply.h
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright 2012 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Paweł Dziepak, pdziepak@quarnos.org
|
||||
*/
|
||||
#ifndef RPCREPLY_H
|
||||
#define RPCREPLY_H
|
||||
|
||||
|
||||
#include "XDR.h"
|
||||
|
||||
|
||||
namespace RPC {
|
||||
|
||||
class Reply {
|
||||
public:
|
||||
Reply(void *buffer, int size);
|
||||
~Reply();
|
||||
|
||||
inline uint32 GetXID();
|
||||
|
||||
inline status_t GetError();
|
||||
inline XDR::ReadStream& GetStream();
|
||||
|
||||
private:
|
||||
uint32 fXID;
|
||||
|
||||
status_t fError;
|
||||
|
||||
XDR::ReadStream fStream;
|
||||
void* fBuffer;
|
||||
};
|
||||
|
||||
inline uint32
|
||||
Reply::GetXID()
|
||||
{
|
||||
return fXID;
|
||||
}
|
||||
|
||||
|
||||
inline status_t
|
||||
Reply::GetError()
|
||||
{
|
||||
return fError;
|
||||
}
|
||||
|
||||
|
||||
inline XDR::ReadStream&
|
||||
Reply::GetStream()
|
||||
{
|
||||
return fStream;
|
||||
}
|
||||
|
||||
} // namespace RPC
|
||||
|
||||
|
||||
#endif // RPCREPLY_H
|
||||
|
Loading…
Reference in New Issue
Block a user