summaryrefslogtreecommitdiff
path: root/nbrpc_event.h
blob: 14dce961be4007ed6dc172d36769f0ec7b6de52e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef __AGNI_NBRPC_H
#define __AGNI_NBRPC_H

#include <netbytes.h>

#include <mq_ntf.h>

#include "mmm.h"

typedef struct rpc_request
{
	char *method;
	char *params;
  int id;
  char *user;
  char *mask;
  char *server;
} rpc_request;

typedef struct rpc_response
{
	char *result;
	char *error;
  int id;
  char *user;
  char *mask;
  char *server;
} 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);

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);

#endif