1 #ifndef paxos_protocol_h
2 #define paxos_protocol_h
12 LEXICOGRAPHIC_COMPARISON(prop_t)
15 MARSHALLABLE_STRUCT(prop_t)
17 namespace paxos_protocol {
18 enum status : rpc_protocol::status { OK, ERR };
25 MEMBERS(oldinstance, accept, n_a, v_a)
27 using node_t = string;
28 using nodes_t = vector<node_t>;
29 using value_t = string;
31 REMOTE_PROCEDURE_BASE(0x11000);
32 REMOTE_PROCEDURE(1, preparereq, (prepareres &, node_t, unsigned, prop_t));
33 REMOTE_PROCEDURE(2, acceptreq, (bool &, node_t, unsigned, prop_t, value_t));
34 REMOTE_PROCEDURE(3, decidereq, (int &, node_t, unsigned, value_t));
35 REMOTE_PROCEDURE(4, heartbeat, (int &, string, unsigned));
38 MARSHALLABLE_STRUCT(paxos_protocol::prepareres)