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 | |
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')
-rw-r--r-- | xlators/protocol/client/src/client-handshake.c | 10 | ||||
-rw-r--r-- | xlators/protocol/client/src/client3_1-fops.c | 6 | ||||
-rw-r--r-- | xlators/protocol/legacy/lib/src/protocol.h | 32 | ||||
-rw-r--r-- | xlators/protocol/legacy/server/src/server-protocol.c | 2 | ||||
-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 |
16 files changed, 1605 insertions, 21 deletions
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index f45cc84aa61..353921ac57f 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -31,7 +31,6 @@ #include "compat-errno.h" extern rpc_clnt_prog_t clnt3_1_fop_prog; -extern rpc_clnt_prog_t clnt3_1_mgmt_prog; int client_ping_cbk (struct rpc_req *req, struct iovec *iov, int count, void *myframe); @@ -619,15 +618,6 @@ select_server_supported_programs (xlator_t *this, gf_prog_detail *prog) trav->progname, trav->prognum, trav->progver); ret = 0; } - if ((clnt3_1_mgmt_prog.prognum == trav->prognum) && - (clnt3_1_mgmt_prog.progver == trav->progver)) { - conf->mgmt = &clnt3_1_mgmt_prog; - gf_log (this->name, GF_LOG_INFO, - "Using Program %s, Num (%"PRId64"), " - "Version (%"PRId64")", - trav->progname, trav->prognum, trav->progver); - ret = 0; - } if (ret) { gf_log (this->name, GF_LOG_TRACE, "%s (%"PRId64") not supported", trav->progname, diff --git a/xlators/protocol/client/src/client3_1-fops.c b/xlators/protocol/client/src/client3_1-fops.c index 07145a097cd..564b1b12268 100644 --- a/xlators/protocol/client/src/client3_1-fops.c +++ b/xlators/protocol/client/src/client3_1-fops.c @@ -4734,8 +4734,4 @@ rpc_clnt_prog_t clnt3_1_fop_prog = { .procnames = clnt3_1_fop_names, }; -rpc_clnt_prog_t clnt3_1_mgmt_prog = { - .progname = "Gluster Mgmt 3.1", - .prognum = GLUSTER1_MGMT_PROGRAM, - .progver = GLUSTER1_MGMT_VERSION, -}; + diff --git a/xlators/protocol/legacy/lib/src/protocol.h b/xlators/protocol/legacy/lib/src/protocol.h index 254e36e661b..85d175dd406 100644 --- a/xlators/protocol/legacy/lib/src/protocol.h +++ b/xlators/protocol/legacy/lib/src/protocol.h @@ -35,6 +35,7 @@ #include "byte-order.h" #include "iatt.h" +#include <uuid/uuid.h> /* Any changes in the protocol structure or adding new '[f,m]ops' needs to * bump the protocol version by "0.1" @@ -1035,6 +1036,37 @@ typedef struct { typedef struct { } __attribute__((packed)) gf_cbk_forget_rsp_t; + +typedef struct { + char volname[0]; + char exportpath[0]; +} __attribute__((packed)) gf_mop_create_volume_t; +typedef struct { +} __attribute__ ((packed))gf_mop_create_volume_rsp_t; + +typedef struct { + uuid_t uuid; +} __attribute__((packed)) gf_mop_cluster_lock_req_t; +typedef struct { + uuid_t uuid; +} __attribute__ ((packed))gf_mop_cluster_lock_rsp_t; + +typedef gf_mop_cluster_lock_req_t gf_mop_cluster_unlock_req_t; +typedef gf_mop_cluster_lock_rsp_t gf_mop_cluster_unlock_rsp_t; + +typedef struct { + uuid_t uuid; + int32_t op; + int32_t len; + char buf[0]; +} __attribute__((packed)) gf_mop_stage_req_t; +typedef struct { + uuid_t uuid; + int32_t op; +} __attribute__ ((packed))gf_mop_stage_rsp_t; + +typedef gf_mop_stage_rsp_t gf_mop_commit_rsp_t; + typedef struct { uint32_t pid; uint32_t uid; diff --git a/xlators/protocol/legacy/server/src/server-protocol.c b/xlators/protocol/legacy/server/src/server-protocol.c index a6d30ca4a2e..839c6a55745 100644 --- a/xlators/protocol/legacy/server/src/server-protocol.c +++ b/xlators/protocol/legacy/server/src/server-protocol.c @@ -2,7 +2,7 @@ Copyright (c) 2006-2009 Gluster, Inc. <http://www.gluster.com> This file is part of GlusterFS. - GlusterFS is GF_FREE software; you can redistribute it and/or modify + 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. diff --git a/xlators/protocol/lib/src/Makefile.am b/xlators/protocol/lib/src/Makefile.am index 70cc069e8f1..abd8ef83e65 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 00000000000..c6a351b124f --- /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 00000000000..9705071bad4 --- /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 00000000000..359fdcf42ba --- /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 00000000000..1fe7ef14f6b --- /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 00000000000..2cd83315ac8 --- /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 00000000000..ee5fb9c7db3 --- /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 00000000000..935fde4ef1b --- /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 00000000000..b35cc35804c --- /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 9227e715fd3..9c5b8b81b38 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 025b7f8c717..364819a399b 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 78ee2581fdf..0cb62426c66 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 */ |