Lots more clean-ups
[invirt/third/libt4.git] / rsm_protocol.h
1 #ifndef rsm_protocol_h
2 #define rsm_protocol_h
3
4 #include "types.h"
5 #include "rpc/rpc.h"
6
7 class rsm_client_protocol {
8     public:
9         enum status : status_t {OK, ERR, NOTPRIMARY, BUSY};
10         enum rpc_numbers : proc_t {
11             invoke = 0x9001,
12             members,
13         };
14 };
15
16 struct viewstamp {
17     unsigned int vid;
18     unsigned int seqno;
19     inline void operator++(int) { seqno++; }
20
21     MEMBERS(vid, seqno)
22     LEXICOGRAPHIC_COMPARISON(viewstamp)
23 };
24
25 MARSHALLABLE(viewstamp)
26
27 class rsm_protocol {
28     public:
29         enum status : status_t { OK, ERR, BUSY};
30         enum rpc_numbers : proc_t {
31             invoke = 0xa001,
32             transferreq,
33             transferdonereq,
34             joinreq,
35         };
36
37         struct transferres {
38             string state;
39             viewstamp last;
40
41             MEMBERS(state, last)
42         };
43 };
44
45 MARSHALLABLE(rsm_protocol::transferres)
46
47 class rsm_test_protocol {
48     public:
49         enum status : status_t {OK, ERR};
50         enum rpc_numbers : proc_t {
51             net_repair = 0x12001,
52             breakpoint = 0x12002,
53         };
54 };
55
56 #endif