aboutsummaryrefslogtreecommitdiffstats
path: root/extlibs/nbrpc.h
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2017-08-22 22:08:56 +0100
committerFreeArtMan <dos21h@gmail.com>2017-08-22 22:08:56 +0100
commit1885184932474907f67208e12902fc7a64818112 (patch)
tree03f37b8024179a949890c679126a8295e3aac2b3 /extlibs/nbrpc.h
parent240be5c4bed01c83a8d9168d5dde7d1f4a716986 (diff)
downloadagni-1885184932474907f67208e12902fc7a64818112.tar.gz
agni-1885184932474907f67208e12902fc7a64818112.zip
update netbyte lib, add rpc lib
Diffstat (limited to 'extlibs/nbrpc.h')
-rw-r--r--extlibs/nbrpc.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/extlibs/nbrpc.h b/extlibs/nbrpc.h
new file mode 100644
index 0000000..3108702
--- /dev/null
+++ b/extlibs/nbrpc.h
@@ -0,0 +1,32 @@
+#ifndef __NBRPC_H
+#define __NBRPC_H
+
+#include <netbytes.h>
+
+#include "mq_cmd.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