diff options
author | Amar Tumballi <amar@gluster.com> | 2010-07-08 08:16:13 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-07-08 23:28:08 -0700 |
commit | 915adb9c1291d140e57765b7fad0c5bb0e7d5ed5 (patch) | |
tree | 0330fa8796e18601ef7ef1441b6d4eb0df8cb9b6 /xlators/protocol/lib | |
parent | 7e489f3cc7f3eb738d2698dcf588bad0bdc12a8b (diff) |
gluster-CLI-and-mgmt-glusterd-added-to-codebase
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 971 (dynamic volume management)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971
Diffstat (limited to 'xlators/protocol/lib')
-rw-r--r-- | xlators/protocol/lib/src/Makefile.am | 4 | ||||
-rw-r--r-- | xlators/protocol/lib/src/cli-xdr.c | 284 | ||||
-rw-r--r-- | xlators/protocol/lib/src/cli-xdr.h | 129 | ||||
-rw-r--r-- | xlators/protocol/lib/src/gluster1.h | 258 | ||||
-rw-r--r-- | xlators/protocol/lib/src/gluster1.x | 144 | ||||
-rw-r--r-- | xlators/protocol/lib/src/gluster1_xdr.c | 270 | ||||
-rw-r--r-- | xlators/protocol/lib/src/glusterd1.h | 157 | ||||
-rw-r--r-- | xlators/protocol/lib/src/glusterd1.x | 87 | ||||
-rw-r--r-- | xlators/protocol/lib/src/glusterd1_xdr.c | 180 | ||||
-rw-r--r-- | xlators/protocol/lib/src/msg-xdr.c | 8 | ||||
-rw-r--r-- | xlators/protocol/lib/src/msg-xdr.h | 9 | ||||
-rw-r--r-- | xlators/protocol/lib/src/protocol-common.h | 46 |
12 files changed, 1571 insertions, 5 deletions
diff --git a/xlators/protocol/lib/src/Makefile.am b/xlators/protocol/lib/src/Makefile.am index 70cc069e8..abd8ef83e 100644 --- a/xlators/protocol/lib/src/Makefile.am +++ b/xlators/protocol/lib/src/Makefile.am @@ -9,6 +9,6 @@ libgfproto1_la_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64 -D_GNU_SO libgfproto1_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la -libgfproto1_la_SOURCES = authenticate.c msg-xdr.c glusterfs-xdr.c +libgfproto1_la_SOURCES = authenticate.c msg-xdr.c glusterfs-xdr.c gluster1_xdr.c glusterd1_xdr.c cli-xdr.c -noinst_HEADERS = authenticate.h protocol-common.h msg-xdr.h glusterfs-xdr.h +noinst_HEADERS = authenticate.h protocol-common.h msg-xdr.h glusterfs-xdr.h cli-xdr.h glusterd1.h gluster1.h diff --git a/xlators/protocol/lib/src/cli-xdr.c b/xlators/protocol/lib/src/cli-xdr.c new file mode 100644 index 000000000..c6a351b12 --- /dev/null +++ b/xlators/protocol/lib/src/cli-xdr.c @@ -0,0 +1,284 @@ +/* + Copyright (c) 2007-2010 Gluster, Inc. <http://www.gluster.com> + This file is part of GlusterFS. + + GlusterFS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + GlusterFS is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see + <http://www.gnu.org/licenses/>. +*/ + + +#include "cli-xdr.h" + + +ssize_t +gf_xdr_serialize_cli_probe_rsp (struct iovec outmsg, void *rsp) +{ + return xdr_serialize_generic (outmsg, (void *)rsp, + (xdrproc_t)xdr_gf1_cli_probe_rsp); + +} + +ssize_t +gf_xdr_to_cli_probe_req (struct iovec inmsg, void *args) +{ + return xdr_to_generic (inmsg, (void *)args, + (xdrproc_t)xdr_gf1_cli_probe_req); +} + + +ssize_t +gf_xdr_from_cli_probe_req (struct iovec outmsg, void *req) +{ + return xdr_serialize_generic (outmsg, (void *)req, + (xdrproc_t)xdr_gf1_cli_probe_req); +} + + +ssize_t +gf_xdr_serialize_cli_create_vol_rsp (struct iovec outmsg, void *rsp) +{ + return xdr_serialize_generic (outmsg, (void *)rsp, + (xdrproc_t)xdr_gf1_cli_create_vol_rsp); + +} + +ssize_t +gf_xdr_to_cli_create_vol_req (struct iovec inmsg, void *args) +{ + return xdr_to_generic (inmsg, (void *)args, + (xdrproc_t)xdr_gf1_cli_create_vol_req); +} + + +ssize_t +gf_xdr_from_cli_create_vol_req (struct iovec outmsg, void *req) +{ + return xdr_serialize_generic (outmsg, (void *)req, + (xdrproc_t)xdr_gf1_cli_create_vol_req); +} + + +ssize_t +gf_xdr_serialize_cli_delete_vol_rsp (struct iovec outmsg, void *rsp) +{ + return xdr_serialize_generic (outmsg, (void *)rsp, + (xdrproc_t)xdr_gf1_cli_delete_vol_rsp); + +} + +ssize_t +gf_xdr_to_cli_delete_vol_req (struct iovec inmsg, void *args) +{ + return xdr_to_generic (inmsg, (void *)args, + (xdrproc_t)xdr_gf1_cli_delete_vol_req); +} + + +ssize_t +gf_xdr_from_cli_delete_vol_req (struct iovec outmsg, void *req) +{ + return xdr_serialize_generic (outmsg, (void *)req, + (xdrproc_t)xdr_gf1_cli_delete_vol_req); +} + +ssize_t +gf_xdr_serialize_cli_start_vol_rsp (struct iovec outmsg, void *rsp) +{ + return xdr_serialize_generic (outmsg, (void *)rsp, + (xdrproc_t)xdr_gf1_cli_start_vol_rsp); + +} + +ssize_t +gf_xdr_to_cli_start_vol_req (struct iovec inmsg, void *args) +{ + return xdr_to_generic (inmsg, (void *)args, + (xdrproc_t)xdr_gf1_cli_start_vol_req); +} + + +ssize_t +gf_xdr_from_cli_start_vol_req (struct iovec outmsg, void *req) +{ + return xdr_serialize_generic (outmsg, (void *)req, + (xdrproc_t)xdr_gf1_cli_start_vol_req); +} + + +ssize_t +gf_xdr_serialize_cli_stop_vol_rsp (struct iovec outmsg, void *rsp) +{ + return xdr_serialize_generic (outmsg, (void *)rsp, + (xdrproc_t)xdr_gf1_cli_stop_vol_rsp); + +} + +ssize_t +gf_xdr_to_cli_stop_vol_req (struct iovec inmsg, void *args) +{ + return xdr_to_generic (inmsg, (void *)args, + (xdrproc_t)xdr_gf1_cli_stop_vol_req); +} + + +ssize_t +gf_xdr_from_cli_stop_vol_req (struct iovec outmsg, void *req) +{ + return xdr_serialize_generic (outmsg, (void *)req, + (xdrproc_t)xdr_gf1_cli_stop_vol_req); +} + + +ssize_t +gf_xdr_serialize_cli_rename_vol_rsp (struct iovec outmsg, void *rsp) +{ + return xdr_serialize_generic (outmsg, (void *)rsp, + (xdrproc_t)xdr_gf1_cli_rename_vol_rsp); + +} + +ssize_t +gf_xdr_to_cli_rename_vol_req (struct iovec inmsg, void *args) +{ + return xdr_to_generic (inmsg, (void *)args, + (xdrproc_t)xdr_gf1_cli_rename_vol_req); +} + + +ssize_t +gf_xdr_from_cli_rename_vol_req (struct iovec outmsg, void *req) +{ + return xdr_serialize_generic (outmsg, (void *)req, + (xdrproc_t)xdr_gf1_cli_rename_vol_req); +} + + +ssize_t +gf_xdr_serialize_cli_defrag_vol_rsp (struct iovec outmsg, void *rsp) +{ + return xdr_serialize_generic (outmsg, (void *)rsp, + (xdrproc_t)xdr_gf1_cli_defrag_vol_rsp); + +} + +ssize_t +gf_xdr_to_cli_defrag_vol_req (struct iovec inmsg, void *args) +{ + return xdr_to_generic (inmsg, (void *)args, + (xdrproc_t)xdr_gf1_cli_defrag_vol_req); +} + + +ssize_t +gf_xdr_from_cli_defrag_vol_req (struct iovec outmsg, void *req) +{ + return xdr_serialize_generic (outmsg, (void *)req, + (xdrproc_t)xdr_gf1_cli_defrag_vol_req); +} + + + +ssize_t +gf_xdr_serialize_cli_add_brick_rsp (struct iovec outmsg, void *rsp) +{ + return xdr_serialize_generic (outmsg, (void *)rsp, + (xdrproc_t)xdr_gf1_cli_add_brick_rsp); + +} + +ssize_t +gf_xdr_to_cli_add_brick_req (struct iovec inmsg, void *args) +{ + return xdr_to_generic (inmsg, (void *)args, + (xdrproc_t)xdr_gf1_cli_add_brick_req); +} + + +ssize_t +gf_xdr_from_cli_add_brick_req (struct iovec outmsg, void *req) +{ + return xdr_serialize_generic (outmsg, (void *)req, + (xdrproc_t)xdr_gf1_cli_add_brick_req); +} + + +ssize_t +gf_xdr_serialize_cli_remove_brick_rsp (struct iovec outmsg, void *rsp) +{ + return xdr_serialize_generic (outmsg, (void *)rsp, + (xdrproc_t)xdr_gf1_cli_remove_brick_rsp); + +} + +ssize_t +gf_xdr_to_cli_remove_brick_req (struct iovec inmsg, void *args) +{ + return xdr_to_generic (inmsg, (void *)args, + (xdrproc_t)xdr_gf1_cli_remove_brick_req); +} + + +ssize_t +gf_xdr_from_cli_remove_brick_req (struct iovec outmsg, void *req) +{ + return xdr_serialize_generic (outmsg, (void *)req, + (xdrproc_t)xdr_gf1_cli_remove_brick_req); +} + + +ssize_t +gf_xdr_serialize_cli_replace_brick_rsp (struct iovec outmsg, void *rsp) +{ + return xdr_serialize_generic (outmsg, (void *)rsp, + (xdrproc_t)xdr_gf1_cli_replace_brick_rsp); + +} + +ssize_t +gf_xdr_to_cli_replace_brick_req (struct iovec inmsg, void *args) +{ + return xdr_to_generic (inmsg, (void *)args, + (xdrproc_t)xdr_gf1_cli_replace_brick_req); +} + + +ssize_t +gf_xdr_from_cli_replace_brick_req (struct iovec outmsg, void *req) +{ + return xdr_serialize_generic (outmsg, (void *)req, + (xdrproc_t)xdr_gf1_cli_replace_brick_req); +} + +ssize_t +gf_xdr_serialize_cli_set_vol_rsp (struct iovec outmsg, void *rsp) +{ + return xdr_serialize_generic (outmsg, (void *)rsp, + (xdrproc_t)xdr_gf1_cli_set_vol_rsp); + +} + +ssize_t +gf_xdr_to_cli_set_vol_req (struct iovec inmsg, void *args) +{ + return xdr_to_generic (inmsg, (void *)args, + (xdrproc_t)xdr_gf1_cli_set_vol_req); +} + + +ssize_t +gf_xdr_from_cli_set_vol_req (struct iovec outmsg, void *req) +{ + return xdr_serialize_generic (outmsg, (void *)req, + (xdrproc_t)xdr_gf1_cli_set_vol_req); +} diff --git a/xlators/protocol/lib/src/cli-xdr.h b/xlators/protocol/lib/src/cli-xdr.h new file mode 100644 index 000000000..9705071ba --- /dev/null +++ b/xlators/protocol/lib/src/cli-xdr.h @@ -0,0 +1,129 @@ +/* + Copyright (c) 2007-2010 Gluster, Inc. <http://www.gluster.com> + This file is part of GlusterFS. + + GlusterFS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + GlusterFS is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see + <http://www.gnu.org/licenses/>. +*/ + + +#ifndef _MSG_CLI_XDR_H +#define _MSG_CLI_XDR_H + +#include <sys/uio.h> + +#include "msg-xdr.h" +#include "gluster1.h" + +ssize_t +gf_xdr_serialize_cli_probe_rsp (struct iovec outmsg, void *rsp); + +ssize_t +gf_xdr_to_cli_probe_req (struct iovec inmsg, void *args); + +ssize_t +gf_xdr_from_cli_probe_req (struct iovec outmsg, void *req); + +ssize_t +gf_xdr_serialize_cli_create_vol_rsp (struct iovec outmsg, void *rsp); + +ssize_t +gf_xdr_to_cli_create_vol_req (struct iovec inmsg, void *args); + +ssize_t +gf_xdr_from_cli_create_vol_req (struct iovec outmsg, void *req); + +ssize_t +gf_xdr_serialize_cli_delete_vol_rsp (struct iovec outmsg, void *rsp); + +ssize_t +gf_xdr_to_cli_delete_vol_req (struct iovec inmsg, void *args); + +ssize_t +gf_xdr_from_cli_delete_vol_req (struct iovec outmsg, void *req); + +ssize_t +gf_xdr_serialize_cli_start_vol_rsp (struct iovec outmsg, void *rsp); + +ssize_t +gf_xdr_to_cli_start_vol_req (struct iovec inmsg, void *args); + +ssize_t +gf_xdr_from_cli_start_vol_req (struct iovec outmsg, void *req); + +ssize_t +gf_xdr_serialize_cli_stop_vol_rsp (struct iovec outmsg, void *rsp); + +ssize_t +gf_xdr_to_cli_stop_vol_req (struct iovec inmsg, void *args); + +ssize_t +gf_xdr_from_cli_stop_vol_req (struct iovec outmsg, void *req); + +ssize_t +gf_xdr_serialize_cli_rename_vol_rsp (struct iovec outmsg, void *rsp); + +ssize_t +gf_xdr_to_cli_rename_vol_req (struct iovec inmsg, void *args); + +ssize_t +gf_xdr_from_cli_rename_vol_req (struct iovec outmsg, void *req); + +ssize_t +gf_xdr_serialize_cli_defrag_vol_rsp (struct iovec outmsg, void *rsp); + +ssize_t +gf_xdr_to_cli_defrag_vol_req (struct iovec inmsg, void *args); + +ssize_t +gf_xdr_from_cli_defrag_vol_req (struct iovec outmsg, void *req); + +ssize_t +gf_xdr_serialize_cli_add_brick_rsp (struct iovec outmsg, void *rsp); + +ssize_t +gf_xdr_to_cli_add_brick_req (struct iovec inmsg, void *args); + +ssize_t +gf_xdr_from_cli_add_brick_req (struct iovec outmsg, void *req); + +ssize_t +gf_xdr_serialize_cli_remove_brick_rsp (struct iovec outmsg, void *rsp); + +ssize_t +gf_xdr_to_cli_remove_brick_req (struct iovec inmsg, void *args); + +ssize_t +gf_xdr_from_cli_remove_brick_req (struct iovec outmsg, void *req); + +ssize_t +gf_xdr_serialize_cli_replace_brick_rsp (struct iovec outmsg, void *rsp); + +ssize_t +gf_xdr_to_cli_replace_brick_req (struct iovec inmsg, void *args); + +ssize_t +gf_xdr_from_cli_replace_brick_req (struct iovec outmsg, void *req); + +ssize_t +gf_xdr_serialize_cli_set_vol_rsp (struct iovec outmsg, void *rsp); + +ssize_t +gf_xdr_to_cli_set_vol_req (struct iovec inmsg, void *args); + + +ssize_t +gf_xdr_from_cli_set_vol_req (struct iovec outmsg, void *req); + +#endif /* !_MSG_CLI_XDR_H */ diff --git a/xlators/protocol/lib/src/gluster1.h b/xlators/protocol/lib/src/gluster1.h new file mode 100644 index 000000000..359fdcf42 --- /dev/null +++ b/xlators/protocol/lib/src/gluster1.h @@ -0,0 +1,258 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _GLUSTER1_H_RPCGEN +#define _GLUSTER1_H_RPCGEN + +#include <rpc/rpc.h> + + +#ifdef __cplusplus +extern "C" { +#endif + + +enum gf1_cluster_type { + GF_CLUSTER_TYPE_NONE = 0, + GF_CLUSTER_TYPE_STRIPE = 0 + 1, + GF_CLUSTER_TYPE_REPLICATE = 0 + 2, +}; +typedef enum gf1_cluster_type gf1_cluster_type; + +enum gf1_cli_replace_op { + GF_REPLACE_OP_NONE = 0, + GF_REPLACE_OP_START = 0 + 1, + GF_REPLACE_OP_STOP = 0 + 2, + GF_REPLACE_OP_PAUSE = 0 + 3, + GF_REPLACE_OP_ABORT = 0 + 4, + GF_REPLACE_OP_STATUS = 0 + 5, +}; +typedef enum gf1_cli_replace_op gf1_cli_replace_op; + +struct gf1_cli_probe_req { + char *hostname; +}; +typedef struct gf1_cli_probe_req gf1_cli_probe_req; + +struct gf1_cli_probe_rsp { + int op_ret; + int op_errno; + char *hostname; +}; +typedef struct gf1_cli_probe_rsp gf1_cli_probe_rsp; + +struct gf1_cli_create_vol_req { + char *volname; + gf1_cluster_type type; + int count; + struct { + u_int bricks_len; + char *bricks_val; + } bricks; +}; +typedef struct gf1_cli_create_vol_req gf1_cli_create_vol_req; + +struct gf1_cli_create_vol_rsp { + int op_ret; + int op_errno; + char *volname; +}; +typedef struct gf1_cli_create_vol_rsp gf1_cli_create_vol_rsp; + +struct gf1_cli_delete_vol_req { + char *volname; +}; +typedef struct gf1_cli_delete_vol_req gf1_cli_delete_vol_req; + +struct gf1_cli_delete_vol_rsp { + int op_ret; + int op_errno; + char *volname; +}; +typedef struct gf1_cli_delete_vol_rsp gf1_cli_delete_vol_rsp; + +struct gf1_cli_start_vol_req { + char *volname; +}; +typedef struct gf1_cli_start_vol_req gf1_cli_start_vol_req; + +struct gf1_cli_start_vol_rsp { + int op_ret; + int op_errno; + char *volname; +}; +typedef struct gf1_cli_start_vol_rsp gf1_cli_start_vol_rsp; + +struct gf1_cli_stop_vol_req { + char *volname; +}; +typedef struct gf1_cli_stop_vol_req gf1_cli_stop_vol_req; + +struct gf1_cli_stop_vol_rsp { + int op_ret; + int op_errno; + char *volname; +}; +typedef struct gf1_cli_stop_vol_rsp gf1_cli_stop_vol_rsp; + +struct gf1_cli_rename_vol_req { + char *old_volname; + char *new_volname; +}; +typedef struct gf1_cli_rename_vol_req gf1_cli_rename_vol_req; + +struct gf1_cli_rename_vol_rsp { + int op_ret; + int op_errno; + char *volname; +}; +typedef struct gf1_cli_rename_vol_rsp gf1_cli_rename_vol_rsp; + +struct gf1_cli_defrag_vol_req { + char *volname; +}; +typedef struct gf1_cli_defrag_vol_req gf1_cli_defrag_vol_req; + +struct gf1_cli_defrag_vol_rsp { + int op_ret; + int op_errno; + char *volname; +}; +typedef struct gf1_cli_defrag_vol_rsp gf1_cli_defrag_vol_rsp; + +struct gf1_cli_add_brick_req { + char *volname; + gf1_cluster_type type; + int count; + struct { + u_int bricks_len; + char *bricks_val; + } bricks; +}; +typedef struct gf1_cli_add_brick_req gf1_cli_add_brick_req; + +struct gf1_cli_add_brick_rsp { + int op_ret; + int op_errno; + char *volname; +}; +typedef struct gf1_cli_add_brick_rsp gf1_cli_add_brick_rsp; + +struct gf1_cli_remove_brick_req { + char *volname; + gf1_cluster_type type; + int count; + struct { + u_int bricks_len; + char *bricks_val; + } bricks; +}; +typedef struct gf1_cli_remove_brick_req gf1_cli_remove_brick_req; + +struct gf1_cli_remove_brick_rsp { + int op_ret; + int op_errno; + char *volname; +}; +typedef struct gf1_cli_remove_brick_rsp gf1_cli_remove_brick_rsp; + +struct gf1_cli_replace_brick_req { + char *volname; + gf1_cli_replace_op op; + struct { + u_int src_brick_len; + char *src_brick_val; + } src_brick; + struct { + u_int dst_brick_len; + char *dst_brick_val; + } dst_brick; +}; +typedef struct gf1_cli_replace_brick_req gf1_cli_replace_brick_req; + +struct gf1_cli_replace_brick_rsp { + int op_ret; + int op_errno; + char *volname; +}; +typedef struct gf1_cli_replace_brick_rsp gf1_cli_replace_brick_rsp; + +struct gf1_cli_set_vol_req { + char *volname; + struct { + u_int dict_len; + char *dict_val; + } dict; +}; +typedef struct gf1_cli_set_vol_req gf1_cli_set_vol_req; + +struct gf1_cli_set_vol_rsp { + int op_ret; + int op_errno; + char *volname; +}; +typedef struct gf1_cli_set_vol_rsp gf1_cli_set_vol_rsp; + +/* the xdr functions */ + +#if defined(__STDC__) || defined(__cplusplus) +extern bool_t xdr_gf1_cluster_type (XDR *, gf1_cluster_type*); +extern bool_t xdr_gf1_cli_replace_op (XDR *, gf1_cli_replace_op*); +extern bool_t xdr_gf1_cli_probe_req (XDR *, gf1_cli_probe_req*); +extern bool_t xdr_gf1_cli_probe_rsp (XDR *, gf1_cli_probe_rsp*); +extern bool_t xdr_gf1_cli_create_vol_req (XDR *, gf1_cli_create_vol_req*); +extern bool_t xdr_gf1_cli_create_vol_rsp (XDR *, gf1_cli_create_vol_rsp*); +extern bool_t xdr_gf1_cli_delete_vol_req (XDR *, gf1_cli_delete_vol_req*); +extern bool_t xdr_gf1_cli_delete_vol_rsp (XDR *, gf1_cli_delete_vol_rsp*); +extern bool_t xdr_gf1_cli_start_vol_req (XDR *, gf1_cli_start_vol_req*); +extern bool_t xdr_gf1_cli_start_vol_rsp (XDR *, gf1_cli_start_vol_rsp*); +extern bool_t xdr_gf1_cli_stop_vol_req (XDR *, gf1_cli_stop_vol_req*); +extern bool_t xdr_gf1_cli_stop_vol_rsp (XDR *, gf1_cli_stop_vol_rsp*); +extern bool_t xdr_gf1_cli_rename_vol_req (XDR *, gf1_cli_rename_vol_req*); +extern bool_t xdr_gf1_cli_rename_vol_rsp (XDR *, gf1_cli_rename_vol_rsp*); +extern bool_t xdr_gf1_cli_defrag_vol_req (XDR *, gf1_cli_defrag_vol_req*); +extern bool_t xdr_gf1_cli_defrag_vol_rsp (XDR *, gf1_cli_defrag_vol_rsp*); +extern bool_t xdr_gf1_cli_add_brick_req (XDR *, gf1_cli_add_brick_req*); +extern bool_t xdr_gf1_cli_add_brick_rsp (XDR *, gf1_cli_add_brick_rsp*); +extern bool_t xdr_gf1_cli_remove_brick_req (XDR *, gf1_cli_remove_brick_req*); +extern bool_t xdr_gf1_cli_remove_brick_rsp (XDR *, gf1_cli_remove_brick_rsp*); +extern bool_t xdr_gf1_cli_replace_brick_req (XDR *, gf1_cli_replace_brick_req*); +extern bool_t xdr_gf1_cli_replace_brick_rsp (XDR *, gf1_cli_replace_brick_rsp*); +extern bool_t xdr_gf1_cli_set_vol_req (XDR *, gf1_cli_set_vol_req*); +extern bool_t xdr_gf1_cli_set_vol_rsp (XDR *, gf1_cli_set_vol_rsp*); + +#else /* K&R C */ +extern bool_t xdr_gf1_cluster_type (); +extern bool_t xdr_gf1_cli_replace_op (); +extern bool_t xdr_gf1_cli_probe_req (); +extern bool_t xdr_gf1_cli_probe_rsp (); +extern bool_t xdr_gf1_cli_create_vol_req (); +extern bool_t xdr_gf1_cli_create_vol_rsp (); +extern bool_t xdr_gf1_cli_delete_vol_req (); +extern bool_t xdr_gf1_cli_delete_vol_rsp (); +extern bool_t xdr_gf1_cli_start_vol_req (); +extern bool_t xdr_gf1_cli_start_vol_rsp (); +extern bool_t xdr_gf1_cli_stop_vol_req (); +extern bool_t xdr_gf1_cli_stop_vol_rsp (); +extern bool_t xdr_gf1_cli_rename_vol_req (); +extern bool_t xdr_gf1_cli_rename_vol_rsp (); +extern bool_t xdr_gf1_cli_defrag_vol_req (); +extern bool_t xdr_gf1_cli_defrag_vol_rsp (); +extern bool_t xdr_gf1_cli_add_brick_req (); +extern bool_t xdr_gf1_cli_add_brick_rsp (); +extern bool_t xdr_gf1_cli_remove_brick_req (); +extern bool_t xdr_gf1_cli_remove_brick_rsp (); +extern bool_t xdr_gf1_cli_replace_brick_req (); +extern bool_t xdr_gf1_cli_replace_brick_rsp (); +extern bool_t xdr_gf1_cli_set_vol_req (); +extern bool_t xdr_gf1_cli_set_vol_rsp (); + +#endif /* K&R C */ + +#ifdef __cplusplus +} +#endif + +#endif /* !_GLUSTER1_H_RPCGEN */ diff --git a/xlators/protocol/lib/src/gluster1.x b/xlators/protocol/lib/src/gluster1.x new file mode 100644 index 000000000..1fe7ef14f --- /dev/null +++ b/xlators/protocol/lib/src/gluster1.x @@ -0,0 +1,144 @@ + enum gf1_cluster_type { + GF_CLUSTER_TYPE_NONE = 0, + GF_CLUSTER_TYPE_STRIPE, + GF_CLUSTER_TYPE_REPLICATE +} ; + + enum gf1_cli_replace_op { + GF_REPLACE_OP_NONE = 0, + GF_REPLACE_OP_START, + GF_REPLACE_OP_STOP, + GF_REPLACE_OP_PAUSE, + GF_REPLACE_OP_ABORT, + GF_REPLACE_OP_STATUS +} ; + + struct gf1_cli_probe_req { + string hostname<>; +} ; + + struct gf1_cli_probe_rsp { + int op_ret; + int op_errno; + string hostname<>; +} ; + + struct gf1_cli_create_vol_req { + string volname<>; + gf1_cluster_type type; + int count; + opaque bricks<>; +} ; + + struct gf1_cli_create_vol_rsp { + int op_ret; + int op_errno; + string volname<>; +} ; + + struct gf1_cli_delete_vol_req { + string volname<>; +} ; + + struct gf1_cli_delete_vol_rsp { + int op_ret; + int op_errno; + string volname<>; +} ; + + struct gf1_cli_start_vol_req { + string volname<>; +} ; + + + struct gf1_cli_start_vol_rsp { + int op_ret; + int op_errno; + string volname<>; +} ; + + struct gf1_cli_stop_vol_req { + string volname<>; +} ; + + + struct gf1_cli_stop_vol_rsp { + int op_ret; + int op_errno; + string volname<>; +} ; + + + struct gf1_cli_rename_vol_req { + string old_volname<>; + string new_volname<>; +} ; + + struct gf1_cli_rename_vol_rsp { + int op_ret; + int op_errno; + string volname<>; +} ; + + struct gf1_cli_defrag_vol_req { + string volname<>; +} ; + + struct gf1_cli_defrag_vol_rsp { + int op_ret; + int op_errno; + string volname<>; +} ; + + struct gf1_cli_add_brick_req { + string volname<>; + gf1_cluster_type type; + int count; + opaque bricks<>; +} ; + + struct gf1_cli_add_brick_rsp { + int op_ret; + int op_errno; + string volname<>; +} ; + + struct gf1_cli_remove_brick_req { + string volname<>; + gf1_cluster_type type; + int count; + opaque bricks<>; +} ; + + + struct gf1_cli_remove_brick_rsp { + int op_ret; + int op_errno; + string volname<>; +} ; + + struct gf1_cli_replace_brick_req { + string volname<>; + gf1_cli_replace_op op; + opaque src_brick<>; + opaque dst_brick<>; +} ; + + struct gf1_cli_replace_brick_rsp { + int op_ret; + int op_errno; + string volname<>; +} ; + + +struct gf1_cli_set_vol_req { + string volname<>; + opaque dict<>; +} ; + + + struct gf1_cli_set_vol_rsp { + int op_ret; + int op_errno; + string volname<>; +} ; diff --git a/xlators/protocol/lib/src/gluster1_xdr.c b/xlators/protocol/lib/src/gluster1_xdr.c new file mode 100644 index 000000000..2cd83315a --- /dev/null +++ b/xlators/protocol/lib/src/gluster1_xdr.c @@ -0,0 +1,270 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "gluster1.h" + +bool_t +xdr_gf1_cluster_type (XDR *xdrs, gf1_cluster_type *objp) +{ + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_replace_op (XDR *xdrs, gf1_cli_replace_op *objp) +{ + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_probe_req (XDR *xdrs, gf1_cli_probe_req *objp) +{ + if (!xdr_string (xdrs, &objp->hostname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_probe_rsp (XDR *xdrs, gf1_cli_probe_rsp *objp) +{ + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + if (!xdr_string (xdrs, &objp->hostname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_create_vol_req (XDR *xdrs, gf1_cli_create_vol_req *objp) +{ + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + if (!xdr_gf1_cluster_type (xdrs, &objp->type)) + return FALSE; + if (!xdr_int (xdrs, &objp->count)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->bricks.bricks_val, (u_int *) &objp->bricks.bricks_len, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_create_vol_rsp (XDR *xdrs, gf1_cli_create_vol_rsp *objp) +{ + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_delete_vol_req (XDR *xdrs, gf1_cli_delete_vol_req *objp) +{ + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_delete_vol_rsp (XDR *xdrs, gf1_cli_delete_vol_rsp *objp) +{ + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_start_vol_req (XDR *xdrs, gf1_cli_start_vol_req *objp) +{ + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_start_vol_rsp (XDR *xdrs, gf1_cli_start_vol_rsp *objp) +{ + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_stop_vol_req (XDR *xdrs, gf1_cli_stop_vol_req *objp) +{ + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_stop_vol_rsp (XDR *xdrs, gf1_cli_stop_vol_rsp *objp) +{ + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_rename_vol_req (XDR *xdrs, gf1_cli_rename_vol_req *objp) +{ + if (!xdr_string (xdrs, &objp->old_volname, ~0)) + return FALSE; + if (!xdr_string (xdrs, &objp->new_volname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_rename_vol_rsp (XDR *xdrs, gf1_cli_rename_vol_rsp *objp) +{ + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_defrag_vol_req (XDR *xdrs, gf1_cli_defrag_vol_req *objp) +{ + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_defrag_vol_rsp (XDR *xdrs, gf1_cli_defrag_vol_rsp *objp) +{ + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_add_brick_req (XDR *xdrs, gf1_cli_add_brick_req *objp) +{ + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + if (!xdr_gf1_cluster_type (xdrs, &objp->type)) + return FALSE; + if (!xdr_int (xdrs, &objp->count)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->bricks.bricks_val, (u_int *) &objp->bricks.bricks_len, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_add_brick_rsp (XDR *xdrs, gf1_cli_add_brick_rsp *objp) +{ + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_remove_brick_req (XDR *xdrs, gf1_cli_remove_brick_req *objp) +{ + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + if (!xdr_gf1_cluster_type (xdrs, &objp->type)) + return FALSE; + if (!xdr_int (xdrs, &objp->count)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->bricks.bricks_val, (u_int *) &objp->bricks.bricks_len, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_remove_brick_rsp (XDR *xdrs, gf1_cli_remove_brick_rsp *objp) +{ + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_replace_brick_req (XDR *xdrs, gf1_cli_replace_brick_req *objp) +{ + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + if (!xdr_gf1_cli_replace_op (xdrs, &objp->op)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->src_brick.src_brick_val, (u_int *) &objp->src_brick.src_brick_len, ~0)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->dst_brick.dst_brick_val, (u_int *) &objp->dst_brick.dst_brick_len, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_replace_brick_rsp (XDR *xdrs, gf1_cli_replace_brick_rsp *objp) +{ + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_set_vol_req (XDR *xdrs, gf1_cli_set_vol_req *objp) +{ + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, (u_int *) &objp->dict.dict_len, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gf1_cli_set_vol_rsp (XDR *xdrs, gf1_cli_set_vol_rsp *objp) +{ + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + return TRUE; +} diff --git a/xlators/protocol/lib/src/glusterd1.h b/xlators/protocol/lib/src/glusterd1.h new file mode 100644 index 000000000..ee5fb9c7d --- /dev/null +++ b/xlators/protocol/lib/src/glusterd1.h @@ -0,0 +1,157 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _GLUSTERD1_H_RPCGEN +#define _GLUSTERD1_H_RPCGEN + +#include <rpc/rpc.h> + + +#ifdef __cplusplus +extern "C" { +#endif + + +struct gd1_mgmt_probe_req { + u_char uuid[16]; + char *hostname; +}; +typedef struct gd1_mgmt_probe_req gd1_mgmt_probe_req; + +struct gd1_mgmt_probe_rsp { + u_char uuid[16]; + char *hostname; +}; +typedef struct gd1_mgmt_probe_rsp gd1_mgmt_probe_rsp; + +struct gd1_mgmt_friend_req { + u_char uuid[16]; + char *hostname; +}; +typedef struct gd1_mgmt_friend_req gd1_mgmt_friend_req; + +struct gd1_mgmt_friend_rsp { + u_char uuid[16]; + char *hostname; + int op_ret; + int op_errno; +}; +typedef struct gd1_mgmt_friend_rsp gd1_mgmt_friend_rsp; + +struct gd1_mgmt_unfriend_req { + u_char uuid[16]; + char *hostname; +}; +typedef struct gd1_mgmt_unfriend_req gd1_mgmt_unfriend_req; + +struct gd1_mgmt_unfriend_rsp { + u_char uuid[16]; + char *hostname; + int op_ret; + int op_errno; +}; +typedef struct gd1_mgmt_unfriend_rsp gd1_mgmt_unfriend_rsp; + +struct gd1_mgmt_cluster_lock_req { + u_char uuid[16]; +}; +typedef struct gd1_mgmt_cluster_lock_req gd1_mgmt_cluster_lock_req; + +struct gd1_mgmt_cluster_lock_rsp { + u_char uuid[16]; + int op_ret; + int op_errno; +}; +typedef struct gd1_mgmt_cluster_lock_rsp gd1_mgmt_cluster_lock_rsp; + +struct gd1_mgmt_cluster_unlock_req { + u_char uuid[16]; +}; +typedef struct gd1_mgmt_cluster_unlock_req gd1_mgmt_cluster_unlock_req; + +struct gd1_mgmt_cluster_unlock_rsp { + u_char uuid[16]; + int op_ret; + int op_errno; +}; +typedef struct gd1_mgmt_cluster_unlock_rsp gd1_mgmt_cluster_unlock_rsp; + +struct gd1_mgmt_stage_op_req { + u_char uuid[16]; + int op; + struct { + u_int buf_len; + char *buf_val; + } buf; +}; +typedef struct gd1_mgmt_stage_op_req gd1_mgmt_stage_op_req; + +struct gd1_mgmt_stage_op_rsp { + u_char uuid[16]; + int op; + int op_ret; + int op_errno; +}; +typedef struct gd1_mgmt_stage_op_rsp gd1_mgmt_stage_op_rsp; + +struct gd1_mgmt_commit_op_req { + u_char uuid[16]; + int op; + struct { + u_int buf_len; + char *buf_val; + } buf; +}; +typedef struct gd1_mgmt_commit_op_req gd1_mgmt_commit_op_req; + +struct gd1_mgmt_commit_op_rsp { + u_char uuid[16]; + int op; + int op_ret; + int op_errno; +}; +typedef struct gd1_mgmt_commit_op_rsp gd1_mgmt_commit_op_rsp; + +/* the xdr functions */ + +#if defined(__STDC__) || defined(__cplusplus) +extern bool_t xdr_gd1_mgmt_probe_req (XDR *, gd1_mgmt_probe_req*); +extern bool_t xdr_gd1_mgmt_probe_rsp (XDR *, gd1_mgmt_probe_rsp*); +extern bool_t xdr_gd1_mgmt_friend_req (XDR *, gd1_mgmt_friend_req*); +extern bool_t xdr_gd1_mgmt_friend_rsp (XDR *, gd1_mgmt_friend_rsp*); +extern bool_t xdr_gd1_mgmt_unfriend_req (XDR *, gd1_mgmt_unfriend_req*); +extern bool_t xdr_gd1_mgmt_unfriend_rsp (XDR *, gd1_mgmt_unfriend_rsp*); +extern bool_t xdr_gd1_mgmt_cluster_lock_req (XDR *, gd1_mgmt_cluster_lock_req*); +extern bool_t xdr_gd1_mgmt_cluster_lock_rsp (XDR *, gd1_mgmt_cluster_lock_rsp*); +extern bool_t xdr_gd1_mgmt_cluster_unlock_req (XDR *, gd1_mgmt_cluster_unlock_req*); +extern bool_t xdr_gd1_mgmt_cluster_unlock_rsp (XDR *, gd1_mgmt_cluster_unlock_rsp*); +extern bool_t xdr_gd1_mgmt_stage_op_req (XDR *, gd1_mgmt_stage_op_req*); +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*); + +#else /* K&R C */ +extern bool_t xdr_gd1_mgmt_probe_req (); +extern bool_t xdr_gd1_mgmt_probe_rsp (); +extern bool_t xdr_gd1_mgmt_friend_req (); +extern bool_t xdr_gd1_mgmt_friend_rsp (); +extern bool_t xdr_gd1_mgmt_unfriend_req (); +extern bool_t xdr_gd1_mgmt_unfriend_rsp (); +extern bool_t xdr_gd1_mgmt_cluster_lock_req (); +extern bool_t xdr_gd1_mgmt_cluster_lock_rsp (); +extern bool_t xdr_gd1_mgmt_cluster_unlock_req (); +extern bool_t xdr_gd1_mgmt_cluster_unlock_rsp (); +extern bool_t xdr_gd1_mgmt_stage_op_req (); +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 (); + +#endif /* K&R C */ + +#ifdef __cplusplus +} +#endif + +#endif /* !_GLUSTERD1_H_RPCGEN */ diff --git a/xlators/protocol/lib/src/glusterd1.x b/xlators/protocol/lib/src/glusterd1.x new file mode 100644 index 000000000..935fde4ef --- /dev/null +++ b/xlators/protocol/lib/src/glusterd1.x @@ -0,0 +1,87 @@ + + struct gd1_mgmt_probe_req { + unsigned char uuid[16]; + string hostname<>; +} ; + + struct gd1_mgmt_probe_rsp { + unsigned char uuid[16]; + string hostname<>; +} ; + +struct gd1_mgmt_friend_req { + unsigned char uuid[16]; + string hostname<>; +} ; + +struct gd1_mgmt_friend_rsp { + unsigned char uuid[16]; + string hostname<>; + int op_ret; + int op_errno; +} ; + +struct gd1_mgmt_unfriend_req { + unsigned char uuid[16]; + string hostname<>; +} ; + +struct gd1_mgmt_unfriend_rsp { + unsigned char uuid[16]; + string hostname<>; + int op_ret; + int op_errno; +} ; + +struct gd1_mgmt_cluster_lock_req { + unsigned char uuid[16]; +} ; + +struct gd1_mgmt_cluster_lock_rsp { + unsigned char uuid[16]; + int op_ret; + int op_errno; +} ; + +struct gd1_mgmt_cluster_unlock_req { + unsigned char uuid[16]; +} ; + +struct gd1_mgmt_cluster_unlock_rsp { + unsigned char uuid[16]; + int op_ret; + int op_errno; +} ; + +struct gd1_mgmt_stage_op_req { + unsigned char uuid[16]; + int op; + opaque buf<>; +} ; + + +struct gd1_mgmt_stage_op_rsp { + unsigned char uuid[16]; + int op; + int op_ret; + int op_errno; +} ; + +struct gd1_mgmt_commit_op_req { + unsigned char uuid[16]; + int op; + opaque buf<>; +} ; + + +struct gd1_mgmt_commit_op_rsp { + unsigned char uuid[16]; + int op; + int op_ret; + int op_errno; +} ; + + + + + diff --git a/xlators/protocol/lib/src/glusterd1_xdr.c b/xlators/protocol/lib/src/glusterd1_xdr.c new file mode 100644 index 000000000..b35cc3580 --- /dev/null +++ b/xlators/protocol/lib/src/glusterd1_xdr.c @@ -0,0 +1,180 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "glusterd1.h" + +bool_t +xdr_gd1_mgmt_probe_req (XDR *xdrs, gd1_mgmt_probe_req *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)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gd1_mgmt_probe_rsp (XDR *xdrs, gd1_mgmt_probe_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)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gd1_mgmt_friend_req (XDR *xdrs, gd1_mgmt_friend_req *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)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gd1_mgmt_friend_rsp (XDR *xdrs, gd1_mgmt_friend_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)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gd1_mgmt_unfriend_req (XDR *xdrs, gd1_mgmt_unfriend_req *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)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gd1_mgmt_unfriend_rsp (XDR *xdrs, gd1_mgmt_unfriend_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)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gd1_mgmt_cluster_lock_req (XDR *xdrs, gd1_mgmt_cluster_lock_req *objp) +{ + if (!xdr_vector (xdrs, (char *)objp->uuid, 16, + sizeof (u_char), (xdrproc_t) xdr_u_char)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gd1_mgmt_cluster_lock_rsp (XDR *xdrs, gd1_mgmt_cluster_lock_rsp *objp) +{ + if (!xdr_vector (xdrs, (char *)objp->uuid, 16, + sizeof (u_char), (xdrproc_t) xdr_u_char)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gd1_mgmt_cluster_unlock_req (XDR *xdrs, gd1_mgmt_cluster_unlock_req *objp) +{ + if (!xdr_vector (xdrs, (char *)objp->uuid, 16, + sizeof (u_char), (xdrproc_t) xdr_u_char)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gd1_mgmt_cluster_unlock_rsp (XDR *xdrs, gd1_mgmt_cluster_unlock_rsp *objp) +{ + if (!xdr_vector (xdrs, (char *)objp->uuid, 16, + sizeof (u_char), (xdrproc_t) xdr_u_char)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gd1_mgmt_stage_op_req (XDR *xdrs, gd1_mgmt_stage_op_req *objp) +{ + if (!xdr_vector (xdrs, (char *)objp->uuid, 16, + sizeof (u_char), (xdrproc_t) xdr_u_char)) + return FALSE; + if (!xdr_int (xdrs, &objp->op)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->buf.buf_val, (u_int *) &objp->buf.buf_len, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gd1_mgmt_stage_op_rsp (XDR *xdrs, gd1_mgmt_stage_op_rsp *objp) +{ + if (!xdr_vector (xdrs, (char *)objp->uuid, 16, + sizeof (u_char), (xdrproc_t) xdr_u_char)) + return FALSE; + if (!xdr_int (xdrs, &objp->op)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gd1_mgmt_commit_op_req (XDR *xdrs, gd1_mgmt_commit_op_req *objp) +{ + if (!xdr_vector (xdrs, (char *)objp->uuid, 16, + sizeof (u_char), (xdrproc_t) xdr_u_char)) + return FALSE; + if (!xdr_int (xdrs, &objp->op)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->buf.buf_val, (u_int *) &objp->buf.buf_len, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_gd1_mgmt_commit_op_rsp (XDR *xdrs, gd1_mgmt_commit_op_rsp *objp) +{ + if (!xdr_vector (xdrs, (char *)objp->uuid, 16, + sizeof (u_char), (xdrproc_t) xdr_u_char)) + return FALSE; + if (!xdr_int (xdrs, &objp->op)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + return TRUE; +} diff --git a/xlators/protocol/lib/src/msg-xdr.c b/xlators/protocol/lib/src/msg-xdr.c index 9227e715f..9c5b8b81b 100644 --- a/xlators/protocol/lib/src/msg-xdr.c +++ b/xlators/protocol/lib/src/msg-xdr.c @@ -1202,3 +1202,11 @@ xdr_to_common_rsp (struct iovec outmsg, void *rsp) (xdrproc_t)xdr_gf_common_rsp); } + +ssize_t +xdr_to_mgmt_probe_query_req (struct iovec outmsg, void *req) +{ + + return xdr_serialize_generic (outmsg, (void *)req, + (xdrproc_t)xdr_gfs3_setattr_req); +} diff --git a/xlators/protocol/lib/src/msg-xdr.h b/xlators/protocol/lib/src/msg-xdr.h index 025b7f8c7..364819a39 100644 --- a/xlators/protocol/lib/src/msg-xdr.h +++ b/xlators/protocol/lib/src/msg-xdr.h @@ -512,4 +512,13 @@ xdr_to_readv_rsp (struct iovec inmsg, void *args); ssize_t xdr_to_getspec_rsp (struct iovec inmsg, void *args); +ssize_t +xdr_serialize_generic (struct iovec outmsg, void *res, xdrproc_t proc); + +ssize_t +xdr_to_generic (struct iovec inmsg, void *args, xdrproc_t proc); + +ssize_t +xdr_to_generic_payload (struct iovec inmsg, void *args, xdrproc_t proc, + struct iovec *pendingpayload); #endif /* !_MSG_XDR_H */ diff --git a/xlators/protocol/lib/src/protocol-common.h b/xlators/protocol/lib/src/protocol-common.h index 78ee2581f..0cb62426c 100644 --- a/xlators/protocol/lib/src/protocol-common.h +++ b/xlators/protocol/lib/src/protocol-common.h @@ -76,16 +76,56 @@ enum gf_handshake_procnum { }; enum gf_mgmt_procnum { - GF1_MGMT_NULL, /* 0 */ + GD_MGMT_NULL, /* 0 */ + GD_MGMT_PROBE_QUERY, + GD_MGMT_FRIEND_ADD, + GD_MGMT_CLUSTER_LOCK, + GD_MGMT_CLUSTER_UNLOCK, + GD_MGMT_STAGE_OP, + GD_MGMT_COMMIT_OP, + GD_MGMT_CLI_PROBE, + GD_MGMT_CLI_CREATE_VOLUME, + GD_MGMT_CLI_GET_VOLUME, + GD_MGMT_CLI_DELETE_VOLUME, + GD_MGMT_CLI_START_VOLUME, + GD_MGMT_CLI_STOP_VOLUME, + GD_MGMT_CLI_RENAME_VOLUME, + GD_MGMT_CLI_DEFRAG_VOLUME, + GD_MGMT_CLI_SET_VOLUME, + GD_MGMT_CLI_ADD_BRICK, + GD_MGMT_CLI_REMOVE_BRICK, + GD_MGMT_CLI_REPLACE_BRICK, + GD_MGMT_MAXVALUE, }; +enum gf_cli_procnum { + GF1_CLI_NULL = GD_MGMT_MAXVALUE+1, /* 0 */ + GF1_CLI_PROBE, + GF1_CLI_CREATE_VOLUME, + GF1_CLI_GET_VOLUME, + GF1_CLI_DELETE_VOLUME, + GF1_CLI_START_VOLUME, + GF1_CLI_STOP_VOLUME, + GF1_CLI_RENAME_VOLUME, + GF1_CLI_DEFRAG_VOLUME, + GF1_CLI_SET_VOLUME, + GF1_CLI_ADD_BRICK, + GF1_CLI_REMOVE_BRICK, + GF1_CLI_REPLACE_BRICK, + GF1_CLI_MAXVALUE, +}; #define GLUSTER3_1_FOP_PROGRAM 1298437 /* Completely random */ #define GLUSTER3_1_FOP_VERSION 310 /* 3.1.0 */ #define GLUSTER3_1_FOP_PROCCNT GFS3_OP_MAXVALUE -#define GLUSTER1_MGMT_PROGRAM 1298433 /* Completely random */ -#define GLUSTER1_MGMT_VERSION 1 /* 0.0.1 */ +#define GLUSTERD1_MGMT_PROGRAM 1298433 /* Completely random */ +#define GLUSTERD1_MGMT_VERSION 1 /* 0.0.1 */ +#define GLUSTERD1_MGMT_PROCCNT GD_MGMT_MAXVALUE + +#define GLUSTER3_1_CLI_PROGRAM 1298433 /* Completely random */ +#define GLUSTER3_1_CLI_VERSION 1 /* 0.0.1 */ +#define GLUSTER3_1_CLI_PROCCNT GF1_CLI_MAXVALUE #define GLUSTER_HNDSK_PROGRAM 14398633 /* Completely random */ #define GLUSTER_HNDSK_VERSION 1 /* 0.0.1 */ |