summaryrefslogtreecommitdiffstats
path: root/rpc/xdr
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/xdr')
-rw-r--r--rpc/xdr/src/glusterd1-xdr.c19
-rw-r--r--rpc/xdr/src/glusterd1-xdr.h16
-rw-r--r--rpc/xdr/src/glusterd1.c15
-rw-r--r--rpc/xdr/src/glusterd1.h6
-rw-r--r--rpc/xdr/src/glusterd1.x10
5 files changed, 59 insertions, 7 deletions
diff --git a/rpc/xdr/src/glusterd1-xdr.c b/rpc/xdr/src/glusterd1-xdr.c
index cbca582eea9..a6b5b122f11 100644
--- a/rpc/xdr/src/glusterd1-xdr.c
+++ b/rpc/xdr/src/glusterd1-xdr.c
@@ -221,12 +221,25 @@ xdr_gd1_mgmt_friend_update (XDR *xdrs, gd1_mgmt_friend_update *objp)
if (!xdr_vector (xdrs, (char *)objp->uuid, 16,
sizeof (u_char), (xdrproc_t) xdr_u_char))
return FALSE;
- if (!xdr_vector (xdrs, (char *)objp->friend_uuid, 16,
+ if (!xdr_bytes (xdrs, (char **)&objp->friends.friends_val, (u_int *) &objp->friends.friends_len, ~0))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->port))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_gd1_mgmt_friend_update_rsp (XDR *xdrs, gd1_mgmt_friend_update_rsp *objp)
+{
+
+ if (!xdr_vector (xdrs, (char *)objp->uuid, 16,
sizeof (u_char), (xdrproc_t) xdr_u_char))
return FALSE;
- if (!xdr_string (xdrs, &objp->hostname, ~0))
+ if (!xdr_int (xdrs, &objp->op))
return FALSE;
- if (!xdr_int (xdrs, &objp->port))
+ if (!xdr_int (xdrs, &objp->op_ret))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->op_errno))
return FALSE;
return TRUE;
}
diff --git a/rpc/xdr/src/glusterd1-xdr.h b/rpc/xdr/src/glusterd1-xdr.h
index 0fc186ed657..85ca9b4ba1e 100644
--- a/rpc/xdr/src/glusterd1-xdr.h
+++ b/rpc/xdr/src/glusterd1-xdr.h
@@ -129,12 +129,22 @@ typedef struct gd1_mgmt_commit_op_rsp gd1_mgmt_commit_op_rsp;
struct gd1_mgmt_friend_update {
u_char uuid[16];
- u_char friend_uuid[16];
- char *hostname;
+ struct {
+ u_int friends_len;
+ char *friends_val;
+ } friends;
int port;
};
typedef struct gd1_mgmt_friend_update gd1_mgmt_friend_update;
+struct gd1_mgmt_friend_update_rsp {
+ u_char uuid[16];
+ int op;
+ int op_ret;
+ int op_errno;
+};
+typedef struct gd1_mgmt_friend_update_rsp gd1_mgmt_friend_update_rsp;
+
/* the xdr functions */
#if defined(__STDC__) || defined(__cplusplus)
@@ -154,6 +164,7 @@ extern bool_t xdr_gd1_mgmt_stage_op_rsp (XDR *, gd1_mgmt_stage_op_rsp*);
extern bool_t xdr_gd1_mgmt_commit_op_req (XDR *, gd1_mgmt_commit_op_req*);
extern bool_t xdr_gd1_mgmt_commit_op_rsp (XDR *, gd1_mgmt_commit_op_rsp*);
extern bool_t xdr_gd1_mgmt_friend_update (XDR *, gd1_mgmt_friend_update*);
+extern bool_t xdr_gd1_mgmt_friend_update_rsp (XDR *, gd1_mgmt_friend_update_rsp*);
#else /* K&R C */
extern bool_t xdr_glusterd_volume_status ();
@@ -172,6 +183,7 @@ extern bool_t xdr_gd1_mgmt_stage_op_rsp ();
extern bool_t xdr_gd1_mgmt_commit_op_req ();
extern bool_t xdr_gd1_mgmt_commit_op_rsp ();
extern bool_t xdr_gd1_mgmt_friend_update ();
+extern bool_t xdr_gd1_mgmt_friend_update_rsp ();
#endif /* K&R C */
diff --git a/rpc/xdr/src/glusterd1.c b/rpc/xdr/src/glusterd1.c
index 6b079f4f450..f566251548e 100644
--- a/rpc/xdr/src/glusterd1.c
+++ b/rpc/xdr/src/glusterd1.c
@@ -68,6 +68,14 @@ gd_xdr_serialize_mgmt_commit_op_rsp (struct iovec outmsg, void *rsp)
(xdrproc_t)xdr_gd1_mgmt_commit_op_rsp);
}
+
+ssize_t
+gd_xdr_serialize_mgmt_friend_update_rsp (struct iovec outmsg, void *rsp)
+{
+ return xdr_serialize_generic (outmsg, (void *)rsp,
+ (xdrproc_t)xdr_gd1_mgmt_friend_update_rsp);
+
+}
/* Decode */
@@ -164,6 +172,13 @@ gd_xdr_to_mgmt_commit_op_rsp (struct iovec inmsg, void *args)
}
ssize_t
+gd_xdr_to_mgmt_friend_update_rsp (struct iovec inmsg, void *args)
+{
+ return xdr_to_generic (inmsg, (void *)args,
+ (xdrproc_t)xdr_gd1_mgmt_friend_update_rsp);
+}
+
+ssize_t
gd_xdr_from_mgmt_probe_req (struct iovec outmsg, void *req)
{
return xdr_serialize_generic (outmsg, (void *)req,
diff --git a/rpc/xdr/src/glusterd1.h b/rpc/xdr/src/glusterd1.h
index b4c4e3d71d6..b4822218a92 100644
--- a/rpc/xdr/src/glusterd1.h
+++ b/rpc/xdr/src/glusterd1.h
@@ -103,4 +103,10 @@ gd_xdr_to_mgmt_friend_update (struct iovec outmsg, void *req);
ssize_t
gd_xdr_from_mgmt_friend_update (struct iovec outmsg, void *req);
+
+ssize_t
+gd_xdr_serialize_mgmt_friend_update_rsp (struct iovec outmsg, void *rsp);
+
+ssize_t
+gd_xdr_to_mgmt_friend_update_rsp (struct iovec inmsg, void *args);
#endif /* !_MSG_GD_XDR_H */
diff --git a/rpc/xdr/src/glusterd1.x b/rpc/xdr/src/glusterd1.x
index f374ea4bff8..28e6de01f82 100644
--- a/rpc/xdr/src/glusterd1.x
+++ b/rpc/xdr/src/glusterd1.x
@@ -88,6 +88,12 @@ struct gd1_mgmt_commit_op_rsp {
struct gd1_mgmt_friend_update {
unsigned char uuid[16];
- unsigned char friend_uuid[16];
- string hostname<>;
+ opaque friends<>;
} ;
+
+struct gd1_mgmt_friend_update_rsp {
+ unsigned char uuid[16];
+ int op;
+ int op_ret;
+ int op_errno;
+} ;