diff options
author | Mohammed Junaid Ahmed <junaid@gluster.com> | 2011-02-10 05:29:34 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2011-02-10 22:18:06 -0800 |
commit | 2e81c881f036d90323fd07d7df07d881723d7a28 (patch) | |
tree | 261c45c9faf90f70a8140994adcc02b9cd881220 /rpc | |
parent | 08ca1d3c7801d22f1de452f098b0a5df251ca5e7 (diff) |
gsync: cli support for gsyncd.
Signed-off-by: Junaid <junaid@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1570 (geosync related changes)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1570
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/rpc-lib/src/protocol-common.h | 2 | ||||
-rw-r--r-- | rpc/xdr/src/cli1-xdr.c | 28 | ||||
-rw-r--r-- | rpc/xdr/src/cli1-xdr.h | 34 | ||||
-rw-r--r-- | rpc/xdr/src/cli1.c | 30 | ||||
-rw-r--r-- | rpc/xdr/src/cli1.h | 12 | ||||
-rw-r--r-- | rpc/xdr/src/cli1.x | 21 |
6 files changed, 126 insertions, 1 deletions
diff --git a/rpc/rpc-lib/src/protocol-common.h b/rpc/rpc-lib/src/protocol-common.h index 2fe70408e..7b31be2bd 100644 --- a/rpc/rpc-lib/src/protocol-common.h +++ b/rpc/rpc-lib/src/protocol-common.h @@ -105,6 +105,7 @@ enum gf_mgmt_procnum_ { GD_MGMT_CLI_SYNC_VOLUME, GD_MGMT_CLI_RESET_VOLUME, GD_MGMT_CLI_FSM_LOG, + GD_MGMT_CLI_GSYNC_SET, GD_MGMT_MAXVALUE, }; @@ -135,6 +136,7 @@ enum gf_cli_procnum { GF1_CLI_SYNC_VOLUME, GF1_CLI_RESET_VOLUME, GF1_CLI_FSM_LOG, + GF1_CLI_GSYNC_SET, GF1_CLI_MAXVALUE, }; diff --git a/rpc/xdr/src/cli1-xdr.c b/rpc/xdr/src/cli1-xdr.c index 084aa8b7b..9cb94eb8b 100644 --- a/rpc/xdr/src/cli1-xdr.c +++ b/rpc/xdr/src/cli1-xdr.c @@ -81,6 +81,14 @@ xdr_gf1_cli_op_flags (XDR *xdrs, gf1_cli_op_flags *objp) } bool_t +xdr_gf1_cli_gsync_set (XDR *xdrs, gf1_cli_gsync_set *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) { @@ -641,3 +649,23 @@ xdr_gf1_cli_fsm_log_rsp (XDR *xdrs, gf1_cli_fsm_log_rsp *objp) return FALSE; return TRUE; } + +bool_t +xdr_gf1_cli_gsync_set_req (XDR *xdrs, gf1_cli_gsync_set_req *objp) +{ + 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_gsync_set_rsp (XDR *xdrs, gf1_cli_gsync_set_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->op_errstr, ~0)) + return FALSE; + return TRUE; +} diff --git a/rpc/xdr/src/cli1-xdr.h b/rpc/xdr/src/cli1-xdr.h index c2ccb3237..3f77c9e9c 100644 --- a/rpc/xdr/src/cli1-xdr.h +++ b/rpc/xdr/src/cli1-xdr.h @@ -74,6 +74,18 @@ enum gf1_cli_op_flags { }; typedef enum gf1_cli_op_flags gf1_cli_op_flags; +enum gf1_cli_gsync_set { + GF_GSYNC_OPTION_TYPE_NONE = 0, + GF_GSYNC_OPTION_TYPE_START = 1, + GF_GSYNC_OPTION_TYPE_STOP = 2, + GF_GSYNC_OPTION_TYPE_CONFIGURE = 3, + GF_GSYNC_OPTION_TYPE_CONFIG_SET = 4, + GF_GSYNC_OPTION_TYPE_CONFIG_DEL = 5, + GF_GSYNC_OPTION_TYPE_CONFIG_GET = 6, + GF_GSYNC_OPTION_TYPE_CONFIG_GET_ALL = 7, +}; +typedef enum gf1_cli_gsync_set gf1_cli_gsync_set; + struct gf1_cli_probe_req { char *hostname; int port; @@ -391,11 +403,27 @@ struct gf1_cli_fsm_log_rsp { }; typedef struct gf1_cli_fsm_log_rsp gf1_cli_fsm_log_rsp; +struct gf1_cli_gsync_set_req { + struct { + u_int dict_len; + char *dict_val; + } dict; +}; +typedef struct gf1_cli_gsync_set_req gf1_cli_gsync_set_req; + +struct gf1_cli_gsync_set_rsp { + int op_ret; + int op_errno; + char *op_errstr; +}; +typedef struct gf1_cli_gsync_set_rsp gf1_cli_gsync_set_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_gsync_set (XDR *, gf1_cli_gsync_set*); extern bool_t xdr_gf1_cli_friends_list (XDR *, gf1_cli_friends_list*); extern bool_t xdr_gf1_cli_get_volume (XDR *, gf1_cli_get_volume*); extern bool_t xdr_gf1_cli_sync_volume (XDR *, gf1_cli_sync_volume*); @@ -440,10 +468,13 @@ extern bool_t xdr_gf1_cli_log_rotate_rsp (XDR *, gf1_cli_log_rotate_rsp*); extern bool_t xdr_gf1_cli_sync_volume_rsp (XDR *, gf1_cli_sync_volume_rsp*); extern bool_t xdr_gf1_cli_fsm_log_req (XDR *, gf1_cli_fsm_log_req*); extern bool_t xdr_gf1_cli_fsm_log_rsp (XDR *, gf1_cli_fsm_log_rsp*); +extern bool_t xdr_gf1_cli_gsync_set_req (XDR *, gf1_cli_gsync_set_req*); +extern bool_t xdr_gf1_cli_gsync_set_rsp (XDR *, gf1_cli_gsync_set_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_gsync_set (); extern bool_t xdr_gf1_cli_friends_list (); extern bool_t xdr_gf1_cli_get_volume (); extern bool_t xdr_gf1_cli_sync_volume (); @@ -488,7 +519,8 @@ extern bool_t xdr_gf1_cli_log_rotate_rsp (); extern bool_t xdr_gf1_cli_sync_volume_rsp (); extern bool_t xdr_gf1_cli_fsm_log_req (); extern bool_t xdr_gf1_cli_fsm_log_rsp (); - +extern bool_t xdr_gf1_cli_gsync_set_req (); +extern bool_t xdr_gf1_cli_gsync_set_rsp (); #endif /* K&R C */ #ifdef __cplusplus diff --git a/rpc/xdr/src/cli1.c b/rpc/xdr/src/cli1.c index 14f383941..7bdfd0332 100644 --- a/rpc/xdr/src/cli1.c +++ b/rpc/xdr/src/cli1.c @@ -438,6 +438,36 @@ gf_xdr_from_cli_reset_vol_req (struct iovec outmsg, void *req) } ssize_t +gf_xdr_serialize_cli_gsync_set_rsp (struct iovec outmsg, void *rsp) +{ + return xdr_serialize_generic (outmsg, (void *)rsp, + (xdrproc_t)xdr_gf1_cli_gsync_set_rsp); + +} + +ssize_t +gf_xdr_to_cli_gsync_set_req (struct iovec inmsg, void *args) +{ + return xdr_to_generic (inmsg, (void *)args, + (xdrproc_t)xdr_gf1_cli_gsync_set_req); +} + +ssize_t +gf_xdr_to_cli_gsync_set_rsp (struct iovec inmsg, void *args) +{ + return xdr_to_generic (inmsg, (void *)args, + (xdrproc_t)xdr_gf1_cli_gsync_set_rsp); +} + + +ssize_t +gf_xdr_from_cli_gsync_set_req (struct iovec outmsg, void *req) +{ + return xdr_serialize_generic (outmsg, (void *)req, + (xdrproc_t)xdr_gf1_cli_gsync_set_req); +} + +ssize_t gf_xdr_serialize_cli_set_vol_rsp (struct iovec outmsg, void *rsp) { return xdr_serialize_generic (outmsg, (void *)rsp, diff --git a/rpc/xdr/src/cli1.h b/rpc/xdr/src/cli1.h index d0c43d802..7e80a18cb 100644 --- a/rpc/xdr/src/cli1.h +++ b/rpc/xdr/src/cli1.h @@ -186,6 +186,18 @@ ssize_t gf_xdr_from_cli_reset_vol_req (struct iovec outmsg, void *req); ssize_t +gf_xdr_serialize_cli_gsync_set_rsp (struct iovec outmsg, void *rsp); + +ssize_t +gf_xdr_to_cli_gsync_set_req (struct iovec inmsg, void *args); + +ssize_t +gf_xdr_to_cli_gsync_set_rsp (struct iovec inmsg, void *args); + +ssize_t +gf_xdr_from_cli_gsync_set_req (struct iovec outmsg, void *req); + +ssize_t gf_xdr_serialize_cli_set_vol_rsp (struct iovec outmsg, void *rsp); ssize_t diff --git a/rpc/xdr/src/cli1.x b/rpc/xdr/src/cli1.x index 4a0bd7163..1bc07a14e 100644 --- a/rpc/xdr/src/cli1.x +++ b/rpc/xdr/src/cli1.x @@ -32,6 +32,17 @@ enum gf1_cli_op_flags { GF_CLI_FLAG_OP_FORCE = 1 }; +enum gf1_cli_gsync_set { + GF_GSYNC_OPTION_TYPE_NONE, + GF_GSYNC_OPTION_TYPE_START, + GF_GSYNC_OPTION_TYPE_STOP, + GF_GSYNC_OPTION_TYPE_CONFIGURE, + GF_GSYNC_OPTION_TYPE_CONFIG_SET, + GF_GSYNC_OPTION_TYPE_CONFIG_DEL, + GF_GSYNC_OPTION_TYPE_CONFIG_GET, + GF_GSYNC_OPTION_TYPE_CONFIG_GET_ALL +}; + struct gf1_cli_probe_req { string hostname<>; int port; @@ -280,3 +291,13 @@ struct gf1_cli_fsm_log_rsp { string op_errstr<>; opaque fsm_log<>; }; + +struct gf1_cli_gsync_set_req { + opaque dict<>; +}; + +struct gf1_cli_gsync_set_rsp { + int op_ret; + int op_errno; + string op_errstr<>; +}; |