aboutsummaryrefslogtreecommitdiffstats
path: root/nbrpc_event.h
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2017-09-24 11:55:09 +0100
committerFreeArtMan <dos21h@gmail.com>2017-09-24 11:55:09 +0100
commit5de1c5ba999dba7da45316d3c1f2592c0e0e4804 (patch)
tree58e2fdc46c9b8b43598acdfad479bda9359b1df9 /nbrpc_event.h
parent1dcf41797bda73d9c9c286d1eff8309ee2148e13 (diff)
downloadagni-5de1c5ba999dba7da45316d3c1f2592c0e0e4804.tar.gz
agni-5de1c5ba999dba7da45316d3c1f2592c0e0e4804.zip
Rearranged code for more IPC protocols
Diffstat (limited to 'nbrpc_event.h')
-rw-r--r--nbrpc_event.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/nbrpc_event.h b/nbrpc_event.h
new file mode 100644
index 0000000..5f3657a
--- /dev/null
+++ b/nbrpc_event.h
@@ -0,0 +1,49 @@
+#ifndef __AGNI_NBRPC_H
+#define __AGNI_NBRPC_H
+
+#include <netbytes.h>
+
+#include <mq_ntf.h>
+
+typedef struct rpc_request
+{
+ char *method;
+ char *params;
+ char *user;
+ char *mask;
+ char *server;
+ int id;
+} rpc_request;
+
+typedef struct rpc_response
+{
+ char *result;
+ char *error;
+ char *user;
+ char *mask;
+ char *server;
+ 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_set_user(rpc_request *req);
+int rpc_resp_set_user(rpc_response *resp);
+
+int rpc_req_set_mask(rpc_request *req);
+int rpc_resp_set_mask(rpc_response *resp);
+
+int rpc_req_set_server(rpc_request *req);
+int rpc_resp_set_server(rpc_response *resp);
+
+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