diff options
author | FreeArtMan <dos21h@gmail.com> | 2017-09-23 23:02:09 +0100 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2017-09-23 23:02:09 +0100 |
commit | 1dcf41797bda73d9c9c286d1eff8309ee2148e13 (patch) | |
tree | 8ddef55d19ffb2eca5222b7f112c82f30a16248b /nbrpc.h | |
parent | c2f9ce9c4b65ee53cd0c070895833215185061f3 (diff) | |
download | agni-1dcf41797bda73d9c9c286d1eff8309ee2148e13.tar.gz agni-1dcf41797bda73d9c9c286d1eff8309ee2148e13.zip |
Moved RPC protocol file to main source
Diffstat (limited to 'nbrpc.h')
-rw-r--r-- | nbrpc.h | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -0,0 +1,31 @@ +#ifndef __AGNI_NBRPC_H +#define __AGNI_NBRPC_H + +#include <netbytes.h> + +#include "mq_ntf.h" + +typedef struct rpc_request +{ + char *method; + char *params; + int id; +} rpc_request; + +typedef struct rpc_response +{ + char *result; + char *error; + int id; +} rpc_response; + +rpc_request* rpc_req_new(char *method, char *params, int id); +rpc_response* rpc_resp_new(char *result, char *error, int id); +int rpc_req_free(rpc_request *req); +int rpc_resp_free(rpc_response *resp); +int rpc_req_marsh( rpc_request *req, netbyte_store **nb_req); +int rpc_resp_marsh( rpc_response *resp, netbyte_store **nb_resp); +int rpc_req_unmarsh( netbyte_store *nb_req, rpc_request **req); +int rpc_resp_unmarsh(netbyte_store *nb_resp, rpc_response **resp); + +#endif
\ No newline at end of file |