summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-system.c
Commit message (Expand)AuthorAgeFilesLines
* glusterd: separate out cli specific programs and mgmt specific programsAmar Tumballi2011-03-011-3/+3
* cli: remove duplication of cmd helpPranith K2010-12-141-8/+2
* cli: remove special behavior for help commands without readlinePranith K2010-11-141-3/+0
* cli,mgmt/glusterd: fsm log implementationPranith K2010-10-291-0/+37
* cli: added system:: portmap brick2portCsaba Henk2010-09-161-0/+48
* cli: added system:: getspecCsaba Henk2010-09-161-0/+49
* cli: add system namespaceCsaba Henk2010-09-161-0/+80
d class='upd'>cli/src/cli-cmd.c4
-rw-r--r--cli/src/cli-cmd.h2
-rw-r--r--cli/src/cli.c12
-rw-r--r--cli/src/cli3_1-cops.c310
8 files changed, 434 insertions, 84 deletions
diff --git a/cli/src/Makefile.am b/cli/src/Makefile.am
index 8e173260325..ee6a675edba 100644
--- a/cli/src/Makefile.am
+++ b/cli/src/Makefile.am
@@ -1,7 +1,8 @@
sbin_PROGRAMS = gluster
gluster_SOURCES = cli.c registry.c input.c cli-cmd.c cli-rl.c \
- cli-cmd-volume.c cli-cmd-probe.c cli3_1-cops.c cli-cmd-parser.c
+ cli-cmd-volume.c cli-cmd-probe.c cli3_1-cops.c cli-cmd-parser.c\
+ cli-cmd-misc.c
gluster_LDADD = $(top_builddir)/libglusterfs/src/libglusterfs.la $(GF_LDADD)\
$(RLLIBS) $(top_builddir)/xlators/protocol/lib/src/libgfproto1.la\
diff --git a/cli/src/cli-cmd-misc.c b/cli/src/cli-cmd-misc.c
new file mode 100644
index 00000000000..9e78ca607e1
--- /dev/null
+++ b/cli/src/cli-cmd-misc.c
@@ -0,0 +1,69 @@
+/*
+ Copyright (c) 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 <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <pthread.h>
+
+#ifndef _CONFIG_H
+#define _CONFIG_H
+#include "config.h"
+#endif
+
+#include "cli.h"
+#include "cli-cmd.h"
+#include "cli-mem-types.h"
+#include "protocol-common.h"
+
+extern struct rpc_clnt *global_rpc;
+
+extern rpc_clnt_prog_t *cli_rpc_prog;
+
+int
+cli_cmd_quit_cbk (struct cli_state *state, struct cli_cmd_word *word,
+ const char **words, int wordcount)
+{
+ exit (0);
+}
+
+struct cli_cmd cli_misc_cmds[] = {
+ { "quit",
+ cli_cmd_quit_cbk },
+
+
+ { NULL, NULL }
+};
+
+
+int
+cli_cmd_misc_register (struct cli_state *state)
+{
+ int ret = 0;
+ struct cli_cmd *cmd = NULL;
+
+ for (cmd = cli_misc_cmds; cmd->pattern; cmd++) {
+ ret = cli_cmd_register (&state->tree, cmd->pattern, cmd->cbk);
+ if (ret)
+ goto out;
+ }
+out:
+ return ret;
+}
diff --git a/cli/src/cli-cmd-probe.c b/cli/src/cli-cmd-probe.c
index dccdaedbef9..a9f15a423bf 100644
--- a/cli/src/cli-cmd-probe.c
+++ b/cli/src/cli-cmd-probe.c
@@ -37,6 +37,24 @@ extern struct rpc_clnt *global_rpc;
extern rpc_clnt_prog_t *cli_rpc_prog;
+void
+cli_cmd_probe_usage ()
+{
+ cli_out ("Usage: probe <hostname>\n");
+}
+
+void
+cli_cmd_deprobe_usage ()
+{
+ cli_out ("Usage: detach <hostname>\n");
+}
+
+void
+cli_cmd_peer_status_usage ()
+{
+ cli_out ("Usage: peer status <hostname>\n");
+}
+
int
cli_cmd_probe_cbk (struct cli_state *state, struct cli_cmd_word *word,
const char **words, int wordcount)
@@ -45,7 +63,11 @@ cli_cmd_probe_cbk (struct cli_state *state, struct cli_cmd_word *word,
rpc_clnt_procedure_t *proc = NULL;
call_frame_t *frame = NULL;
- //cli_out ("probe not implemented\n");
+ if (wordcount != 2) {
+ cli_cmd_probe_usage ();
+ goto out;
+ }
+
proc = &cli_rpc_prog->proctable[GF1_CLI_PROBE];
frame = create_frame (THIS, THIS->ctx->pool);
@@ -53,21 +75,83 @@ cli_cmd_probe_cbk (s