-
Notifications
You must be signed in to change notification settings - Fork 0
/
extent_protocol.h
59 lines (51 loc) · 901 Bytes
/
extent_protocol.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// extent wire protocol
#ifndef extent_protocol_h
#define extent_protocol_h
#include "rpc.h"
class extent_protocol {
public:
typedef int status;
typedef unsigned long long extentid_t;
enum xxstatus { OK, RPCERR, NOENT, IOERR };
enum rpc_numbers {
put = 0x6001,
get,
getattr,
remove,
create
};
//add the new file type symlink.
enum types {
T_DIR = 1,
T_FILE,
T_SYMLINK
};
struct attr {
uint32_t type;
unsigned int atime;
unsigned int mtime;
unsigned int ctime;
unsigned int size;
};
};
inline unmarshall &
operator>>(unmarshall &u, extent_protocol::attr &a)
{
u >> a.type;
u >> a.atime;
u >> a.mtime;
u >> a.ctime;
u >> a.size;
return u;
}
inline marshall &
operator<<(marshall &m, extent_protocol::attr a)
{
m << a.type;
m << a.atime;
m << a.mtime;
m << a.ctime;
m << a.size;
return m;
}
#endif