900897a4f7f57bb09b6cd9e21c883b1b394644ae
[invirt/third/libt4.git] / lock_protocol.h
1 // lock protocol
2
3 #ifndef lock_protocol_h
4 #define lock_protocol_h
5
6 #include "rpc/rpc.h"
7 #include <string>
8
9 using std::string;
10
11 class lock_protocol {
12     public:
13         enum status : status_t { OK, RETRY, RPCERR, NOENT, IOERR };
14         using lockid_t = string;
15         using xid_t = uint64_t;
16         enum rpc_numbers : proc_t {
17             acquire = 0x7001,
18             release,
19             stat
20         };
21 };
22
23 class rlock_protocol {
24     public:
25         enum status : status_t { OK, RPCERR };
26         enum rpc_numbers : proc_t {
27             revoke = 0x8001,
28             retry = 0x8002
29         };
30 };
31 #endif