summaryrefslogtreecommitdiff
path: root/nbrpc_call.h
diff options
context:
space:
mode:
Diffstat (limited to 'nbrpc_call.h')
-rw-r--r--nbrpc_call.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/nbrpc_call.h b/nbrpc_call.h
new file mode 100644
index 0000000..183f911
--- /dev/null
+++ b/nbrpc_call.h
@@ -0,0 +1,40 @@
+#ifndef __AGNI_NBRPC_CALL_H
+#define __AGNI_NBRPC_CALL_H
+
+#include <netbytes.h>
+
+#include <mq_ntf.h>
+
+typedef struct rpc_call_request
+{
+ char *method;
+ char *params;
+ char *user;
+ char *mask;
+ char *server;
+ int id;
+} rpc_call_request;
+
+typedef struct rpc_call_response
+{
+ char *result;
+ char *error;
+ char *user;
+ char *mask;
+ char *server;
+ int id;
+} rpc_call_response;
+
+rpc_call_request* rpc_call_req_new(char *method, char *params, int id);
+rpc_call_response* rpc_call_resp_new(char *result, char *error, int id);
+
+int rpc_call_req_free(rpc_call_request *req);
+int rpc_call_resp_free(rpc_call_response *resp);
+
+int rpc_call_req_marsh( rpc_call_request *req, netbyte_store **nb_req);
+int rpc_call_resp_marsh( rpc_call_response *resp, netbyte_store **nb_resp);
+
+int rpc_call_req_unmarsh( netbyte_store *nb_req, rpc_call_request **req);
+int rpc_call_resp_unmarsh(netbyte_store *nb_resp, rpc_call_response **resp);
+
+#endif \ No newline at end of file