Initial RetroNFS95 Win9x VxD prototype
This commit is contained in:
43
include/rpc.hpp
Normal file
43
include/rpc.hpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#ifndef RETRONFS95_RPC_HPP
|
||||
#define RETRONFS95_RPC_HPP
|
||||
|
||||
#include "socket.hpp"
|
||||
#include "xdr.hpp"
|
||||
|
||||
namespace retronfs {
|
||||
|
||||
enum RpcAuthFlavor {
|
||||
AUTH_NONE = 0,
|
||||
AUTH_SYS = 1
|
||||
};
|
||||
|
||||
struct RpcIdentity {
|
||||
std::string machine;
|
||||
uint32_t uid;
|
||||
uint32_t gid;
|
||||
std::vector<uint32_t> groups;
|
||||
|
||||
RpcIdentity() : machine("retronfs95"), uid(65534), gid(65534) {}
|
||||
};
|
||||
|
||||
class RpcClient {
|
||||
public:
|
||||
RpcClient(const std::string& host, unsigned short port, uint32_t program, uint32_t version);
|
||||
|
||||
Bytes call(uint32_t procedure, const Bytes& args, const RpcIdentity& identity);
|
||||
|
||||
private:
|
||||
std::string host_;
|
||||
unsigned short port_;
|
||||
uint32_t program_;
|
||||
uint32_t version_;
|
||||
uint32_t xid_;
|
||||
|
||||
Bytes make_call(uint32_t procedure, const Bytes& args, const RpcIdentity& identity, uint32_t xid);
|
||||
Bytes read_record(TcpSocket& sock);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user