2ef9ab298ca7396ec5c3460bc4abba595f332188
[invirt/third/libt4.git] / rpc / rpc_protocol.h
1 #ifndef rpc_protocol_h
2 #define rpc_protocol_h
3
4 #include "types.h"
5
6 using proc_t = uint32_t;
7 using status_t = int32_t;
8 using rpc_sz_t = uint32_t;
9
10 struct request_header {
11     int xid;
12     proc_t proc;
13     unsigned int clt_nonce;
14     unsigned int srv_nonce;
15     int xid_rep;
16
17     MEMBERS(xid, proc, clt_nonce, srv_nonce, xid_rep)
18 };
19
20 struct reply_header {
21     int xid;
22     int ret;
23
24     MEMBERS(xid, ret)
25 };
26
27 const size_t RPC_HEADER_SZ = max(sizeof(request_header), sizeof(reply_header)) + sizeof(rpc_sz_t);
28 const size_t DEFAULT_RPC_SZ = 1024; // size of initial buffer allocation
29 const size_t MAX_PDU = 10<<20; //maximum PDF is 10M
30
31 #endif